From 65013b27727440fa26a746302acb4fcc5de4fde6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 9 Jun 2011 08:54:17 +0100 Subject: Resolves: fdo#37668 bitwise operations on signed numbers --- vcl/aqua/inc/salgdi.h | 4 ++-- vcl/aqua/source/gdi/salgdi.cxx | 9 +++++---- vcl/inc/vcl/salgdi.hxx | 5 +++-- vcl/source/gdi/outdev3.cxx | 2 +- vcl/unx/headless/svpgdi.hxx | 4 ++-- vcl/unx/headless/svppspgraphics.cxx | 8 ++++---- vcl/unx/headless/svppspgraphics.hxx | 4 ++-- vcl/unx/headless/svptext.cxx | 10 +++++----- vcl/unx/inc/pspgraphics.h | 4 ++-- vcl/unx/inc/salgdi.h | 4 ++-- vcl/unx/source/gdi/pspgraphics.cxx | 8 ++++---- vcl/unx/source/gdi/salgdi3.cxx | 10 +++++----- vcl/win/inc/salgdi.h | 4 ++-- vcl/win/source/gdi/salgdi3.cxx | 4 ++-- 14 files changed, 41 insertions(+), 39 deletions(-) diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index c69f5d70bf96..bcf3a609f59a 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -338,8 +338,8 @@ public: Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index c64601ba48a3..2d04996375f4 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -1809,15 +1809,16 @@ static OSStatus GgoMoveToProc( const Float32Point* pPoint, void* pData ) return eStatus; } -sal_Bool AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) +sal_Bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) { GgoData aGgoData; aGgoData.mpPolyPoly = &rPolyPoly; rPolyPoly.clear(); ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback when CWS pdffix02 is integrated + GlyphID aGlyphId = nGlyphId & GF_IDXMASK; OSStatus eGgoStatus = noErr; - OSStatus eStatus = ATSUGlyphGetCubicPaths( rATSUStyle, nGlyphId, + OSStatus eStatus = ATSUGlyphGetCubicPaths( rATSUStyle, aGlyphId, GgoMoveToProc, GgoLineToProc, GgoCurveToProc, GgoClosePathProc, &aGgoData, &eGgoStatus ); if( (eStatus != noErr) ) // TODO: why is (eGgoStatus!=noErr) when curves are involved? @@ -1851,10 +1852,10 @@ long AquaSalGraphics::GetGraphicsWidth() const // ----------------------------------------------------------------------- -sal_Bool AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect ) +sal_Bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect ) { ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback - GlyphID aGlyphId = nGlyphId; + GlyphID aGlyphId = nGlyphId & GF_IDXMASK; ATSGlyphScreenMetrics aGlyphMetrics; OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle, 1, &aGlyphId, 0, FALSE, !mbNonAntialiasedText, &aGlyphMetrics ); diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx index 5b9e59f68d8f..f2aa64a9549a 100644 --- a/vcl/inc/vcl/salgdi.hxx +++ b/vcl/inc/vcl/salgdi.hxx @@ -37,6 +37,7 @@ #include "osl/thread.hxx" #include "vcl/outdev.hxx" #include "vcl/salnativewidgets.hxx" +#include "sallayout.hxx" #include @@ -298,8 +299,8 @@ public: Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ) = 0; - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ) = 0; - virtual sal_Bool GetGlyphOutline( long nIndex, basegfx::B2DPolyPolygon& ) = 0; + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0; + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0; diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index f0110047db5c..11da7ab19086 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -6106,7 +6106,7 @@ void OutputDevice::forceFallbackFontToFit(SalLayout &rFallback, ImplFontEntry &r if( !rFallback.GetNextGlyphs( 1, &nLGlyph, aPos, nStart ) ) break; - int nFontTag = nFallbackLevel << GF_FONTSHIFT; + sal_GlyphId nFontTag = nFallbackLevel << GF_FONTSHIFT; nLGlyph |= nFontTag; // get bounding rectangle of individual glyph diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx index 0489606e9fce..3857c57af2e7 100644 --- a/vcl/unx/headless/svpgdi.hxx +++ b/vcl/unx/headless/svpgdi.hxx @@ -110,8 +110,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 7200019db9d2..fa21c139a581 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -847,7 +847,7 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa return nHavePairs; } -sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) @@ -857,13 +857,13 @@ sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return sal_True; } -sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; @@ -874,7 +874,7 @@ sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) ) return sal_True; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx index 78f36f85295e..19fda96998bd 100644 --- a/vcl/unx/headless/svppspgraphics.hxx +++ b/vcl/unx/headless/svppspgraphics.hxx @@ -129,8 +129,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 18e2f4af8c90..0c27171cc123 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -429,7 +429,7 @@ void SvpSalGraphics::GetGlyphWidths( const ImplFontData* pFont, // --------------------------------------------------------------------------- -sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) @@ -439,7 +439,7 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return sal_True; @@ -447,7 +447,7 @@ sal_Bool SvpSalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) // --------------------------------------------------------------------------- -sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPolyPoly ) +sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) @@ -457,7 +457,7 @@ sal_Bool SvpSalGraphics::GetGlyphOutline( long nGlyphIndex, B2DPolyPolygon& rPol if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) return sal_True; @@ -493,7 +493,7 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) continue; // get the glyph's alpha mask and adjust the drawing position - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; B2IPoint aDstPoint( aPos.X(), aPos.Y() ); BitmapDeviceSharedPtr aAlphaMask = rGlyphPeer.GetGlyphBmp( *pSF, nGlyphIndex, m_eTextFmt, aDstPoint ); diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h index 80d1f5fb92cc..3ec4d87f41cf 100644 --- a/vcl/unx/inc/pspgraphics.h +++ b/vcl/unx/inc/pspgraphics.h @@ -126,8 +126,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h index a2774099673b..246199f655ba 100644 --- a/vcl/unx/inc/salgdi.h +++ b/vcl/unx/inc/salgdi.h @@ -284,8 +284,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index a4289496fa14..241bbc7be2f8 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -939,7 +939,7 @@ sal_uLong PspGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPa return nHavePairs; } -sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool PspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) @@ -949,13 +949,13 @@ sal_Bool PspGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return sal_True; } -sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool PspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; @@ -966,7 +966,7 @@ sal_Bool PspGraphics::GetGlyphOutline( long nGlyphIndex, if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) ) return sal_True; diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 6d77f66662e4..60e9ae80de5b 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1235,17 +1235,17 @@ X11SalGraphics::GetKernPairs( sal_uLong nPairs, ImplKernPairData *pKernPairs ) // --------------------------------------------------------------------------- -sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) +sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; - if( nLevel < 0 || nLevel >= MAX_FALLBACK ) + if( nLevel >= MAX_FALLBACK ) return sal_False; ServerFont* pSF = mpServerFont[ nLevel ]; if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return sal_True; @@ -1253,7 +1253,7 @@ sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect ) // --------------------------------------------------------------------------- -sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex, +sal_Bool X11SalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, ::basegfx::B2DPolyPolygon& rPolyPoly ) { int nLevel = nGlyphIndex >> GF_FONTSHIFT; @@ -1264,7 +1264,7 @@ sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex, if( !pSF ) return sal_False; - nGlyphIndex &= ~GF_FONTMASK; + nGlyphIndex &= GF_IDXMASK; if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) return sal_True; diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h index a23963f81e7b..7365870fa692 100644 --- a/vcl/win/inc/salgdi.h +++ b/vcl/win/inc/salgdi.h @@ -370,8 +370,8 @@ public: Ucs2UIntMap& rUnicodeEnc ); virtual int GetMinKashidaWidth(); - virtual sal_Bool GetGlyphBoundRect( long nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index f87cfaec386f..5d28f4dcc1c1 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2505,7 +2505,7 @@ void WinSalGraphics::GetDevFontSubstList( OutputDevice* ) // ----------------------------------------------------------------------- -sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect ) +sal_Bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& rRect ) { HDC hDC = mhDC; @@ -2537,7 +2537,7 @@ sal_Bool WinSalGraphics::GetGlyphBoundRect( long nIndex, Rectangle& rRect ) // ----------------------------------------------------------------------- -sal_Bool WinSalGraphics::GetGlyphOutline( long nIndex, +sal_Bool WinSalGraphics::GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { rB2DPolyPoly.clear(); -- cgit v1.2.3 From b90fa5defc891b0789037514ced383b6b5c9989c Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 10 Jun 2011 11:52:26 +0200 Subject: make the debug build work again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fridrich Štrba --- cppcanvas/source/mtfrenderer/emfplus.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index b2a582b1319d..e90db4032bf6 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -105,7 +105,7 @@ namespace cppcanvas EMFP_DEBUG (void dumpWords (SvStream& s, int i) { sal_uInt32 pos = s.Tell (); - INT16 data; + sal_Int16 data; for (; i > 0; i --) { s >> data; printf ("EMF+\tdata: %04hX\n", data); -- cgit v1.2.3 From c594335ddbf39268a76c865a20c72683e9030c5e Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 10 Jun 2011 12:07:07 +0200 Subject: added mtfrenderer component --- cppcanvas/prj/d.lst | 1 + cppcanvas/util/makefile.mk | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/cppcanvas/prj/d.lst b/cppcanvas/prj/d.lst index 7ed2d10bad26..c05b2f4102d3 100644 --- a/cppcanvas/prj/d.lst +++ b/cppcanvas/prj/d.lst @@ -2,6 +2,7 @@ ..\%__SRC%\bin\mtfrenderer*.dll %_DEST%\bin%_EXT%\mtfrenderer*.dll ..\%__SRC%\lib\icppcanvas.lib %_DEST%\lib%_EXT%\icppcanvas.lib ..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.* +..\%__SRC%\misc\mtfrenderer.component %_DEST%\xml\mtfrenderer.component mkdir: %_DEST%\inc%_EXT%\cppcanvas ..\inc\cppcanvas\bitmap.hxx %_DEST%\inc%_EXT%\cppcanvas\bitmap.hxx diff --git a/cppcanvas/util/makefile.mk b/cppcanvas/util/makefile.mk index 01cf6234602c..74d86e6d75de 100644 --- a/cppcanvas/util/makefile.mk +++ b/cppcanvas/util/makefile.mk @@ -68,3 +68,11 @@ DEFLIB1NAME =$(TARGET) $(MISC)$/$(SHL1TARGET).flt : makefile.mk @$(TYPE) $(TARGET).flt > $@ + +$(MISC)/mtfrenderer.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mtfrenderer.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mtfrenderer.component + +ALLTAR : $(MISC)/mtfrenderer.component -- cgit v1.2.3 From 58c1c1788b651a947639aa435c5675017f5cfce8 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 10 Jun 2011 15:59:33 +0200 Subject: make the renderer component point to the right shared library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fridrich Štrba --- cppcanvas/source/uno/makefile.mk | 8 ++++++++ cppcanvas/source/uno/mtfrenderer.component | 7 +++++++ cppcanvas/util/makefile.mk | 8 -------- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 cppcanvas/source/uno/mtfrenderer.component diff --git a/cppcanvas/source/uno/makefile.mk b/cppcanvas/source/uno/makefile.mk index 76d259474c58..5e06f4f1c839 100644 --- a/cppcanvas/source/uno/makefile.mk +++ b/cppcanvas/source/uno/makefile.mk @@ -60,3 +60,11 @@ DEF1EXPORTFILE=exports.dxp # ========================================================================== .INCLUDE : target.mk + +$(MISC)/mtfrenderer.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mtfrenderer.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mtfrenderer.component + +ALLTAR : $(MISC)/mtfrenderer.component diff --git a/cppcanvas/source/uno/mtfrenderer.component b/cppcanvas/source/uno/mtfrenderer.component new file mode 100644 index 000000000000..32284e46cd74 --- /dev/null +++ b/cppcanvas/source/uno/mtfrenderer.component @@ -0,0 +1,7 @@ + + + + + + diff --git a/cppcanvas/util/makefile.mk b/cppcanvas/util/makefile.mk index 74d86e6d75de..01cf6234602c 100644 --- a/cppcanvas/util/makefile.mk +++ b/cppcanvas/util/makefile.mk @@ -68,11 +68,3 @@ DEFLIB1NAME =$(TARGET) $(MISC)$/$(SHL1TARGET).flt : makefile.mk @$(TYPE) $(TARGET).flt > $@ - -$(MISC)/mtfrenderer.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - mtfrenderer.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt mtfrenderer.component - -ALLTAR : $(MISC)/mtfrenderer.component -- cgit v1.2.3 -- cgit v1.2.3 From 83a5d1ee63390da689740b88393d04fe07ca7d62 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 16:42:27 +0100 Subject: figure out how to make new-style cursors from ye-oldy xbms --- vcl/unx/gtk/app/gtkdata.cxx | 71 +++++++++++++++++++++++++++++++++-------- vcl/unx/gtk/window/gtkframe.cxx | 2 ++ 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 0a71ad01dab0..8550cc39b484 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -333,25 +333,70 @@ long GtkSalDisplay::Dispatch( XEvent* pEvent ) return GDK_FILTER_CONTINUE; } +#if GTK_CHECK_VERSION(3,0,0) +namespace +{ + //cairo annoyingly won't take raw xbm data unless it fits + //the required cairo stride + unsigned char* ensurePaddedForCairo(const unsigned char *pXBM, + int nWidth, int nHeight, int nStride) + { + unsigned char *pPaddedXBM = const_cast(pXBM); + + int bytes_per_row = (nWidth + 7) / 8; + + if (nStride != bytes_per_row) + { + pPaddedXBM = new unsigned char[nStride * nHeight]; + for (int row = 0; row < nHeight; ++row) + { + memcpy(pPaddedXBM + (nStride * row), + pXBM + (bytes_per_row * row), bytes_per_row); + memset(pPaddedXBM + (nStride * row) + bytes_per_row, + 0, nStride - bytes_per_row); + } + } + + return pPaddedXBM; + } +} +#endif + GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ) { #if GTK_CHECK_VERSION(3,0,0) - g_warning ("FIXME: to use gdk_cursor_new_from_pixbuf instead of spiders"); - // We need to do something like: - /* - GdkPixbuf *pPix = gdk_pixbuf_new_from_xpm_data (pBitmap); - GdkPixbuf *pMask = gdk_pixbuf_new_from_xpm_data (pMask); - - GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display, - GdkPixbuf *pixbuf, - gint x, - gint y); - */ - return gdk_cursor_new_for_display (gdk_display_get_default(), - GDK_SPIDER); + int cairo_stride = cairo_format_stride_for_width(CAIRO_FORMAT_A1, nWidth); + + unsigned char *pPaddedXBM = ensurePaddedForCairo(pBitmap, nWidth, nHeight, cairo_stride); + cairo_surface_t *s = cairo_image_surface_create_for_data( + pPaddedXBM, + CAIRO_FORMAT_A1, nWidth, nHeight, + cairo_stride); + + cairo_t *cr = cairo_create(s); + unsigned char *pPaddedMaskXBM = ensurePaddedForCairo(pMask, nWidth, nHeight, cairo_stride); + cairo_surface_t *mask = cairo_image_surface_create_for_data( + pPaddedMaskXBM, + CAIRO_FORMAT_A1, nWidth, nHeight, + cairo_stride); + cairo_mask_surface(cr, mask, 0, 0); + cairo_destroy(cr); + cairo_surface_destroy(mask); + if (pPaddedMaskXBM != pMask) + delete [] pPaddedMaskXBM; + + GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface(s, 0, 0, nWidth, nHeight); + cairo_surface_destroy(s); + if (pPaddedXBM != pBitmap) + delete [] pPaddedXBM; + + GdkCursor *cursor = gdk_cursor_new_from_pixbuf(m_pGdkDisplay, pixbuf, nXHot, nYHot); + g_object_unref(pixbuf); + + return cursor; #else GdkScreen *pScreen = gdk_display_get_default_screen( m_pGdkDisplay ); GdkDrawable *pDrawable = GDK_DRAWABLE( gdk_screen_get_root_window (pScreen) ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 8c151e782153..b0988f6fb1b1 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -2371,6 +2371,8 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings ) #ifndef GTK_GRAPHICS_DISABLED pGraphics->updateSettings( rSettings ); +#else + (void)rSettings; #endif if( bFreeGraphics ) -- cgit v1.2.3 From 0bdfde69aa01ced2461ac889037155726607bbee Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 16:45:09 +0100 Subject: they are xbms, not xpms, hence my bafflement --- vcl/inc/unx/gtk/gtkdata.hxx | 2 +- vcl/unx/gtk/app/gtkdata.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 307a3f2b3e01..28e0f3298fb9 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -95,7 +95,7 @@ class GtkSalDisplay : public SalDisplay bool m_bStartupCompleted; std::vector< int > m_aXineramaScreenIndexMap; - GdkCursor* getFromXPM( const unsigned char *pBitmap, const unsigned char *pMask, + GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ); public: GtkSalDisplay( GdkDisplay* pDisplay ); diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 8550cc39b484..dde909ff27f2 100644 --- a/vcl/unx/gtk/app/gtkdata.cxx +++ b/vcl/unx/gtk/app/gtkdata.cxx @@ -362,7 +362,7 @@ namespace } #endif -GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, +GdkCursor* GtkSalDisplay::getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ) @@ -420,7 +420,7 @@ GdkCursor* GtkSalDisplay::getFromXPM( const unsigned char *pBitmap, #define MAKE_CURSOR( vcl_name, name ) \ case vcl_name: \ - pCursor = getFromXPM( name##curs##_bits, name##mask##_bits, \ + pCursor = getFromXBM( name##curs##_bits, name##mask##_bits, \ name##curs_width, name##curs_height, \ name##curs_x_hot, name##curs_y_hot ); \ break -- cgit v1.2.3 From 8b0e20064327a77333bf9e61c3d505f28198f3a2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 17:36:59 +0300 Subject: Deliver also static i18nisolang library if built such (as for iOS) --- i18npool/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst index 71e0ae3b4758..91df3e890ab2 100644 --- a/i18npool/prj/d.lst +++ b/i18npool/prj/d.lst @@ -40,6 +40,7 @@ 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 -- cgit v1.2.3 From f0c461dfd587ea0271a7be3834c374c371e808a7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 17:57:49 +0300 Subject: Don't bother with any mount table handling on iOS either --- tools/source/fsys/unx.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index b04a2e64904a..5cb196869870 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -44,7 +44,7 @@ extern "C" int mntctl( int cmd, size_t size, char* buf ); #elif defined(NETBSD) #include #elif defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || \ - defined(DRAGONFLY) + defined(DRAGONFLY) || defined(IOS) struct mnttab { char *mnt_dir; @@ -85,7 +85,7 @@ struct mymnttab #if defined(NETBSD) || defined(FREEBSD) || defined(MACOSX) || \ - defined(OPENBSD) || defined(DRAGONFLY) + defined(OPENBSD) || defined(DRAGONFLY) || defined(IOS) sal_Bool GetMountEntry(dev_t /* dev */, struct mymnttab * /* mytab */ ) { DBG_WARNING( "Sorry, not implemented: GetMountEntry" ); -- cgit v1.2.3 From 851b841094c6aeddbd85e8a56ea4fb8aee81844b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 17:59:53 +0300 Subject: It's called EDEADLK on iOS, too --- tools/source/stream/strmunx.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index 1e8b75c5fe37..d9d177ce9658 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -226,7 +226,8 @@ static sal_uInt32 GetSvError( int nErrno ) { EBADF, SVSTREAM_INVALID_HANDLE }, #if defined(RS6000) || defined(ALPHA) || defined(NETBSD) || \ defined(FREEBSD) || defined(MACOSX) || defined(OPENBSD) || \ - defined(__FreeBSD_kernel__) || defined (AIX) || defined(DRAGONFLY) + defined(__FreeBSD_kernel__) || defined (AIX) || defined(DRAGONFLY) || \ + defined(IOS) { EDEADLK, SVSTREAM_LOCKING_VIOLATION }, #else { EDEADLOCK, SVSTREAM_LOCKING_VIOLATION }, -- cgit v1.2.3 From 73a15b7576fcd831aca08decdba15e8e6fa72536 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 19:26:53 +0300 Subject: Don't do anything here when cross-compiling --- l10ntools/layout/makefile.mk | 5 +++++ l10ntools/source/filter/merge/makefile.mk | 5 +++++ l10ntools/source/filter/utils/makefile.mk | 5 +++++ l10ntools/source/help/makefile.mk | 6 ++++++ l10ntools/source/makefile.mk | 5 +++++ 5 files changed, 26 insertions(+) diff --git a/l10ntools/layout/makefile.mk b/l10ntools/layout/makefile.mk index dee3c6e81b33..c977cba441cf 100644 --- a/l10ntools/layout/makefile.mk +++ b/l10ntools/layout/makefile.mk @@ -40,6 +40,11 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(CROSS_COMPILING)" == "YES" +all: + @echo Nothing done when cross-compiling +.ENDIF + .IF "$(SYSTEM_EXPAT)" == "YES" CFLAGS+=-DSYSTEM_EXPAT .ENDIF diff --git a/l10ntools/source/filter/merge/makefile.mk b/l10ntools/source/filter/merge/makefile.mk index 8ef73debd743..cc9efd9118e6 100644 --- a/l10ntools/source/filter/merge/makefile.mk +++ b/l10ntools/source/filter/merge/makefile.mk @@ -34,6 +34,11 @@ PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge .INCLUDE: settings.mk +.IF "$(CROSS_COMPILING)" == "YES" +all: + @echo Nothing done when cross-compiling +.ENDIF + #----- compile .java files ----------------------------------------- OWNCOPY = \ diff --git a/l10ntools/source/filter/utils/makefile.mk b/l10ntools/source/filter/utils/makefile.mk index 43a28d57ee9e..ca92f4b1b515 100644 --- a/l10ntools/source/filter/utils/makefile.mk +++ b/l10ntools/source/filter/utils/makefile.mk @@ -34,6 +34,11 @@ PACKAGE = com$/sun$/star$/filter$/config$/tools$/utils .INCLUDE: settings.mk +.IF "$(CROSS_COMPILING)" == "YES" +all: + @echo Nothing done when cross-compiling +.ENDIF + #----- compile .java files ----------------------------------------- diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk index 3fd6879a9989..d79194e10c29 100644 --- a/l10ntools/source/help/makefile.mk +++ b/l10ntools/source/help/makefile.mk @@ -35,6 +35,12 @@ TARGETTYPE=CUI # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk + +.IF "$(CROSS_COMPILING)" == "YES" +all: + @echo Nothing done when cross-compiling +.ENDIF + .INCLUDE : helplinker.pmk .IF "$(SYSTEM_LIBXSLT)" == "YES" diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk index 86bcea3cbd0e..b581c463f352 100644 --- a/l10ntools/source/makefile.mk +++ b/l10ntools/source/makefile.mk @@ -40,6 +40,11 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF "$(CROSS_COMPILING)" == "YES" +all: + @echo Nothing done when cross-compiling +.ENDIF + CDEFS+= -DYY_NEVER_INTERACTIVE=1 .IF "$(SYSTEM_EXPAT)" == "YES" -- cgit v1.2.3 From 03298b9ffe0de4c9cc0a4a05ea1d958057943aaa Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 19:33:24 +0300 Subject: Deliver also static i18nutil library if we have built it that way (as for iOS) --- i18nutil/prj/d.lst | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3 From 454d8d65761097b58809e3b6e009915a07903096 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 19:42:15 +0300 Subject: Don't link with jvmfwk unless SOLAR_JAVA --- svl/Library_svl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 246530a22bb3..45932191b48a 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -52,7 +52,7 @@ $(eval $(call gb_Library_add_linked_libs,svl,\ cppuhelper \ i18nisolang1 \ i18nutil \ - jvmfwk \ + $(if $(SOLAR_JAVA),jvmfwk) \ sal \ sot \ tl \ -- cgit v1.2.3 From c8f876b2d94712268adc85b6816dd46772f57b44 Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Wed, 15 Jun 2011 20:43:48 +0200 Subject: We don't want to create MS-DOS short file names. --- tools/source/fsys/dirent.cxx | 149 ------------------------------------------- 1 file changed, 149 deletions(-) diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index a188569868e1..83b3ebdfd9ba 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -662,7 +662,6 @@ DirEntry::DirEntry( const String& rInitName, FSysPathStyle eStyle ) } #ifdef DBG_UTIL - // ASF nur bei Default eStyle, nicht z.B. aus MakeShortName() if( eStyle == FSYS_STYLE_HOST && aTmpName.Search( "://" ) != STRING_NOTFOUND ) { @@ -709,7 +708,6 @@ DirEntry::DirEntry( const ByteString& rInitName, FSysPathStyle eStyle ) } #ifdef DBG_UTIL else - // ASF nur bei Default eStyle, nicht z.B. aus MakeShortName() if( eStyle == FSYS_STYLE_HOST && rInitName.Search( "://" ) != STRING_NOTFOUND ) { @@ -1844,37 +1842,6 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt return FSYS_ERR_OK; } -/************************************************************************* -|* -|* DirEntry::MakeShortName() -|* -*************************************************************************/ - -ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind ) -{ - // versuchen, anzulegen (ausser bei FSYS_KIND_ALL) - ErrCode eErr = ERRCODE_NONE; - if ( FSYS_KIND_FILE == eKind ) - { - SvFileStream aStream( rPath.GetFull(), STREAM_STD_WRITE ); - aStream.WriteLine( "" ); - eErr = aStream.GetError(); - } - else if ( FSYS_KIND_ALL != eKind ) - eErr = rPath.MakeDir() ? ERRCODE_NONE : ERRCODE_IO_UNKNOWN; - - // erfolgreich? - if ( !rPath.Exists() ) - eErr = ERRCODE_IO_UNKNOWN; // Doch was schiefgegangen ? - - // ggf. wieder l"oschen - if ( FSYS_KIND_NONE == eKind ) - rPath.Kill(); - - // Fehlercode zur?ckliefern - return eErr; -} - sal_Bool IsValidEntry_Impl( const DirEntry &rPath, const String &rLongName, DirEntryKind eKind, @@ -1921,122 +1888,6 @@ sal_Bool IsValidEntry_Impl( const DirEntry &rPath, #define MAX_LEN_MAX 255 #define INVALID_CHARS_DEF "\\/\"':|^<>?*" -sal_Bool DirEntry::MakeShortName( const String& rLongName, DirEntryKind eKind, - sal_Bool bUseDelim, FSysPathStyle eStyle ) -{ - String aLongName(rLongName); - - // Alle '#' aus den Dateinamen entfernen, weil das INetURLObject - // damit Probleme hat. Siehe auch #51246# - aLongName.EraseAllChars( '#' ); - ByteString bLongName(aLongName, osl_getThreadTextEncoding()); - - // Auf Novell-Servern (wegen der rottigen Clients) nur 7bit ASCII - - // bei FSYS_KIND_ALL den alten Namen merken und abh"angen (rename) - ByteString aOldName; - if ( FSYS_KIND_ALL == eKind ) - { - aOldName = ByteString(CutName(), osl_getThreadTextEncoding()); - aOldName = CMP_LOWER(aOldName); - } - - // ist der Langname direkt verwendbar? - if ( IsValidEntry_Impl( *this, aLongName, eKind, sal_False, bUseDelim ) ) - { - operator+=( DirEntry(aLongName) ); - return sal_True; - } - - // max L"angen feststellen - sal_uInt16 nMaxExt, nMaxLen; - if ( FSYS_STYLE_DETECT == eStyle ) - eStyle = DirEntry::GetPathStyle( GetDevice().GetName() ); - ByteString aInvalidChars; - nMaxExt = MAX_EXT_MAX; - nMaxLen = MAX_LEN_MAX; - aInvalidChars = INVALID_CHARS_DEF; - - // Extension abschneiden und kuerzen - ByteString aExt; - ByteString aFName = bLongName; - DirEntry aUnparsed; - aUnparsed.aName = bLongName; - aExt = ByteString(aUnparsed.CutExtension(), osl_getThreadTextEncoding()); - aFName = aUnparsed.aName; - if ( aExt.Len() > nMaxExt ) - { - char c = aExt.GetChar( aExt.Len() - 1 ); - aExt.Erase(nMaxExt-1); - aExt += c; - } - - // ausser auf einem FAT-System geh"ort die Extension zur - // Maxl"ange. Muss also vorher mit dem Punkt abgezogen werden. - nMaxLen -= ( aExt.Len() + 1 ); - - // Name k"urzen - ByteString aSName; - for ( const char *pc = aFName.GetBuffer(); aSName.Len() < nMaxLen && *pc; ++pc ) - { - if ( STRING_NOTFOUND == aInvalidChars.Search( *pc ) && - (unsigned char) *pc >= (unsigned char) 32 && - ( !aSName.Len() || *pc != ' ' || aSName.GetChar(aSName.Len()-1) != ' ' ) ) - aSName += *pc; - } - aSName.EraseTrailingChars(); - - // HRO: #74246# Also cut leading spaces - aSName.EraseLeadingChars(); - - if ( !aSName.Len() ) - aSName = "noname"; - - // kommt dabei der alte Name raus? - ByteString aNewName = aSName; - if ( aExt.Len() ) - ( aNewName += '.' ) += aExt; - operator+=( DirEntry(String(aNewName, osl_getThreadTextEncoding())) ); - if ( FSYS_KIND_ALL == eKind && CMP_LOWER(aName) == aOldName ) - if ( FSYS_KIND_ALL == eKind && CMP_LOWER(ByteString(GetName(), osl_getThreadTextEncoding())) == aOldName ) - return sal_True; - - // kann der gek"urzte Name direkt verwendet werden? - if ( !Exists() && (ERRCODE_NONE == CreateEntry_Impl( *this, eKind )) ) - return sal_True; - - // darf '?##' verwendet werden, um eindeutigen Name zu erzeugen? - if ( bUseDelim ) - { - // eindeutigen Namen per '?##' erzeugen - aSName.Erase( nMaxLen-3 ); - if ( bUseDelim != 2 ) - aSName += FSYS_SHORTNAME_DELIMITER; - for ( int n = 1; n < 99; ++n ) - { - // Name zusammensetzen - ByteString aTmpStr( aSName ); - aTmpStr += ByteString::CreateFromInt32(n); - if ( aExt.Len() ) - ( aTmpStr += '.' ) += aExt; - - // noch nicht vorhanden? - SetName( String(aTmpStr, osl_getThreadTextEncoding()) ); - - if ( !Exists() ) - { - // Fehler setzen !!! - nError = CreateEntry_Impl( *this, eKind ); - return (ERRCODE_NONE == nError); - } - } - } - - // keine ## mehr frei / ?## soll nicht verwendet werden - nError = ERRCODE_IO_ALREADYEXISTS; - return sal_False; -} - /************************************************************************* |* |* DirEntry::CreatePath() -- cgit v1.2.3 From abefd1e5a59ea7f356ee59eafd0e6e09301aa542 Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Wed, 15 Jun 2011 21:01:16 +0200 Subject: Revert part of previous commit --- tools/source/fsys/dirent.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 83b3ebdfd9ba..fd22a37f124f 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -1842,6 +1842,31 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt return FSYS_ERR_OK; } +ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind ) +{ + // versuchen, anzulegen (ausser bei FSYS_KIND_ALL) + ErrCode eErr = ERRCODE_NONE; + if ( FSYS_KIND_FILE == eKind ) + { + SvFileStream aStream( rPath.GetFull(), STREAM_STD_WRITE ); + aStream.WriteLine( "" ); + eErr = aStream.GetError(); + } + else if ( FSYS_KIND_ALL != eKind ) + eErr = rPath.MakeDir() ? ERRCODE_NONE : ERRCODE_IO_UNKNOWN; + + // erfolgreich? + if ( !rPath.Exists() ) + eErr = ERRCODE_IO_UNKNOWN; // Doch was schiefgegangen ? + + // ggf. wieder l"oschen + if ( FSYS_KIND_NONE == eKind ) + rPath.Kill(); + + // Fehlercode zur?ckliefern + return eErr; +} + sal_Bool IsValidEntry_Impl( const DirEntry &rPath, const String &rLongName, DirEntryKind eKind, -- cgit v1.2.3 From 7c2224a88f9df3bc6cb956ddbb4fc1251711b0c4 Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Wed, 15 Jun 2011 22:11:14 +0200 Subject: GetPathStyle() has no needs for arguments any more --- tools/inc/tools/fsys.hxx | 2 +- tools/source/fsys/dirent.cxx | 2 +- tools/source/fsys/unx.cxx | 2 +- tools/source/fsys/wntmsc.cxx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 440d3aeaeabb..c8a6d9ed60c6 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -348,7 +348,7 @@ public: static String GetAccessDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST ); static String GetSearchDelimiter( FSysPathStyle eFormatter = FSYS_STYLE_HOST ); - static FSysPathStyle GetPathStyle( const String &rDevice ); + static FSysPathStyle GetPathStyle(); }; // -------------- diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index fd22a37f124f..5683b5b45542 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -1881,7 +1881,7 @@ sal_Bool IsValidEntry_Impl( const DirEntry &rPath, // Alle von MSDOS erreichbaren FSYS_STYLES muessen den // MSDOS Filenamenanforderungen genuegen. Sonst wird probiert, // ob sich eine Datei des gewuenschten Names anlegen laesst. - FSysPathStyle eStyle = DirEntry::GetPathStyle( rPath.GetDevice().GetName() ); + FSysPathStyle eStyle = DirEntry::GetPathStyle(); DirEntry aPath(rPath); DirEntry aName(rLongName, eStyle); if ( !aName.IsValid() || aName.Level() != 1 ) diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index 5cb196869870..f19c14bfb84b 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -478,7 +478,7 @@ const char *TempDirImpl( char *pBuf ) |* *************************************************************************/ -FSysPathStyle DirEntry::GetPathStyle( const String & ) +FSysPathStyle DirEntry::GetPathStyle() { return FSYS_STYLE_UNX; } diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx index fa18aa46fcf1..6ed2ba1950c9 100644 --- a/tools/source/fsys/wntmsc.cxx +++ b/tools/source/fsys/wntmsc.cxx @@ -114,7 +114,7 @@ int closedir( DIR *pDir ) |* *************************************************************************/ -FSysPathStyle DirEntry::GetPathStyle( const String & ) +FSysPathStyle DirEntry::GetPathStyle() { return FSYS_STYLE_NTFS; } -- cgit v1.2.3 From 67ad4156818e8c95d075ead152fc35672b1a6135 Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Wed, 15 Jun 2011 22:24:06 +0200 Subject: Remove unused methods --- tools/inc/tools/fsys.hxx | 9 ------ tools/source/fsys/dirent.cxx | 67 -------------------------------------------- tools/source/fsys/unx.cxx | 13 --------- tools/source/fsys/wntmsc.cxx | 38 ------------------------- 4 files changed, 127 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index c8a6d9ed60c6..341d74d8bc5d 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -215,9 +215,6 @@ public: static sal_uIntPtr SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO = sal_True ); static sal_Bool GetReadOnlyFlag( const DirEntry &rEntry ); - static ErrCode QueryDiskSpace( const String &rPath, - BigInt &rFreeBytes, BigInt &rTotalBytes ); - static void SetDateTime( const String& rFileName, const DateTime& rNewDateTime ); }; @@ -522,12 +519,6 @@ public: #endif // BOOTSTRP -//======================================================================== - -void FSysEnableSysErrorBox( sal_Bool bEnable ); - -//======================================================================== - #if defined(DBG_UTIL) void FSysTest(); #endif diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 5683b5b45542..a38d698b2f9b 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -1842,73 +1842,6 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt return FSYS_ERR_OK; } -ErrCode CreateEntry_Impl( const DirEntry &rPath, DirEntryKind eKind ) -{ - // versuchen, anzulegen (ausser bei FSYS_KIND_ALL) - ErrCode eErr = ERRCODE_NONE; - if ( FSYS_KIND_FILE == eKind ) - { - SvFileStream aStream( rPath.GetFull(), STREAM_STD_WRITE ); - aStream.WriteLine( "" ); - eErr = aStream.GetError(); - } - else if ( FSYS_KIND_ALL != eKind ) - eErr = rPath.MakeDir() ? ERRCODE_NONE : ERRCODE_IO_UNKNOWN; - - // erfolgreich? - if ( !rPath.Exists() ) - eErr = ERRCODE_IO_UNKNOWN; // Doch was schiefgegangen ? - - // ggf. wieder l"oschen - if ( FSYS_KIND_NONE == eKind ) - rPath.Kill(); - - // Fehlercode zur?ckliefern - return eErr; -} - -sal_Bool IsValidEntry_Impl( const DirEntry &rPath, - const String &rLongName, - DirEntryKind eKind, - sal_Bool bIsShortened, - sal_Bool bUseDelim ) -{ - // Parameter-Pr"uefung - DBG_ASSERT( eKind == FSYS_KIND_NONE || eKind == FSYS_KIND_ALL || - eKind == FSYS_KIND_FILE || eKind == FSYS_KIND_DIR, - "invalid entry-kind" ); - - // Alle von MSDOS erreichbaren FSYS_STYLES muessen den - // MSDOS Filenamenanforderungen genuegen. Sonst wird probiert, - // ob sich eine Datei des gewuenschten Names anlegen laesst. - FSysPathStyle eStyle = DirEntry::GetPathStyle(); - DirEntry aPath(rPath); - DirEntry aName(rLongName, eStyle); - if ( !aName.IsValid() || aName.Level() != 1 ) - return sal_False; - aPath += aName; - if ( 1 == aPath.Level() ) - return sal_False; - - // Pfad-Trenner sind nicht erlaubt (bei ungek"urzten auch nicht FSYS_SHORTNAME_DELIMITER) - char cDelim = bUseDelim == 2 ? FSYS_SHORTNAME_DELIMITER : char(0); - if ( - rLongName.Search(DirEntry::GetAccessDelimiter()) != STRING_NOTFOUND || - (!bIsShortened && rLongName.Search(cDelim) != STRING_NOTFOUND) - ) - { - return sal_False; - } - - // MI: Abfrage nach 'CON:' etc. wird jetzt in Exists() mitgemacht - if ( aPath.Exists() ) - return sal_False; - - return (ERRCODE_NONE == CreateEntry_Impl( aPath, eKind )); -} - -//------------------------------------------------------------------------- - #define MAX_EXT_MAX 250 #define MAX_LEN_MAX 255 #define INVALID_CHARS_DEF "\\/\"':|^<>?*" diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx index f19c14bfb84b..0adc7ce8fa03 100644 --- a/tools/source/fsys/unx.cxx +++ b/tools/source/fsys/unx.cxx @@ -521,17 +521,4 @@ void FileStat::SetDateTime( const String& rFileName, } } -//========================================================================= - -ErrCode FileStat::QueryDiskSpace( const String &, BigInt &, BigInt & ) -{ - return ERRCODE_IO_NOTSUPPORTED; -} - -//========================================================================= - -void FSysEnableSysErrorBox( sal_Bool ) -{ -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/fsys/wntmsc.cxx b/tools/source/fsys/wntmsc.cxx index 6ed2ba1950c9..ab783b45a161 100644 --- a/tools/source/fsys/wntmsc.cxx +++ b/tools/source/fsys/wntmsc.cxx @@ -872,42 +872,4 @@ const char* TempDirImpl( char *pBuf ) return pBuf; } -//======================================================================= - -ErrCode FileStat::QueryDiskSpace( const String &rPath, - BigInt &rFreeBytes, BigInt &rTotalBytes ) -{ - DWORD nSectorsPerCluster; /* address of sectors per cluster */ - DWORD nBytesPerSector; /* address of bytes per sector */ - DWORD nFreeClusters; /* address of number of free clusters */ - DWORD nClusters; /* address of total number of clusters */ - - ByteString aVol( DirEntry(rPath).ImpGetTopPtr()->GetName(), osl_getThreadTextEncoding()); - bool bOK = GetDiskFreeSpace( aVol.GetBuffer(), - &nSectorsPerCluster, &nBytesPerSector, - &nFreeClusters, &nClusters ); - if ( !bOK ) - return Sys2SolarError_Impl( GetLastError() ); - - BigInt aBytesPerCluster( BigInt(nSectorsPerCluster) * - BigInt(nBytesPerSector) ); - rFreeBytes = aBytesPerCluster * BigInt(nFreeClusters); - rTotalBytes = aBytesPerCluster * BigInt(nClusters); - return 0; -} - -//========================================================================= - -void FSysEnableSysErrorBox( sal_Bool bEnable ) -{ // Preserve other Bits!! - sal_uInt32 nErrorMode = SetErrorMode( bEnable ? 0 : SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX ); - if ( bEnable ) - nErrorMode &= ~(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); - else - nErrorMode |= (SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); - SetErrorMode( nErrorMode ); -} - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From e2f5fffe2e73d70794bb5edbf58e40460f1c9b5f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 22:35:28 +0100 Subject: rscdep not related to mkunroll --- tools/Executable_mkunroll.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/Executable_mkunroll.mk b/tools/Executable_mkunroll.mk index 3aa74bc160ea..6936b70283fe 100644 --- a/tools/Executable_mkunroll.mk +++ b/tools/Executable_mkunroll.mk @@ -50,8 +50,4 @@ $(eval $(call gb_Executable_add_exception_objects,mkunroll,\ tools/bootstrp/mkunroll/mkunroll \ )) -$(eval $(call gb_Executable_add_linked_static_libs,rscdep,\ - toolshelpers \ -)) - # vim: set noet sw=4 ts=4: -- cgit v1.2.3 From d12ddc8f86194ab7699646a302efb6d35b24b1fd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 23:17:08 +0100 Subject: remove appdef.hxx --- tools/StaticLibrary_toolshelpers.mk | 1 - tools/bootstrp/appdef.cxx | 54 ------------------------------------- tools/inc/bootstrp/appdef.hxx | 49 --------------------------------- 3 files changed, 104 deletions(-) delete mode 100644 tools/bootstrp/appdef.cxx delete mode 100644 tools/inc/bootstrp/appdef.hxx diff --git a/tools/StaticLibrary_toolshelpers.mk b/tools/StaticLibrary_toolshelpers.mk index a63ac47a7eac..94ba4f739382 100644 --- a/tools/StaticLibrary_toolshelpers.mk +++ b/tools/StaticLibrary_toolshelpers.mk @@ -40,7 +40,6 @@ $(eval $(call gb_StaticLibrary_set_cxxflags,toolshelpers,\ )) $(eval $(call gb_StaticLibrary_add_exception_objects,toolshelpers,\ - tools/bootstrp/appdef \ tools/bootstrp/cppdep \ tools/bootstrp/prj \ )) diff --git a/tools/bootstrp/appdef.cxx b/tools/bootstrp/appdef.cxx deleted file mode 100644 index 9600272ca858..000000000000 --- a/tools/bootstrp/appdef.cxx +++ /dev/null @@ -1,54 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_tools.hxx" - -#include -#include -#include - -#include "bootstrp/appdef.hxx" - -const char* GetEnv( const char *pVar ) -{ - char const *pRet = getenv( pVar ); - if ( !pRet ) - pRet = ""; - return pRet; -} - -const char* GetEnv( const char *pVar, const char *pDefault ) -{ - char *pRet = getenv( pVar ); - if ( !pRet ) - return pDefault; - return pRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/inc/bootstrp/appdef.hxx b/tools/inc/bootstrp/appdef.hxx deleted file mode 100644 index 833cd404847f..000000000000 --- a/tools/inc/bootstrp/appdef.hxx +++ /dev/null @@ -1,49 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _MHAPPDEF_HXX -#define _MHAPPDEF_HXX - - -#ifdef UNX -#define PATH_SEPARATOR '/' -#define S_PATH_SEPARATOR "/" -#else -#define PATH_SEPARATOR '\\' -#define S_PATH_SEPARATOR "\\" -#endif - -// path conversion - -const char* GetEnv( const char *pVar ); -const char* GetEnv( const char *pVar, const char *pDefault ); - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From eef23a3f537320267583f5fc2e145f66d520fe23 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 23:32:08 +0100 Subject: ByteString -> rtl::OString --- tools/bootstrp/md5.cxx | 13 ++++++++----- tools/bootstrp/md5.hxx | 4 ++-- tools/bootstrp/so_checksum.cxx | 12 ++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx index 1df85d32ff80..2c8a30a5c66b 100644 --- a/tools/bootstrp/md5.cxx +++ b/tools/bootstrp/md5.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #ifdef WNT #define FILE_OPEN_READ "rb" @@ -93,13 +93,14 @@ void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize) } } -rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum ) +rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum) { const size_t BUFFER_SIZE = 0x1000; const size_t MINIMAL_SIZE = 512; sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5]; - rtlDigestError error = rtl_Digest_E_None; + rtlDigestError error = rtl_Digest_E_None; + rtl::OStringBuffer aChecksumBuf; FILE *fp = fopen( filename, FILE_OPEN_READ ); @@ -136,8 +137,8 @@ rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum ) for ( std::size_t i = 0; i < sizeof(checksum); i++ ) { if ( checksum[i] < 16 ) - aChecksum.Append( "0" ); - aChecksum += ByteString::CreateFromInt32( checksum[i], 16 ); + aChecksumBuf.append('0'); + aChecksumBuf.append(checksum[i], 16); } } @@ -146,6 +147,8 @@ rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum ) else error = rtl_Digest_E_Unknown; + rChecksum = aChecksumBuf.makeStringAndClear(); + return error; } diff --git a/tools/bootstrp/md5.hxx b/tools/bootstrp/md5.hxx index f8d6e6b9695a..9f6e4aea6100 100644 --- a/tools/bootstrp/md5.hxx +++ b/tools/bootstrp/md5.hxx @@ -27,8 +27,8 @@ ************************************************************************/ #include -class ByteString; +#include -rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum ); +rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/bootstrp/so_checksum.cxx b/tools/bootstrp/so_checksum.cxx index e38252ea2f70..9ff6a6832379 100644 --- a/tools/bootstrp/so_checksum.cxx +++ b/tools/bootstrp/so_checksum.cxx @@ -31,20 +31,20 @@ #include "md5.hxx" -#include +#include -#include +#include int main( int argc, char * argv[] ) { - for ( int n = 1; n < argc; n++ ) + for (int n = 1; n < argc; ++n) { - ByteString aChecksum; - rtlDigestError error = calc_md5_checksum( argv[n], aChecksum ); + rtl::OString aChecksum; + rtlDigestError error = calc_md5_checksum(argv[n], aChecksum); if ( rtl_Digest_E_None == error ) { - printf( "%s %s\n", aChecksum.GetBuffer(), argv[n] ); + printf( "%s %s\n", aChecksum.getStr(), argv[n] ); } else printf( "ERROR: Unable to calculate MD5 checksum for %s\n", argv[n] ); -- cgit v1.2.3 From 58c8b07e33ea958db5380507c548b7dc9b1e11ee Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 23:34:45 +0100 Subject: can be const --- tools/source/ref/globname.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 05c7709931e6..9f55aadbde77 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -262,8 +262,8 @@ void SvGlobalName::MakeFromMemory( void * pData ) *************************************************************************/ sal_Bool SvGlobalName::MakeId( const String & rIdStr ) { - ByteString aStr( rIdStr, RTL_TEXTENCODING_ASCII_US ); - sal_Char * pStr = (sal_Char *)aStr.GetBuffer(); + ByteString aStr( rIdStr, RTL_TEXTENCODING_ASCII_US ); + const sal_Char * pStr = (sal_Char *)aStr.GetBuffer(); if( rIdStr.Len() == 36 && '-' == pStr[ 8 ] && '-' == pStr[ 13 ] && '-' == pStr[ 18 ] && '-' == pStr[ 23 ] ) -- cgit v1.2.3 From 2fc686889c6ba0e38048d861ad6e1c13a72f9aab Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 15 Jun 2011 23:47:04 +0100 Subject: ByteString -> rtl::OString --- tools/source/ref/globname.cxx | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 9f55aadbde77..5272023ce43e 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -33,6 +33,8 @@ #include #include +#include + #include #include @@ -262,8 +264,9 @@ void SvGlobalName::MakeFromMemory( void * pData ) *************************************************************************/ sal_Bool SvGlobalName::MakeId( const String & rIdStr ) { - ByteString aStr( rIdStr, RTL_TEXTENCODING_ASCII_US ); - const sal_Char * pStr = (sal_Char *)aStr.GetBuffer(); + rtl::OString aStr(rtl::OUStringToOString(rIdStr, + RTL_TEXTENCODING_ASCII_US)); + const sal_Char *pStr = aStr.getStr(); if( rIdStr.Len() == 36 && '-' == pStr[ 8 ] && '-' == pStr[ 13 ] && '-' == pStr[ 18 ] && '-' == pStr[ 23 ] ) @@ -342,29 +345,29 @@ sal_Bool SvGlobalName::MakeId( const String & rIdStr ) *************************************************************************/ String SvGlobalName::GetctorName() const { - ByteString aRet; + rtl::OStringBuffer aStrBuffer; sal_Char buf[ 20 ]; sal_uInt32 Data1; memcpy(&Data1, pImp->szData, sizeof(sal_uInt32)); sprintf( buf, "0x%8.8" SAL_PRIXUINT32, Data1 ); - aRet += buf; + aStrBuffer.append(buf); sal_uInt16 i; for( i = 4; i < 8; i += 2 ) { - aRet += ','; + aStrBuffer.append(','); sal_uInt16 Data2; memcpy(&Data2, pImp->szData+i, sizeof(sal_uInt16)); sprintf( buf, "0x%4.4X", Data2 ); - aRet += buf; + aStrBuffer.append(buf); } for( i = 8; i < 16; i++ ) { - aRet += ','; + aStrBuffer.append(','); sprintf( buf, "0x%2.2x", pImp->szData[ i ] ); - aRet += buf; + aStrBuffer.append(buf); } - return String( aRet, RTL_TEXTENCODING_ASCII_US ); + return rtl::OStringToOUString(aStrBuffer.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); } /************************************************************************* @@ -372,35 +375,35 @@ String SvGlobalName::GetctorName() const *************************************************************************/ String SvGlobalName::GetHexName() const { - ByteString aRet; + rtl::OStringBuffer aHexBuffer; sal_Char buf[ 10 ]; sal_uInt32 Data1; memcpy(&Data1, pImp->szData, sizeof(sal_uInt32)); sprintf( buf, "%8.8" SAL_PRIXUINT32, Data1 ); - aRet += buf; - aRet += '-'; + aHexBuffer.append(buf); + aHexBuffer.append('-'); sal_uInt16 i ; for( i = 4; i < 8; i += 2 ) { sal_uInt16 Data2; memcpy(&Data2, pImp->szData+i, sizeof(sal_uInt16)); sprintf( buf, "%4.4X", Data2 ); - aRet += buf; - aRet += '-'; + aHexBuffer.append(buf); + aHexBuffer.append('-'); } for( i = 8; i < 10; i++ ) { sprintf( buf, "%2.2x", pImp->szData[ i ] ); - aRet += buf; + aHexBuffer.append(buf); } - aRet += '-'; + aHexBuffer.append('-'); for( i = 10; i < 16; i++ ) { sprintf( buf, "%2.2x", pImp->szData[ i ] ); - aRet += buf; + aHexBuffer.append(buf); } - return String( aRet, RTL_TEXTENCODING_ASCII_US ); + return rtl::OStringToOUString(aHexBuffer.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); } /************** SvGlobalNameList ****************************************/ -- cgit v1.2.3 From aa6d94be39957752a7e83425d17a31c1eeefc8ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 01:10:39 +0100 Subject: catch by const reference --- toolkit/inc/toolkit/helper/macros.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toolkit/inc/toolkit/helper/macros.hxx b/toolkit/inc/toolkit/helper/macros.hxx index 255530a32628..7275b8a7ffd3 100644 --- a/toolkit/inc/toolkit/helper/macros.hxx +++ b/toolkit/inc/toolkit/helper/macros.hxx @@ -189,13 +189,13 @@ void ClassName::disposing( const ::com::sun::star::lang::EventObject& ) throw(:: { \ xListener->MethodName( aMulti, aMulti2 ); \ } \ - catch( ::com::sun::star::lang::DisposedException e ) \ + catch(const ::com::sun::star::lang::DisposedException& e) \ { \ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \ if ( e.Context == xListener || !e.Context.is() ) \ aIt.remove(); \ } \ - catch( ::com::sun::star::uno::RuntimeException e ) \ + catch(const ::com::sun::star::uno::RuntimeException& e) \ { \ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ } \ @@ -214,13 +214,13 @@ void ClassName::disposing( const ::com::sun::star::lang::EventObject& ) throw(:: { \ xListener->MethodName( aMulti ); \ } \ - catch( ::com::sun::star::lang::DisposedException e ) \ + catch(const ::com::sun::star::lang::DisposedException& e) \ { \ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \ if ( e.Context == xListener || !e.Context.is() ) \ aIt.remove(); \ } \ - catch( ::com::sun::star::uno::RuntimeException e ) \ + catch(const ::com::sun::star::uno::RuntimeException& e) \ { \ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ } \ @@ -240,13 +240,13 @@ void ClassName::disposing( const ::com::sun::star::lang::EventObject& ) throw(:: { \ xListener->MethodName( aMulti ); \ } \ - catch( ::com::sun::star::lang::DisposedException e ) \ + catch(const ::com::sun::star::lang::DisposedException& e) \ { \ OSL_ENSURE( e.Context.is(), "caught DisposedException with empty Context field" ); \ if ( e.Context == xListener || !e.Context.is() ) \ aIt.remove(); \ } \ - catch( ::com::sun::star::uno::RuntimeException e ) \ + catch(const ::com::sun::star::uno::RuntimeException& e) \ { \ DISPLAY_EXCEPTION( ClassName, MethodName, e ) \ } \ -- cgit v1.2.3 From 5ffd93d3be6078e786ca4ab6ea5d738ca9f526ea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 10:13:41 +0100 Subject: fix tinderbox --- tools/bootstrp/md5.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx index 2c8a30a5c66b..18ecb46ceb9d 100644 --- a/tools/bootstrp/md5.cxx +++ b/tools/bootstrp/md5.cxx @@ -138,7 +138,7 @@ rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum) { if ( checksum[i] < 16 ) aChecksumBuf.append('0'); - aChecksumBuf.append(checksum[i], 16); + aChecksumBuf.append(static_cast(checksum[i]), 16); } } -- cgit v1.2.3 From 406d40996242c750b56cd84dd4c647d43648bfb5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 14:33:25 +0100 Subject: this assert isn't helpful --- unotools/source/config/saveopt.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx index 83aea5d7cc9f..28614e00975c 100644 --- a/unotools/source/config/saveopt.cxx +++ b/unotools/source/config/saveopt.cxx @@ -469,7 +469,6 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl() { for ( int nProp = 0; nProp < aNames.getLength(); nProp++ ) { - DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" ); if ( pValues[nProp].hasValue() ) { sal_Int32 nTemp = 0; -- cgit v1.2.3 From 5b1fbb58d4e23b85dbc70a78a00666632afc6e42 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 14:54:35 +0100 Subject: WaE: keep windows compiler cast happy --- l10ntools/source/help/HelpCompiler.cxx | 4 ++-- l10ntools/source/help/HelpCompiler.hxx | 5 +++++ l10ntools/source/help/HelpLinker.cxx | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) 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..d40c72547203 100644 --- a/l10ntools/source/help/HelpCompiler.hxx +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -322,6 +322,11 @@ private: bool bExtensionMode; }; +inline char tocharlower(char c) +{ + return static_cast(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(fileLen); for (size_t j = 0; j < fileB.length(); ++j) - dataB[i++] = fileB[j]; + dataB[i++] = static_cast(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) ); } } -- cgit v1.2.3 From 165f46f6e6353a703617713d659781bf4eea4bf2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 15 Jun 2011 23:00:37 +0300 Subject: Revert "Don't do anything here when cross-compiling" We use a BUILD_TYPE keyword instead to bypass l10ntools. This reverts commit cb7948c88ab3e2c8702bef0794455c07ccd88295. --- l10ntools/layout/makefile.mk | 5 ----- l10ntools/source/filter/merge/makefile.mk | 5 ----- l10ntools/source/filter/utils/makefile.mk | 5 ----- l10ntools/source/help/makefile.mk | 6 ------ l10ntools/source/makefile.mk | 5 ----- 5 files changed, 26 deletions(-) diff --git a/l10ntools/layout/makefile.mk b/l10ntools/layout/makefile.mk index c977cba441cf..dee3c6e81b33 100644 --- a/l10ntools/layout/makefile.mk +++ b/l10ntools/layout/makefile.mk @@ -40,11 +40,6 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(CROSS_COMPILING)" == "YES" -all: - @echo Nothing done when cross-compiling -.ENDIF - .IF "$(SYSTEM_EXPAT)" == "YES" CFLAGS+=-DSYSTEM_EXPAT .ENDIF diff --git a/l10ntools/source/filter/merge/makefile.mk b/l10ntools/source/filter/merge/makefile.mk index cc9efd9118e6..8ef73debd743 100644 --- a/l10ntools/source/filter/merge/makefile.mk +++ b/l10ntools/source/filter/merge/makefile.mk @@ -34,11 +34,6 @@ PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge .INCLUDE: settings.mk -.IF "$(CROSS_COMPILING)" == "YES" -all: - @echo Nothing done when cross-compiling -.ENDIF - #----- compile .java files ----------------------------------------- OWNCOPY = \ diff --git a/l10ntools/source/filter/utils/makefile.mk b/l10ntools/source/filter/utils/makefile.mk index ca92f4b1b515..43a28d57ee9e 100644 --- a/l10ntools/source/filter/utils/makefile.mk +++ b/l10ntools/source/filter/utils/makefile.mk @@ -34,11 +34,6 @@ PACKAGE = com$/sun$/star$/filter$/config$/tools$/utils .INCLUDE: settings.mk -.IF "$(CROSS_COMPILING)" == "YES" -all: - @echo Nothing done when cross-compiling -.ENDIF - #----- compile .java files ----------------------------------------- diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk index d79194e10c29..3fd6879a9989 100644 --- a/l10ntools/source/help/makefile.mk +++ b/l10ntools/source/help/makefile.mk @@ -35,12 +35,6 @@ TARGETTYPE=CUI # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk - -.IF "$(CROSS_COMPILING)" == "YES" -all: - @echo Nothing done when cross-compiling -.ENDIF - .INCLUDE : helplinker.pmk .IF "$(SYSTEM_LIBXSLT)" == "YES" diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk index b581c463f352..86bcea3cbd0e 100644 --- a/l10ntools/source/makefile.mk +++ b/l10ntools/source/makefile.mk @@ -40,11 +40,6 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk -.IF "$(CROSS_COMPILING)" == "YES" -all: - @echo Nothing done when cross-compiling -.ENDIF - CDEFS+= -DYY_NEVER_INTERACTIVE=1 .IF "$(SYSTEM_EXPAT)" == "YES" -- cgit v1.2.3 From 89bdbffaaa26e95619e2f52a86e58ef0c2419011 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 01:17:35 +0300 Subject: Use DESKTOP and NATIVE where appropriate --- dtrans/prj/build.lst | 2 +- svl/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst index 6ee2b47d53af..f93333ff9dfd 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 offuh 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/svl/prj/build.lst b/svl/prj/build.lst index 67366a6aee68..58c150563e5e 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 offuh 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/vcl/prj/build.lst b/vcl/prj/build.lst index 9e0ccdba440b..1b32995ae668 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From 2a6cec5c73d116a4935d4b07fe817aadfc20a39c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 01:25:38 +0300 Subject: Deliver also static i18npaper library if we have built it that way --- i18npool/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/i18npool/prj/d.lst b/i18npool/prj/d.lst index 91df3e890ab2..d6fd70f9adf9 100644 --- a/i18npool/prj/d.lst +++ b/i18npool/prj/d.lst @@ -46,6 +46,7 @@ mkdir: %_DEST%\inc\i18npool ..\%__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 -- cgit v1.2.3 From ce68a70755f970ee702a13b330415d7c97c7415b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 02:10:37 +0300 Subject: Add svsys.h file for iOS --- vcl/inc/ios/svsys.h | 36 ++++++++++++++++++++++++++++++++++++ vcl/inc/svsys.h | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 vcl/inc/ios/svsys.h diff --git a/vcl/inc/ios/svsys.h b/vcl/inc/ios/svsys.h new file mode 100644 index 000000000000..0d01631c09f0 --- /dev/null +++ b/vcl/inc/ios/svsys.h @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 Tor Lillqvist + * Portions created by the Initial Developer are Copyright (C) 2010 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 _SV_SVSYS_H +#define _SV_SVSYS_H + + +// ? + +#endif // _SV_SVSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index df0b58c548ca..fb9a9215be7a 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -34,6 +34,8 @@ #include "aqua/svsys.h" #elif defined OS2 #include "os2/svsys.h" +#elif defined IOS +#include "ios/svsys.h" #else #include "unx/svsys.h" #endif -- cgit v1.2.3 From db21bb1863dba86896c1250eec90a510af8afc2d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 10:59:30 +0300 Subject: Revert "Don't link with jvmfwk unless SOLAR_JAVA" Nah, in the non-SOLAR_JAVA case we just build a dummy libjvmfwk. This reverts commit 2b3f92d9293123ff96b18c82935d68e9d86ec1d0. --- svl/Library_svl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk index 45932191b48a..246530a22bb3 100644 --- a/svl/Library_svl.mk +++ b/svl/Library_svl.mk @@ -52,7 +52,7 @@ $(eval $(call gb_Library_add_linked_libs,svl,\ cppuhelper \ i18nisolang1 \ i18nutil \ - $(if $(SOLAR_JAVA),jvmfwk) \ + jvmfwk \ sal \ sot \ tl \ -- cgit v1.2.3 From 174be928f7d7c42a846e574eaaa03572b2655f8c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 19:57:32 +0300 Subject: Put the local LetterTable class in the anonymous namespace --- svtools/source/edit/syntaxhighlight.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index f859e9930cf9..6ccaa07453d8 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -237,6 +237,8 @@ extern "C" int CDECL compare_strings( const void *arg1, const void *arg2 ) } +namespace { + class LetterTable { bool IsLetterTab[256]; @@ -252,6 +254,8 @@ public: bool isLetterUnicode( sal_Unicode c ); }; +} + class BasicSimpleCharClass { static LetterTable aLetterTable; -- cgit v1.2.3 From 3abfbe34c50e2d96da40f470a40ced918d8626ab Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 16 Jun 2011 20:31:07 +0300 Subject: Deliver also static libraries --- sax/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/sax/prj/d.lst b/sax/prj/d.lst index 9534663d5bfb..12cd6cd81370 100644 --- a/sax/prj/d.lst +++ b/sax/prj/d.lst @@ -2,6 +2,7 @@ ..\%__SRC%\lib\*.so %_DEST%\lib\*.so ..\%__SRC%\lib\*.dylib %_DEST%\lib\*.dylib ..\%__SRC%\lib\*.lib %_DEST%\lib\*.lib +..\%__SRC%\lib\*.a %_DEST%\lib\*.a ..\%__SRC%\misc\fastsax.component %_DEST%\xml\fastsax.component ..\%__SRC%\misc\sax.component %_DEST%\xml\sax.component ..\%__SRC%\misc\sax.inbuild.component %_DEST%\xml\sax.inbuild.component -- cgit v1.2.3 From 4bdd4e57a3cd6b22f6d36e7027774312950014aa Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 17 Jun 2011 01:39:10 +0300 Subject: Deliver also static libraries --- canvas/prj/d.lst | 1 + 1 file changed, 1 insertion(+) diff --git a/canvas/prj/d.lst b/canvas/prj/d.lst index 8c4a583f8e75..933e11490b82 100644 --- a/canvas/prj/d.lst +++ b/canvas/prj/d.lst @@ -14,6 +14,7 @@ ..\%__SRC%\lib\simplecanvas.uno.so %_DEST%\lib\simplecanvas.uno.so ..\%__SRC%\lib\canvasfactory.uno.so %_DEST%\lib\canvasfactory.uno.so ..\%__SRC%\lib\*.dylib %_DEST%\lib\*.dylib +..\%__SRC%\lib\*.a %_DEST%\lib\*.a ..\%__SRC%\class\javacanvas.uno.jar %_DEST%\bin\javacanvas.uno.jar ..\%__SRC%\misc\cairocanvas.component %_DEST%\xml\cairocanvas.component -- cgit v1.2.3 From f058498dafd4f9fb30e1e6eef7e677d10cae427a Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Thu, 16 Jun 2011 22:37:37 -0500 Subject: avoid 'error' in warning message as it triggers cloph's error detector --- i18npool/source/localedata/LocaleNode.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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()) -- cgit v1.2.3 From f30169f7f7873ac3174f6218dc8c1573ca839aef Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 21:34:11 +0100 Subject: let the caller own this --- vcl/source/app/svapp.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fe536addac98..fad5ad84ac7d 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -2067,13 +2067,9 @@ void Application::Property( ApplicationProperty& rProp ) void Application::SetPropertyHandler( PropertyHandler* p ) { - if ( pHandler ) - delete pHandler; pHandler = p; } - - void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ ) { } -- cgit v1.2.3 From 8e752d47381c50e2522be9dc2f216738e2045613 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 21:36:00 +0100 Subject: fix comment typo --- toolkit/source/awt/vclxtoolkit.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index f255777f5cb6..b6655ab56d98 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -1069,7 +1069,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( { VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( rDescriptor.Parent ); - // #103939# Don't through assertion, may be it's a system dependend window, used in ImplCreateWindow. + // #103939# Don't throw assertion, may be it's a system dependend window, used in ImplCreateWindow. // DBG_ASSERT( pParentComponent, "ParentComponent not valid" ); if ( pParentComponent ) -- cgit v1.2.3 From 74a007ef73e81bcd9197fde40a38fa303fa88330 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 22:15:27 +0100 Subject: don't need to expose aNameMask --- tools/inc/tools/fsys.hxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 341d74d8bc5d..9d8cc934699a 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -450,8 +450,6 @@ public: FSysSort nSort, ... ); ~Dir(); - const WildCard& GetNameMask() const { return aNameMask; } - FSysError SetSort( FSysSort nSort, ... ); void Reset(); -- cgit v1.2.3 From e178d5a97fd3949f3bf3eb02da73390b6e727291 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 22:28:08 +0100 Subject: ByteString -> rtl::OString --- vcl/unx/generic/app/wmadaptor.cxx | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index ad9b5ee22d6c..7ad584953069 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -228,8 +228,9 @@ WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay ) pAdaptor = new WMAdaptor( pSalDisplay ); #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Window Manager's name is \"%s\"\n", - ByteString( pAdaptor->getWindowManagerName(), RTL_TEXTENCODING_ISO_8859_1 ).GetBuffer() ); + fprintf(stderr, "Window Manager's name is \"%s\"\n", + rtl::OUStringToOString(pAdaptor->getWindowManagerName(), + RTL_TEXTENCODING_UTF8).getStr()); #endif return pAdaptor; } @@ -1075,10 +1076,11 @@ void GnomeWMAdaptor::initAtoms() void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const { - ByteString aTitle( rWMName, osl_getThreadTextEncoding() ); + rtl::OString aTitle(rtl::OUStringToOString(rWMName, + osl_getThreadTextEncoding())); if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) ) - aTitle = " "; + aTitle = rtl::OString(' '); ::rtl::OString aWMLocale; rtl_Locale* pLocale = NULL; @@ -1140,7 +1142,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const } #endif - char* pT = const_cast(aTitle.GetBuffer()); + char* pT = const_cast(aTitle.getStr()); XTextProperty aProp = { NULL, None, 0, 0 }; if( bTrustXmb ) { @@ -1151,10 +1153,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const &aProp ); } - unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer(); - Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; - int nFormat = aProp.nitems ? aProp.format : 8; - int nBytes = aProp.nitems ? aProp.nitems : aTitle.Len(); + unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr(); + Atom nType = aProp.nitems ? aProp.encoding : XA_STRING; + int nFormat = aProp.nitems ? aProp.format : 8; + int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength(); const SystemEnvData* pEnv = pFrame->GetSystemData(); XChangeProperty( m_pDisplay, (XLIB_Window)pEnv->aShellWindow, @@ -1195,7 +1197,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const { WMAdaptor::setWMName( pFrame, rWMName ); - ByteString aTitle( rWMName, RTL_TEXTENCODING_UTF8 ); + rtl::OString aTitle(rtl::OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8)); const SystemEnvData* pEnv = pFrame->GetSystemData(); if( m_aWMAtoms[ NET_WM_NAME ] ) XChangeProperty( m_pDisplay, @@ -1204,8 +1206,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.GetBuffer(), - aTitle.Len()+1 ); + (unsigned char*)aTitle.getStr(), + aTitle.getLength()+1 ); if( m_aWMAtoms[ NET_WM_ICON_NAME ] ) XChangeProperty( m_pDisplay, (XLIB_Window)pEnv->aShellWindow, @@ -1213,8 +1215,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const m_aWMAtoms[ UTF8_STRING ], 8, PropModeReplace, - (unsigned char*)aTitle.GetBuffer(), - aTitle.Len()+1 ); + (unsigned char*)aTitle.getStr(), + aTitle.getLength()+1 ); // The +1 copies the terminating null byte. Although // the spec says, this should not be necessary // at least the kwin implementation seems to depend -- cgit v1.2.3 From 6e613c590bdd7c6643616ac897533323ff77ebff Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 16 Jun 2011 22:49:31 +0100 Subject: ByteString -> rtl::OString --- vcl/unx/generic/plugadapt/salplug.cxx | 2 +- vcl/unx/gtk/app/gtksys.cxx | 25 +++++++++++++++---------- vcl/unx/headless/svppspgraphics.cxx | 8 +++++--- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 3235aa9a58fa..8cadab79b0a7 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -272,7 +272,7 @@ void SalAbort( const XubString& rErrorText ) if( !rErrorText.Len() ) std::fprintf( stderr, "Application Error\n" ); else - std::fprintf( stderr, "%s\n", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() ); + std::fprintf( stderr, "%s\n", rtl::OUStringToOString(rErrorText, gsl_getSystemTextEncoding()).getStr() ); exit(-1); } diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx index 2076d39cc229..66987ef533e1 100644 --- a/vcl/unx/gtk/app/gtksys.cxx +++ b/vcl/unx/gtk/app/gtksys.cxx @@ -55,11 +55,11 @@ GtkSalSystem::~GtkSalSystem() } // convert ~ to indicate mnemonic to '_' -static ByteString MapToGtkAccelerator (const String &rStr) +static rtl::OString MapToGtkAccelerator(const String &rStr) { String aRet( rStr ); aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_")); - return ByteString( aRet, RTL_TEXTENCODING_UTF8 ); + return rtl::OUStringToOString(aRet, RTL_TEXTENCODING_UTF8); } int GtkSalSystem::ShowNativeDialog( const String& rTitle, @@ -76,14 +76,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle, std::fprintf( stderr, "GtkSalSystem::ShowNativeDialog\n"); #endif - ByteString aTitle( rTitle, RTL_TEXTENCODING_UTF8 ); - ByteString aMessage( rMessage, RTL_TEXTENCODING_UTF8 ); + rtl::OString aTitle(rtl::OUStringToOString(rTitle, + RTL_TEXTENCODING_UTF8)); + rtl::OString aMessage(rtl::OUStringToOString(rMessage, + RTL_TEXTENCODING_UTF8)); /* Create the dialogue */ GtkWidget* mainwin = gtk_message_dialog_new ( NULL, (GtkDialogFlags)0, GTK_MESSAGE_WARNING, - GTK_BUTTONS_NONE, aMessage.GetBuffer(), NULL ); - gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.GetBuffer() ); + GTK_BUTTONS_NONE, aMessage.getStr(), NULL ); + gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.getStr() ); gint nButtons = 0, nResponse; @@ -92,13 +94,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle, { if( nButton == nDefButton ) { - gtk_dialog_add_button( GTK_DIALOG( mainwin ), MapToGtkAccelerator(*it).GetBuffer(), nButtons ); - gtk_dialog_set_default_response( GTK_DIALOG( mainwin ), nButtons ); + gtk_dialog_add_button(GTK_DIALOG( mainwin ), + MapToGtkAccelerator(*it).getStr(), nButtons); + gtk_dialog_set_default_response(GTK_DIALOG(mainwin), nButtons); } else { - ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 ); - gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons ); + rtl::OString aLabel(rtl::OUStringToOString(*it, + RTL_TEXTENCODING_UTF8)); + gtk_dialog_add_button(GTK_DIALOG(mainwin), aLabel.getStr(), + nButtons); } nButtons++; } diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 93fb0ced68b2..82f3ac43df96 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -1135,10 +1135,12 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF #if OSL_DEBUG_LEVEL > 2 if( bHasMapNames ) { - ByteString aOrigName( aDFA.maName, osl_getThreadTextEncoding() ); - ByteString aAliasNames( aDFA.maMapNames, osl_getThreadTextEncoding() ); + rtl::OString aOrigName(rtl::OUStringToOString(aDFA.maName, + osl_getThreadTextEncoding())); + rtl::OString aAliasNames(rtl::OUStringToOString(aDFA.maMapNames, + osl_getThreadTextEncoding())); fprintf( stderr, "using alias names \"%s\" for font family \"%s\"\n", - aAliasNames.GetBuffer(), aOrigName.GetBuffer() ); + aAliasNames.getStr(), aOrigName.getStr() ); } #endif -- cgit v1.2.3 From b33ae7fc706c6f9a8130e34d5eafb0ffbf938905 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 18 Jun 2011 00:00:52 +0900 Subject: remove dead code --- regexp/source/reclass.cxx | 7 ------- svl/source/numbers/zformat.cxx | 17 +---------------- svl/source/svdde/ddesvr.cxx | 29 ----------------------------- svtools/source/contnr/imivctl1.cxx | 7 ------- toolkit/source/layout/vcl/wbutton.cxx | 4 ---- vcl/aqua/source/gdi/salatslayout.cxx | 2 -- vcl/unx/kde4/KDESalFrame.cxx | 2 -- 7 files changed, 1 insertion(+), 67 deletions(-) diff --git a/regexp/source/reclass.cxx b/regexp/source/reclass.cxx index 79457e6c1fd3..b296230ead9f 100644 --- a/regexp/source/reclass.cxx +++ b/regexp/source/reclass.cxx @@ -1362,13 +1362,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/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/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::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/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 640f6c5ae923..cdb95366d560 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2754,15 +2754,8 @@ void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt ) (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) || (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) ) { -#if 1 if( HandleScrollCommand( rCEvt ) ) return; -#else - ScrollBar* pHor = aHorSBar.IsVisible() ? &aHorSBar : 0; - ScrollBar* pVer = aVerSBar.IsVisible() ? &aVerSBar : 0; - if( pView->HandleScrollCommand( rCEvt, pHor, pVer ) ) - return; -#endif } } diff --git a/toolkit/source/layout/vcl/wbutton.cxx b/toolkit/source/layout/vcl/wbutton.cxx index 5e303ada03ba..96e6aeb5d251 100644 --- a/toolkit/source/layout/vcl/wbutton.cxx +++ b/toolkit/source/layout/vcl/wbutton.cxx @@ -276,7 +276,6 @@ public: if ( !mxRadioButton.is() ) return; -#if 1 // Have setState fire item event for // RadioGroups::RadioGroup::itemStateChanged () ::RadioButton *r = static_cast(mpWindow)->GetRadioButton (); @@ -284,9 +283,6 @@ public: r->EnableRadioCheck(); mxRadioButton->setState( !!bCheck ); r->EnableRadioCheck (state); -#else - mxRadioButton->setState( !!bCheck ); -#endif fireToggle(); } diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index 94022b763a03..1c193378b9cf 100644 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -1043,7 +1043,6 @@ bool ATSLayout::GetDeltaY() const if( mpDeltaY != NULL ) return true; -#if 1 if( !maATSULayout ) return false; @@ -1069,7 +1068,6 @@ bool ATSLayout::GetDeltaY() const mpDeltaY = NULL; return false; } -#endif return true; } diff --git a/vcl/unx/kde4/KDESalFrame.cxx b/vcl/unx/kde4/KDESalFrame.cxx index 98b84ce54d7a..10e73502927c 100644 --- a/vcl/unx/kde4/KDESalFrame.cxx +++ b/vcl/unx/kde4/KDESalFrame.cxx @@ -88,8 +88,6 @@ static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey ) return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() ); } -#if 0 -#endif /** Helper function to add information to Font from QFont. Mostly grabbed from the Gtk+ vclplug (salnativewidgets-gtk.cxx). -- cgit v1.2.3 From 190ae222e6933eabb7a9a016690619621bea07ad Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 18 Jun 2011 01:28:02 +0300 Subject: Use the i prefix for the import library only with MSC --- basegfx/util/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/basegfx/util/makefile.mk b/basegfx/util/makefile.mk index 777f30aba696..cf82c01aa3d3 100644 --- a/basegfx/util/makefile.mk +++ b/basegfx/util/makefile.mk @@ -52,7 +52,11 @@ LIB1FILES=\ $(SLB)$/raster.lib SHL1TARGET= basegfx$(DLLPOSTFIX) +.IF "$(COM)" == "MSC" SHL1IMPLIB= ibasegfx +.ELSE +SHL1IMPLIB= $(SHL1TARGET) +.ENDIF SHL1STDLIBS=\ $(SALLIB) \ -- cgit v1.2.3 From 0e6ab013f7def9891c2e982bec76458a64953c20 Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Mon, 30 May 2011 18:09:09 +0200 Subject: ause130: #i117218# change .idl handling to gnu make --- basegfx/prj/build.lst | 2 +- canvas/prj/build.lst | 2 +- comphelper/Library_comphelp.mk | 6 +++++- comphelper/prj/build.lst | 2 +- cppcanvas/prj/build.lst | 2 +- dtrans/prj/build.lst | 2 +- i18nutil/prj/build.lst | 2 +- padmin/Executable_spadmin.bin.mk | 6 +++++- padmin/Library_spa.mk | 10 +++++----- sot/Library_sot.mk | 6 +++++- svl/Library_fsstorage.mk | 6 +++++- svl/Library_passwordcontainer.mk | 6 +++++- svl/Library_svl.mk | 7 ++++++- svl/prj/build.lst | 2 +- svtools/Executable_bmp.mk | 6 +++++- svtools/Executable_bmpsum.mk | 6 +++++- svtools/Executable_g2g.mk | 6 +++++- svtools/Library_hatchwindowfactory.mk | 6 +++++- svtools/Library_productregistration.mk | 6 +++++- svtools/Library_svt.mk | 8 ++++++-- svtools/prj/build.lst | 2 +- toolkit/Library_tk.mk | 6 +++++- tools/Library_tl.mk | 6 +++++- tools/StaticLibrary_ooopathutils.mk | 2 +- tools/prj/build.lst | 2 +- ucbhelper/prj/build.lst | 2 +- unotools/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 28 files changed, 90 insertions(+), 33 deletions(-) diff --git a/basegfx/prj/build.lst b/basegfx/prj/build.lst index fe3354b3f256..01a39b6d964f 100644 --- a/basegfx/prj/build.lst +++ b/basegfx/prj/build.lst @@ -1,4 +1,4 @@ -fx basegfx : o3tl sal offuh cppuhelper cppu CPPUNIT:cppunit NULL +fx basegfx : o3tl sal offapi cppuhelper cppu CPPUNIT:cppunit NULL fx basegfx usr1 - all fx_mkout NULL fx basegfx\inc nmake - all fx_inc NULL fx basegfx\prj get - all fx_prj NULL diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index 121be382208f..dad6e28c0ea5 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -1,4 +1,4 @@ -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 usr1 - all cv_mkout NULL cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL diff --git a/comphelper/Library_comphelp.mk b/comphelper/Library_comphelp.mk index 8336b8cb2124..64c58cc65623 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_set_defs,comphelper,\ @@ -53,6 +52,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/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/cppcanvas/prj/build.lst b/cppcanvas/prj/build.lst index 317e3276c249..143af130f39b 100644 --- a/cppcanvas/prj/build.lst +++ b/cppcanvas/prj/build.lst @@ -1,4 +1,4 @@ -cx cppcanvas : comphelper cppuhelper offuh tools vcl basegfx canvas NULL +cx cppcanvas : comphelper cppuhelper offapi tools vcl basegfx canvas NULL cx cppcanvas usr1 - all cx_mkout NULL cx cppcanvas\inc nmake - all cx_inc NULL cx cppcanvas\source\tools nmake - all cx_tools cx_inc NULL diff --git a/dtrans/prj/build.lst b/dtrans/prj/build.lst index f93333ff9dfd..519e1fda37c8 100644 --- a/dtrans/prj/build.lst +++ b/dtrans/prj/build.lst @@ -1,4 +1,4 @@ -dr dtrans : unotools offapi offuh DESKTOP: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/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/padmin/Executable_spadmin.bin.mk b/padmin/Executable_spadmin.bin.mk index bcb69b28e748..4ec56f2cf7e0 100644 --- a/padmin/Executable_spadmin.bin.mk +++ b/padmin/Executable_spadmin.bin.mk @@ -30,7 +30,6 @@ $(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_set_cxxflags,spadmin.bin,\ @@ -41,6 +40,11 @@ $(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 3cd9dc7c271e..e72c676b57eb 100644 --- a/padmin/Library_spa.mk +++ b/padmin/Library_spa.mk @@ -27,16 +27,16 @@ $(eval $(call gb_Library_Library,spa)) -$(eval $(call gb_Library_set_include,spa,\ - $$(INCLUDE) \ - -I$(OUTDIR)/inc/offuh \ -)) - $(eval $(call gb_Library_set_defs,spa,\ $$(DEFS) \ -DSPA_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,spa,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,spa,\ svt \ vcl \ diff --git a/sot/Library_sot.mk b/sot/Library_sot.mk index 51679534763c..927fdc001045 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_set_defs,sot,\ 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 246530a22bb3..638ab9c89832 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_set_defs,svl,\ diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 58c150563e5e..5fc7d0e223a3 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations DESKTOP: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/svtools/Executable_bmp.mk b/svtools/Executable_bmp.mk index 3b2fd2a1203c..f05013df4170 100644 --- a/svtools/Executable_bmp.mk +++ b/svtools/Executable_bmp.mk @@ -36,7 +36,11 @@ $(eval $(call gb_Executable_set_include,bmp,\ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ -I$(realpath $(SRCDIR)/svtools/source/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Executable_add_api,bmp,\ + udkapi \ + offapi \ )) $(eval $(call gb_Executable_add_linked_libs,bmp,\ diff --git a/svtools/Executable_bmpsum.mk b/svtools/Executable_bmpsum.mk index 492dabeb58f8..1bef32c970de 100644 --- a/svtools/Executable_bmpsum.mk +++ b/svtools/Executable_bmpsum.mk @@ -30,12 +30,16 @@ $(eval $(call gb_Executable_Executable,bmpsum)) $(eval $(call gb_Executable_set_include,bmpsum,\ $$(INCLUDE) \ -I$(OUTDIR)/inc/ \ - -I$(OUTDIR)/inc/offuh/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ )) +$(eval $(call gb_Executable_add_api,bmpsum,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,bmpsum,\ sal \ tl \ diff --git a/svtools/Executable_g2g.mk b/svtools/Executable_g2g.mk index c817cff43ccd..c41dae777dbd 100644 --- a/svtools/Executable_g2g.mk +++ b/svtools/Executable_g2g.mk @@ -30,12 +30,16 @@ $(eval $(call gb_Executable_Executable,g2g)) $(eval $(call gb_Executable_set_include,g2g,\ $$(INCLUDE) \ -I$(OUTDIR)/inc/ \ - -I$(OUTDIR)/inc/offuh/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ )) +$(eval $(call gb_Executable_add_api,g2g,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Executable_add_linked_libs,g2g,\ jvmfwk \ sal \ diff --git a/svtools/Library_hatchwindowfactory.mk b/svtools/Library_hatchwindowfactory.mk index 96e8f10c3306..91b92267ddd5 100644 --- a/svtools/Library_hatchwindowfactory.mk +++ b/svtools/Library_hatchwindowfactory.mk @@ -36,10 +36,14 @@ $(eval $(call gb_Library_set_include,hatchwindowfactory,\ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(OUTDIR)/inc/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,hatchwindowfactory,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,hatchwindowfactory,\ cppu \ cppuhelper \ diff --git a/svtools/Library_productregistration.mk b/svtools/Library_productregistration.mk index 726e5a3b664b..44867f4530e3 100644 --- a/svtools/Library_productregistration.mk +++ b/svtools/Library_productregistration.mk @@ -36,10 +36,14 @@ $(eval $(call gb_Library_set_include,productregistration,\ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ -I$(OUTDIR)/inc/ \ -I$(realpath $(SRCDIR)/svtools/inc) \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,productregistration,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,productregistration,\ cppu \ cppuhelper \ diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index def31f0d121f..2dee92a7dceb 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -33,17 +33,21 @@ $(eval $(call gb_Library_add_precompiled_header,svt,$(SRCDIR)/svtools/inc/pch/pr $(eval $(call gb_Library_set_componentfile,svt,svtools/util/svt)) +$(eval $(call gb_Library_add_api,svt,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_set_include,svt,\ -I$(OUTDIR)/inc/external/jpeg \ $$(INCLUDE) \ -I$(WORKDIR)/inc/svtools \ -I$(WORKDIR)/inc/ \ -I$(OUTDIR)/inc/ \ - -I$(realpath $(SRCDIR)/svtools/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/svtools) \ -I$(realpath $(SRCDIR)/svtools/source/inc) \ -I$(realpath $(SRCDIR)/svtools/inc/pch) \ - -I$(OUTDIR)/inc/offuh \ + -I$(realpath $(SRCDIR)/svtools/inc) \ )) $(eval $(call gb_Library_set_defs,svt,\ diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index 7ac223ae1588..a438456220a0 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,2 +1,2 @@ -st svtools : TRANSLATIONS:translations svl offuh toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL +st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL st svtools\prj nmake - all st_prj NULL diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 1a94bbd21ab1..84c05eb752ab 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Library_set_include,tk,\ -I$(realpath $(SRCDIR)/toolkit/inc) \ -I$(realpath $(SRCDIR)/toolkit/inc/pch) \ -I$(realpath $(SRCDIR)/toolkit/source) \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_set_defs,tk,\ @@ -46,6 +45,11 @@ $(eval $(call gb_Library_set_defs,tk,\ -DTOOLKIT_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,tk,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,tk,\ comphelper \ cppu \ diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index da3e0276f521..ad3c9c4ec682 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Library_set_include,tl,\ -I$(realpath $(SRCDIR)/tools/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(SRCDIR)/solenv/inc/Xp31 \ - -I$(OUTDIR)/inc/offuh \ -I$(WORKDIR)/CustomTarget/tools/source/reversemap \ )) @@ -48,6 +47,11 @@ $(eval $(call gb_Library_set_defs,tl,\ -DVCL \ )) +$(eval $(call gb_Library_add_api,tl,\ + udkapi \ + offapi \ +)) + $(eval $(call gb_Library_add_linked_libs,tl,\ basegfx \ comphelper \ diff --git a/tools/StaticLibrary_ooopathutils.mk b/tools/StaticLibrary_ooopathutils.mk index e58becb175d3..c5b2ea6ad846 100644 --- a/tools/StaticLibrary_ooopathutils.mk +++ b/tools/StaticLibrary_ooopathutils.mk @@ -39,7 +39,7 @@ $(eval $(call gb_StaticLibrary_add_exception_objects,ooopathutils,\ # Instead of this evil linking of an object from $(OUTDIR) define StaticLibrary_ooopathutils_hack $(call gb_StaticLibrary_get_target,ooopathutils) : $(OUTDIR)/lib/$(1) -$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils))) +$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,tools/source/misc/pathutils),$(1))) $(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,tools/source/misc/pathutils) $$(call gb_Deliver_deliver,$$<,$$@) diff --git a/tools/prj/build.lst b/tools/prj/build.lst index eeb470c384d6..ee6803567843 100644 --- a/tools/prj/build.lst +++ b/tools/prj/build.lst @@ -1,3 +1,3 @@ -tl tools : cppu external offuh ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL +tl tools : cppu external offapi ZLIB:zlib EXPAT:expat basegfx comphelper i18npool NULL tl tools\prj nmake - all tl_prj NULL # tl tools\qa nmake - all tl_qa tl_utl NULL diff --git a/ucbhelper/prj/build.lst b/ucbhelper/prj/build.lst index bbd01df9022a..f97173305622 100644 --- a/ucbhelper/prj/build.lst +++ b/ucbhelper/prj/build.lst @@ -1,4 +1,4 @@ -uh ucbhelper : offuh sal cppu cppuhelper salhelper NULL +uh ucbhelper : offapi sal cppu cppuhelper salhelper NULL uh ucbhelper usr1 - all uh_mkout NULL uh ucbhelper\inc nmake - all uh_inc NULL uh ucbhelper\source\client nmake - all uh_client uh_inc NULL diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst index b7883fa2e3dd..8e182910f277 100644 --- a/unotools/prj/build.lst +++ b/unotools/prj/build.lst @@ -1,3 +1,3 @@ -ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL +ut unotools : LIBXSLT:libxslt comphelper cppuhelper offapi tools ucbhelper NULL ut unotools\prj nmake - all ut_prj NULL diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 1b32995ae668..6db5d660f085 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From 254cb2dc95c29e0ddf250db5daf775f9897f5790 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 30 May 2011 18:47:58 +0200 Subject: remove all traces of offuh from makefiles --- unotools/Library_utl.mk | 6 +++++- vcl/Library_desktop_detector.mk | 6 +++++- vcl/Library_vcl.mk | 6 +++++- vcl/Library_vclplug_gen.mk | 6 +++++- vcl/Library_vclplug_gtk.mk | 6 +++++- vcl/Library_vclplug_kde.mk | 6 +++++- vcl/Library_vclplug_kde4.mk | 6 +++++- vcl/Library_vclplug_svp.mk | 6 +++++- vcl/StaticLibrary_vclmain.mk | 5 ++++- 9 files changed, 44 insertions(+), 9 deletions(-) diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk index 1a86c469996c..b77a8ebb6826 100644 --- a/unotools/Library_utl.mk +++ b/unotools/Library_utl.mk @@ -35,7 +35,6 @@ $(eval $(call gb_Library_set_include,utl,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/unotools/inc/pch) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_set_defs,utl,\ @@ -43,6 +42,11 @@ $(eval $(call gb_Library_set_defs,utl,\ -DUNOTOOLS_DLLIMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,utl,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,utl,\ comphelper \ cppu \ diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk index c7e1cd087d4e..7a34ee739461 100644 --- a/vcl/Library_desktop_detector.mk +++ b/vcl/Library_desktop_detector.mk @@ -36,7 +36,6 @@ $(eval $(call gb_Library_set_include,desktop_detector,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -45,6 +44,11 @@ $(eval $(call gb_Library_set_defs,desktop_detector,\ -DDESKTOP_DETECTOR_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,desktop_detector,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,desktop_detector,\ vcl \ tl \ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index d663d462d972..c8292cf7ac71 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -43,7 +43,6 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) @@ -61,6 +60,11 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DDLLPOSTFIX=$(subst $(or $(gb_Library_DLLEXT),$(gb_Library_PLAINEXT)),,$(gb_Library_OOOEXT)) \ )) +$(eval $(call gb_Library_add_api,vcl,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vcl,\ tl \ utl \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 494f36acc349..b5cca31d365f 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -32,10 +32,14 @@ $(eval $(call gb_Library_set_include,vclplug_gen,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_Library_add_api,vclplug_gen,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ vcl \ tl \ diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk index 838df57d1d8e..da001a220565 100644 --- a/vcl/Library_vclplug_gtk.mk +++ b/vcl/Library_vclplug_gtk.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -62,6 +61,11 @@ $(eval $(call gb_Library_set_ldflags,vclplug_gtk,\ )) endif +$(eval $(call gb_Library_add_api,vclplug_gtk,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_gtk,\ $$(LDFLAGS) \ $$(GTK_LIBS) \ diff --git a/vcl/Library_vclplug_kde.mk b/vcl/Library_vclplug_kde.mk index efb134d912ac..bcec46732b7d 100644 --- a/vcl/Library_vclplug_kde.mk +++ b/vcl/Library_vclplug_kde.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -46,6 +45,11 @@ $(eval $(call gb_Library_set_defs,vclplug_kde,\ -DVCLPLUG_KDE_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_kde,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_kde,\ $$(KDE_LIBS)\ $$(LDFLAGS) \ diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk index 0f7f3e78696b..c075ca3ba4e1 100644 --- a/vcl/Library_vclplug_kde4.mk +++ b/vcl/Library_vclplug_kde4.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde4,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ -I$(WORKDIR)/CustomTarget/vcl/unx/kde4 \ )) @@ -49,6 +48,11 @@ $(eval $(call gb_Library_set_defs,vclplug_kde4,\ -DVCLPLUG_KDE4_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_kde4,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_set_ldflags,vclplug_kde4,\ $$(KDE4_LIBS)\ $$(LDFLAGS) \ diff --git a/vcl/Library_vclplug_svp.mk b/vcl/Library_vclplug_svp.mk index 5ba89f3568db..8c222ad05b9b 100644 --- a/vcl/Library_vclplug_svp.mk +++ b/vcl/Library_vclplug_svp.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_svp,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -41,6 +40,11 @@ $(eval $(call gb_Library_set_defs,vclplug_svp,\ -DVCLPLUG_SVP_IMPLEMENTATION \ )) +$(eval $(call gb_Library_add_api,vclplug_svp,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,vclplug_svp,\ vcl \ vclplug_gen \ diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 044ce10ca40c..1b6496ce2623 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -32,10 +32,13 @@ $(eval $(call gb_StaticLibrary_set_include,vclmain,\ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) +$(eval $(call gb_StaticLibrary_add_api,vclmain,\ + udkapi \ +)) + $(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\ vcl/source/salmain/salmain \ )) -- cgit v1.2.3 From 00ed6f6f71dd6615d37c84f878196582038a15aa Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 31 May 2011 17:08:42 +0200 Subject: gb_Deliver_add_deliverable takes 3 params now --- vcl/StaticLibrary_vclmain.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 1b6496ce2623..79b3ddd3ad5f 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -48,7 +48,7 @@ $(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\ # Instead of this evil linking of an object from $(OUTDIR) define StaticLibrary_salmain_hack $(call gb_StaticLibrary_get_target,vclmain) : $(OUTDIR)/lib/$(1) -$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain))) +$$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain),$(OUTDIR)/lib/$(1))) $(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,vcl/source/salmain/salmain) $$(call gb_Deliver_deliver,$$<,$$@) -- cgit v1.2.3 From fef6942ac3d6d9ebf8acfa4576308c923ee05544 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 18 Jun 2011 16:05:23 +0300 Subject: Produce the expected import library name in the MinGW case --- ucbhelper/util/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ucbhelper/util/makefile.mk b/ucbhelper/util/makefile.mk index 41cd0e5b4190..05fee92e83dc 100644 --- a/ucbhelper/util/makefile.mk +++ b/ucbhelper/util/makefile.mk @@ -49,7 +49,11 @@ SHL1STDLIBS = \ $(SALLIB) SHL1DEPN= +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET)$(UCBHELPER_MAJOR)$(COMID) +.ENDIF SHL1USE_EXPORTS=name SHL1LIBS= $(LIB1TARGET) SHL1DEF= $(MISC)$/$(SHL1TARGET).def -- cgit v1.2.3 From 03db851b12a77326926ecfdf0543aa2da2205c52 Mon Sep 17 00:00:00 2001 From: Jesús Corrius Date: Sat, 18 Jun 2011 18:36:57 +0200 Subject: Remove obsolete Win95/NT code --- vcl/win/source/window/salframe.cxx | 125 +++++++++++++------------------------ 1 file changed, 45 insertions(+), 80 deletions(-) diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 9ed173ee6170..ed428e473aae 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -232,9 +232,6 @@ static void ImplSaveFrameState( WinSalFrame* pFrame ) // if pParentRect is set, the workarea of the monitor that contains pParentRect is returned void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ) { - static int winVerChecked = 0; - static int winVerOk = 0; - // check if we or our parent is fullscreen, then the taskbar should be ignored bool bIgnoreTaskbar = false; WinSalFrame* pFrame = GetWindowPtr( hWnd ); @@ -254,96 +251,64 @@ void ImplSalGetWorkArea( HWND hWnd, RECT *pRect, const RECT *pParentRect ) } } - if( !winVerChecked ) + // calculates the work area taking multiple monitors into account + static int nMonitors = GetSystemMetrics( SM_CMONITORS ); + if( nMonitors == 1 ) { - winVerChecked = 1; - winVerOk = 1; - - // multi monitor calls not available on Win95/NT - if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) - { - if ( aSalShlData.maVersionInfo.dwMajorVersion <= 4 ) - winVerOk = 0; // NT - } - else if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) + if( bIgnoreTaskbar ) { - if ( aSalShlData.maVersionInfo.dwMajorVersion == 4 && aSalShlData.maVersionInfo.dwMinorVersion == 0 ) - winVerOk = 0; // Win95 + pRect->left = pRect->top = 0; + pRect->right = GetSystemMetrics( SM_CXSCREEN ); + pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); } + else + SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); } - - // calculates the work area taking multiple monitors into account - if( winVerOk ) + else { - static int nMonitors = GetSystemMetrics( SM_CMONITORS ); - if( nMonitors == 1 ) + if( pParentRect != NULL ) { - if( bIgnoreTaskbar ) - { - pRect->left = pRect->top = 0; - pRect->right = GetSystemMetrics( SM_CXSCREEN ); - pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); - } + // return the size of the monitor where pParentRect lives + HMONITOR hMonitor; + MONITORINFO mi; + + // get the nearest monitor to the passed rect. + hMonitor = MonitorFromRect(pParentRect, MONITOR_DEFAULTTONEAREST); + + // get the work area or entire monitor rect. + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + if( !bIgnoreTaskbar ) + *pRect = mi.rcWork; else - SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); + *pRect = mi.rcMonitor; } else { - if( pParentRect != NULL ) + // return the union of all monitors + pRect->left = GetSystemMetrics( SM_XVIRTUALSCREEN ); + pRect->top = GetSystemMetrics( SM_YVIRTUALSCREEN ); + pRect->right = pRect->left + GetSystemMetrics( SM_CXVIRTUALSCREEN ); + pRect->bottom = pRect->top + GetSystemMetrics( SM_CYVIRTUALSCREEN ); + + // virtualscreen does not take taskbar into account, so use the corresponding + // diffs between screen and workarea from the default screen + // however, this is still not perfect: the taskbar might not be on the primary screen + if( !bIgnoreTaskbar ) { - // return the size of the monitor where pParentRect lives - HMONITOR hMonitor; - MONITORINFO mi; - - // get the nearest monitor to the passed rect. - hMonitor = MonitorFromRect(pParentRect, MONITOR_DEFAULTTONEAREST); - - // get the work area or entire monitor rect. - mi.cbSize = sizeof(mi); - GetMonitorInfo(hMonitor, &mi); - if( !bIgnoreTaskbar ) - *pRect = mi.rcWork; - else - *pRect = mi.rcMonitor; + RECT wRect, scrRect; + SystemParametersInfo( SPI_GETWORKAREA, 0, &wRect, 0 ); + scrRect.left = 0; + scrRect.top = 0; + scrRect.right = GetSystemMetrics( SM_CXSCREEN ); + scrRect.bottom = GetSystemMetrics( SM_CYSCREEN ); + + pRect->left += wRect.left; + pRect->top += wRect.top; + pRect->right -= scrRect.right - wRect.right; + pRect->bottom -= scrRect.bottom - wRect.bottom; } - else - { - // return the union of all monitors - pRect->left = GetSystemMetrics( SM_XVIRTUALSCREEN ); - pRect->top = GetSystemMetrics( SM_YVIRTUALSCREEN ); - pRect->right = pRect->left + GetSystemMetrics( SM_CXVIRTUALSCREEN ); - pRect->bottom = pRect->top + GetSystemMetrics( SM_CYVIRTUALSCREEN ); - - // virtualscreen does not take taskbar into account, so use the corresponding - // diffs between screen and workarea from the default screen - // however, this is still not perfect: the taskbar might not be on the primary screen - if( !bIgnoreTaskbar ) - { - RECT wRect, scrRect; - SystemParametersInfo( SPI_GETWORKAREA, 0, &wRect, 0 ); - scrRect.left = 0; - scrRect.top = 0; - scrRect.right = GetSystemMetrics( SM_CXSCREEN ); - scrRect.bottom = GetSystemMetrics( SM_CYSCREEN ); - - pRect->left += wRect.left; - pRect->top += wRect.top; - pRect->right -= scrRect.right - wRect.right; - pRect->bottom -= scrRect.bottom - wRect.bottom; - } - } - } - } - else - { - if( bIgnoreTaskbar ) - { - pRect->left = pRect->top = 0; - pRect->right = GetSystemMetrics( SM_CXSCREEN ); - pRect->bottom = GetSystemMetrics( SM_CYSCREEN ); } - else - SystemParametersInfo( SPI_GETWORKAREA, 0, pRect, 0 ); } } -- cgit v1.2.3 From b74c7e7fceddca2c93bf7586df938f9909feb0f7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 17 Jun 2011 21:39:12 +0100 Subject: silence unhelpful assert --- svtools/source/config/optionsdrawinglayer.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index 410c430810b2..957792d85166 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -388,13 +388,12 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nI miss some values of configuration keys!\n" ); - // Copy values from list in right order to ouer internal member. + // Copy values from list in right order to our internal member. sal_Int32 nPropertyCount = seqValues.getLength(); - sal_Int32 nProperty = 0; - - for( nProperty=0; nProperty Date: Fri, 17 Jun 2011 23:52:59 +0100 Subject: catch by const reference --- ucbhelper/source/provider/propertyvalueset.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx index c6ab550237c1..361a8fd514af 100644 --- a/ucbhelper/source/provider/propertyvalueset.cxx +++ b/ucbhelper/source/provider/propertyvalueset.cxx @@ -221,10 +221,10 @@ class PropertyValues : public PropertyValuesVector {}; m_bWasNull = sal_False; \ } \ } \ - catch ( IllegalArgumentException ) \ + catch (const IllegalArgumentException&) \ { \ } \ - catch ( CannotConvertException ) \ + catch (const CannotConvertException&) \ { \ } \ } \ @@ -881,10 +881,10 @@ void PropertyValueSet::appendPropertySet( if ( aValue.hasValue() ) appendObject( rProp, aValue ); } - catch ( UnknownPropertyException ) + catch (const UnknownPropertyException&) { } - catch ( WrappedTargetException ) + catch (const WrappedTargetException&) { } } @@ -909,10 +909,10 @@ sal_Bool PropertyValueSet::appendPropertySetValue( return sal_True; } } - catch ( UnknownPropertyException ) + catch (const UnknownPropertyException&) { } - catch ( WrappedTargetException ) + catch (const WrappedTargetException&) { } } -- cgit v1.2.3 From e7355a7d5c1c9f35de4758cd74f29ded768c65fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:01:50 +0100 Subject: catch by const reference --- vcl/source/app/svdata.cxx | 17 ++---- vcl/source/gdi/print3.cxx | 4 +- vcl/source/window/dndlcon.cxx | 30 ++++------ vcl/source/window/window.cxx | 12 ++-- vcl/unx/gtk/a11y/atkutil.cxx | 136 +++++++++++++++++++++--------------------- 5 files changed, 91 insertions(+), 108 deletions(-) diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 7648dbbae75c..10f7e50d9aad 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -410,8 +410,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return bSuccess; } - - catch(::com::sun::star::java::JavaNotConfiguredException e) + catch (const ::com::sun::star::java::JavaNotConfiguredException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -435,8 +434,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::JavaVMCreationFailureException e) + catch (const ::com::sun::star::java::JavaVMCreationFailureException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -460,8 +458,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::MissingJavaRuntimeException e) + catch (const ::com::sun::star::java::MissingJavaRuntimeException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -485,8 +482,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - catch(::com::sun::star::java::JavaDisabledException e) + catch (const ::com::sun::star::java::JavaDisabledException&) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && bAllowCancel && pResMgr ) @@ -510,9 +506,7 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - - - catch(::com::sun::star::uno::RuntimeException e) + catch (const ::com::sun::star::uno::RuntimeException& e) { ResMgr *pResMgr = ImplGetResMgr(); if( bErrorMessage && pResMgr ) @@ -564,7 +558,6 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled) return false; } - catch (...) { return false; diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 61a40af43bdd..dfe5bfb2aa73 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -250,7 +250,7 @@ static rtl::OUString queryFile( Printer* pPrinter ) // add arbitrary files xFilterMgr->appendFilter( String( VclResId( SV_STDTEXT_ALLFILETYPES ) ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*.*" ) ) ); } - catch( lang::IllegalArgumentException ) + catch (const lang::IllegalArgumentException&) { DBG_ERRORFILE( "caught IllegalArgumentException when registering filter\n" ); } @@ -460,7 +460,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr& i_pContr makeAny( sal_True ) ); } } - catch( std::bad_alloc& ) + catch (const std::bad_alloc&) { } } diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx index 977e8611e70a..08c8e4d24c3b 100644 --- a/vcl/source/window/dndlcon.cxx +++ b/vcl/source/window/dndlcon.cxx @@ -193,8 +193,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -209,8 +208,7 @@ sal_uInt32 DNDListenerContainer::fireDropEvent( const Reference< XDropTargetDrop { context->rejectDrop(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -253,8 +251,7 @@ sal_uInt32 DNDListenerContainer::fireDragExitEvent() nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -305,8 +302,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -321,8 +317,7 @@ sal_uInt32 DNDListenerContainer::fireDragOverEvent( const Reference< XDropTarget { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -373,8 +368,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -389,8 +383,7 @@ sal_uInt32 DNDListenerContainer::fireDragEnterEvent( const Reference< XDropTarge { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -440,8 +433,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } @@ -456,8 +448,7 @@ sal_uInt32 DNDListenerContainer::fireDropActionChangedEvent( const Reference< XD { context->rejectDrag(); } - - catch( RuntimeException exc ) + catch (const RuntimeException&) { } } @@ -502,8 +493,7 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_ nRet++; } } - - catch( RuntimeException ) + catch (const RuntimeException&) { pContainer->removeInterface( xElement ); } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b8457d1267a5..1ab898011672 100755 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -4340,8 +4340,7 @@ Window::~Window() if( xComponent.is() ) xComponent->dispose(); } - - catch ( Exception ) + catch (const Exception&) { // can be safely ignored here. } @@ -8378,8 +8377,7 @@ uno::Reference< XDropTarget > Window::GetDropTarget() mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True; } - - catch( RuntimeException ) + catch (const RuntimeException&) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8452,7 +8450,7 @@ uno::Reference< XDragSource > Window::GetDragSource() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxDropTarget.clear(); @@ -8532,7 +8530,7 @@ uno::Reference< XClipboard > Window::GetClipboard() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxClipboard.clear(); @@ -8584,7 +8582,7 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() } // createInstance can throw any exception - catch( Exception ) + catch (const Exception&) { // release all instances mpWindowImpl->mpFrameData->mxSelection.clear(); diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 78e0cb05d4de..8514e4417ca3 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -224,7 +224,7 @@ void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObj if( accessibility::AccessibleStateType::FOCUSED == nState ) atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) ); } - catch(const lang::IndexOutOfBoundsException &e) + catch (const lang::IndexOutOfBoundsException&) { g_warning("Focused object has invalid index in parent"); } @@ -559,7 +559,7 @@ static void handle_get_focus(::VclWindowEvent const * pEvent) { aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet); } - catch( const uno::Exception &e ) + catch (const uno::Exception&) { g_warning( "Exception caught processing focus events" ); } @@ -593,7 +593,7 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) } } } - catch( const uno::Exception& e ) + catch (const uno::Exception&) { g_warning( "Exception caught processing menu highlight events" ); } @@ -603,74 +603,76 @@ static void handle_menu_highlighted(::VclMenuEvent const * pEvent) long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) { - try { - switch (pEvent->GetId()) + try { - case VCLEVENT_WINDOW_SHOW: - break; - case VCLEVENT_WINDOW_HIDE: - break; - case VCLEVENT_WINDOW_CLOSE: - break; - case VCLEVENT_WINDOW_GETFOCUS: - handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent)); - break; - case VCLEVENT_WINDOW_LOSEFOCUS: - break; - case VCLEVENT_WINDOW_MINIMIZE: - break; - case VCLEVENT_WINDOW_NORMALIZE: - break; - case VCLEVENT_WINDOW_KEYINPUT: - case VCLEVENT_WINDOW_KEYUP: - case VCLEVENT_WINDOW_COMMAND: - case VCLEVENT_WINDOW_MOUSEMOVE: - break; - - case VCLEVENT_MENU_HIGHLIGHT: - if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) - { - handle_menu_highlighted(pMenuEvent); - } - else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) + switch (pEvent->GetId()) { - uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); - if (xAccessible.is()) - atk_wrapper_focus_tracker_notify_when_idle(xAccessible); + case VCLEVENT_WINDOW_SHOW: + break; + case VCLEVENT_WINDOW_HIDE: + break; + case VCLEVENT_WINDOW_CLOSE: + break; + case VCLEVENT_WINDOW_GETFOCUS: + handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent)); + break; + case VCLEVENT_WINDOW_LOSEFOCUS: + break; + case VCLEVENT_WINDOW_MINIMIZE: + break; + case VCLEVENT_WINDOW_NORMALIZE: + break; + case VCLEVENT_WINDOW_KEYINPUT: + case VCLEVENT_WINDOW_KEYUP: + case VCLEVENT_WINDOW_COMMAND: + case VCLEVENT_WINDOW_MOUSEMOVE: + break; + + case VCLEVENT_MENU_HIGHLIGHT: + if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) + { + handle_menu_highlighted(pMenuEvent); + } + else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) + { + uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); + if (xAccessible.is()) + atk_wrapper_focus_tracker_notify_when_idle(xAccessible); + } + break; + + case VCLEVENT_TOOLBOX_HIGHLIGHT: + handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_TOOLBOX_BUTTONSTATECHANGED: + handle_toolbox_buttonchange(static_cast< ::VclWindowEvent const * >(pEvent)); + break; + + case VCLEVENT_OBJECT_DYING: + g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow() ); + // fallthrough intentional ! + case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: + handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_TABPAGE_ACTIVATE: + handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + case VCLEVENT_COMBOBOX_SETTEXT: + // This looks quite strange to me. Stumbled over this when fixing #i104290#. + // This kicked in when leaving the combobox in the toolbar, after that the events worked. + // I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore. + // Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general. + // create_wrapper_for_children(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); + break; + + default: + break; } - break; - - case VCLEVENT_TOOLBOX_HIGHLIGHT: - handle_toolbox_highlight(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_TOOLBOX_BUTTONSTATECHANGED: - handle_toolbox_buttonchange(static_cast< ::VclWindowEvent const * >(pEvent)); - break; - - case VCLEVENT_OBJECT_DYING: - g_aWindowList.erase( static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow() ); - // fallthrough intentional ! - case VCLEVENT_TOOLBOX_HIGHLIGHTOFF: - handle_toolbox_highlightoff(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_TABPAGE_ACTIVATE: - handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - case VCLEVENT_COMBOBOX_SETTEXT: - // This looks quite strange to me. Stumbled over this when fixing #i104290#. - // This kicked in when leaving the combobox in the toolbar, after that the events worked. - // I guess this was a try to work around missing combobox events, which didn't do the full job, and shouldn't be necessary anymore. - // Fix for #i104290# was done in toolkit/source/awt/vclxaccessiblecomponent, FOCUSED state for compound controls in general. - // create_wrapper_for_children(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); - break; - - default: - break; } - } catch(lang::IndexOutOfBoundsException) + catch (const lang::IndexOutOfBoundsException&) { g_warning("Focused object has invalid index in parent"); } -- cgit v1.2.3 From 7956c175a6324393e9dc861a8e21608cd7956594 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:07:43 +0100 Subject: catch by const reference --- svl/source/misc/strmadpt.cxx | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) 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&) + { + } + } } //============================================================================ -- cgit v1.2.3 From 86e420075cfc47c21a8c755e10507f018c3ce925 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:47:37 +0100 Subject: handle truncated stream --- toolkit/source/layout/core/root.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/source/layout/core/root.cxx b/toolkit/source/layout/core/root.cxx index 6a3ebe85e836..f83f42a94cec 100644 --- a/toolkit/source/layout/core/root.cxx +++ b/toolkit/source/layout/core/root.cxx @@ -71,7 +71,7 @@ LayoutRoot::~LayoutRoot() m_refCount++; // inhibit multiple destruction dispose(); } - catch( uno::Exception& ) + catch (const uno::Exception&) { } } @@ -186,7 +186,7 @@ void SAL_CALL LayoutRoot::initialize( const uno::Sequence< uno::Any >& aArgument { xParser->parseStream( source ); } - catch ( xml::sax::SAXParseException& e ) + catch (const xml::sax::SAXParseException& e) { OUString c(RTL_CONSTASCII_USTRINGPARAM(":")); error( aXMLName @@ -361,7 +361,7 @@ bool LayoutWidget::addChild( LayoutWidget *pChild ) { mxContainer->addChild( pChild->mxWidget ); } - catch( awt::MaxChildrenException ex ) + catch (const awt::MaxChildrenException&) { return false; } -- cgit v1.2.3 From dfcb6799d7ec99e8cdcab344ffd92dc8c13c17b0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:49:02 +0100 Subject: catch by const reference --- dtrans/source/generic/clipboardmanager.cxx | 3 +-- dtrans/source/test/test_dtrans.cxx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) 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/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." ); } -- cgit v1.2.3 From b98ab2bee1bbe223582a71dc6b2024a2ce40aeb0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 18 Jun 2011 00:55:38 +0100 Subject: catch by const reference --- unotools/source/config/fontcfg.cxx | 40 +++++++++--------- unotools/source/ucbhelper/ucblockbytes.cxx | 68 +++++++++++++++++------------- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 46d92d121a66..c97f6fd505a0 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -165,7 +165,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() } } } - catch( Exception& ) + catch (const Exception&) { // configuration is awry m_xConfigProvider.clear(); @@ -173,7 +173,7 @@ DefaultFontConfiguration::DefaultFontConfiguration() } } } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } #if OSL_DEBUG_LEVEL > 1 @@ -214,10 +214,10 @@ OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUStr it->second.xAccess = xNode; } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } } @@ -231,10 +231,10 @@ OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUStr aAny >>= aRet; } } - catch( NoSuchElementException& ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } } @@ -451,7 +451,7 @@ FontSubstConfiguration::FontSubstConfiguration() : } } } - catch( Exception& ) + catch (const Exception&) { // configuration is awry m_xConfigProvider.clear(); @@ -459,7 +459,7 @@ FontSubstConfiguration::FontSubstConfiguration() : } } } - catch( WrappedTargetException& ) + catch (const WrappedTargetException&) { } #if OSL_DEBUG_LEVEL > 1 @@ -994,10 +994,10 @@ void FontSubstConfiguration::fillSubstVector( const com::sun::star::uno::Referen } } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } } @@ -1025,10 +1025,10 @@ FontWeight FontSubstConfiguration::getSubstWeight( const com::sun::star::uno::Re #endif } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } return (FontWeight)( weight >= 0 ? pWeightNames[weight].nEnum : WEIGHT_DONTKNOW ); @@ -1057,10 +1057,10 @@ FontWidth FontSubstConfiguration::getSubstWidth( const com::sun::star::uno::Refe #endif } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } return (FontWidth)( width >= 0 ? pWidthNames[width].nEnum : WIDTH_DONTKNOW ); @@ -1092,10 +1092,10 @@ unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::R } } } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } @@ -1117,10 +1117,10 @@ void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale Any aAny = m_xConfigAccess->getByName( it->second.aConfigLocaleString ); aAny >>= xNode; } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } if( xNode.is() ) @@ -1147,10 +1147,10 @@ void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale Any aAny = xNode->getByName( pFontNames[i] ); aAny >>= xFont; } - catch( NoSuchElementException ) + catch (const NoSuchElementException&) { } - catch( WrappedTargetException ) + catch (const WrappedTargetException&) { } if( ! xFont.is() ) diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index c95608c3faaf..5393cb972813 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -696,7 +696,7 @@ Moderator::Result Moderator::getResult(const sal_uInt32 milliSec) // reset m_aResultType = NORESULT; } - catch(const salhelper::ConditionWaiter::timedout&) + catch (const salhelper::ConditionWaiter::timedout&) { ret.type = TIMEDOUT; } @@ -849,24 +849,24 @@ void SAL_CALL Moderator::run() aResult = m_aContent.executeCommand(m_aArg.Name,m_aArg.Argument); aResultType = RESULT; } - catch ( CommandAbortedException ) + catch (const CommandAbortedException&) { aResultType = COMMANDABORTED; } - catch ( CommandFailedException ) + catch (const CommandFailedException&) { aResultType = COMMANDFAILED; } - catch ( InteractiveIOException& r ) + catch (const InteractiveIOException& r) { nIOErrorCode = r.Code; aResultType = INTERACTIVEIO; } - catch ( UnsupportedDataSinkException& ) + catch (const UnsupportedDataSinkException ) { aResultType = UNSUPPORTED; } - catch ( Exception ) + catch (const Exception&) { aResultType = GENERAL; } @@ -950,10 +950,13 @@ static sal_Bool UCBOpenContentSync( bool bResultAchieved(false); Moderator* pMod = 0; - try { + try + { pMod = new Moderator(xContent,xInteract,xProgress,rArg); pMod->create(); - } catch(const ContentCreationException&) { + } + catch (const ContentCreationException&) + { bResultAchieved = bException = true; xLockBytes->SetError( ERRCODE_IO_GENERAL ); } @@ -1180,17 +1183,17 @@ static sal_Bool _UCBOpenContentSync( { aResult = aContent.executeCommand( rArg.Name, rArg.Argument ); } - catch ( CommandAbortedException ) + catch (const CommandAbortedException&) { bAborted = true; xLockBytes->SetError( ERRCODE_ABORT ); } - catch ( CommandFailedException ) + catch (const CommandFailedException&) { bAborted = true; xLockBytes->SetError( ERRCODE_ABORT ); } - catch ( InteractiveIOException& r ) + catch (const InteractiveIOException& r) { bException = true; if ( r.Code == IOErrorCode_ACCESS_DENIED || r.Code == IOErrorCode_LOCKING_VIOLATION ) @@ -1202,12 +1205,12 @@ static sal_Bool _UCBOpenContentSync( else xLockBytes->SetError( ERRCODE_IO_GENERAL ); } - catch ( UnsupportedDataSinkException& ) + catch (const UnsupportedDataSinkException&) { bException = true; xLockBytes->SetError( ERRCODE_IO_NOTSUPPORTED ); } - catch ( Exception ) + catch (const Exception&) { bException = true; xLockBytes->SetError( ERRCODE_IO_GENERAL ); @@ -1262,10 +1265,12 @@ UcbLockBytes::~UcbLockBytes() { m_xInputStream->closeInput(); } - catch ( RuntimeException const & ) - {} - catch ( IOException const & ) - {} + catch (const RuntimeException&) + { + } + catch (const IOException&) + { + } } } @@ -1275,10 +1280,12 @@ UcbLockBytes::~UcbLockBytes() { m_xOutputStream->closeOutput(); } - catch ( RuntimeException const & ) - {} - catch ( IOException const & ) - {} + catch (const RuntimeException&) + { + } + catch (const IOException&) + { + } } } @@ -1352,8 +1359,9 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference &rxInp bRet = m_xInputStream.is(); } - catch( Exception& ) - {} + catch (const Exception&) + { + } if ( m_bStreamValid && m_xInputStream.is() ) m_aInitialized.set(); @@ -1420,11 +1428,11 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, { xSeekable->seek( nPos ); } - catch ( IOException ) + catch (const IOException&) { return ERRCODE_IO_CANTSEEK; } - catch (com::sun::star::lang::IllegalArgumentException) + catch (const com::sun::star::lang::IllegalArgumentException&) { return ERRCODE_IO_CANTSEEK; } @@ -1444,7 +1452,7 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount, nSize = xStream->readBytes( aData, sal_Int32(nCount) ); } - catch (IOException) + catch (const IOException&) { return ERRCODE_IO_CANTREAD; } @@ -1474,7 +1482,7 @@ ErrCode UcbLockBytes::WriteAt ( sal_uLong nPos, const void *pBuffer, sal_uLong n { xSeekable->seek( nPos ); } - catch ( IOException ) + catch (const IOException&) { return ERRCODE_IO_CANTSEEK; } @@ -1487,7 +1495,7 @@ ErrCode UcbLockBytes::WriteAt ( sal_uLong nPos, const void *pBuffer, sal_uLong n if ( pWritten ) *pWritten = nCount; } - catch ( Exception ) + catch (const Exception&) { return ERRCODE_IO_CANTWRITE; } @@ -1506,7 +1514,7 @@ ErrCode UcbLockBytes::Flush() const { xOutputStream->flush(); } - catch( Exception ) + catch (const Exception&) { return ERRCODE_IO_CANTWRITE; } @@ -1577,7 +1585,7 @@ ErrCode UcbLockBytes::Stat( SvLockBytesStat *pStat, SvLockBytesStatFlag) const { pStat->nSize = sal_uLong(xSeekable->getLength()); } - catch (IOException) + catch (const IOException&) { return ERRCODE_IO_CANTTELL; } -- cgit v1.2.3 From c481fc6bb8ba7777e4890b9f76d68827f46beb77 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 20 Jun 2011 17:08:12 +0200 Subject: add missing newline to the end of file to silence the compiler --- svtools/inc/svtools/grfmgr.hxx | 2 +- svtools/source/filter/exportdialog.cxx | 2 +- svtools/source/filter/filter2.cxx | 2 +- svtools/source/graphic/grfmgr.cxx | 2 +- svtools/source/graphic/grfmgr2.cxx | 2 +- vcl/inc/vcl/gdimtf.hxx | 2 +- vcl/inc/vcl/graph.hxx | 2 +- vcl/inc/vcl/svgread.hxx | 2 +- vcl/source/gdi/metaact.cxx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index c99ea7a55bcd..e81458644d50 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -574,4 +574,4 @@ public: #endif // _GRFMGR_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 0a03904cf176..47a7a690153f 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -1512,4 +1512,4 @@ IMPL_LINK( ExportDialog, OK, void *, EMPTYARG ) return 0; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/filter/filter2.cxx b/svtools/source/filter/filter2.cxx index d34825312470..b973c9bdb3b0 100644 --- a/svtools/source/filter/filter2.cxx +++ b/svtools/source/filter/filter2.cxx @@ -1352,4 +1352,4 @@ String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat ) return String( aKeyName, RTL_TEXTENCODING_ASCII_US ); } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 19b09e8f67a7..fdfa92a72b00 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -1232,4 +1232,4 @@ GraphicObject GraphicObject::CreateGraphicObjectFromURL( const ::rtl::OUString & } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 1115635157a8..fbd00913607b 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -2384,4 +2384,4 @@ void GraphicObject::ImplTransformBitmap( BitmapEx& rBmpEx, } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx index 86f8dc5cbc77..e15a536ced0f 100644 --- a/vcl/inc/vcl/gdimtf.hxx +++ b/vcl/inc/vcl/gdimtf.hxx @@ -291,4 +291,4 @@ MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererSe #endif // _SV_GDIMTF_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx index 61da922acce6..d613c2d8432b 100644 --- a/vcl/inc/vcl/graph.hxx +++ b/vcl/inc/vcl/graph.hxx @@ -222,4 +222,4 @@ public: #endif // _SV_GRAPH_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/svgread.hxx b/vcl/inc/vcl/svgread.hxx index 4427198eeb5a..cf4f8008c7ef 100644 --- a/vcl/inc/vcl/svgread.hxx +++ b/vcl/inc/vcl/svgread.hxx @@ -80,4 +80,4 @@ namespace vcl #endif -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 2ffa3c68e4f7..32c4a589f54d 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -4409,4 +4409,4 @@ void MetaRenderGraphicAction::Read( SvStream& rIStm, ImplMetaReadData* ) rIStm >> maRenderGraphic >> maPoint >> maSize >> mfRotateAngle >> mfShearAngleX >> mfShearAngleY; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 6bc21bfd345c80a6b3a9cb8b966326e603a1bae1 Mon Sep 17 00:00:00 2001 From: Jesús Corrius Date: Mon, 20 Jun 2011 22:21:13 +0200 Subject: Avoid possible null pointer dereference --- vcl/win/source/window/salframe.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index ed428e473aae..9541593a5c51 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5239,7 +5239,11 @@ static void ImplHandleInputLangChange( HWND hWnd, WPARAM, LPARAM lParam ) // Feststellen, ob wir IME unterstuetzen WinSalFrame* pFrame = GetWindowPtr( hWnd ); - if ( pFrame && pFrame->mbIME && pFrame->mhDefIMEContext ) + + if ( !pFrame ) + return; + + if ( pFrame->mbIME && pFrame->mhDefIMEContext ) { HKL hKL = (HKL)lParam; UINT nImeProps = ImmGetProperty( hKL, IGP_PROPERTY ); -- cgit v1.2.3 From 14619535c984dd1ae6d6a2ed476f4eb43dca700a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 20 Jun 2011 22:40:52 +0300 Subject: This file is not used --- sax/util/makefile.mk | 67 ---------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 sax/util/makefile.mk diff --git a/sax/util/makefile.mk b/sax/util/makefile.mk deleted file mode 100644 index 8875e381e1b9..000000000000 --- a/sax/util/makefile.mk +++ /dev/null @@ -1,67 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=sax -TARGET=sax - -USE_DEFFILE=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# ------------------------------------------------------------------ - -LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1FILES=\ - $(SLB)$/saxtools.lib - -# sax - -SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -SHL1IMPLIB= i$(TARGET) -SHL1USE_EXPORTS=name - -SHL1LIBS= $(LIB1TARGET) -SHL1STDLIBS= \ - $(CPPULIB) \ - $(CPPUHELPERLIB)\ - $(COMPHELPERLIB)\ - $(RTLLIB) \ - $(SALLIB) \ - $(ONELIB) \ - $(SALHELPERLIB) - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) -DEFLIB1NAME=$(TARGET) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk -- cgit v1.2.3 From fc9e0ee821a57cb504659da300901dbe68447b8f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 20 Jun 2011 22:45:09 +0300 Subject: Don't use the i prefix for import libraries with WNTGCC --- sax/source/expatwrap/makefile.mk | 4 ++++ sax/source/fastparser/makefile.mk | 4 ++++ sax/source/tools/makefile.mk | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/sax/source/expatwrap/makefile.mk b/sax/source/expatwrap/makefile.mk index 6e1348c0d403..a0f177178004 100644 --- a/sax/source/expatwrap/makefile.mk +++ b/sax/source/expatwrap/makefile.mk @@ -54,7 +54,11 @@ SLOFILES =\ $(SLO)$/saxwriter.obj SHL1TARGET= $(TARGET) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET) +.ENDIF SHL1STDLIBS= \ $(SALLIB) \ diff --git a/sax/source/fastparser/makefile.mk b/sax/source/fastparser/makefile.mk index d8f9378c19b9..9690ffab326e 100644 --- a/sax/source/fastparser/makefile.mk +++ b/sax/source/fastparser/makefile.mk @@ -51,7 +51,11 @@ SLOFILES =\ $(SLO)$/xml2utf.obj SHL1TARGET= $(TARGET) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET) +.ENDIF SHL1STDLIBS= \ $(SALLIB) \ diff --git a/sax/source/tools/makefile.mk b/sax/source/tools/makefile.mk index 5923fc5a7785..abece06312ba 100644 --- a/sax/source/tools/makefile.mk +++ b/sax/source/tools/makefile.mk @@ -45,7 +45,11 @@ SLOFILES = \ $(SLO)$/fshelper.obj SHL1TARGET= $(TARGET)$(DLLPOSTFIX) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET)$(DLLPOSTFIX) +.ENDIF SHL1STDLIBS= \ $(CPPULIB) \ -- cgit v1.2.3 From ec5b3a6157997b3704792ab5854cde64e924f310 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 20 Jun 2011 22:49:40 +0300 Subject: Make the MinGW import library name match what libs.mk wants Use the i prefix only for import libraries built with MSC. Add COMID to the import library built with MinGW. This matches the shared library name on Unix, and MinGW is a Unix-style compiler. --- i18nutil/source/utility/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3 From a31a128023dbf29d3493417c06a9e3516067add9 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 02:24:39 +0300 Subject: Use MSVC-specific compiler options only when $(COM)==MSC --- i18npool/source/breakiterator/data/makefile.mk | 2 +- i18npool/source/collator/data/makefile.mk | 2 +- i18npool/source/indexentry/data/makefile.mk | 2 +- i18npool/source/textconversion/data/makefile.mk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/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/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/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 -- cgit v1.2.3 From 62467741ecf1360cfe89c656c9310feab530ae44 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 02:29:08 +0300 Subject: Use the import library name that i18npool expects with MinGW --- regexp/prj/d.lst | 1 + regexp/source/makefile.mk | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/regexp/prj/d.lst b/regexp/prj/d.lst index fadeaf70053d..0408e36f30c6 100644 --- a/regexp/prj/d.lst +++ b/regexp/prj/d.lst @@ -5,4 +5,5 @@ mkdir: %_DEST%\inc\external\regexp ..\%__SRC%\bin\i18nrege*.dll %_DEST%\bin\i18nrege*.dll ..\%__SRC%\lib\libi18nregexp*.so %_DEST%\lib\libi18nregexp*.so ..\%__SRC%\lib\libi18nregexp*.dylib %_DEST%\lib\libi18nregexp*.dylib +..\%__SRC%\lib\libi18nregexp*.dll.a %_DEST%\lib\libi18nregexp*.dll.a ..\%__SRC%\lib\ii18nregexp.lib %_DEST%\lib\ii18nregexp.lib diff --git a/regexp/source/makefile.mk b/regexp/source/makefile.mk index 7aa2a2eaa03b..b1ebf69224cf 100644 --- a/regexp/source/makefile.mk +++ b/regexp/source/makefile.mk @@ -44,7 +44,11 @@ SLOFILES= \ $(EXCEPTIONSFILES) SHL1TARGET= $(TARGET)$(COMID) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB = $(TARGET)$(COMID) +.ENDIF DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) -- cgit v1.2.3 From c8127045308fc81ea02e76f0268b3d64c10ecf51 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 02:47:53 +0300 Subject: Fix for cross-compiling with MinGW --- i18npool/source/localedata/data/makefile.mk | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/i18npool/source/localedata/data/makefile.mk b/i18npool/source/localedata/data/makefile.mk index 4668785231ea..c93a3f316165 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:// @@ -326,12 +326,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 \ -- cgit v1.2.3 From 74948277ffe67a5bd03822a8c04e69d5915816c1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 03:07:58 +0300 Subject: Mark l10ntools for DESKTOP builds only --- vcl/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 6db5d660f085..646a45563dde 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From e72b8881cdf3eeb6ecb4ea4864e07ba06a958078 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 03:19:23 +0300 Subject: Do depend on rsc always, we include rscsfx.hxx delivered from there --- svl/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 5fc7d0e223a3..2e01ff682242 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations DESKTOP:rsc offapi ucbhelper unotools cppu cppuhelper comphelper sal sot LIBXSLT:libxslt NULL +sl svl : TRANSLATIONS:translations 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 -- cgit v1.2.3 From 6c359e5757efb9eeefc42c73c0390fb7cc2c1bed Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Jun 2011 21:39:11 +0100 Subject: ByteString->rtl::OStringBuffer --- svtools/inc/svtools/imapcirc.hxx | 2 +- svtools/inc/svtools/imapobj.hxx | 10 +- svtools/source/misc/imap.cxx | 2 +- svtools/source/misc/imap2.cxx | 287 +++++++-------------------------------- 4 files changed, 56 insertions(+), 245 deletions(-) diff --git a/svtools/inc/svtools/imapcirc.hxx b/svtools/inc/svtools/imapcirc.hxx index 1ae929374b4f..ea2168597e15 100644 --- a/svtools/inc/svtools/imapcirc.hxx +++ b/svtools/inc/svtools/imapcirc.hxx @@ -43,7 +43,7 @@ class Fraction; class SVT_DLLPUBLIC IMapCircleObject : public IMapObject { Point aCenter; - sal_uLong nRadius; + sal_Int32 nRadius; void ImpConstruct( const Point& rCenter, sal_uLong nRad, sal_Bool bPixel ); diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx index fc907135fdaa..88362d118ff6 100644 --- a/svtools/inc/svtools/imapobj.hxx +++ b/svtools/inc/svtools/imapobj.hxx @@ -32,6 +32,7 @@ #include "svtools/svtdllapi.h" #include #include +#include class Point; class Rectangle; @@ -77,7 +78,6 @@ class SVT_DLLPUBLIC IMapObject sal_Bool bActive; protected: - sal_uInt16 nReadVersion; // Binaer-Im-/Export @@ -85,10 +85,10 @@ protected: virtual void ReadIMapObject( SvStream& rIStm ) = 0; // Hilfsmethoden - void AppendCERNCoords( const Point& rPoint100, ByteString& rStr ) const; - void AppendCERNURL( ByteString& rStr, const String& rBaseURL ) const; - void AppendNCSACoords( const Point& rPoint100, ByteString& rStr ) const; - void AppendNCSAURL( ByteString& rStr, const String& rBaseURL ) const; + void AppendCERNCoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const; + void AppendCERNURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const; + void AppendNCSACoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const; + void AppendNCSAURL(rtl::OStringBuffer&rBuf, const String& rBaseURL) const; public: diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index d4ee29924801..9cfa72b76ade 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -433,7 +433,7 @@ sal_Bool IMapCircleObject::IsHit( const Point& rPoint ) const const Point aPoint( aCenter - rPoint ); sal_Bool bRet = sal_False; - if ( (sal_uLong) sqrt( (double) aPoint.X() * aPoint.X() + + if ( (sal_Int32) sqrt( (double) aPoint.X() * aPoint.X() + aPoint.Y() * aPoint.Y() ) <= nRadius ) { bRet = sal_True; diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 20e8ae6431b8..b9231a50c2d3 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -48,209 +48,111 @@ #define NOTEOL(c) ((c)!='\0') - TYPEINIT0_AUTOFACTORY( ImageMap ); - -/******************************************************************************/ -/******************************************************************************/ - - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - -void IMapObject::AppendCERNCoords( const Point& rPoint100, ByteString& rStr ) const +void IMapObject::AppendCERNCoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const { const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) ); - rStr += '('; - rStr += ByteString::CreateFromInt32( aPixPt.X() ); - rStr += ','; - rStr += ByteString::CreateFromInt32( aPixPt.Y() ); - rStr += ") "; + rBuf.append('('); + rBuf.append(static_cast(aPixPt.X())); + rBuf.append(','); + rBuf.append(static_cast(aPixPt.Y())); + rBuf.append(RTL_CONSTASCII_STRINGPARAM(") ")); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - -void IMapObject::AppendNCSACoords( const Point& rPoint100, ByteString& rStr ) const +void IMapObject::AppendNCSACoords(rtl::OStringBuffer& rBuf, const Point& rPoint100) const { const Point aPixPt( Application::GetDefaultDevice()->LogicToPixel( rPoint100, MapMode( MAP_100TH_MM ) ) ); - rStr += ByteString::CreateFromInt32( aPixPt.X() ); - rStr += ','; - rStr += ByteString::CreateFromInt32( aPixPt.Y() ); - rStr += ' '; + rBuf.append(static_cast(aPixPt.X())); + rBuf.append(','); + rBuf.append(static_cast(aPixPt.Y())); + rBuf.append(' '); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - -void IMapObject::AppendCERNURL( ByteString& rStr, const String& rBaseURL ) const +void IMapObject::AppendCERNURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const { - rStr += ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), gsl_getSystemTextEncoding() ); + rBuf.append(rtl::OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), gsl_getSystemTextEncoding())); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - -void IMapObject::AppendNCSAURL( ByteString& rStr, const String& rBaseURL ) const +void IMapObject::AppendNCSAURL(rtl::OStringBuffer& rBuf, const String& rBaseURL) const { - rStr += ByteString( String(URIHelper::simpleNormalizedMakeRelative( rBaseURL, aURL )), gsl_getSystemTextEncoding() ); - rStr += ' '; + rBuf.append(rtl::OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), gsl_getSystemTextEncoding())); + rBuf.append(' '); } - -/******************************************************************************/ -/******************************************************************************/ - - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapRectangleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "rectangle " ); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rectangle ")); - AppendCERNCoords( aRect.TopLeft(), aStr ); - AppendCERNCoords( aRect.BottomRight(), aStr ); - AppendCERNURL( aStr, rBaseURL ); + AppendCERNCoords(aStrBuf, aRect.TopLeft()); + AppendCERNCoords(aStrBuf, aRect.BottomRight()); + AppendCERNURL(aStrBuf, rBaseURL); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapRectangleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "rect " ); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rect ")); - AppendNCSAURL( aStr, rBaseURL ); - AppendNCSACoords( aRect.TopLeft(), aStr ); - AppendNCSACoords( aRect.BottomRight(), aStr ); + AppendNCSAURL(aStrBuf, rBaseURL); + AppendNCSACoords(aStrBuf, aRect.TopLeft()); + AppendNCSACoords(aStrBuf, aRect.BottomRight()); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/******************************************************************************/ -/******************************************************************************/ - - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapCircleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "circle " ); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle ")); - AppendCERNCoords( aCenter, aStr ); - aStr += ByteString::CreateFromInt32(nRadius); - aStr += ' '; - AppendCERNURL( aStr, rBaseURL ); + AppendCERNCoords(aStrBuf, aCenter); + aStrBuf.append(nRadius); + aStrBuf.append(' '); + AppendCERNURL(aStrBuf, rBaseURL); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "circle " ); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle ")); - AppendNCSAURL( aStr, rBaseURL ); - AppendNCSACoords( aCenter, aStr ); - AppendNCSACoords( aCenter + Point( nRadius, 0 ), aStr ); + AppendNCSAURL(aStrBuf, rBaseURL); + AppendNCSACoords(aStrBuf, aCenter); + AppendNCSACoords(aStrBuf, aCenter + Point(nRadius, 0)); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/******************************************************************************/ -/******************************************************************************/ - - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "polygon " ); - const sal_uInt16 nCount = aPoly.GetSize(); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("polygon ")); + const sal_uInt16 nCount = aPoly.GetSize(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) - AppendCERNCoords( aPoly[ i ], aStr ); + for (sal_uInt16 i = 0; i < nCount; ++i) + AppendCERNCoords(aStrBuf, aPoly[i]); - AppendCERNURL( aStr, rBaseURL ); + AppendCERNURL(aStrBuf, rBaseURL); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { - ByteString aStr( "poly " ); - const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 ); + rtl::OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("poly ")); + const sal_uInt16 nCount = Min( aPoly.GetSize(), (sal_uInt16) 100 ); - AppendNCSAURL( aStr, rBaseURL ); + AppendNCSAURL(aStrBuf, rBaseURL); - for ( sal_uInt16 i = 0; i < nCount; i++ ) - AppendNCSACoords( aPoly[ i ], aStr ); + for (sal_uInt16 i = 0; i < nCount; ++i) + AppendNCSACoords(aStrBuf, aPoly[i]); - rOStm.WriteLine( aStr ); + rOStm.WriteLine(aStrBuf.makeStringAndClear()); } - -/******************************************************************************/ -/******************************************************************************/ - - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const { switch( nFormat ) @@ -264,13 +166,6 @@ void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL } } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; @@ -300,13 +195,6 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const } } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; @@ -336,13 +224,6 @@ void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const } } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL ) { sal_uLong nRet = IMAP_ERR_FORMAT; @@ -366,13 +247,6 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBas return nRet; } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -386,13 +260,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL ) return IMAP_ERR_OK; } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL ) { ByteString aStr( rLine ); @@ -451,13 +318,6 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL } } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - Point ImageMap::ImpReadCERNCoords( const char** ppStr ) { String aStrX; @@ -498,13 +358,6 @@ Point ImageMap::ImpReadCERNCoords( const char** ppStr ) return aPt; } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - long ImageMap::ImpReadCERNRadius( const char** ppStr ) { String aStr; @@ -525,13 +378,6 @@ long ImageMap::ImpReadCERNRadius( const char** ppStr ) return aStr.ToInt32(); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL ) { String aStr( String::CreateFromAscii( *ppStr ) ); @@ -544,13 +390,6 @@ String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL ) return INetURLObject::GetAbsURL( rBaseURL, aStr ); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) { ByteString aStr; @@ -564,13 +403,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL ) return IMAP_ERR_OK; } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL ) { ByteString aStr( rLine ); @@ -629,13 +461,6 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL } } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - String ImageMap::ImpReadNCSAURL( const char** ppStr, const String& rBaseURL ) { String aStr; @@ -656,13 +481,6 @@ String ImageMap::ImpReadNCSAURL( const char** ppStr, const String& rBaseURL ) return INetURLObject::GetAbsURL( rBaseURL, aStr ); } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - Point ImageMap::ImpReadNCSACoords( const char** ppStr ) { String aStrX; @@ -699,13 +517,6 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr ) return aPt; } - -/****************************************************************************** -|* -|* -|* -\******************************************************************************/ - sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm ) { sal_uLong nPos = rIStm.Tell(); -- cgit v1.2.3 From 3b2dca63e71457e38b8ec65cb207f3d845f2c887 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Jun 2011 22:46:12 +0100 Subject: convert string --- toolkit/source/awt/vclxwindows.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 1c6d5418dd38..f95ceb65f3ac 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -6470,7 +6470,7 @@ void VCLXPatternField::getMasks( ::rtl::OUString& EditMask, ::rtl::OUString& Lit PatternField* pPatternField = (PatternField*) GetWindow(); if ( pPatternField ) { - EditMask = String( pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US ); + EditMask = rtl::OStringToOUString(pPatternField->GetEditMask(), RTL_TEXTENCODING_ASCII_US); LiteralMask = pPatternField->GetLiteralMask(); } } -- cgit v1.2.3 From ce404da339abcf0e8495ccad2e4a235e10a68454 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 20 Jun 2011 23:06:57 +0100 Subject: convert string --- vcl/inc/vcl/field.hxx | 10 ++-- vcl/source/control/field2.cxx | 107 ++++++++++++++++++++++-------------------- 2 files changed, 60 insertions(+), 57 deletions(-) diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index fd0ce90cb0d7..9271df88ba86 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -111,7 +111,7 @@ public: class VCL_DLLPUBLIC PatternFormatter : public FormatterBase { private: - ByteString maEditMask; + rtl::OString m_aEditMask; XubString maFieldString; XubString maLiteralMask; sal_uInt16 mnFormatFlags; @@ -122,7 +122,8 @@ protected: PatternFormatter(); SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId ); - SAL_DLLPRIVATE void ImplSetMask( const ByteString& rEditMask, const XubString& rLiteralMask ); + SAL_DLLPRIVATE void ImplSetMask(const rtl::OString& rEditMask, + const XubString& rLiteralMask); SAL_DLLPRIVATE sal_Bool ImplIsSameMask() const { return mbSameMask; } SAL_DLLPRIVATE sal_Bool& ImplGetInPattKeyInput() { return mbInPattKeyInput; } @@ -131,9 +132,8 @@ public: virtual void Reformat(); - void SetMask( const ByteString& rEditMask, - const XubString& rLiteralMask ); - const ByteString& GetEditMask() const { return maEditMask; } + void SetMask(const rtl::OString& rEditMask, const XubString& rLiteralMask ); + const rtl::OString& GetEditMask() const { return m_aEditMask; } const XubString& GetLiteralMask() const { return maLiteralMask; } void SetFormatFlags( sal_uInt16 nFlags ) { mnFormatFlags = nFlags; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 69a3fdbdce9d..74241bef0f1b 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -241,11 +241,11 @@ static int ImplKommaPointCharEqual( xub_Unicode c1, xub_Unicode c2 ) // ----------------------------------------------------------------------- static XubString ImplPatternReformat( const XubString& rStr, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_uInt16 nFormatFlags ) { - if ( !rEditMask.Len() ) + if (rEditMask.isEmpty()) return rStr; XubString aStr = rStr; @@ -258,14 +258,14 @@ static XubString ImplPatternReformat( const XubString& rStr, xub_StrLen i = 0; xub_StrLen n; - while ( i < rEditMask.Len() ) + while ( i < rEditMask.getLength() ) { if ( nStrIndex >= aStr.Len() ) break; cChar = aStr.GetChar(nStrIndex); cLiteral = rLiteralMask.GetChar(i); - cMask = rEditMask.GetChar(i); + cMask = rEditMask[i]; // Aktuelle Position ein Literal if ( cMask == EDITMASK_LITERAL ) @@ -281,11 +281,11 @@ static XubString ImplPatternReformat( const XubString& rStr, // Dies ist dann der Fall, wenn es nicht in das Muster // des naechsten nicht Literal-Zeichens passt n = i+1; - while ( n < rEditMask.Len() ) + while ( n < rEditMask.getLength() ) { - if ( rEditMask.GetChar(n) != EDITMASK_LITERAL ) + if ( rEditMask[n] != EDITMASK_LITERAL ) { - if ( !ImplIsPatternChar( cChar, rEditMask.GetChar(n) ) ) + if ( !ImplIsPatternChar( cChar, rEditMask[n] ) ) nStrIndex++; break; } @@ -318,9 +318,9 @@ static XubString ImplPatternReformat( const XubString& rStr, if ( nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS ) { n = i; - while ( n < rEditMask.Len() ) + while ( n < rEditMask.getLength() ) { - if ( rEditMask.GetChar( n ) == EDITMASK_LITERAL ) + if ( rEditMask[n] == EDITMASK_LITERAL ) { if ( ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar( n ) ) ) i = n+1; @@ -346,7 +346,7 @@ static XubString ImplPatternReformat( const XubString& rStr, // ----------------------------------------------------------------------- -static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask, +static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask, sal_uInt16 nCursorPos, sal_uInt16& rPos ) { @@ -360,7 +360,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask { while ( nMaxPos ) { - if ( (rEditMask.GetChar(nMaxPos-1) != EDITMASK_LITERAL) && + if ( (rEditMask[nMaxPos-1] != EDITMASK_LITERAL) && (rStr.GetChar(nMaxPos-1) != ' ') ) break; nMaxPos--; @@ -369,9 +369,9 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask // Wenn wir vor einem Literal stehen, dann solange weitersuchen, // bis erste Stelle nach Literal xub_StrLen nTempPos = nMaxPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos] != EDITMASK_LITERAL ) { nMaxPos = nTempPos; break; @@ -390,7 +390,7 @@ static void ImplPatternMaxPos( const XubString rStr, const ByteString& rEditMask // ----------------------------------------------------------------------- static void ImplPatternProcessStrictModify( Edit* pEdit, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask ) { @@ -403,14 +403,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, xub_StrLen nMaxLen = aText.Len(); while ( i < nMaxLen ) { - if ( (rEditMask.GetChar( i ) != EDITMASK_LITERAL) && + if ( (rEditMask[i] != EDITMASK_LITERAL) && (aText.GetChar( i ) != ' ') ) break; i++; } // Alle Literalzeichen beibehalten - while ( i && (rEditMask.GetChar( i ) == EDITMASK_LITERAL) ) + while ( i && (rEditMask[i] == EDITMASK_LITERAL) ) i--; aText.Erase( 0, i ); } @@ -442,14 +442,14 @@ static void ImplPatternProcessStrictModify( Edit* pEdit, // ----------------------------------------------------------------------- -static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nCursorPos ) +static xub_StrLen ImplPatternLeftPos(const rtl::OString& rEditMask, xub_StrLen nCursorPos) { // Vorheriges Zeichen suchen, was kein Literal ist xub_StrLen nNewPos = nCursorPos; xub_StrLen nTempPos = nNewPos; while ( nTempPos ) { - if ( rEditMask.GetChar(nTempPos-1) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos-1] != EDITMASK_LITERAL ) { nNewPos = nTempPos-1; break; @@ -461,16 +461,16 @@ static xub_StrLen ImplPatternLeftPos( const ByteString& rEditMask, xub_StrLen nC // ----------------------------------------------------------------------- -static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& rEditMask, +static xub_StrLen ImplPatternRightPos( const XubString& rStr, const rtl::OString& rEditMask, sal_uInt16 nFormatFlags, sal_Bool bSameMask, xub_StrLen nCursorPos ) { // Naechstes Zeichen suchen, was kein Literal ist xub_StrLen nNewPos = nCursorPos; xub_StrLen nTempPos = nNewPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) + if ( rEditMask[nTempPos+1] != EDITMASK_LITERAL ) { nNewPos = nTempPos+1; break; @@ -484,14 +484,14 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const ByteString& // ----------------------------------------------------------------------- static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, - const ByteString& rEditMask, + const rtl::OString& rEditMask, const XubString& rLiteralMask, sal_Bool bStrictFormat, sal_uInt16 nFormatFlags, sal_Bool bSameMask, sal_Bool& rbInKeyInput ) { - if ( !rEditMask.Len() || !bStrictFormat ) + if ( rEditMask.isEmpty() || !bStrictFormat ) return sal_False; Selection aOldSel = pEdit->GetSelection(); @@ -533,8 +533,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, { // Home ist Position des ersten nicht literalen Zeichens nNewPos = 0; - while ( (nNewPos < rEditMask.Len()) && - (rEditMask.GetChar(nNewPos) == EDITMASK_LITERAL) ) + while ( (nNewPos < rEditMask.getLength()) && + (rEditMask[nNewPos] == EDITMASK_LITERAL) ) nNewPos++; // Home sollte nicht nach rechts wandern if ( nCursorPos < nNewPos ) @@ -548,9 +548,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, else if ( nKeyCode == KEY_END ) { // End ist die Position des letzten nicht literalen Zeichens - nNewPos = rEditMask.Len(); + nNewPos = rEditMask.getLength(); while ( nNewPos && - (rEditMask.GetChar(nNewPos-1) == EDITMASK_LITERAL) ) + (rEditMask[nNewPos-1] == EDITMASK_LITERAL) ) nNewPos--; // Hier nehmen wir Selectionsanfang als minimum, da falls durch // Focus alles selektiert ist, ist eine kleine Position schon @@ -601,7 +601,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, { if ( bSameMask ) { - if ( rEditMask.GetChar( nNewPos ) != EDITMASK_LITERAL ) + if ( rEditMask[nNewPos] != EDITMASK_LITERAL ) aStr.Erase( nNewPos, 1 ); } else @@ -647,9 +647,9 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, aSel.Justify(); nNewPos = (xub_StrLen)aSel.Min(); - if ( nNewPos < rEditMask.Len() ) + if ( nNewPos < rEditMask.getLength() ) { - xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask.GetChar(nNewPos) ); + xub_Unicode cPattChar = ImplPatternChar( cChar, rEditMask[nNewPos] ); if ( cPattChar ) cChar = cPattChar; else @@ -661,17 +661,17 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // nicht dazu fuehren, das der Anwender dann da steht, wo // er nicht stehen wollte. if ( nNewPos && - (rEditMask.GetChar(nNewPos-1) != EDITMASK_LITERAL) && + (rEditMask[nNewPos-1] != EDITMASK_LITERAL) && !aSel.Len() ) { // Naechstes Zeichen suchen, was kein Literal ist nTempPos = nNewPos; - while ( nTempPos < rEditMask.Len() ) + while ( nTempPos < rEditMask.getLength() ) { - if ( rEditMask.GetChar(nTempPos) == EDITMASK_LITERAL ) + if ( rEditMask[nTempPos] == EDITMASK_LITERAL ) { // Gilt nur, wenn ein Literalzeichen vorhanden - if ( (rEditMask.GetChar(nTempPos+1) != EDITMASK_LITERAL ) && + if ( (rEditMask[nTempPos+1] != EDITMASK_LITERAL ) && ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar(nTempPos) ) ) { nTempPos++; @@ -705,7 +705,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, while ( n && (n > nNewPos) ) { if ( (aStr.GetChar( n-1 ) != ' ') && - ((n > rEditMask.Len()) || (rEditMask.GetChar(n-1) != EDITMASK_LITERAL)) ) + ((n > rEditMask.getLength()) || (rEditMask[n-1] != EDITMASK_LITERAL)) ) break; n--; @@ -715,14 +715,14 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, if ( aSel.Len() ) aStr.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() ); - if ( aStr.Len() < rEditMask.Len() ) + if ( aStr.Len() < rEditMask.getLength() ) { // String evtl. noch bis Cursor-Position erweitern if ( aStr.Len() < nNewPos ) aStr += rLiteralMask.Copy( aStr.Len(), nNewPos-aStr.Len() ); if ( nNewPos < aStr.Len() ) aStr.Insert( cChar, nNewPos ); - else if ( nNewPos < rEditMask.Len() ) + else if ( nNewPos < rEditMask.getLength() ) aStr += cChar; aStr = ImplPatternReformat( aStr, rEditMask, rLiteralMask, nFormatFlags ); } @@ -740,7 +740,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, if ( nNewPos < aStr.Len() ) aStr.SetChar( nNewPos, cChar ); - else if ( nNewPos < rEditMask.Len() ) + else if ( nNewPos < rEditMask.getLength() ) aStr += cChar; } @@ -764,19 +764,19 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt, // ----------------------------------------------------------------------- -void PatternFormatter::ImplSetMask( const ByteString& rEditMask, - const XubString& rLiteralMask ) +void PatternFormatter::ImplSetMask(const rtl::OString& rEditMask, + const XubString& rLiteralMask) { - maEditMask = rEditMask; + m_aEditMask = rEditMask; maLiteralMask = rLiteralMask; mbSameMask = sal_True; - if ( maEditMask.Len() != maLiteralMask.Len() ) + if ( m_aEditMask.getLength() != maLiteralMask.Len() ) { - if ( maEditMask.Len() < maLiteralMask.Len() ) - maLiteralMask.Erase( maEditMask.Len() ); + if ( m_aEditMask.getLength() < maLiteralMask.Len() ) + maLiteralMask.Erase(m_aEditMask.getLength()); else - maLiteralMask.Expand( maEditMask.Len(), ' ' ); + maLiteralMask.Expand(m_aEditMask.getLength(), ' '); } // StrictModus erlaubt nur Input-Mode, wenn als Maske nur @@ -785,9 +785,9 @@ void PatternFormatter::ImplSetMask( const ByteString& rEditMask, // nicht zugelassen sind xub_StrLen i = 0; sal_Char c = 0; - while ( i < rEditMask.Len() ) + while ( i < rEditMask.getLength() ) { - sal_Char cTemp = rEditMask.GetChar( i ); + sal_Char cTemp = rEditMask[i]; if ( cTemp != EDITMASK_LITERAL ) { if ( (cTemp == EDITMASK_ALLCHAR) || @@ -830,7 +830,7 @@ PatternFormatter::PatternFormatter() void PatternFormatter::ImplLoadRes( const ResId& rResId ) { - ByteString aEditMask; + rtl::OString aEditMask; XubString aLiteralMask; ResMgr* pMgr = rResId.GetResMgr(); if( pMgr ) @@ -841,7 +841,10 @@ void PatternFormatter::ImplLoadRes( const ResId& rResId ) SetStrictFormat( (sal_Bool)pMgr->ReadShort() ); if ( PATTERNFORMATTER_EDITMASK & nMask ) - aEditMask = ByteString( pMgr->ReadString(), RTL_TEXTENCODING_ASCII_US ); + { + aEditMask = rtl::OUStringToOString(pMgr->ReadString(), + RTL_TEXTENCODING_ASCII_US); + } if ( PATTERNFORMATTER_LITTERALMASK & nMask ) aLiteralMask = pMgr->ReadString(); @@ -859,7 +862,7 @@ PatternFormatter::~PatternFormatter() // ----------------------------------------------------------------------- -void PatternFormatter::SetMask( const ByteString& rEditMask, +void PatternFormatter::SetMask( const rtl::OString& rEditMask, const XubString& rLiteralMask ) { ImplSetMask( rEditMask, rLiteralMask ); @@ -885,7 +888,7 @@ XubString PatternFormatter::GetString() const if ( !GetField() ) return ImplGetSVEmptyStr(); else - return ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ); + return ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ); } // ----------------------------------------------------------------------- @@ -894,7 +897,7 @@ void PatternFormatter::Reformat() { if ( GetField() ) { - ImplSetText( ImplPatternReformat( GetField()->GetText(), maEditMask, maLiteralMask, mnFormatFlags ) ); + ImplSetText( ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, mnFormatFlags ) ); if ( !mbSameMask && IsStrictFormat() && !GetField()->IsReadOnly() ) GetField()->SetInsertMode( sal_False ); } -- cgit v1.2.3 From 5b3e2b65345d24961c285b4651730f22f3bf2a0b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 12:34:30 +0300 Subject: Don't use backslashes in #include, eek --- tools/source/fsys/wntmsc.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/source/fsys/wntmsc.hxx b/tools/source/fsys/wntmsc.hxx index ba88e4eaf020..43b700fe17be 100644 --- a/tools/source/fsys/wntmsc.hxx +++ b/tools/source/fsys/wntmsc.hxx @@ -34,8 +34,8 @@ #ifndef ICC #include #endif -#include -#include +#include +#include #include #include -- cgit v1.2.3 From 6423a66abff68d421fc356d5df9e3193da59014d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 12:37:25 +0300 Subject: Use "Unix-style" (import) library names for MinGW, to match libs.mk --- i18npool/source/isolang/makefile.mk | 4 ++++ i18npool/source/paper/makefile.mk | 4 ++++ 2 files changed, 8 insertions(+) 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/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 -- cgit v1.2.3 From 1b74a59a35ca36d6eb52a0a043f385c5f67e8c39 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 10:47:07 +0100 Subject: WaE: short-reads/writes --- vcl/unx/generic/gdi/salprnpsp.cxx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/vcl/unx/generic/gdi/salprnpsp.cxx b/vcl/unx/generic/gdi/salprnpsp.cxx index 009621a9e22e..dbee65c589dc 100644 --- a/vcl/unx/generic/gdi/salprnpsp.cxx +++ b/vcl/unx/generic/gdi/salprnpsp.cxx @@ -271,11 +271,16 @@ static bool passFileToCommandLine( const String& rFilename, const String& rComma close( fd[0] ); char aBuffer[ 2048 ]; FILE* fp = fopen( aFilename.GetBuffer(), "r" ); - while( fp && ! feof( fp ) ) + while (fp && !feof(fp)) { - int nBytes = fread( aBuffer, 1, sizeof( aBuffer ), fp ); - if( nBytes ) - write( fd[ 1 ], aBuffer, nBytes ); + size_t nBytesRead = fread(aBuffer, 1, sizeof( aBuffer ), fp); + if (nBytesRead ) + { + size_t nBytesWritten = write(fd[1], aBuffer, nBytesRead); + OSL_ENSURE(nBytesWritten == nBytesRead, "short write"); + if (nBytesWritten != nBytesRead) + break; + } } fclose( fp ); close( fd[ 1 ] ); @@ -1342,7 +1347,12 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo { osl_readFile( pFile, &buffer[0], buffer.size(), &nBytesRead ); if( nBytesRead > 0 ) - fwrite( &buffer[0], 1, nBytesRead, fp ); + { + size_t nBytesWritten = fwrite(&buffer[0], 1, nBytesRead, fp); + OSL_ENSURE(nBytesRead == nBytesWritten, "short write"); + if (nBytesRead != nBytesWritten) + break; + } } while( nBytesRead == buffer.size() ); rtl::OUStringBuffer aBuf( i_rJobName.Len() + 8 ); aBuf.append( i_rJobName ); -- cgit v1.2.3 From 2062cdd6ca671fb6a1b0d3bfb4146de02bfb15d2 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 23:40:13 +0300 Subject: Add (dummy) svsys.h file for Android --- vcl/inc/android/svsys.h | 36 ++++++++++++++++++++++++++++++++++++ vcl/inc/ios/svsys.h | 8 ++++---- vcl/inc/svsys.h | 2 ++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 vcl/inc/android/svsys.h diff --git a/vcl/inc/android/svsys.h b/vcl/inc/android/svsys.h new file mode 100644 index 000000000000..9dabc7187400 --- /dev/null +++ b/vcl/inc/android/svsys.h @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 Tor Lillqvist + * 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 _VCL_ANDROID_SVSYS_H +#define _VCL_ANDROID_SVSYS_H + + +// ? + +#endif // _VCL_ANDROID_SVSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/svsys.h b/vcl/inc/ios/svsys.h index 0d01631c09f0..a8edcab96eef 100644 --- a/vcl/inc/ios/svsys.h +++ b/vcl/inc/ios/svsys.h @@ -13,7 +13,7 @@ * License. * * The Initial Developer of the Original Code is Tor Lillqvist - * Portions created by the Initial Developer are Copyright (C) 2010 the + * Portions created by the Initial Developer are Copyright (C) 2011 the * Initial Developer. All Rights Reserved. * * For minor contributions see the git repository. @@ -25,12 +25,12 @@ * instead of those above. */ -#ifndef _SV_SVSYS_H -#define _SV_SVSYS_H +#ifndef _VCL_IOS_SVSYS_H +#define _VCL_IOS_SVSYS_H // ? -#endif // _SV_SVSYS_H +#endif // _VCL_IOS_SVSYS_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index fb9a9215be7a..ce65f4ab95fb 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -36,6 +36,8 @@ #include "os2/svsys.h" #elif defined IOS #include "ios/svsys.h" +#elif defined ANDROID +#include "android/svsys.h" #else #include "unx/svsys.h" #endif -- cgit v1.2.3 From 1ad1d7c114931b3daf870fd8935463b92510787d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 21 Jun 2011 13:46:49 +0300 Subject: Drop unnecessary UNX vs. Windows ifdef The UNX code compiles fine both with MSVC and MinGW. In fact, the non-UNX code did not compile with a modern MinGW. --- rsc/source/prj/start.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx index 8a949546ce3a..cee2ae0612be 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -162,11 +162,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 if ( fRspFile ) #if OSL_DEBUG_LEVEL > 5 @@ -260,11 +256,7 @@ static sal_Bool CallRsc2( ByteString aRsc2Name, 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 if( fRspFile ) #if OSL_DEBUG_LEVEL > 5 -- cgit v1.2.3 From b1d08330f488ce079669d7f7255772469499ed8f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 22 Jun 2011 09:08:02 +0300 Subject: Fix MinGW compilation --- dtrans/source/win32/misc/ImplHelper.cxx | 1 + dtrans/source/win32/mtaole/MtaOleClipb.cxx | 2 +- l10ntools/source/help/HelpCompiler.hxx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx index c0db923d55d4..d2a79e3d0af8 100644 --- a/dtrans/source/win32/misc/ImplHelper.cxx +++ b/dtrans/source/win32/misc/ImplHelper.cxx @@ -47,6 +47,7 @@ #pragma warning(pop) #endif #ifdef __MINGW32__ +#include #include #endif 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 -#include "..\..\inc\MtaOleClipb.hxx" +#include "../../inc/MtaOleClipb.hxx" #include #include diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx index d40c72547203..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(); } -- cgit v1.2.3 From 93d8410023f659c324d1249f6500134b51edf242 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 22 Jun 2011 10:06:34 +0200 Subject: use the new way of specifying UNO API includes --- vcl/Library_vclplug_gtk3.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcl/Library_vclplug_gtk3.mk b/vcl/Library_vclplug_gtk3.mk index 83fb8306468d..587d69376500 100644 --- a/vcl/Library_vclplug_gtk3.mk +++ b/vcl/Library_vclplug_gtk3.mk @@ -32,7 +32,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk3,\ -I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ - -I$(OUTDIR)/inc/offuh \ -I$(OUTDIR)/inc \ )) @@ -47,6 +46,11 @@ $(eval $(call gb_Library_set_defs,vclplug_gtk3,\ -DVERSION=\"$(UPD)$(LAST_MINOR)\" \ )) +$(eval $(call gb_Library_add_api,vclplug_gtk3,\ + offapi \ + udkapi \ +)) + ifneq ($(ENABLE_DBUS),) $(eval $(call gb_Library_set_include,vclplug_gtk3,\ $$(INCLUDE) \ -- cgit v1.2.3 From e370ee9a887417c93b455562cf60fc375d9725ea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:04:05 +0100 Subject: ditch some old-style strings --- tools/bootstrp/prj.cxx | 16 ++++++++-------- tools/bootstrp/rscdep.cxx | 6 +++--- tools/inc/bootstrp/prj.hxx | 5 +++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx index 00be3bedddee..b44592c562ec 100644 --- a/tools/bootstrp/prj.cxx +++ b/tools/bootstrp/prj.cxx @@ -53,26 +53,26 @@ SimpleConfig::~SimpleConfig() aFileStream.Close (); } -ByteString SimpleConfig::GetNext() +rtl::OString SimpleConfig::getNext() { - if ( aStringBuffer =="" ) + if (aStringBuffer == "") while ((aStringBuffer = GetNextLine()) == "\t") ; //solange bis != "\t" - if ( aStringBuffer =="" ) - return ByteString(); + if ( aStringBuffer == "" ) + return rtl::OString(); - ByteString aString = aStringBuffer.GetToken(0,'\t'); - aStringBuffer.Erase(0, aString.Len()+1); + rtl::OString aString = aStringBuffer.GetToken(0,'\t'); + aStringBuffer.Erase(0, aString.getLength()+1); aStringBuffer.EraseLeadingChars( '\t' ); return aString; } -ByteString SimpleConfig::GetNextLine() +rtl::OString SimpleConfig::GetNextLine() { aFileStream.ReadLine ( aTmpStr ); if ( aTmpStr.Search( "#" ) == 0 ) - return "\t"; + return rtl::OString('\t'); aTmpStr = aTmpStr.EraseLeadingChars(); aTmpStr = aTmpStr.EraseTrailingChars(); while ( aTmpStr.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND ) ; diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx index 1ebd9e85ac9a..d1e26f21d27a 100644 --- a/tools/bootstrp/rscdep.cxx +++ b/tools/bootstrp/rscdep.cxx @@ -125,13 +125,13 @@ int main( int argc, char** argv ) } if (aBuf[0] == '@' ) { - ByteString aToken; + rtl::OString aToken; String aRespName( &aBuf[1], gsl_getSystemTextEncoding()); SimpleConfig aConfig( aRespName ); - while ( (aToken = aConfig.GetNext()) != "") + while ((aToken = aConfig.getNext()).getLength()) { char aBuf2[255]; - (void) strcpy( aBuf2, aToken.GetBuffer()); + strcpy( aBuf2, aToken.getStr()); if ( aBuf[0] == '-' && aBuf[1] == 'p' && aBuf[2] == '=' ) { strcpy(pFileNamePrefix, &aBuf[3]); diff --git a/tools/inc/bootstrp/prj.hxx b/tools/inc/bootstrp/prj.hxx index 496f47bc88d1..35896065d159 100644 --- a/tools/inc/bootstrp/prj.hxx +++ b/tools/inc/bootstrp/prj.hxx @@ -31,6 +31,7 @@ #include #include +#include /********************************************************************* * @@ -45,11 +46,11 @@ class SimpleConfig ByteString aTmpStr; ByteString aStringBuffer; - ByteString GetNextLine(); + rtl::OString GetNextLine(); public: SimpleConfig(const String& rSimpleConfigFileName); ~SimpleConfig(); - ByteString GetNext(); + rtl::OString getNext(); }; #endif -- cgit v1.2.3 From ac96c998b9ed4cff056a05d343a2ec0a3ce15a60 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:19:02 +0100 Subject: take advantage of default arguments --- vcl/inc/vcl/strhelper.hxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 450139b0ba14..9a6cc0cca634 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -58,14 +58,12 @@ ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect // parses the first double in the string; decimal is '.' only inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) { - rtl_math_ConversionStatus eStatus; - return rtl::math::stringToDouble( rStr, sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); + return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); } inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) { - rtl_math_ConversionStatus eStatus; - return rtl::math::stringToDouble( rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0), &eStatus, NULL); + return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0)); } // fills a character buffer with the string representation of a double -- cgit v1.2.3 From a9bec36b0444ae0c0eaf92db22efb456227c4f93 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:26:13 +0100 Subject: remove unused appendUSASCIIParameter methods --- svl/inc/svl/inettype.hxx | 36 -------------- svl/source/misc/inettype.cxx | 112 ------------------------------------------- 2 files changed, 148 deletions(-) diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 3abe09c0e37c..8f667ae908d4 100644 --- a/svl/inc/svl/inettype.hxx +++ b/svl/inc/svl/inettype.hxx @@ -443,42 +443,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/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index cb16349ab487..819d9026f1d6 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -1237,116 +1237,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: */ -- cgit v1.2.3 From 42bfc7c6ddc12788d2b40076ee58ab6ca95feb89 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:40:29 +0100 Subject: junk unused archaic pre-stl containers --- svl/inc/svl/svstdarr.hxx | 20 --------- svl/source/memtools/svarray.cxx | 97 ----------------------------------------- 2 files changed, 117 deletions(-) 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/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: */ -- cgit v1.2.3 From 30a53d4ea9f554fed283245fb02ae6c1437dd0fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 21 Jun 2011 23:53:45 +0100 Subject: simplify this now --- vcl/inc/vcl/strhelper.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 9a6cc0cca634..6f1ec6646a6f 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -63,7 +63,7 @@ inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) { - return rtl::math::stringToDouble(rtl::OStringToOUString( rStr, osl_getThreadTextEncoding() ), sal_Unicode('.'), sal_Unicode(0)); + return rtl::math::stringToDouble(rStr, '.', static_cast(0)); } // fills a character buffer with the string representation of a double -- cgit v1.2.3 From 32cc00e9bcd01ff1864ddb3e8727aa4bfa0d4775 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 00:00:52 +0100 Subject: ditch old string --- vcl/inc/unx/saldisp.hxx | 2 +- vcl/unx/generic/app/keysymnames.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 6687762c1e9d..7248f87fbd35 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -372,7 +372,7 @@ protected: KeySym nShiftKeySym_; // first shift modifier KeySym nCtrlKeySym_; // first control modifier KeySym nMod1KeySym_; // first mod1 modifier - ByteString m_aKeyboardName; + rtl::OString m_aKeyboardName; vcl_sal::WMAdaptor* m_pWMAdaptor; DtIntegrator* m_pDtIntegrator; diff --git a/vcl/unx/generic/app/keysymnames.cxx b/vcl/unx/generic/app/keysymnames.cxx index e164d06d5d07..c2db38c2a13a 100644 --- a/vcl/unx/generic/app/keysymnames.cxx +++ b/vcl/unx/generic/app/keysymnames.cxx @@ -583,7 +583,7 @@ static const keyboard_layout type6_layout[] = const char* SalDisplay::GetKeyboardName( bool bRefresh ) { - if( bRefresh || ! m_aKeyboardName.Len() ) + if (bRefresh || m_aKeyboardName.isEmpty()) { #if defined(SOLARIS) if( IsLocal() ) @@ -665,10 +665,10 @@ const char* SalDisplay::GetKeyboardName( bool bRefresh ) } } #endif - if( ! m_aKeyboardName.Len() ) + if (m_aKeyboardName.isEmpty()) m_aKeyboardName = ""; } - return m_aKeyboardName.GetBuffer(); + return m_aKeyboardName.getStr(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 7ccf55e61d8b56b223e72045ed1bf6290269d1bb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 00:49:30 +0100 Subject: ByteString->osl::OString[Buffer] --- vcl/inc/vcl/syswin.hxx | 4 +- vcl/source/window/syswin.cxx | 120 ++++++++++++++++++++++--------------------- 2 files changed, 64 insertions(+), 60 deletions(-) diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index 0fd2fd8d1512..c8062e3dc352 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -231,8 +231,8 @@ public: const Size& GetMaxOutputSizePixel() const; Size GetResizeOutputSizePixel() const; - void SetWindowState( const ByteString& rStr ); - ByteString GetWindowState( sal_uLong nMask = WINDOWSTATE_MASK_ALL ) const; + void SetWindowState(const rtl::OString& rStr); + rtl::OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const; void SetMenuBar( MenuBar* pMenuBar ); MenuBar* GetMenuBar() const { return mpMenuBar; } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index f6c7e422cc3b..53c277e06bb1 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -39,6 +39,8 @@ #include #include +#include + #include #include #include @@ -498,16 +500,17 @@ Size SystemWindow::GetResizeOutputSizePixel() const // ----------------------------------------------------------------------- -static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr ) +static void ImplWindowStateFromStr(WindowStateData& rData, + const rtl::OString& rStr) { sal_uLong nValidMask = 0; - xub_StrLen nIndex = 0; - ByteString aTokenStr; + sal_Int32 nIndex = 0; + rtl::OString aTokenStr; - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetX( aTokenStr.ToInt32() ); + rData.SetX(aTokenStr.toInt32()); if( rData.GetX() > -16384 && rData.GetX() < 16384 ) nValidMask |= WINDOWSTATE_MASK_X; else @@ -515,10 +518,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetX( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetY( aTokenStr.ToInt32() ); + rData.SetY(aTokenStr.toInt32()); if( rData.GetY() > -16384 && rData.GetY() < 16384 ) nValidMask |= WINDOWSTATE_MASK_Y; else @@ -526,10 +529,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetY( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetWidth( aTokenStr.ToInt32() ); + rData.SetWidth(aTokenStr.toInt32()); if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 ) nValidMask |= WINDOWSTATE_MASK_WIDTH; else @@ -537,10 +540,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetWidth( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetHeight( aTokenStr.ToInt32() ); + rData.SetHeight(aTokenStr.toInt32()); if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 ) nValidMask |= WINDOWSTATE_MASK_HEIGHT; else @@ -548,12 +551,12 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetHeight( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - sal_uLong nState = (sal_uLong)aTokenStr.ToInt32(); + sal_uInt32 nState = (sal_uInt32)aTokenStr.toInt32(); //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); rData.SetState( nState ); nValidMask |= WINDOWSTATE_MASK_STATE; @@ -562,10 +565,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS rData.SetState( 0 ); // read maximized pos/size - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedX( aTokenStr.ToInt32() ); + rData.SetMaximizedX(aTokenStr.toInt32()); if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X; else @@ -573,10 +576,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedX( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedY( aTokenStr.ToInt32() ); + rData.SetMaximizedY(aTokenStr.toInt32()); if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y; else @@ -584,10 +587,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedY( 0 ); - aTokenStr = rStr.GetToken( 0, ',', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ',', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedWidth( aTokenStr.ToInt32() ); + rData.SetMaximizedWidth(aTokenStr.toInt32()); if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH; else @@ -595,10 +598,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS } else rData.SetMaximizedWidth( 0 ); - aTokenStr = rStr.GetToken( 0, ';', nIndex ); - if ( aTokenStr.Len() ) + aTokenStr = rStr.getToken(0, ';', nIndex); + if (!aTokenStr.isEmpty()) { - rData.SetMaximizedHeight( aTokenStr.ToInt32() ); + rData.SetMaximizedHeight(aTokenStr.toInt32()); if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 ) nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; else @@ -613,45 +616,48 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS // ----------------------------------------------------------------------- -static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr ) +static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) { sal_uLong nValidMask = rData.GetMask(); if ( !nValidMask ) - return; + return rtl::OString(); + + rtl::OStringBuffer rStrBuf; if ( nValidMask & WINDOWSTATE_MASK_X ) - rStr.Append( ByteString::CreateFromInt32( rData.GetX() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetX()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_Y ) - rStr.Append( ByteString::CreateFromInt32( rData.GetY() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetY()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_WIDTH ) - rStr.Append( ByteString::CreateFromInt32( rData.GetWidth() ) ); - rStr.Append( ',' ); + rStrBuf.append(static_cast(rData.GetWidth())); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_HEIGHT ) - rStr.Append( ByteString::CreateFromInt32( rData.GetHeight() ) ); - rStr.Append( ';' ); + rStrBuf.append(static_cast(rData.GetHeight())); + rStrBuf.append( ';' ); if ( nValidMask & WINDOWSTATE_MASK_STATE ) { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - sal_uLong nState = rData.GetState(); - //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); - rStr.Append( ByteString::CreateFromInt32( (long)nState ) ); + sal_uInt32 nState = rData.GetState(); + rStrBuf.append(static_cast(nState)); } - rStr.Append( ';' ); + rStrBuf.append(';'); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedX() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetMaximizedX()); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedY() ) ); - rStr.Append( ',' ); + rStrBuf.append(rData.GetMaximizedY()); + rStrBuf.append( ',' ); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedWidth() ) ); - rStr.Append( ',' ); + rStrBuf.append(static_cast(rData.GetMaximizedWidth())); + rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ) - rStr.Append( ByteString::CreateFromInt32( rData.GetMaximizedHeight() ) ); - rStr.Append( ';' ); + rStrBuf.append(static_cast(rData.GetMaximizedHeight())); + rStrBuf.append(';'); + + return rStrBuf.makeStringAndClear(); } // ----------------------------------------------------------------------- @@ -955,9 +961,9 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const // ----------------------------------------------------------------------- -void SystemWindow::SetWindowState( const ByteString& rStr ) +void SystemWindow::SetWindowState(const rtl::OString& rStr) { - if ( !rStr.Len() ) + if (rStr.isEmpty()) return; WindowStateData aData; @@ -967,15 +973,13 @@ void SystemWindow::SetWindowState( const ByteString& rStr ) // ----------------------------------------------------------------------- -ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const +rtl::OString SystemWindow::GetWindowState( sal_uLong nMask ) const { WindowStateData aData; aData.SetMask( nMask ); GetWindowStateData( aData ); - ByteString aStr; - ImplWindowStateToStr( aData, aStr ); - return aStr; + return ImplWindowStateToStr(aData); } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 0c6f8003581ea03460f54c5ada00936ec5d341c5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 10:38:44 +0100 Subject: fix build errors --- vcl/source/window/syswin.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 53c277e06bb1..51258f73e77f 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -625,10 +625,10 @@ static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) rtl::OStringBuffer rStrBuf; if ( nValidMask & WINDOWSTATE_MASK_X ) - rStrBuf.append(rData.GetX()); + rStrBuf.append(static_cast(rData.GetX())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_Y ) - rStrBuf.append(rData.GetY()); + rStrBuf.append(static_cast(rData.GetY())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_WIDTH ) rStrBuf.append(static_cast(rData.GetWidth())); @@ -645,10 +645,10 @@ static rtl::OString ImplWindowStateToStr(const WindowStateData& rData) } rStrBuf.append(';'); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_X ) - rStrBuf.append(rData.GetMaximizedX()); + rStrBuf.append(static_cast(rData.GetMaximizedX())); rStrBuf.append(','); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_Y ) - rStrBuf.append(rData.GetMaximizedY()); + rStrBuf.append(static_cast(rData.GetMaximizedY())); rStrBuf.append( ',' ); if ( nValidMask & WINDOWSTATE_MASK_MAXIMIZED_WIDTH ) rStrBuf.append(static_cast(rData.GetMaximizedWidth())); -- cgit v1.2.3 From fb18147a63061e719c35f32d5adf7699bc021972 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 11:19:06 +0100 Subject: make fontconfig non-optional on non-MacOSX unix --- vcl/Library_vcl.mk | 7 -- vcl/unx/generic/fontmanager/fontconfig.cxx | 131 +++++++---------------------- 2 files changed, 31 insertions(+), 107 deletions(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c8292cf7ac71..c0eb89e04eeb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -177,12 +177,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ )) -## handle fontconfig -ifneq ($(ENABLE_FONTCONFIG),) -$(eval $(call gb_Library_set_defs,vcl,\ - $$(DEFS) \ - -DENABLE_FONTCONFIG \ -)) ## handle CUPS ifneq ($(ENABLE_CUPS),) $(eval $(call gb_Library_set_defs,vcl,\ @@ -190,7 +184,6 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DENABLE_CUPS \ )) endif -endif $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/glyphs/gcach_ftyp \ vcl/source/glyphs/gcach_layout \ diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index c1d506d91d83..1dc100159778 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -36,53 +36,37 @@ using namespace psp; -#ifdef ENABLE_FONTCONFIG - #include - #include - #include - // allow compile on baseline (currently with fontconfig 2.2.0) - #ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 - #define FC_WEIGHT_BOOK 75 - #endif - #ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 - #define FC_EMBEDDED_BITMAP "embeddedbitmap" - #endif - #ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_FAMILYLANG "familylang" - #endif - #ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_CAPABILITY "capability" - #endif - #ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 - #define FC_STYLELANG "stylelang" - #endif - #ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 - #define FC_HINT_STYLE "hintstyle" - #define FC_HINT_NONE 0 - #define FC_HINT_SLIGHT 1 - #define FC_HINT_MEDIUM 2 - #define FC_HINT_FULL 3 - #endif - #ifndef FC_FT_FACE - #define FC_FT_FACE "ftface" - #endif - #ifndef FC_EMBOLDEN - #define FC_EMBOLDEN "embolden" - #endif -#else - typedef void FcConfig; - typedef void FcObjectSet; - typedef void FcPattern; - typedef void FcFontSet; - typedef void FcCharSet; - typedef int FcResult; - typedef int FcBool; - typedef int FcMatchKind; - typedef char FcChar8; - typedef int FcChar32; - typedef unsigned int FT_UInt; - typedef void* FT_Face; - typedef int FcSetName; +#include +#include +#include +// allow compile on baseline (currently with fontconfig 2.2.0) +#ifndef FC_WEIGHT_BOOK // TODO: remove when baseline moves to fc>=2.2.1 + #define FC_WEIGHT_BOOK 75 +#endif +#ifndef FC_EMBEDDED_BITMAP // TODO: remove when baseline moves to fc>=2.3.92 + #define FC_EMBEDDED_BITMAP "embeddedbitmap" +#endif +#ifndef FC_FAMILYLANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_FAMILYLANG "familylang" +#endif +#ifndef FC_CAPABILITY // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_CAPABILITY "capability" +#endif +#ifndef FC_STYLELANG // TODO: remove when baseline moves to fc>=2.2.97 + #define FC_STYLELANG "stylelang" +#endif +#ifndef FC_HINT_STYLE // TODO: remove when baseline moves to fc>=2.2.91 + #define FC_HINT_STYLE "hintstyle" + #define FC_HINT_NONE 0 + #define FC_HINT_SLIGHT 1 + #define FC_HINT_MEDIUM 2 + #define FC_HINT_FULL 3 +#endif +#ifndef FC_FT_FACE + #define FC_FT_FACE "ftface" +#endif +#ifndef FC_EMBOLDEN + #define FC_EMBOLDEN "embolden" #endif #include @@ -483,7 +467,6 @@ FontCfgWrapper::FontCfgWrapper() void FontCfgWrapper::addFontSet( FcSetName eSetName ) { - #ifdef ENABLE_FONTCONFIG /* add only acceptable outlined fonts to our config, for future fontconfig use @@ -506,12 +489,8 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) } // TODO?: FcFontSetDestroy( pOrig ); - #else - (void)eSetName; // prevent compiler warning about unused parameter - #endif } -#ifdef ENABLE_FONTCONFIG namespace { int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b) @@ -593,11 +572,9 @@ namespace return bIsDup; } } -#endif FcFontSet* FontCfgWrapper::getFontSet() { - #ifdef ENABLE_FONTCONFIG if( !m_pOutlineSet ) { m_pOutlineSet = FcFontSetCreate(); @@ -607,7 +584,6 @@ FcFontSet* FontCfgWrapper::getFontSet() ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this)); } - #endif return m_pOutlineSet; } @@ -639,7 +615,6 @@ void FontCfgWrapper::release() } } -#ifdef ENABLE_FONTCONFIG namespace { class localizedsorter @@ -1262,10 +1237,6 @@ public: ImplFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const { -#ifndef ENABLE_FONTCONFIG - (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions; - return NULL; -#else // ENABLE_FONTCONFIG FontCfgWrapper& rWrapper = FontCfgWrapper::get(); if( ! rWrapper.isValid() ) return NULL; @@ -1334,7 +1305,6 @@ ImplFontOptions* PrintFontManager::getFontOptions( rWrapper.FcPatternDestroy( pPattern ); return pOptions; -#endif } bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ) @@ -1404,43 +1374,4 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star return bSuccess; } -#else // ENABLE_FONTCONFIG not defined - -bool PrintFontManager::initFontconfig() -{ - return false; -} - -int PrintFontManager::countFontconfigFonts( boost::unordered_map& ) -{ - return 0; -} - -void PrintFontManager::deinitFontconfig() -{} - -bool PrintFontManager::addFontconfigDir( const rtl::OString& ) -{ - return false; -} - -bool PrintFontManager::matchFont( FastPrintFontInfo&, const com::sun::star::lang::Locale& ) -{ - return false; -} - -int PrintFontManager::FreeTypeCharIndex( void*, sal_uInt32 ) -{ - return 0; -} - -rtl::OUString PrintFontManager::Substitute( const rtl::OUString&, - rtl::OUString&, const rtl::OString&, FontItalic, FontWeight, FontWidth, FontPitch) const -{ - rtl::OUString aName; - return aName; -} - -#endif // ENABLE_FONTCONFIG - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From de8b6ad8ff15b3e31aa057436113ef37cf24ea09 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 21 Jun 2011 09:11:29 +0200 Subject: Teach LibreOffice proper svg:d support --- basegfx/inc/basegfx/tools/unotools.hxx | 55 +++++++ basegfx/prj/d.lst | 1 + basegfx/source/tools/makefile.mk | 3 +- basegfx/source/tools/unotools.cxx | 264 +++++++++++++++++++++++++++++++++ 4 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 basegfx/inc/basegfx/tools/unotools.hxx create mode 100644 basegfx/source/tools/unotools.cxx 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 + * 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 +#include +#include +#include +#include +#include +#include + + +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/d.lst b/basegfx/prj/d.lst index dd4a2d8aedd6..06888a8e5e99 100644 --- a/basegfx/prj/d.lst +++ b/basegfx/prj/d.lst @@ -93,6 +93,7 @@ mkdir: %_DEST%\inc\basegfx\tools ..\inc\basegfx\tools\keystoplerp.hxx %_DEST%\inc\basegfx\tools\keystoplerp.hxx ..\inc\basegfx\tools\lerp.hxx %_DEST%\inc\basegfx\tools\lerp.hxx ..\inc\basegfx\tools\unopolypolygon.hxx %_DEST%\inc\basegfx\tools\unopolypolygon.hxx +..\inc\basegfx\tools\unotools.hxx %_DEST%\inc%_EXT%\basegfx\tools\unotools.hxx ..\inc\basegfx\tools\b2dclipstate.hxx %_DEST%\inc\basegfx\tools\b2dclipstate.hxx ..\inc\basegfx\tools\rectcliptools.hxx %_DEST%\inc\basegfx\tools\rectcliptools.hxx ..\inc\basegfx\tools\tools.hxx %_DEST%\inc\basegfx\tools\tools.hxx diff --git a/basegfx/source/tools/makefile.mk b/basegfx/source/tools/makefile.mk index 0a0977f7305d..6023a327a66f 100755 --- a/basegfx/source/tools/makefile.mk +++ b/basegfx/source/tools/makefile.mk @@ -44,7 +44,8 @@ SLOFILES= $(SLO)$/b2dclipstate.obj \ $(SLO)$/keystoplerp.obj \ $(SLO)$/liangbarsky.obj \ $(SLO)$/tools.obj \ - $(SLO)$/unopolypolygon.obj + $(SLO)$/unopolypolygon.obj\ + $(SLO)$/unotools.obj # --- Targets ---------------------------------- 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 + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_basegfx.hxx" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +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 aPoints; aPoints.reserve(nLoopCount); + std::vector aFlags; aFlags.reserve(nLoopCount); + + // prepare insert index and current point + basegfx::B2DCubicBezier aBezier; + aBezier.setStartPoint(rPoly.getB2DPoint(0)); + + for(sal_uInt32 b(0L); b Date: Tue, 21 Jun 2011 09:40:32 +0200 Subject: Fix deliver --- basegfx/prj/d.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basegfx/prj/d.lst b/basegfx/prj/d.lst index 06888a8e5e99..a654a17c1249 100644 --- a/basegfx/prj/d.lst +++ b/basegfx/prj/d.lst @@ -93,7 +93,7 @@ mkdir: %_DEST%\inc\basegfx\tools ..\inc\basegfx\tools\keystoplerp.hxx %_DEST%\inc\basegfx\tools\keystoplerp.hxx ..\inc\basegfx\tools\lerp.hxx %_DEST%\inc\basegfx\tools\lerp.hxx ..\inc\basegfx\tools\unopolypolygon.hxx %_DEST%\inc\basegfx\tools\unopolypolygon.hxx -..\inc\basegfx\tools\unotools.hxx %_DEST%\inc%_EXT%\basegfx\tools\unotools.hxx +..\inc\basegfx\tools\unotools.hxx %_DEST%\inc\basegfx\tools\unotools.hxx ..\inc\basegfx\tools\b2dclipstate.hxx %_DEST%\inc\basegfx\tools\b2dclipstate.hxx ..\inc\basegfx\tools\rectcliptools.hxx %_DEST%\inc\basegfx\tools\rectcliptools.hxx ..\inc\basegfx\tools\tools.hxx %_DEST%\inc\basegfx\tools\tools.hxx -- cgit v1.2.3 From bfc8f933669f486931da4808211154ff6d6965c0 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Wed, 22 Jun 2011 09:36:20 +0200 Subject: Use the sweep flag to determine the drawing direction The previous solution was giving somehow acceptable results in the majority of cases, but was pretty broken with corner cases where the arc is exactly half of the whole ellipse and where the large arc flag is largely irrelevant. If the sweep flag is equal to 0 drawing goes in the sense of decreasing angles. If it is set, drawing goes in the sense of increasing angles. --- basegfx/source/polygon/b2dsvgpolypolygon.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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) Date: Wed, 22 Jun 2011 15:40:26 +1200 Subject: Set the listbox height to an integer multiple of the listbox entry height. This ensures that we don't get a half visible entry at the bottom of the view. Signed-off-by: Tor Lillqvist --- svtools/source/contnr/svimpbox.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index da5aff817b60..ab6d4e1b8fb3 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1358,8 +1358,19 @@ void SvImpLBox::InitScrollBarBox() void SvImpLBox::Resize() { Size aSize( pView->Control::GetOutputSizePixel()); + long nEntryHeight = pView->GetEntryHeight(); + int nEntryCount = 0; + if( aSize.Width() <= 0 || aSize.Height() <= 0 ) return; + if( nEntryHeight ) + { + // Set the view height to an integer multiple of the entry height. + nEntryCount = (int) aSize.Height() / nEntryHeight; + aSize.Height() = pView->GetEntryHeight() * nEntryCount; + pView->Control::SetOutputSizePixel( aSize ); + } + nFlags |= F_IN_RESIZE; InitScrollBarBox(); -- cgit v1.2.3 From 657a01ef25b43df56bc6752b18c9797d49b7201b Mon Sep 17 00:00:00 2001 From: Luke Symes Date: Wed, 22 Jun 2011 15:56:50 +1200 Subject: Implement ScrollToAbsPos for listboxes. Scrolls the listbox so the given entry is the first visible entry. The existing MakeVisible is not good enough since it won't scroll down if the given entry is already visible. Signed-off-by: Tor Lillqvist --- svtools/inc/svtools/svtreebx.hxx | 1 + svtools/inc/svtools/treelist.hxx | 6 ++++++ svtools/source/contnr/svimpbox.cxx | 26 ++++++++++++++++++++++++++ svtools/source/contnr/svtreebx.cxx | 5 +++++ svtools/source/inc/svimpbox.hxx | 1 + 5 files changed, 39 insertions(+) diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index 6edd32110317..370ab44f34f4 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -369,6 +369,7 @@ public: SvLBoxEntry* GetFirstEntryInView() const; SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const; + void ScrollToAbsPos( long nPos ); void ShowFocusRect( const SvLBoxEntry* pEntry ); void SetTabBar( TabBar* pTabBar ); diff --git a/svtools/inc/svtools/treelist.hxx b/svtools/inc/svtools/treelist.hxx index 6c296d26ea44..63545ed30cc1 100644 --- a/svtools/inc/svtools/treelist.hxx +++ b/svtools/inc/svtools/treelist.hxx @@ -494,9 +494,15 @@ public: SvListEntry* LastSelected() const { return pModel->LastSelected(this); } + SvListEntry* GetEntryAtAbsPos( sal_uLong nAbsPos ) const + { return pModel->GetEntryAtAbsPos(nAbsPos); } + SvListEntry* GetEntryAtVisPos( sal_uLong nVisPos ) const { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); } + sal_uLong GetAbsPos( SvListEntry* pEntry ) const + { return pModel->GetAbsPos(pEntry); } + sal_uLong GetVisiblePos( SvListEntry* pEntry ) const { return pModel->GetVisiblePos((SvListView*)this,pEntry); } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index ab6d4e1b8fb3..fd5a649d833c 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1012,6 +1012,32 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) pView->Invalidate(); } +void SvImpLBox::ScrollToAbsPos( long nPos ) +{ + long nLastEntryPos = pView->GetAbsPos( pView->Last() ); + + if( nPos < 0 ) + nPos = 0; + else if( nPos > nLastEntryPos ) + nPos = nLastEntryPos; + + SvLBoxEntry* pEntry = (SvLBoxEntry*)pView->GetEntryAtAbsPos( nPos ); + if( !pEntry || pEntry == pStartEntry ) + return; + + if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) + nFlags &= (~F_FILLING); + + if( pView->IsEntryVisible(pEntry) ) + { + pStartEntry = pEntry; + ShowCursor( sal_False ); + aVerSBar.SetThumbPos( nPos ); + ShowCursor( sal_True ); + if (GetUpdateMode()) + pView->Invalidate(); + } +} void SvImpLBox::RepaintSelectionItems() { diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index d03b956bf571..8f9a14926825 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -853,6 +853,11 @@ void SvTreeListBox::ScrollOutputArea( short nDeltaEntries ) NotifyEndScroll(); } +void SvTreeListBox::ScrollToAbsPos( long nPos ) +{ + pImp->ScrollToAbsPos( nPos ); +} + void SvTreeListBox::SetSelectionMode( SelectionMode eSelectMode ) { DBG_CHKTHIS(SvTreeListBox,0); diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index c7603827f61e..d38046a6f47c 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -313,6 +313,7 @@ public: void SetCurEntry( SvLBoxEntry* ); Point GetEntryPosition( SvLBoxEntry* ) const; void MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop=sal_False ); + void ScrollToAbsPos( long nPos ); void PaintDDCursor( SvLBoxEntry* ); -- cgit v1.2.3 From a7e20d7ae2d39dc8e5a87852ea492e556dbf1c9e Mon Sep 17 00:00:00 2001 From: Luke Symes Date: Wed, 22 Jun 2011 16:03:10 +1200 Subject: Implement GetLastEntryInView for SvTreeListBox. This function matches up with GetFirstEntryInView, and will be useful in saving the scroll state of a SvTreeListBox, in particular the CustomAnimationList. Signed-off-by: Tor Lillqvist --- svtools/inc/svtools/svtreebx.hxx | 1 + svtools/source/contnr/svtreebx.cxx | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx index 370ab44f34f4..96adfe73aea9 100644 --- a/svtools/inc/svtools/svtreebx.hxx +++ b/svtools/inc/svtools/svtreebx.hxx @@ -369,6 +369,7 @@ public: SvLBoxEntry* GetFirstEntryInView() const; SvLBoxEntry* GetNextEntryInView(SvLBoxEntry*) const; + SvLBoxEntry* GetLastEntryInView() const; void ScrollToAbsPos( long nPos ); void ShowFocusRect( const SvLBoxEntry* pEntry ); diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 8f9a14926825..7695137431f0 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -2452,6 +2452,28 @@ SvLBoxEntry* SvTreeListBox::GetNextEntryInView(SvLBoxEntry* pEntry ) const return pNext; } +SvLBoxEntry* SvTreeListBox::GetLastEntryInView() const +{ + SvLBoxEntry* pEntry = GetFirstEntryInView(); + SvLBoxEntry* pNext = 0; + while( pEntry ) + { + pNext = (SvLBoxEntry*)NextVisible( pEntry ); + if( pNext ) + { + Point aPos( GetEntryPosition(pNext) ); + const Size& rSize = pImp->GetOutputSize(); + if( aPos.Y() < 0 || aPos.Y() >= rSize.Height() ) + break; + else + pEntry = pNext; + } + else + break; + } + return pEntry; +} + void SvTreeListBox::ShowFocusRect( const SvLBoxEntry* pEntry ) { pImp->ShowFocusRect( pEntry ); -- cgit v1.2.3 From 8fdcbfe58681752727e658071937177f6ee79ceb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 12:26:48 +0100 Subject: dewrap fontconfig and link directly, remove non-fontconfig paths --- vcl/Library_vcl.mk | 15 +- vcl/unx/generic/fontmanager/fontconfig.cxx | 576 ++++++----------------------- vcl/unx/generic/printer/cupsmgr.cxx | 2 +- 3 files changed, 115 insertions(+), 478 deletions(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c0eb89e04eeb..8811bda29661 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -49,6 +49,7 @@ $(eval $(call gb_Library_set_include,vcl,\ ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ + $$(FONTCONFIG_CFLAGS) \ $$(FREETYPE_CFLAGS) \ )) endif @@ -84,12 +85,6 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ $(gb_STDLIBS) \ )) -ifeq ($(GUIBASE),unx) -$(eval $(call gb_Library_add_linked_libs,vcl,\ - freetype \ -)) -endif - ifeq ($(GUIBASE),aqua) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ @@ -444,6 +439,14 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ endif endif +ifeq ($(GUIBASE),unx) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + $$(FONTCONFIG_LIBS) \ + $$(FREETYPE_LIBS) \ +)) +endif + ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_linked_libs,vcl,\ dl \ diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 1dc100159778..693bf3b6a3d5 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -98,53 +98,8 @@ namespace class FontCfgWrapper { - oslModule m_pLib; FcFontSet* m_pOutlineSet; - int m_nFcVersion; - FcBool (*m_pFcInit)(); - void (*m_pFcFini)(); - int (*m_pFcGetVersion)(); - FcConfig* (*m_pFcConfigGetCurrent)(); - FcObjectSet* (*m_pFcObjectSetVaBuild)(const char*,va_list); - void (*m_pFcObjectSetDestroy)(FcObjectSet* pSet); - FcPattern* (*m_pFcPatternCreate)(); - void (*m_pFcPatternDestroy)(FcPattern*); - FcBool (*m_pFcPatternEqual)(const FcPattern*,const FcPattern*); - FcFontSet* (*m_pFcConfigGetFonts)(FcConfig*,FcSetName); - FcFontSet* (*m_pFcFontSetCreate)(); - FcCharSet* (*m_pFcCharSetCreate)(); - FcBool (*m_pFcCharSetAddChar)(FcCharSet *, FcChar32); - FcBool (*m_pFcCharSetHasChar)(FcCharSet *, FcChar32); - void (*m_pFcCharSetDestroy)(FcCharSet*); - void (*m_pFcFontSetDestroy)(FcFontSet*); - FcBool (*m_pFcFontSetAdd)(FcFontSet*,FcPattern*); - void (*m_pFcPatternReference)(FcPattern*); - FcResult (*m_pFcPatternGetCharSet)(const FcPattern*,const char*,int,FcCharSet**); - FcResult (*m_pFcPatternGetString)(const FcPattern*,const char*,int,FcChar8**); - FcResult (*m_pFcPatternGetInteger)(const FcPattern*,const char*,int,int*); - FcResult (*m_pFcPatternGetDouble)(const FcPattern*,const char*,int,double*); - FcResult (*m_pFcPatternGetBool)(const FcPattern*,const char*,int,FcBool*); - void (*m_pFcDefaultSubstitute)(FcPattern *); - FcPattern* (*m_pFcFontSetMatch)(FcConfig*,FcFontSet**, int, FcPattern*,FcResult*); - FcPattern* (*m_pFcFontMatch)(FcConfig*,FcPattern*,FcResult*); - FcBool (*m_pFcConfigAppFontAddFile)(FcConfig*, const FcChar8*); - FcBool (*m_pFcConfigAppFontAddDir)(FcConfig*, const FcChar8*); - FcBool (*m_pFcConfigParseAndLoad)(FcConfig*,const FcChar8*,FcBool); - FcBool (*m_pFcConfigSubstitute)(FcConfig*,FcPattern*,FcMatchKind); - - FcPattern* (*m_pFcPatternDuplicate)(const FcPattern*); - FcBool (*m_pFcPatternAddInteger)(FcPattern*,const char*,int); - FcBool (*m_pFcPatternAddDouble)(FcPattern*,const char*,double); - FcBool (*m_pFcPatternAddBool)(FcPattern*,const char*,FcBool); - FcBool (*m_pFcPatternAddCharSet)(FcPattern*,const char*,const FcCharSet*); - FcBool (*m_pFcPatternAddString)(FcPattern*,const char*,const FcChar8*); - FcBool (*m_pFcPatternDel)(FcPattern*,const char*); - - FT_UInt (*m_pFcFreeTypeCharIndex)(FT_Face,FcChar32); - FcBool (*m_pFcPatternAddFTFace)(FcPattern*,const char*,const FT_Face); - - oslGenericFunction loadSymbol( const char* ); void addFontSet( FcSetName ); FontCfgWrapper(); @@ -154,127 +109,8 @@ public: static FontCfgWrapper& get(); static void release(); - bool isValid() const - { return m_pLib != NULL;} - FcFontSet* getFontSet(); - FcBool FcInit() - { return m_pFcInit(); } - - void FcFini() - { - //To-Do: get gtk vclplug smoketest to pass - //if (m_pFcFini) m_pFcFini(); - } - - int FcGetVersion() - { return m_pFcGetVersion(); } - - FcConfig* FcConfigGetCurrent() - { return m_pFcConfigGetCurrent(); } - - FcObjectSet* FcObjectSetBuild( const char* first, ... ) - { - va_list ap; - va_start( ap, first ); - FcObjectSet* pSet = m_pFcObjectSetVaBuild( first, ap ); - va_end( ap ); - return pSet; - } - - void FcObjectSetDestroy( FcObjectSet* pSet ) - { m_pFcObjectSetDestroy( pSet ); } - - FcPattern* FcPatternCreate() - { return m_pFcPatternCreate(); } - - void FcPatternDestroy( FcPattern* pPattern ) - { if (m_pFcPatternDestroy) m_pFcPatternDestroy( pPattern ); } - - FcBool FcPatternEqual( const FcPattern* pPatternA, const FcPattern *pPatternB ) - { return m_pFcPatternEqual( pPatternA, pPatternB ); } - - FcFontSet* FcConfigGetFonts( FcConfig* pConfig, FcSetName eSet) - { return m_pFcConfigGetFonts( pConfig, eSet ); } - - FcFontSet* FcFontSetCreate() - { return m_pFcFontSetCreate(); } - - FcCharSet* FcCharSetCreate() - { return m_pFcCharSetCreate(); } - - FcBool FcCharSetAddChar(FcCharSet *fcs, FcChar32 ucs4) - { return m_pFcCharSetAddChar(fcs, ucs4); } - - FcBool FcCharSetHasChar(FcCharSet *fcs, FcChar32 ucs4) - { return m_pFcCharSetHasChar(fcs, ucs4); } - - void FcCharSetDestroy( FcCharSet* pSet ) - { m_pFcCharSetDestroy( pSet );} - - void FcFontSetDestroy( FcFontSet* pSet ) - { m_pFcFontSetDestroy( pSet );} - - FcBool FcFontSetAdd( FcFontSet* pSet, FcPattern* pPattern ) - { return m_pFcFontSetAdd( pSet, pPattern ); } - - void FcPatternReference( FcPattern* pPattern ) - { m_pFcPatternReference( pPattern ); } - - FcResult FcPatternGetCharSet( const FcPattern* pPattern, const char* object, int n, FcCharSet** s ) - { return m_pFcPatternGetCharSet( pPattern, object, n, s ); } - - FcResult FcPatternGetString( const FcPattern* pPattern, const char* object, int n, FcChar8** s ) - { return m_pFcPatternGetString( pPattern, object, n, s ); } - - FcResult FcPatternGetInteger( const FcPattern* pPattern, const char* object, int n, int* s ) - { return m_pFcPatternGetInteger( pPattern, object, n, s ); } - - FcResult FcPatternGetDouble( const FcPattern* pPattern, const char* object, int n, double* s ) - { return m_pFcPatternGetDouble( pPattern, object, n, s ); } - - FcResult FcPatternGetBool( const FcPattern* pPattern, const char* object, int n, FcBool* s ) - { return m_pFcPatternGetBool( pPattern, object, n, s ); } - FcBool FcConfigAppFontAddFile( FcConfig* pConfig, const FcChar8* pFileName ) - { return m_pFcConfigAppFontAddFile( pConfig, pFileName ); } - FcBool FcConfigAppFontAddDir(FcConfig* pConfig, const FcChar8* pDirName ) - { return m_pFcConfigAppFontAddDir( pConfig, pDirName ); } - FcBool FcConfigParseAndLoad( FcConfig* pConfig, const FcChar8* pFileName, FcBool bComplain ) - { return m_pFcConfigParseAndLoad( pConfig, pFileName, bComplain ); } - - void FcDefaultSubstitute( FcPattern* pPattern ) - { m_pFcDefaultSubstitute( pPattern ); } - FcPattern* FcFontSetMatch( FcConfig* pConfig, FcFontSet **ppFontSet, int nset, FcPattern* pPattern, FcResult* pResult ) - { return m_pFcFontSetMatch ? m_pFcFontSetMatch( pConfig, ppFontSet, nset, pPattern, pResult ) : 0; } - FcPattern* FcFontMatch( FcConfig* pConfig, FcPattern* pPattern, FcResult* pResult ) - { return m_pFcFontMatch( pConfig, pPattern, pResult ); } - FcBool FcConfigSubstitute( FcConfig* pConfig, FcPattern* pPattern, FcMatchKind eKind ) - { return m_pFcConfigSubstitute( pConfig, pPattern, eKind ); } - - FcPattern* FcPatternDuplicate( const FcPattern* pPattern ) const - { return m_pFcPatternDuplicate( pPattern ); } - FcBool FcPatternAddInteger( FcPattern* pPattern, const char* pObject, int nValue ) - { return m_pFcPatternAddInteger( pPattern, pObject, nValue ); } - FcBool FcPatternAddDouble( FcPattern* pPattern, const char* pObject, double nValue ) - { return m_pFcPatternAddDouble( pPattern, pObject, nValue ); } - FcBool FcPatternAddString( FcPattern* pPattern, const char* pObject, const FcChar8* pString ) - { return m_pFcPatternAddString( pPattern, pObject, pString ); } - FcBool FcPatternAddBool( FcPattern* pPattern, const char* pObject, bool nValue ) - { return m_pFcPatternAddBool( pPattern, pObject, nValue ); } - FcBool FcPatternAddCharSet(FcPattern* pPattern,const char* pObject,const FcCharSet*pCharSet) - { return m_pFcPatternAddCharSet(pPattern,pObject,pCharSet); } - FcBool FcPatternDel(FcPattern* pPattern, const char* object) - { return m_pFcPatternDel( pPattern, object); } - - FT_UInt FcFreeTypeCharIndex( FT_Face face, FcChar32 ucs4 ) - { return m_pFcFreeTypeCharIndex ? m_pFcFreeTypeCharIndex( face, ucs4 ) : 0; } - FcBool FcPatternAddFTFace( FcPattern* pPattern, const char* pObject, const FT_Face nValue ) - { - return m_pFcPatternAddFTFace - ? m_pFcPatternAddFTFace( pPattern, pObject, nValue ) - : false; - } public: FcResult LocalizedElementFromPattern(FcPattern* pPattern, FcChar8 **family, const char *elementtype, const char *elementlangtype); @@ -285,184 +121,10 @@ private: void cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements); }; -oslGenericFunction FontCfgWrapper::loadSymbol( const char* pSymbol ) -{ - OUString aSym( OUString::createFromAscii( pSymbol ) ); - oslGenericFunction pSym = osl_getFunctionSymbol( m_pLib, aSym.pData ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "%s %s\n", pSymbol, pSym ? "found" : "not found" ); -#endif - return pSym; -} - FontCfgWrapper::FontCfgWrapper() - : m_pLib( NULL ), - m_pOutlineSet( NULL ), - m_nFcVersion( 0 ) + : m_pOutlineSet( NULL ) { - OUString aLib( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so.1" ) ); - m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); - if( !m_pLib ) - { - aLib = OUString( RTL_CONSTASCII_USTRINGPARAM( "libfontconfig.so" ) ); - m_pLib = osl_loadModule( aLib.pData, SAL_LOADMODULE_LAZY ); - } - - if( ! m_pLib ) - { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "no libfontconfig\n" ); -#endif - return; - } - - m_pFcInit = (FcBool(*)()) - loadSymbol( "FcInit" ); - m_pFcFini = (void(*)()) - loadSymbol( "FcFini" ); - m_pFcGetVersion = (int(*)()) - loadSymbol( "FcGetVersion" ); - m_pFcConfigGetCurrent = (FcConfig *(*)()) - loadSymbol( "FcConfigGetCurrent" ); - m_pFcObjectSetVaBuild = (FcObjectSet*(*)(const char*,va_list)) - loadSymbol( "FcObjectSetVaBuild" ); - m_pFcObjectSetDestroy = (void(*)(FcObjectSet*)) - loadSymbol( "FcObjectSetDestroy" ); - m_pFcPatternCreate = (FcPattern*(*)()) - loadSymbol( "FcPatternCreate" ); - m_pFcPatternDestroy = (void(*)(FcPattern*)) - loadSymbol( "FcPatternDestroy" ); - m_pFcPatternEqual = (FcBool(*)(const FcPattern*,const FcPattern*)) - loadSymbol( "FcPatternEqual" ); - m_pFcConfigGetFonts = (FcFontSet*(*)(FcConfig*,FcSetName)) - loadSymbol( "FcConfigGetFonts" ); - m_pFcFontSetCreate = (FcFontSet*(*)()) - loadSymbol( "FcFontSetCreate" ); - m_pFcCharSetCreate = (FcCharSet*(*)()) - loadSymbol( "FcCharSetCreate" ); - m_pFcCharSetAddChar = (FcBool(*)(FcCharSet*, FcChar32)) - loadSymbol( "FcCharSetAddChar" ); - m_pFcCharSetHasChar = (FcBool(*)(FcCharSet*, FcChar32)) - loadSymbol( "FcCharSetHasChar" ); - m_pFcCharSetDestroy = (void(*)(FcCharSet*)) - loadSymbol( "FcCharSetDestroy" ); - m_pFcFontSetDestroy = (void(*)(FcFontSet*)) - loadSymbol( "FcFontSetDestroy" ); - m_pFcFontSetAdd = (FcBool(*)(FcFontSet*,FcPattern*)) - loadSymbol( "FcFontSetAdd" ); - m_pFcPatternReference = (void(*)(FcPattern*)) - loadSymbol( "FcPatternReference" ); - m_pFcPatternGetCharSet = (FcResult(*)(const FcPattern*,const char*,int,FcCharSet**)) - loadSymbol( "FcPatternGetCharSet" ); - m_pFcPatternGetString = (FcResult(*)(const FcPattern*,const char*,int,FcChar8**)) - loadSymbol( "FcPatternGetString" ); - m_pFcPatternGetInteger = (FcResult(*)(const FcPattern*,const char*,int,int*)) - loadSymbol( "FcPatternGetInteger" ); - m_pFcPatternGetDouble = (FcResult(*)(const FcPattern*,const char*,int,double*)) - loadSymbol( "FcPatternGetDouble" ); - m_pFcPatternGetBool = (FcResult(*)(const FcPattern*,const char*,int,FcBool*)) - loadSymbol( "FcPatternGetBool" ); - m_pFcConfigAppFontAddFile = (FcBool(*)(FcConfig*, const FcChar8*)) - loadSymbol( "FcConfigAppFontAddFile" ); - m_pFcConfigAppFontAddDir = (FcBool(*)(FcConfig*, const FcChar8*)) - loadSymbol( "FcConfigAppFontAddDir" ); - m_pFcConfigParseAndLoad = (FcBool(*)(FcConfig*, const FcChar8*, FcBool)) - loadSymbol( "FcConfigParseAndLoad" ); - m_pFcDefaultSubstitute = (void(*)(FcPattern *)) - loadSymbol( "FcDefaultSubstitute" ); - m_pFcFontSetMatch = (FcPattern*(*)(FcConfig*,FcFontSet**,int,FcPattern*,FcResult*)) - loadSymbol( "FcFontSetMatch" ); - m_pFcFontMatch = (FcPattern*(*)(FcConfig*,FcPattern*,FcResult*)) - loadSymbol( "FcFontMatch" ); - m_pFcConfigSubstitute = (FcBool(*)(FcConfig*,FcPattern*,FcMatchKind)) - loadSymbol( "FcConfigSubstitute" ); - - m_pFcPatternDuplicate = (FcPattern*(*)(const FcPattern*)) - loadSymbol( "FcPatternDuplicate" ); - m_pFcPatternAddInteger = (FcBool(*)(FcPattern*,const char*,int)) - loadSymbol( "FcPatternAddInteger" ); - m_pFcPatternAddDouble = (FcBool(*)(FcPattern*,const char*,double)) - loadSymbol( "FcPatternAddDouble" ); - m_pFcPatternAddBool = (FcBool(*)(FcPattern*,const char*,FcBool)) - loadSymbol( "FcPatternAddBool" ); - m_pFcPatternAddCharSet = (FcBool(*)(FcPattern*,const char*,const FcCharSet *)) - loadSymbol( "FcPatternAddCharSet" ); - m_pFcPatternAddString = (FcBool(*)(FcPattern*,const char*,const FcChar8*)) - loadSymbol( "FcPatternAddString" ); - m_pFcPatternDel = (FcBool(*)(FcPattern*,const char*)) - loadSymbol( "FcPatternDel" ); - - m_pFcFreeTypeCharIndex = (FT_UInt(*)(FT_Face,FcChar32)) - loadSymbol( "FcFreeTypeCharIndex" ); - m_pFcPatternAddFTFace = (FcBool(*)(FcPattern*,const char*,const FT_Face)) - loadSymbol( "FcPatternAddFTFace" ); - - m_nFcVersion = FcGetVersion(); -#if (OSL_DEBUG_LEVEL > 1) - fprintf( stderr,"FC_VERSION = %05d\n", m_nFcVersion ); -#endif - // make minimum version configurable - const char* pMinFcVersion = getenv( "SAL_MIN_FC_VERSION"); - if( pMinFcVersion ) - { - const int nMinFcVersion = atoi( pMinFcVersion ); - if( m_nFcVersion < nMinFcVersion ) - m_pFcInit = NULL; - } - - if( ! ( - m_pFcInit && - m_pFcGetVersion && - m_pFcConfigGetCurrent && - m_pFcObjectSetVaBuild && - m_pFcObjectSetDestroy && - m_pFcPatternCreate && - m_pFcPatternDestroy && - m_pFcPatternEqual && - m_pFcConfigGetFonts && - m_pFcFontSetCreate && - m_pFcCharSetCreate && - m_pFcCharSetAddChar && - m_pFcCharSetHasChar && - m_pFcCharSetDestroy && - m_pFcFontSetDestroy && - m_pFcFontSetAdd && - m_pFcPatternReference && - m_pFcPatternGetCharSet && - m_pFcPatternGetString && - m_pFcPatternGetInteger && - m_pFcPatternGetDouble && - m_pFcPatternGetBool && - m_pFcConfigAppFontAddFile && - m_pFcConfigAppFontAddDir && - m_pFcConfigParseAndLoad && - m_pFcFontMatch && - m_pFcDefaultSubstitute && - m_pFcConfigSubstitute && - m_pFcPatternDuplicate && - m_pFcPatternAddInteger && - m_pFcPatternAddDouble && - m_pFcPatternAddCharSet && - m_pFcPatternAddBool && - m_pFcPatternAddString && - m_pFcPatternDel - ) ) - { - osl_unloadModule( (oslModule)m_pLib ); - m_pLib = NULL; -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "not all needed symbols were found in libfontconfig\n" ); -#endif - return; - } - - FcInit(); - if( ! FcConfigGetCurrent() ) - { - osl_unloadModule( (oslModule)m_pLib ); - m_pLib = NULL; - } } void FontCfgWrapper::addFontSet( FcSetName eSetName ) @@ -493,12 +155,12 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) namespace { - int compareFontNames(FontCfgWrapper& rWrapper, const FcPattern *a, const FcPattern *b) + int compareFontNames(const FcPattern *a, const FcPattern *b) { FcChar8 *pNameA=NULL, *pNameB=NULL; - bool bHaveA = rWrapper.FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch; - bool bHaveB = rWrapper.FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch; + bool bHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch; + bool bHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch; if (bHaveA && bHaveB) return strcmp((const char*)pNameA, (const char*)pNameB); @@ -510,21 +172,17 @@ namespace //those with higher version numbers first class SortFont : public ::std::binary_function< const FcPattern*, const FcPattern*, bool > { - private: - FontCfgWrapper& m_rWrapper; public: - SortFont(FontCfgWrapper& rWrapper) : m_rWrapper(rWrapper) {} - bool operator()(const FcPattern *a, const FcPattern *b) { - int comp = compareFontNames(m_rWrapper, a, b); + int comp = compareFontNames(a, b); if (comp != 0) return comp < 0; int nVersionA=0, nVersionB=0; - bool bHaveA = m_rWrapper.FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch; - bool bHaveB = m_rWrapper.FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch; + bool bHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch; + bool bHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch; if (bHaveA && bHaveB) return nVersionA > nVersionB; @@ -539,7 +197,7 @@ namespace //See if this font is a duplicate with equal attributes which has already been //inserted, or if it an older version of an inserted fonts. Depends on FcFontSet //on being sorted with SortFont - bool isPreviouslyDuplicateOrObsoleted(FontCfgWrapper& rWrapper, FcFontSet *pFSet, int i) + bool isPreviouslyDuplicateOrObsoleted(FcFontSet *pFSet, int i) { if (i == 0) return false; @@ -547,27 +205,25 @@ namespace const FcPattern *a = pFSet->fonts[i]; const FcPattern *b = pFSet->fonts[i-1]; - if (compareFontNames(rWrapper, a, b) != 0) + if (compareFontNames(a, b) != 0) return false; - FcPattern* pTestPatternA = rWrapper.FcPatternDuplicate(a); - rWrapper.FcPatternDel(pTestPatternA, FC_FILE); - rWrapper.FcPatternDel(pTestPatternA, FC_CHARSET); - rWrapper.FcPatternDel(pTestPatternA, FC_CAPABILITY); - rWrapper.FcPatternDel(pTestPatternA, FC_FONTVERSION); + FcPattern* pTestPatternA = FcPatternDuplicate(a); + FcPatternDel(pTestPatternA, FC_FILE); + FcPatternDel(pTestPatternA, FC_CHARSET); + FcPatternDel(pTestPatternA, FC_CAPABILITY); + FcPatternDel(pTestPatternA, FC_FONTVERSION); - FcPattern* pTestPatternB = rWrapper.FcPatternDuplicate(b); - rWrapper.FcPatternDel(pTestPatternB, FC_FILE); - rWrapper.FcPatternDel(pTestPatternB, FC_CHARSET); - rWrapper.FcPatternDel(pTestPatternB, FC_CAPABILITY); - rWrapper.FcPatternDel(pTestPatternB, FC_FONTVERSION); + FcPattern* pTestPatternB = FcPatternDuplicate(b); + FcPatternDel(pTestPatternB, FC_FILE); + FcPatternDel(pTestPatternB, FC_CHARSET); + FcPatternDel(pTestPatternB, FC_CAPABILITY); + FcPatternDel(pTestPatternB, FC_FONTVERSION); - bool bIsDup = false; - if (rWrapper.FcPatternEqual(pTestPatternA, pTestPatternB)) - bIsDup = true; + bool bIsDup = FcPatternEqual(pTestPatternA, pTestPatternB); - rWrapper.FcPatternDestroy(pTestPatternB); - rWrapper.FcPatternDestroy(pTestPatternA); + FcPatternDestroy(pTestPatternB); + FcPatternDestroy(pTestPatternA); return bIsDup; } @@ -579,10 +235,10 @@ FcFontSet* FontCfgWrapper::getFontSet() { m_pOutlineSet = FcFontSetCreate(); addFontSet( FcSetSystem ); - if( m_nFcVersion > 20400 ) // #i85462# prevent crashes + if( FcGetVersion() > 20400 ) // #i85462# prevent crashes addFontSet( FcSetApplication ); - ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont(*this)); + ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont()); } return m_pOutlineSet; @@ -592,9 +248,8 @@ FontCfgWrapper::~FontCfgWrapper() { if( m_pOutlineSet ) FcFontSetDestroy( m_pOutlineSet ); - FcFini(); - if( m_pLib ) - osl_unloadModule( (oslModule)m_pLib ); + //To-Do: get gtk vclplug smoketest to pass + //FcFini(); } static FontCfgWrapper* pOneInstance = NULL; @@ -724,9 +379,7 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern* pPattern, FcChar */ bool PrintFontManager::initFontconfig() { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; + FontCfgWrapper::get(); return true; } @@ -802,8 +455,6 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_mapfonts[i], FC_FILE, 0, &file ); + FcResult eFileRes = FcPatternGetString(pFSet->fonts[i], FC_FILE, 0, &file); FcResult eFamilyRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &family, FC_FAMILY, FC_FAMILYLANG ); FcResult eStyleRes = rWrapper.LocalizedElementFromPattern( pFSet->fonts[i], &style, FC_STYLE, FC_STYLELANG ); - FcResult eSlantRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SLANT, 0, &slant ); - FcResult eWeightRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_WEIGHT, 0, &weight ); - FcResult eSpacRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_SPACING, 0, &spacing ); - FcResult eOutRes = rWrapper.FcPatternGetBool( pFSet->fonts[i], FC_OUTLINE, 0, &outline ); - FcResult eIndexRes = rWrapper.FcPatternGetInteger( pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry ); + FcResult eSlantRes = FcPatternGetInteger(pFSet->fonts[i], FC_SLANT, 0, &slant); + FcResult eWeightRes = FcPatternGetInteger(pFSet->fonts[i], FC_WEIGHT, 0, &weight); + FcResult eSpacRes = FcPatternGetInteger(pFSet->fonts[i], FC_SPACING, 0, &spacing); + FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline); + FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry); if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch ) continue; @@ -853,7 +504,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map 2 fprintf(stderr, "Ditching %s as duplicate/obsolete\n", file); @@ -979,25 +630,15 @@ void PrintFontManager::deinitFontconfig() FontCfgWrapper::release(); } -int PrintFontManager::FreeTypeCharIndex( void *pFace, sal_uInt32 aChar ) -{ - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - return rWrapper.isValid() ? rWrapper.FcFreeTypeCharIndex( (FT_Face)pFace, aChar ) : 0; -} - bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; - // workaround for a stability problems in older FC versions // when handling application specifc fonts - const int nVersion = rWrapper.FcGetVersion(); + const int nVersion = FcGetVersion(); if( nVersion <= 20400 ) return false; const char* pDirName = (const char*)rDirName.getStr(); - bool bDirOk = (rWrapper.FcConfigAppFontAddDir( rWrapper.FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); + bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), (FcChar8*)pDirName ) == FcTrue); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk ); @@ -1012,8 +653,8 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) if( pCfgFile ) { fclose( pCfgFile); - bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(), - (FcChar8*)aConfFileName.getStr(), FcTrue ); + bool bCfgOk = FcConfigParseAndLoad(FcConfigGetCurrent(), + (FcChar8*)aConfFileName.getStr(), FcTrue); if( !bCfgOk ) fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); } @@ -1021,7 +662,7 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName ) return true; } -static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, +static void addtopattern(FcPattern *pPattern, FontItalic eItalic, FontWeight eWeight, FontWidth eWidth, FontPitch ePitch) { if( eItalic != ITALIC_DONTKNOW ) @@ -1029,12 +670,16 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, int nSlant = FC_SLANT_ROMAN; switch( eItalic ) { - case ITALIC_NORMAL: nSlant = FC_SLANT_ITALIC;break; - case ITALIC_OBLIQUE: nSlant = FC_SLANT_OBLIQUE;break; + case ITALIC_NORMAL: + nSlant = FC_SLANT_ITALIC; + break; + case ITALIC_OBLIQUE: + nSlant = FC_SLANT_OBLIQUE; + break; default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_SLANT, nSlant ); + FcPatternAddInteger(pPattern, FC_SLANT, nSlant); } if( eWeight != WEIGHT_DONTKNOW ) { @@ -1054,7 +699,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_WEIGHT, nWeight ); + FcPatternAddInteger(pPattern, FC_WEIGHT, nWeight); } if( eWidth != WIDTH_DONTKNOW ) { @@ -1073,7 +718,7 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_WIDTH, nWidth ); + FcPatternAddInteger(pPattern, FC_WIDTH, nWidth); } if( ePitch != PITCH_DONTKNOW ) { @@ -1085,9 +730,9 @@ static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern, default: break; } - rWrapper.FcPatternAddInteger( pPattern, FC_SPACING, nSpacing ); + FcPatternAddInteger(pPattern, FC_SPACING, nSpacing); if (nSpacing == FC_MONO) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)"monospace"); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)"monospace"); } } @@ -1098,18 +743,16 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, { rtl::OUString aName; FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return aName; // build pattern argument for fontconfig query - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcPattern* pPattern = FcPatternCreate(); // Prefer scalable fonts - rWrapper.FcPatternAddBool( pPattern, FC_SCALABLE, FcTrue ); + FcPatternAddBool(pPattern, FC_SCALABLE, FcTrue); const rtl::OString aTargetName = rtl::OUStringToOString( rFontName, RTL_TEXTENCODING_UTF8 ); const FcChar8* pTargetNameUtf8 = (FcChar8*)aTargetName.getStr(); - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 ); + FcPatternAddString(pPattern, FC_FAMILY, pTargetNameUtf8); if( rLangAttrib.getLength() ) { @@ -1118,42 +761,42 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, pLangAttribUtf8 = (FcChar8*)"pa"; else pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr(); - rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 ); + FcPatternAddString(pPattern, FC_LANG, pLangAttribUtf8); } // Add required Unicode characters, if any if ( rMissingCodes.getLength() ) { - FcCharSet *unicodes = rWrapper.FcCharSetCreate(); + FcCharSet *unicodes = FcCharSetCreate(); for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); ) { // also handle unicode surrogates const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex ); - rWrapper.FcCharSetAddChar( unicodes, nCode ); + FcCharSetAddChar( unicodes, nCode ); } - rWrapper.FcPatternAddCharSet( pPattern, FC_CHARSET, unicodes); - rWrapper.FcCharSetDestroy( unicodes ); + FcPatternAddCharSet(pPattern, FC_CHARSET, unicodes); + FcCharSetDestroy(unicodes); } - addtopattern(rWrapper, pPattern, rItalic, rWeight, rWidth, rPitch); + addtopattern(pPattern, rItalic, rWeight, rWidth, rPitch); // query fontconfig for a substitute - rWrapper.FcConfigSubstitute( rWrapper.FcConfigGetCurrent(), pPattern, FcMatchPattern ); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(FcConfigGetCurrent(), pPattern, FcMatchPattern); + FcDefaultSubstitute(pPattern); // process the result of the fontconfig query FcResult eResult = FcResultNoMatch; FcFontSet* pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( rWrapper.FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult ); - rWrapper.FcPatternDestroy( pPattern ); + FcPattern* pResult = FcFontSetMatch(FcConfigGetCurrent(), &pFontSet, 1, pPattern, &eResult); + FcPatternDestroy( pPattern ); FcFontSet* pSet = NULL; if( pResult ) { - pSet = rWrapper.FcFontSetCreate(); + pSet = FcFontSetCreate(); // info: destroying the pSet destroys pResult implicitly // since pResult was "added" to pSet - rWrapper.FcFontSetAdd( pSet, pResult ); + FcFontSetAdd( pSet, pResult ); } if( pSet ) @@ -1162,7 +805,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, { //extract the closest match FcChar8* family = NULL; - FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family ); + FcResult eFileRes = FcPatternGetString( pSet->fonts[0], FC_FAMILY, 0, &family ); // get the family name if( eFileRes == FcResultMatch ) @@ -1175,13 +818,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, int val = 0; - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WEIGHT, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WEIGHT, 0, &val)) rWeight = convertWeight(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SLANT, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SLANT, 0, &val)) rItalic = convertSlant(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_SPACING, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_SPACING, 0, &val)) rPitch = convertSpacing(val); - if ( FcResultMatch == rWrapper.FcPatternGetInteger( pSet->fonts[0], FC_WIDTH, 0, &val)) + if (FcResultMatch == FcPatternGetInteger(pSet->fonts[0], FC_WIDTH, 0, &val)) rWidth = convertWidth(val); } @@ -1191,13 +834,13 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, sal_uInt32* pRemainingCodes = (sal_uInt32*)alloca( rMissingCodes.getLength() * sizeof(sal_uInt32) ); int nRemainingLen = 0; FcCharSet* unicodes; - if( !rWrapper.FcPatternGetCharSet( pSet->fonts[0], FC_CHARSET, 0, &unicodes ) ) + if (!FcPatternGetCharSet(pSet->fonts[0], FC_CHARSET, 0, &unicodes)) { for( sal_Int32 nStrIndex = 0; nStrIndex < rMissingCodes.getLength(); ) { // also handle unicode surrogates const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex ); - if( rWrapper.FcCharSetHasChar( unicodes, nCode ) != FcTrue ) + if (FcCharSetHasChar(unicodes, nCode) != FcTrue) pRemainingCodes[ nRemainingLen++ ] = nCode; } } @@ -1205,7 +848,7 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, } } - rWrapper.FcFontSetDestroy( pSet ); + FcFontSetDestroy( pSet ); } return aName; @@ -1217,18 +860,12 @@ public: FontConfigFontOptions() : mpPattern(0) {} ~FontConfigFontOptions() { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( rWrapper.isValid() ) - rWrapper.FcPatternDestroy( mpPattern ); + FcPatternDestroy(mpPattern); } virtual void *GetPattern(void * face, bool bEmbolden) const { - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( rWrapper.isValid() ) - { - rWrapper.FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); - rWrapper.FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); - } + FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); + FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); return mpPattern; } FcPattern* mpPattern; @@ -1238,12 +875,10 @@ ImplFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) const { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return NULL; FontConfigFontOptions* pOptions = NULL; - FcConfig* pConfig = rWrapper.FcConfigGetCurrent(); - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcConfig* pConfig = FcConfigGetCurrent(); + FcPattern* pPattern = FcPatternCreate(); OString sFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 ); @@ -1251,32 +886,33 @@ ImplFontOptions* PrintFontManager::getFontOptions( if (aI != rWrapper.m_aLocalizedToCanonical.end()) sFamily = aI->second; if( sFamily.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr() ); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)sFamily.getStr()); - addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); - rWrapper.FcPatternAddDouble( pPattern, FC_PIXEL_SIZE, nSize); + addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); + FcPatternAddDouble(pPattern, FC_PIXEL_SIZE, nSize); FcBool embitmap = true, antialias = true, autohint = true, hinting = true; int hintstyle = FC_HINT_FULL; - rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern ); - if (subcallback) subcallback(pPattern); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(pConfig, pPattern, FcMatchPattern); + if (subcallback) + subcallback(pPattern); + FcDefaultSubstitute(pPattern); FcResult eResult = FcResultNoMatch; FcFontSet* pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); + FcPattern* pResult = FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); if( pResult ) { - FcResult eEmbeddedBitmap = rWrapper.FcPatternGetBool(pResult, + FcResult eEmbeddedBitmap = FcPatternGetBool(pResult, FC_EMBEDDED_BITMAP, 0, &embitmap); - FcResult eAntialias = rWrapper.FcPatternGetBool(pResult, + FcResult eAntialias = FcPatternGetBool(pResult, FC_ANTIALIAS, 0, &antialias); - FcResult eAutoHint = rWrapper.FcPatternGetBool(pResult, + FcResult eAutoHint = FcPatternGetBool(pResult, FC_AUTOHINT, 0, &autohint); - FcResult eHinting = rWrapper.FcPatternGetBool(pResult, + FcResult eHinting = FcPatternGetBool(pResult, FC_HINTING, 0, &hinting); - /*FcResult eHintStyle =*/ rWrapper.FcPatternGetInteger(pResult, + /*FcResult eHintStyle =*/ FcPatternGetInteger(pResult, FC_HINT_STYLE, 0, &hintstyle); pOptions = new FontConfigFontOptions; @@ -1302,7 +938,7 @@ ImplFontOptions* PrintFontManager::getFontOptions( } // cleanup - rWrapper.FcPatternDestroy( pPattern ); + FcPatternDestroy( pPattern ); return pOptions; } @@ -1310,11 +946,9 @@ ImplFontOptions* PrintFontManager::getFontOptions( bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ) { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); - if( ! rWrapper.isValid() ) - return false; - FcConfig* pConfig = rWrapper.FcConfigGetCurrent(); - FcPattern* pPattern = rWrapper.FcPatternCreate(); + FcConfig* pConfig = FcConfigGetCurrent(); + FcPattern* pPattern = FcPatternCreate(); OString aLangAttrib; // populate pattern with font characteristics @@ -1330,29 +964,29 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star aLangAttrib = OUStringToOString( aLang.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } if( aLangAttrib.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr() ); + FcPatternAddString(pPattern, FC_LANG, (FcChar8*)aLangAttrib.getStr()); OString aFamily = OUStringToOString( rInfo.m_aFamilyName, RTL_TEXTENCODING_UTF8 ); if( aFamily.getLength() ) - rWrapper.FcPatternAddString( pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr() ); + FcPatternAddString(pPattern, FC_FAMILY, (FcChar8*)aFamily.getStr()); - addtopattern(rWrapper, pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); + addtopattern(pPattern, rInfo.m_eItalic, rInfo.m_eWeight, rInfo.m_eWidth, rInfo.m_ePitch); - rWrapper.FcConfigSubstitute( pConfig, pPattern, FcMatchPattern ); - rWrapper.FcDefaultSubstitute( pPattern ); + FcConfigSubstitute(pConfig, pPattern, FcMatchPattern); + FcDefaultSubstitute(pPattern); FcResult eResult = FcResultNoMatch; FcFontSet *pFontSet = rWrapper.getFontSet(); - FcPattern* pResult = rWrapper.FcFontSetMatch( pConfig, &pFontSet, 1, pPattern, &eResult ); + FcPattern* pResult = FcFontSetMatch(pConfig, &pFontSet, 1, pPattern, &eResult); bool bSuccess = false; if( pResult ) { - FcFontSet* pSet = rWrapper.FcFontSetCreate(); - rWrapper.FcFontSetAdd( pSet, pResult ); + FcFontSet* pSet = FcFontSetCreate(); + FcFontSetAdd( pSet, pResult ); if( pSet->nfont > 0 ) { //extract the closest match FcChar8* file = NULL; - FcResult eFileRes = rWrapper.FcPatternGetString( pSet->fonts[0], FC_FILE, 0, &file ); + FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file); if( eFileRes == FcResultMatch ) { OString aDir, aBase, aOrgPath( (sal_Char*)file ); @@ -1365,11 +999,11 @@ bool PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const com::sun::star } // info: destroying the pSet destroys pResult implicitly // since pResult was "added" to pSet - rWrapper.FcFontSetDestroy( pSet ); + FcFontSetDestroy( pSet ); } // cleanup - rWrapper.FcPatternDestroy( pPattern ); + FcPatternDestroy( pPattern ); return bSuccess; } diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index a850ec14bb28..1e8c378c8166 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -436,7 +436,7 @@ extern "C" { static void lcl_signal_action(int nSignal) { - fprintf( stderr, "Signal %d during fontconfig initialization called, ignoring fontconfig\n", nSignal ); + fprintf( stderr, "Signal %d during cups initialization called, ignoring cups\n", nSignal ); siglongjmp( aViolationBuffer, 1 ); } } -- cgit v1.2.3 From 17e84ae72d784c9c5c1b9ebc3eb3c5fb989121e8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 13:27:19 +0100 Subject: add comphelper as a depend if we use comphelper includes --- basegfx/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basegfx/prj/build.lst b/basegfx/prj/build.lst index 01a39b6d964f..8d55325d4f93 100644 --- a/basegfx/prj/build.lst +++ b/basegfx/prj/build.lst @@ -1,4 +1,4 @@ -fx basegfx : o3tl sal offapi cppuhelper cppu CPPUNIT:cppunit NULL +fx basegfx : o3tl sal offapi comphelper cppuhelper cppu CPPUNIT:cppunit NULL fx basegfx usr1 - all fx_mkout NULL fx basegfx\inc nmake - all fx_inc NULL fx basegfx\prj get - all fx_prj NULL -- cgit v1.2.3 From 97529fc38405cb75a7c924d8f228fa28b2a82f6c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 23 Jun 2011 00:24:38 +0300 Subject: Fix includes for MinGW cross-compilation Don't use backslashes. Use correct case in header names. --- dtrans/source/win32/clipb/WinClipbImpl.cxx | 14 +++++++------- dtrans/source/win32/clipb/WinClipbImpl.hxx | 2 +- dtrans/source/win32/dtobj/DOTransferable.cxx | 6 +++--- dtrans/source/win32/dtobj/DTransHelper.hxx | 2 +- dtrans/source/win32/dtobj/DataFmtTransl.cxx | 4 ++-- dtrans/source/win32/dtobj/DtObjFactory.cxx | 2 +- dtrans/source/win32/dtobj/Fetc.cxx | 2 +- dtrans/source/win32/dtobj/FetcList.cxx | 4 ++-- dtrans/source/win32/dtobj/FmtFilter.cxx | 4 ++-- dtrans/source/win32/dtobj/TxtCnvtHlp.cxx | 2 +- dtrans/source/win32/dtobj/XNotifyingDataObject.cxx | 6 +++--- dtrans/source/win32/dtobj/XTDataObject.cxx | 2 +- dtrans/source/win32/ftransl/ftransl.cxx | 2 +- dtrans/source/win32/ftransl/ftransl.hxx | 2 +- dtrans/source/win32/workbench/XTDo.cxx | 2 +- dtrans/source/win32/workbench/test_wincb.cxx | 2 +- dtrans/test/win32/dnd/transferable.hxx | 2 +- 17 files changed, 30 insertions(+), 30 deletions(-) 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 -#include "..\..\inc\DtObjFactory.hxx" -#include "..\dtobj\APNDataObject.hxx" +#include "../../inc/DtObjFactory.hxx" +#include "../dtobj/APNDataObject.hxx" #include "WinClipboard.hxx" #include -#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 #include #include -#include "..\..\inc\MtaOleClipb.hxx" +#include "../../inc/MtaOleClipb.hxx" #if defined _MSC_VER #pragma warning(push,1) 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 #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 #include #include -#include "..\misc\ImplHelper.hxx" -#include "..\misc\WinClip.hxx" +#include "../misc/ImplHelper.hxx" +#include "../misc/WinClip.hxx" #include "MimeAttrib.hxx" #include "DTransHelper.hxx" #include 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 #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 #include "DataFmtTransl.hxx" -#include "..\misc\ImplHelper.hxx" -#include "..\misc\WinClip.hxx" +#include "../misc/ImplHelper.hxx" +#include "../misc/WinClip.hxx" #include 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 +#include #include -#include +#include #include #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 #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 #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 -#include "..\misc\ImplHelper.hxx" +#include "../misc/ImplHelper.hxx" #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include 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 -#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 #include #include -#include "..\misc\WinClip.hxx" +#include "../misc/WinClip.hxx" #include 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 -#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 -#include "..\..\source\win32\ImplHelper.hxx" +#include "../../source/win32/ImplHelper.hxx" //------------------------------------------------------------- -- cgit v1.2.3 From 588fe79ac95ead46bf4130c059b437581dcc2fae Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 23 Jun 2011 00:26:03 +0300 Subject: Use the newly introduced sehandler.hxx (now in solenv/wntgcci/inc) Where the OOo MinGW people get their __SEHandler from, no idea. --- dtrans/source/win32/misc/ImplHelper.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/dtrans/source/win32/misc/ImplHelper.cxx index d2a79e3d0af8..0a189577d880 100644 --- a/dtrans/source/win32/misc/ImplHelper.cxx +++ b/dtrans/source/win32/misc/ImplHelper.cxx @@ -47,8 +47,7 @@ #pragma warning(pop) #endif #ifdef __MINGW32__ -#include -#include +#include #endif //------------------------------------------------------------------------ @@ -189,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; -- cgit v1.2.3 From ace57f2d4ac15557667127d64ac43136fd1d7858 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 22:38:54 +0100 Subject: ditch unused inline methods --- vcl/inc/vcl/svapp.hxx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 85e902161a48..231d754ab7fb 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -184,10 +184,6 @@ public: const UniString& GetData() const { return aData; } const ApplicationAddress& GetAppAddress() const { return aAppAddr; } - sal_Bool IsOpenEvent() const; - sal_Bool IsPrintEvent() const; - sal_Bool IsDiskInsertEvent() const; - sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); } UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); } }; @@ -203,30 +199,6 @@ inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, { } -inline sal_Bool ApplicationEvent::IsOpenEvent() const -{ - if ( aEvent.Equals( APPEVENT_OPEN_STRING )) - return sal_True; - else - return sal_False; -} - -inline sal_Bool ApplicationEvent::IsPrintEvent() const -{ - if ( aEvent.Equals( APPEVENT_PRINT_STRING )) - return sal_True; - else - return sal_False; -} - -inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const -{ - if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING )) - return sal_True; - else - return sal_False; -} - class VCL_DLLPUBLIC PropertyHandler { public: -- cgit v1.2.3 From 2d73bf30420c72b63413c27d9484a242b55259e1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 22:39:39 +0100 Subject: ditch unused APPEVENT strings --- vcl/inc/vcl/svapp.hxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 231d754ab7fb..baeb3044abf7 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -161,8 +161,6 @@ inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& r #define APPEVENT_OPEN_STRING "Open" #define APPEVENT_PRINT_STRING "Print" -#define APPEVENT_DISKINSERT_STRING "DiskInsert" -#define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments" class VCL_DLLPUBLIC ApplicationEvent { -- cgit v1.2.3 From 9eca65e23a126f8c74e4f0dd0552a019b837feea Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 23:11:00 +0100 Subject: ByteString->rtl::OString --- vcl/inc/vcl/svapp.hxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index baeb3044abf7..d78d42cf1d52 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -166,7 +166,7 @@ class VCL_DLLPUBLIC ApplicationEvent { private: UniString aSenderAppName; // Absender Applikationsname - ByteString aEvent; // Event + rtl::OString m_aEvent; // Event UniString aData; // Uebertragene Daten ApplicationAddress aAppAddr; // Absender Addresse @@ -174,11 +174,11 @@ public: ApplicationEvent() {} ApplicationEvent( const UniString& rSenderAppName, const ApplicationAddress& rAppAddr, - const ByteString& rEvent, + const rtl::OString& rEvent, const UniString& rData ); const UniString& GetSenderAppName() const { return aSenderAppName; } - const ByteString& GetEvent() const { return aEvent; } + const rtl::OString& GetEvent() const { return m_aEvent; } const UniString& GetData() const { return aData; } const ApplicationAddress& GetAppAddress() const { return aAppAddr; } @@ -188,10 +188,10 @@ public: inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, const ApplicationAddress& rAppAddr, - const ByteString& rEvent, + const rtl::OString& rEvent, const UniString& rData ) : aSenderAppName( rSenderAppName ), - aEvent( rEvent ), + m_aEvent( rEvent ), aData( rData ), aAppAddr( rAppAddr ) { -- cgit v1.2.3 From a34626180887aa9f5d453924982b8ad04c546cda Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Jun 2011 23:35:43 +0100 Subject: this method is debugging only --- vcl/inc/unx/saldisp.hxx | 5 +++-- vcl/unx/generic/app/saldisp.cxx | 12 ++++++------ vcl/unx/generic/window/salframe.cxx | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 7248f87fbd35..194e050df2b0 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -420,8 +420,9 @@ public: bool DispatchInternalEvent(); void PrintInfo() const; - void PrintEvent( const ByteString &rComment, - XEvent *pEvent ) const; +#ifdef DBG_UTIL + void DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const; +#endif void Beep() const; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 358bbc205004..90d65efbd921 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2358,7 +2358,7 @@ void SalX11Display::Yield() if( pXLib_->HasXErrorOccurred() ) { XFlush( pDisp_ ); - PrintEvent( "SalDisplay::Yield (WasXError)", &aEvent ); + DbgPrintDisplayEvent("SalDisplay::Yield (WasXError)", &aEvent); } #endif pXLib_->ResetXErrorOccurred(); @@ -2475,14 +2475,13 @@ long SalX11Display::Dispatch( XEvent *pEvent ) return 0; } -// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -void SalDisplay::PrintEvent( const ByteString &rComment, - XEvent *pEvent ) const +#ifdef DBG_UTIL +void SalDisplay::DbgPrintDisplayEvent(const char *pComment, XEvent *pEvent) const { if( pEvent->type <= MappingNotify ) { fprintf( stderr, "[%s] %s s=%d w=%ld\n", - rComment.GetBuffer(), + pComment, EventNames[pEvent->type], pEvent->xany.send_event, pEvent->xany.window ); @@ -2609,11 +2608,12 @@ void SalDisplay::PrintEvent( const ByteString &rComment, } else fprintf( stderr, "[%s] %d s=%d w=%ld\n", - rComment.GetBuffer(), + pComment, pEvent->type, pEvent->xany.send_event, pEvent->xany.window ); } +#endif // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= void SalDisplay::PrintInfo() const diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 1fdfc02c3916..2c1c94ae46c3 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -4241,7 +4241,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) CaptureMouse( sal_True ); #ifdef DBG_UTIL if( -1 != nCaptured_ ) - pDisplay_->PrintEvent( "Captured", pEvent ); + pDisplay_->DbgPrintDisplayEvent("Captured", pEvent); #endif } -- cgit v1.2.3 From f1251f68b178860c33521254c9dd4d9b35a96202 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:03:52 +0100 Subject: remove parse ByteString variant --- svl/inc/svl/inettype.hxx | 31 --------------------------- svl/source/misc/inettype.cxx | 45 --------------------------------------- svtools/source/svhtml/parhtml.cxx | 7 +++--- 3 files changed, 3 insertions(+), 80 deletions(-) diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 8f667ae908d4..54dbda7b75d4 100644 --- a/svl/inc/svl/inettype.hxx +++ b/svl/inc/svl/inettype.hxx @@ -382,37 +382,6 @@ public: 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 diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 819d9026f1d6..762f53061dcf 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -1147,51 +1147,6 @@ INetContentType INetContentTypes::MapStringToContentType(UniString const & 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, diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 8cf6f406e2bd..b431d0d931c7 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -2266,11 +2266,10 @@ bool HTMLParser::ParseMetaOptions( rtl_TextEncoding HTMLParser::GetEncodingByMIME( const String& rMime ) { - ByteString sType; - ByteString sSubType; + String sType; + String sSubType; INetContentTypeParameterList aParameters; - ByteString sMime( rMime, RTL_TEXTENCODING_ASCII_US ); - if (INetContentTypes::parse(sMime, sType, sSubType, &aParameters)) + if (INetContentTypes::parse(rMime, sType, sSubType, &aParameters)) { const INetContentTypeParameter * pCharset = aParameters.find("charset"); -- cgit v1.2.3 From d17279e61aed460c83a6a7da4d41eadd0434fa0f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:16:22 +0100 Subject: ditch unused stream operators --- svl/inc/svl/ownlist.hxx | 3 --- svl/source/misc/ownlist.cxx | 58 --------------------------------------------- 2 files changed, 61 deletions(-) diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 6bb9f311119b..75dd88afee5c 100644 --- a/svl/inc/svl/ownlist.hxx +++ b/svl/inc/svl/ownlist.hxx @@ -98,9 +98,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/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(); -- cgit v1.2.3 From 4e7325d751bba2333453a82e171d18c3245b976c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:30:40 +0100 Subject: ditch other unused stream operators --- svl/inc/svl/ownlist.hxx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx index 75dd88afee5c..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; -- cgit v1.2.3 From 124a30f47b1fea9921f5b901f22bacc536a53ce0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:34:11 +0100 Subject: anonymous namespaces work fine now --- svl/source/misc/urihelper.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index ac70f8a6e467..541892b9dfe5 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -65,10 +65,6 @@ #include #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) { @@ -422,7 +418,7 @@ rtl::OUString URIHelper::simpleNormalizedMakeRelative( // //============================================================================ -namespace unnamed_svl_urihelper { +namespace { inline xub_StrLen nextChar(UniString const & rStr, xub_StrLen nPos) { -- cgit v1.2.3 From fe64e6fc81e9c1f75c065dc6109e17d3076aabef Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:40:27 +0100 Subject: use OString::equalsL --- tools/source/rc/isofallback.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/source/rc/isofallback.cxx b/tools/source/rc/isofallback.cxx index e2a82a865b94..2fae5cfc9eee 100644 --- a/tools/source/rc/isofallback.cxx +++ b/tools/source/rc/isofallback.cxx @@ -42,7 +42,7 @@ bool GetIsoFallback(rtl::OString& rLanguage) sal_Int32 nSepPos = rLanguage.indexOf('-'); if (nSepPos == -1) { - if (rLanguage == rtl::OString(RTL_CONSTASCII_STRINGPARAM("en"))) + if (rLanguage.equalsL(RTL_CONSTASCII_STRINGPARAM("en"))) { // en -> "" rLanguage = rtl::OString(); -- cgit v1.2.3 From d7f0047e6365e9eac8654cfab2b757e50a2f72a2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:49:14 +0100 Subject: Remove unused SmartRel2Abs variant --- svl/inc/svl/urihelper.hxx | 27 --------------------------- svl/source/misc/urihelper.cxx | 18 ------------------ 2 files changed, 45 deletions(-) diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 3baab37f7896..b5bf4d6a119b 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx @@ -49,33 +49,6 @@ class UniString; //============================================================================ namespace URIHelper { -/** - @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, - 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 diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 541892b9dfe5..3f46d8ab9f5b 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -146,24 +146,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, -- cgit v1.2.3 From 0d1fc0ca49b672c70d2ba29d651628c7cb0f8a17 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 00:49:47 +0100 Subject: remove unused forward declaration --- svl/inc/svl/urihelper.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index b5bf4d6a119b..67326861642c 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; -- cgit v1.2.3 From 921fd5f5d533c1aae8fd339b7ce35189e21fb5cb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 09:02:47 +0100 Subject: Resolves: fdo#33509 Context menu in spellcheck in RTL UI closes too early --- vcl/source/window/floatwin.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 118c60f214cc..72847ab17bc7 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -697,13 +697,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags ) // so they can be compared across different frames // !!! rRect is expected to be in screen coordinates of the parent frame window !!! maFloatRect = rRect; - if( GetParent()->ImplHasMirroredGraphics() ) + + Window *pReference = GetParent(); + + // compare coordinates in absolute screen coordinates + // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509 + if( pReference->ImplHasMirroredGraphics() ) { - maFloatRect.SetPos( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ); - maFloatRect = GetParent()->ImplOutputToUnmirroredAbsoluteScreenPixel( maFloatRect ); + if(!pReference->IsRTLEnabled() ) + // --- RTL --- re-mirror back to get device coordiantes + pReference->ImplReMirror(maFloatRect); + + maFloatRect.SetPos(pReference->ScreenToOutputPixel(maFloatRect.TopLeft())); + maFloatRect = pReference->ImplOutputToUnmirroredAbsoluteScreenPixel(maFloatRect); } else - maFloatRect.SetPos( GetParent()->OutputToAbsoluteScreenPixel( GetParent()->ScreenToOutputPixel( rRect.TopLeft() ) ) ); + maFloatRect.SetPos(pReference->OutputToAbsoluteScreenPixel(pReference->ScreenToOutputPixel(rRect.TopLeft()))); maFloatRect.Left() -= 2; maFloatRect.Top() -= 2; -- cgit v1.2.3 From 8ade517f3d7d30c048cae3bf218e7f4df6ed83d9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 21 Jun 2011 13:25:16 +0200 Subject: fix crash when changing screen resolution - m_aXineramaScreenIndexMap in GtkSalDisplay was shadowing the same field in SalDisplay, which led to crash in saldisp.cxx code in SalDisplay::addXineramaScreenUnique --- vcl/inc/unx/gtk/gtkdata.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 28e0f3298fb9..24860b8f80df 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -93,7 +93,6 @@ class GtkSalDisplay : public SalDisplay GdkDisplay* m_pGdkDisplay; GdkCursor *m_aCursors[ POINTER_COUNT ]; bool m_bStartupCompleted; - std::vector< int > m_aXineramaScreenIndexMap; GdkCursor* getFromXBM( const unsigned char *pBitmap, const unsigned char *pMask, int nWidth, int nHeight, int nXHot, int nYHot ); -- cgit v1.2.3 From 224b2a46820a320b196c1c4a339fe77d80235c27 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 22 Jun 2011 15:42:50 +0200 Subject: fix condition for compositing surface refresh - fixes problems on slideshow window shrinking --- canvas/source/cairo/cairo_spritecanvashelper.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- cgit v1.2.3 From 270e7e9dd759ab82b98ebfab62b4c7d5d8951f09 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 23 Jun 2011 13:35:01 +0200 Subject: make sure we send resize event to fullscreen windows - this fixes regression of i#86302 fix. it happens when screen is resized (by xrandr for example) and the fullscreen windows are not notified about their size change, because they don't have sizeable style set --- vcl/unx/gtk/window/gtkframe.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index b0988f6fb1b1..089a67344271 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -3069,7 +3069,7 @@ gboolean GtkSalFrame::signalConfigure( GtkWidget*, GdkEventConfigure* pEvent, gp * - which is not good since the window manager will now size the window back to this * wrong size at some point. */ - if( (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) + if( pThis->m_bFullscreen || (pThis->m_nStyle & (SAL_FRAME_STYLE_SIZEABLE | SAL_FRAME_STYLE_PLUG)) == SAL_FRAME_STYLE_SIZEABLE ) { if( pEvent->width != (int)pThis->maGeometry.nWidth || pEvent->height != (int)pThis->maGeometry.nHeight ) { -- cgit v1.2.3 From 301d17aa879d7225edf4eb18716479182f7f4299 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 23 Jun 2011 23:41:54 +0100 Subject: rtl::ByteString->rtl::OString --- vcl/inc/vcl/ppdparser.hxx | 2 +- vcl/unx/generic/printer/ppdparser.cxx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index 7082c020c7a2..806677a0e621 100644 --- a/vcl/inc/vcl/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -186,7 +186,7 @@ private: PPDParser( const String& rFile ); ~PPDParser(); - void parseOrderDependency( const ByteString& rLine ); + void parseOrderDependency(const rtl::OString& rLine); void parseOpenUI( const ByteString& rLine ); void parseConstraint( const ByteString& rLine ); void parse( std::list< ByteString >& rLines ); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 3246e18fc806..8d6b9c302193 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -1211,12 +1211,12 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) pKey->m_eUIType = PPDKey::PickOne; } -void PPDParser::parseOrderDependency( const ByteString& rLine ) +void PPDParser::parseOrderDependency(const rtl::OString& rLine) { - ByteString aLine( rLine ); - int nPos = aLine.Search( ':' ); - if( nPos != STRING_NOTFOUND ) - aLine.Erase( 0, nPos+1 ); + rtl::OString aLine(rLine); + sal_Int32 nPos = aLine.indexOf(':'); + if( nPos != -1 ) + aLine = aLine.copy( nPos+1 ); int nOrder = GetCommandLineToken( 0, aLine ).ToInt32(); ByteString aSetup = GetCommandLineToken( 1, aLine ); -- cgit v1.2.3 From 6ea5ea262b8e6b18ed62165ef559d26ae7ee222a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 24 Jun 2011 00:18:15 +0100 Subject: rtl::ByteString->rtl::OString --- vcl/inc/vcl/ppdparser.hxx | 8 ++++---- vcl/inc/vcl/strhelper.hxx | 8 ++++---- vcl/source/helper/strhelper.cxx | 29 ++++++++++++++--------------- vcl/unx/generic/printer/ppdparser.cxx | 35 +++++++++++++++++++---------------- 4 files changed, 41 insertions(+), 39 deletions(-) diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index 806677a0e621..474d847e2607 100644 --- a/vcl/inc/vcl/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -187,11 +187,11 @@ private: ~PPDParser(); void parseOrderDependency(const rtl::OString& rLine); - void parseOpenUI( const ByteString& rLine ); - void parseConstraint( const ByteString& rLine ); - void parse( std::list< ByteString >& rLines ); + void parseOpenUI(const rtl::OString& rLine); + void parseConstraint(const rtl::OString& rLine); + void parse( std::list< rtl::OString >& rLines ); - String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized ); + String handleTranslation(const rtl::OString& i_rString, bool i_bIsGlobalized); static void scanPPDDir( const String& rDir ); static void initPPDFiles(); diff --git a/vcl/inc/vcl/strhelper.hxx b/vcl/inc/vcl/strhelper.hxx index 6f1ec6646a6f..62e4fc072bdd 100644 --- a/vcl/inc/vcl/strhelper.hxx +++ b/vcl/inc/vcl/strhelper.hxx @@ -38,17 +38,17 @@ namespace psp { String VCL_DLLPUBLIC GetCommandLineToken( int, const String& ); -ByteString VCL_DLLPUBLIC GetCommandLineToken( int, const ByteString& ); +rtl::OString VCL_DLLPUBLIC GetCommandLineToken(int, const rtl::OString&); // gets one token of a unix command line style string // doublequote, singlequote and singleleftquote protect their respective // contents int VCL_DLLPUBLIC GetCommandLineTokenCount( const String& ); -int VCL_DLLPUBLIC GetCommandLineTokenCount( const ByteString& ); +int VCL_DLLPUBLIC GetCommandLineTokenCount(const rtl::OString&); // returns number of tokens (zero if empty or whitespace only) String VCL_DLLPUBLIC WhitespaceToSpace( const String&, sal_Bool bProtect = sal_True ); -ByteString VCL_DLLPUBLIC WhitespaceToSpace( const ByteString&, sal_Bool bProtect = sal_True ); +rtl::OString VCL_DLLPUBLIC WhitespaceToSpace(const rtl::OString&, sal_Bool bProtect = sal_True); // returns a string with multiple adjacent occurrences of whitespace // converted to a single space. if bProtect is sal_True (nonzero), then // doublequote, singlequote and singleleftquote protect their respective @@ -61,7 +61,7 @@ inline double VCL_DLLPUBLIC StringToDouble( const String& rStr ) return rtl::math::stringToDouble(rStr, sal_Unicode('.'), sal_Unicode(0)); } -inline double VCL_DLLPUBLIC StringToDouble( const ByteString& rStr ) +inline double VCL_DLLPUBLIC StringToDouble(const rtl::OString& rStr) { return rtl::math::stringToDouble(rStr, '.', static_cast(0)); } diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index c8b5cc7fbf22..c192431e87e6 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -173,15 +173,15 @@ String GetCommandLineToken( int nToken, const String& rLine ) return aRet; } -ByteString GetCommandLineToken( int nToken, const ByteString& rLine ) +rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine) { - int nLen = rLine.Len(); - if( ! nLen ) - return ByteString(); + sal_Int32 nLen = rLine.getLength(); + if (!nLen) + return rLine; int nActualToken = 0; char* pBuffer = (char*)alloca( nLen + 1 ); - const char* pRun = rLine.GetBuffer(); + const char* pRun = rLine.getStr(); char* pLeap = NULL; while( *pRun && nActualToken <= nToken ) @@ -275,13 +275,13 @@ int GetCommandLineTokenCount( const String& rLine ) return nTokenCount; } -int GetCommandLineTokenCount( const ByteString& rLine ) +int GetCommandLineTokenCount(const rtl::OString& rLine) { - if( ! rLine.Len() ) + if (rLine.isEmpty()) return 0; int nTokenCount = 0; - const char *pRun = rLine.GetBuffer(); + const char *pRun = rLine.getStr(); while( *pRun ) @@ -383,14 +383,14 @@ String WhitespaceToSpace( const String& rLine, sal_Bool bProtect ) return aRet; } -ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect ) +rtl::OString WhitespaceToSpace(const rtl::OString& rLine, sal_Bool bProtect) { - int nLen = rLine.Len(); - if( ! nLen ) - return ByteString(); + sal_Int32 nLen = rLine.getLength(); + if (!nLen) + return rLine; char *pBuffer = (char*)alloca( nLen + 1 ); - const char *pRun = rLine.GetBuffer(); + const char *pRun = rLine.getStr(); char *pLeap = pBuffer; while( *pRun ) @@ -436,8 +436,7 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect ) if( *pLeap == ' ' ) *pLeap = 0; - ByteString aRet( *pBuffer == ' ' ? pBuffer+1 : pBuffer ); - return aRet; + return rtl::OString(*pBuffer == ' ' ? pBuffer+1 : pBuffer); } } // namespace diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 8d6b9c302193..91643d6646b2 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -696,7 +696,7 @@ PPDParser::PPDParser( const String& rFile ) : m_pTranslator( new PPDTranslator() ) { // read in the file - std::list< ByteString > aLines; + std::list< rtl::OString > aLines; PPDDecompressStream aStream( m_aFile ); bool bLanguageEncoding = false; if( aStream.IsOpen() ) @@ -897,11 +897,11 @@ static sal_uInt8 getNibble( sal_Char cChar ) return nRet; } -String PPDParser::handleTranslation( const ByteString& i_rString, bool bIsGlobalized ) +String PPDParser::handleTranslation(const rtl::OString& i_rString, bool bIsGlobalized) { - int nOrigLen = i_rString.Len(); + sal_Int32 nOrigLen = i_rString.getLength(); OStringBuffer aTrans( nOrigLen ); - const sal_Char* pStr = i_rString.GetBuffer(); + const sal_Char* pStr = i_rString.getStr(); const sal_Char* pEnd = pStr + nOrigLen; while( pStr < pEnd ) { @@ -923,9 +923,9 @@ String PPDParser::handleTranslation( const ByteString& i_rString, bool bIsGlobal return OStringToOUString( aTrans.makeStringAndClear(), bIsGlobalized ? RTL_TEXTENCODING_UTF8 : m_aFileEncoding ); } -void PPDParser::parse( ::std::list< ByteString >& rLines ) +void PPDParser::parse( ::std::list< rtl::OString >& rLines ) { - std::list< ByteString >::iterator line = rLines.begin(); + std::list< rtl::OString >::iterator line = rLines.begin(); PPDParser::hash_type::const_iterator keyit; while( line != rLines.end() ) { @@ -1027,7 +1027,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) { // copy the newlines also aLine += '\n'; - aLine += *line; + aLine += ByteString(*line); ++line; } } @@ -1142,7 +1142,9 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) if( nPos != STRING_NOTFOUND ) { aKey.Erase( nPos ); - String aOption( WhitespaceToSpace( aLine.Copy( nPos+9 ) ), RTL_TEXTENCODING_MS_1252 ); + rtl::OUString aOption(rtl::OStringToOUString( + WhitespaceToSpace(aLine.Copy(nPos+9)), + RTL_TEXTENCODING_MS_1252)); keyit = m_aKeys.find( aKey ); if( keyit != m_aKeys.end() ) { @@ -1171,7 +1173,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) } } -void PPDParser::parseOpenUI( const ByteString& rLine ) +void PPDParser::parseOpenUI(const rtl::OString& rLine) { String aTranslation; ByteString aKey = rLine; @@ -1202,7 +1204,8 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) pKey->m_bUIOption = true; m_pTranslator->insertKey( pKey->getKey(), aTranslation ); - ByteString aValue = WhitespaceToSpace( rLine.GetToken( 1, ':' ) ); + sal_Int32 nIndex = 0; + ByteString aValue = WhitespaceToSpace( rLine.getToken( 1, ':', nIndex ) ); if( aValue.CompareIgnoreCaseToAscii( "boolean" ) == COMPARE_EQUAL ) pKey->m_eUIType = PPDKey::Boolean; else if( aValue.CompareIgnoreCaseToAscii( "pickmany" ) == COMPARE_EQUAL ) @@ -1218,9 +1221,9 @@ void PPDParser::parseOrderDependency(const rtl::OString& rLine) if( nPos != -1 ) aLine = aLine.copy( nPos+1 ); - int nOrder = GetCommandLineToken( 0, aLine ).ToInt32(); + sal_Int32 nOrder = GetCommandLineToken( 0, aLine ).toInt32(); ByteString aSetup = GetCommandLineToken( 1, aLine ); - String aKey( GetCommandLineToken( 2, aLine ), RTL_TEXTENCODING_MS_1252 ); + String aKey(rtl::OStringToOUString(GetCommandLineToken(2, aLine), RTL_TEXTENCODING_MS_1252)); if( aKey.GetChar( 0 ) != '*' ) return; // invalid order depency aKey.Erase( 0, 1 ); @@ -1250,12 +1253,12 @@ void PPDParser::parseOrderDependency(const rtl::OString& rLine) pKey->m_eSetupType = PPDKey::AnySetup; } -void PPDParser::parseConstraint( const ByteString& rLine ) +void PPDParser::parseConstraint( const rtl::OString& rLine ) { bool bFailed = false; - String aLine( rLine, RTL_TEXTENCODING_MS_1252 ); - aLine.Erase( 0, rLine.Search( ':' )+1 ); + String aLine(rtl::OStringToOUString(rLine, RTL_TEXTENCODING_MS_1252)); + aLine.Erase(0, rLine.indexOf(':') + 1); PPDConstraint aConstraint; int nTokens = GetCommandLineTokenCount( aLine ); for( int i = 0; i < nTokens; i++ ) @@ -1291,7 +1294,7 @@ void PPDParser::parseConstraint( const ByteString& rLine ) if( ! aConstraint.m_pKey1 || ! aConstraint.m_pKey2 || bFailed ) { #ifdef __DEBUG - fprintf( stderr, "Warning: constraint \"%s\" is invalid\n", rLine.GetStr() ); + fprintf( stderr, "Warning: constraint \"%s\" is invalid\n", rLine.getStr() ); #endif } else -- cgit v1.2.3 From 115feb261aec2d396b7a26f59da084860d7e550a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 16 Jun 2011 11:46:48 +0100 Subject: make svp / headless backend's headers more public --- vcl/inc/unx/gtk/gtkgdi.hxx | 3 +- vcl/inc/unx/headless/svpbmp.hxx | 72 +++++++++ vcl/inc/unx/headless/svpdummies.hxx | 100 +++++++++++++ vcl/inc/unx/headless/svpelement.hxx | 49 +++++++ vcl/inc/unx/headless/svpframe.hxx | 132 +++++++++++++++++ vcl/inc/unx/headless/svpgdi.hxx | 174 ++++++++++++++++++++++ vcl/inc/unx/headless/svpinst.hxx | 204 ++++++++++++++++++++++++++ vcl/inc/unx/headless/svpprn.hxx | 57 +++++++ vcl/inc/unx/headless/svppspgraphics.hxx | 189 ++++++++++++++++++++++++ vcl/inc/unx/headless/svpvd.hxx | 62 ++++++++ vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 4 +- vcl/unx/headless/svpbmp.cxx | 2 +- vcl/unx/headless/svpbmp.hxx | 72 --------- vcl/unx/headless/svpdummies.cxx | 4 +- vcl/unx/headless/svpdummies.hxx | 100 ------------- vcl/unx/headless/svpelement.cxx | 8 +- vcl/unx/headless/svpelement.hxx | 49 ------- vcl/unx/headless/svpframe.cxx | 6 +- vcl/unx/headless/svpframe.hxx | 132 ----------------- vcl/unx/headless/svpgdi.cxx | 6 +- vcl/unx/headless/svpgdi.hxx | 174 ---------------------- vcl/unx/headless/svpinst.cxx | 10 +- vcl/unx/headless/svpinst.hxx | 204 -------------------------- vcl/unx/headless/svpprn.cxx | 6 +- vcl/unx/headless/svpprn.hxx | 57 ------- vcl/unx/headless/svppspgraphics.cxx | 4 +- vcl/unx/headless/svppspgraphics.hxx | 189 ------------------------ vcl/unx/headless/svptext.cxx | 6 +- vcl/unx/headless/svpvd.cxx | 4 +- vcl/unx/headless/svpvd.hxx | 62 -------- 30 files changed, 1072 insertions(+), 1069 deletions(-) create mode 100644 vcl/inc/unx/headless/svpbmp.hxx create mode 100644 vcl/inc/unx/headless/svpdummies.hxx create mode 100644 vcl/inc/unx/headless/svpelement.hxx create mode 100644 vcl/inc/unx/headless/svpframe.hxx create mode 100644 vcl/inc/unx/headless/svpgdi.hxx create mode 100644 vcl/inc/unx/headless/svpinst.hxx create mode 100644 vcl/inc/unx/headless/svpprn.hxx create mode 100644 vcl/inc/unx/headless/svppspgraphics.hxx create mode 100644 vcl/inc/unx/headless/svpvd.hxx delete mode 100644 vcl/unx/headless/svpbmp.hxx delete mode 100644 vcl/unx/headless/svpdummies.hxx delete mode 100644 vcl/unx/headless/svpelement.hxx delete mode 100644 vcl/unx/headless/svpframe.hxx delete mode 100644 vcl/unx/headless/svpgdi.hxx delete mode 100644 vcl/unx/headless/svpinst.hxx delete mode 100644 vcl/unx/headless/svpprn.hxx delete mode 100644 vcl/unx/headless/svppspgraphics.hxx delete mode 100644 vcl/unx/headless/svpvd.hxx diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index 41e500c49027..83d4aa827da9 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -39,6 +39,8 @@ #if GTK_CHECK_VERSION(3,0,0) +#include + // Disabled for gtk3 - use legacy theming code #define GTK_GRAPHICS_DISABLED class GtkSalFrame; @@ -46,7 +48,6 @@ class GtkSalGraphics : public X11SalGraphics { public: GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ); }; - #else class GtkSalGraphics : public X11SalGraphics diff --git a/vcl/inc/unx/headless/svpbmp.hxx b/vcl/inc/unx/headless/svpbmp.hxx new file mode 100644 index 000000000000..b3adb3b9951f --- /dev/null +++ b/vcl/inc/unx/headless/svpbmp.hxx @@ -0,0 +1,72 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SVP_SVBMP_HXX +#define SVP_SVBMP_HXX + +#include +#include "svpelement.hxx" + +class SvpSalBitmap : public SalBitmap, public SvpElement +{ + basebmp::BitmapDeviceSharedPtr m_aBitmap; +public: + SvpSalBitmap() {} + virtual ~SvpSalBitmap(); + + const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; } + void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; } + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; } + + // SalBitmap + virtual bool Create( const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal ); + virtual bool Create( const SalBitmap& rSalBmp ); + virtual bool Create( const SalBitmap& rSalBmp, + SalGraphics* pGraphics ); + virtual bool Create( const SalBitmap& rSalBmp, + sal_uInt16 nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); + virtual void Destroy(); + virtual Size GetSize() const; + virtual sal_uInt16 GetBitCount() const; + + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpdummies.hxx b/vcl/inc/unx/headless/svpdummies.hxx new file mode 100644 index 000000000000..bc46e9b22f70 --- /dev/null +++ b/vcl/inc/unx/headless/svpdummies.hxx @@ -0,0 +1,100 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPDUMMIES_HXX + +#include + +#include +#include +#include + +class SalGraphics; + +class SvpSalObject : public SalObject +{ +public: + SystemChildData m_aSystemChildData; + + SvpSalObject(); + virtual ~SvpSalObject(); + + // overload all pure virtual methods + virtual void ResetClipRegion(); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + + virtual const SystemEnvData* GetSystemData() const; + + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +class SvpImeStatus : public SalI18NImeStatus +{ + public: + SvpImeStatus() {} + virtual ~SvpImeStatus(); + + virtual bool canToggle(); + virtual void toggle(); +}; + +class SvpSalSystem : public SalSystem +{ + public: + SvpSalSystem() {} + virtual ~SvpSalSystem(); + // get info about the display + virtual unsigned int GetDisplayScreenCount(); + virtual bool IsMultiDisplay(); + virtual unsigned int GetDefaultDisplayNumber(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + virtual rtl::OUString GetScreenName( unsigned int nScreen ); + + + virtual int ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton); +}; + + +#endif // _SVP_SVPDUMMIES_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpelement.hxx b/vcl/inc/unx/headless/svpelement.hxx new file mode 100644 index 000000000000..c7f647cf3a03 --- /dev/null +++ b/vcl/inc/unx/headless/svpelement.hxx @@ -0,0 +1,49 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPELEMENT_HXX +#define _SVP_SVPELEMENT_HXX + +#include + +#define SVP_DEFAULT_BITMAP_FORMAT basebmp::Format::TWENTYFOUR_BIT_TC_MASK + +class SvpElement +{ + protected: + SvpElement(); + virtual ~SvpElement(); + public: + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0; + + static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpframe.hxx b/vcl/inc/unx/headless/svpframe.hxx new file mode 100644 index 000000000000..e57381780f61 --- /dev/null +++ b/vcl/inc/unx/headless/svpframe.hxx @@ -0,0 +1,132 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPFRAME_HXX + +#include + +#include +#include "svpelement.hxx" + +#include + +class SvpSalInstance; +class SvpSalGraphics; + +class SvpSalFrame : public SalFrame, public SvpElement +{ + SvpSalInstance* m_pInstance; + SvpSalFrame* m_pParent; // pointer to parent frame + std::list< SvpSalFrame* > m_aChildren; // List of child frames + sal_uLong m_nStyle; + bool m_bVisible; + long m_nMinWidth; + long m_nMinHeight; + long m_nMaxWidth; + long m_nMaxHeight; + + SystemEnvData m_aSystemChildData; + + basebmp::BitmapDeviceSharedPtr m_aFrame; + std::list< SvpSalGraphics* > m_aGraphics; + + static SvpSalFrame* s_pFocusFrame; +public: + SvpSalFrame( SvpSalInstance* pInstance, + SalFrame* pParent, + sal_uLong nSalFrameStyle, + SystemParentData* pSystemParent = NULL ); + virtual ~SvpSalFrame(); + + void GetFocus(); + void LoseFocus(); + void PostPaint() const; + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; } + + // SalFrame + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool PostEvent( void* pData ); + + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( sal_uInt16 nIcon ); + virtual void SetMenu( SalMenu* pMenu ); + virtual void DrawMenuBar(); + + virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); + virtual void SetMinClientSize( long nWidth, long nHeight ); + virtual void SetMaxClientSize( long nWidth, long nHeight ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); + virtual void GetClientSize( long& rWidth, long& rHeight ); + virtual void GetWorkArea( Rectangle& rRect ); + virtual SalFrame* GetParent() const; + virtual void SetWindowState( const SalFrameState* pState ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); + virtual void StartPresentation( sal_Bool bStart ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); + virtual void ToTop( sal_uInt16 nFlags ); + virtual void SetPointer( PointerStyle ePointerStyle ); + virtual void CaptureMouse( sal_Bool bMouse ); + virtual void SetPointerPos( long nX, long nY ); + using SalFrame::Flush; + virtual void Flush(); + virtual void Sync(); + virtual void SetInputContext( SalInputContext* pContext ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual LanguageType GetInputLanguage(); + virtual SalBitmap* SnapShot(); + virtual void UpdateSettings( AllSettings& rSettings ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + virtual SalIndicatorState GetIndicatorState(); + virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); + virtual void SetParent( SalFrame* pNewParent ); + virtual bool SetPluginParent( SystemParentData* pNewParent ); + virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); + virtual void ResetClipRegion(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + + /*TODO: functional implementation */ + virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; } + virtual void SetApplicationID(const rtl::OUString &rApplicationID) { (void) rApplicationID; } +}; +#endif // _SVP_SVPFRAME_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpgdi.hxx b/vcl/inc/unx/headless/svpgdi.hxx new file mode 100644 index 000000000000..8291a3c2f7bc --- /dev/null +++ b/vcl/inc/unx/headless/svpgdi.hxx @@ -0,0 +1,174 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPGDI_HXX + +#include +#include + +#include +#include + +class ServerFont; + +class SvpSalGraphics : public SalGraphics +{ + basebmp::BitmapDeviceSharedPtr m_aDevice; + basebmp::BitmapDeviceSharedPtr m_aOrigDevice; + basebmp::BitmapDeviceSharedPtr m_aClipMap; + + bool m_bUseLineColor; + basebmp::Color m_aLineColor; + bool m_bUseFillColor; + basebmp::Color m_aFillColor; + basebmp::Color m_aTextColor; + + basebmp::DrawMode m_aDrawMode; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + sal_uInt32 m_eTextFmt; + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + SvpSalGraphics(); + virtual ~SvpSalGraphics(); + + const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + + virtual void SetFillColor( SalColor nSalColor ); + + virtual void SetXORMode( bool bSet, bool ); + + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + virtual void drawPixel( long nX, long nY ); + virtual void drawPixel( long nX, long nY, SalColor nSalColor ); + virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); + virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolyPolygon( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + PCONSTSALPOINT* pPtAry ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + virtual void copyBits( const SalTwoRect* pPosAry, + SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); + virtual SalColor getPixel( long nX, long nY ); + virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpinst.hxx b/vcl/inc/unx/headless/svpinst.hxx new file mode 100644 index 000000000000..6fcafe0c7f66 --- /dev/null +++ b/vcl/inc/unx/headless/svpinst.hxx @@ -0,0 +1,204 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SALINST_HXX +#define _SVP_SALINST_HXX + +#include + +#include +#include +#include +#include +#include + +#include + +#include // timeval + +#define VIRTUAL_DESKTOP_WIDTH 1024 +#define VIRTUAL_DESKTOP_HEIGHT 768 +#define VIRTUAL_DESKTOP_DEPTH 24 + +// ------------------------------------------------------------------------- +// SalYieldMutex +// ------------------------------------------------------------------------- + +class SvpSalYieldMutex : public ::vcl::SolarMutexObject +{ +protected: + sal_uLong mnCount; + oslThreadIdentifier mnThreadId; + +public: + SvpSalYieldMutex(); + + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + + sal_uLong GetAcquireCount() const { return mnCount; } + oslThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +// --------------- +// - SalTimer - +// --------------- +class SvpSalInstance; +class SvpSalTimer : public SalTimer +{ + SvpSalInstance* m_pInstance; +public: + SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {} + virtual ~SvpSalTimer(); + + // overload all pure virtual methods + virtual void Start( sal_uLong nMS ); + virtual void Stop(); +}; + +// --------------- +// - SalInstance - +// --------------- +class SvpSalFrame; +class SvpSalInstance : public SalInstance +{ + timeval m_aTimeout; + sal_uLong m_nTimeoutMS; + int m_pTimeoutFDS[2]; + SvpSalYieldMutex m_aYieldMutex; + + // internal event queue + struct SalUserEvent + { + const SalFrame* m_pFrame; + void* m_pData; + sal_uInt16 m_nEvent; + + SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) + : m_pFrame( pFrame ), + m_pData( pData ), + m_nEvent( nEvent ) + {} + }; + + oslMutex m_aEventGuard; + std::list< SalUserEvent > m_aUserEvents; + + std::list< SalFrame* > m_aFrames; + + bool isFrameAlive( const SalFrame* pFrame ) const; + +public: + static SvpSalInstance* s_pDefaultInstance; + + SvpSalInstance(); + virtual ~SvpSalInstance(); + + void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); + + void StartTimer( sal_uLong nMS ); + void StopTimer(); + void Wakeup(); + + void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); } + void deregisterFrame( SalFrame* pFrame ); + const std::list< SalFrame* >& getFrames() const { return m_aFrames; } + + bool CheckTimeout( bool bExecuteTimers = true ); + + // Frame + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); + virtual void DestroyFrame( SalFrame* pFrame ); + + // Object (System Child Window) + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); + virtual void DestroyObject( SalObject* pObject ); + + // VirtualDevice + // nDX and nDY in Pixel + // nBitCount: 0 == Default(=as window) / 1 == Mono + // pData allows for using a system dependent graphics or device context + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); + virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); + + // Printer + // pSetupData->mpDriverData can be 0 + // pSetupData must be updatet with the current + // JobSetup + virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); + virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); + virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); + virtual void DestroyPrinter( SalPrinter* pPrinter ); + + virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); + virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); + virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); + virtual String GetDefaultPrinter(); + + // SalTimer + virtual SalTimer* CreateSalTimer(); + // SalI18NImeStatus + virtual SalI18NImeStatus* CreateI18NImeStatus(); + // SalSystem + virtual SalSystem* CreateSalSystem(); + // SalBitmap + virtual SalBitmap* CreateSalBitmap(); + + // YieldMutex + virtual osl::SolarMutex* GetYieldMutex(); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong nCount ); + virtual bool CheckYieldMutex(); + + // wait next event and dispatch + // must returned by UserEvent (SalFrame::PostEvent) + // and timer + virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual bool AnyInput( sal_uInt16 nType ); + + // may return NULL to disable session management + virtual SalSession* CreateSalSession(); + + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); + + virtual void updatePrinterUpdate(); + virtual void jobStartedPrinterUpdate(); + virtual void jobEndedPrinterUpdate(); +}; + +#endif // _SV_SALINST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpprn.hxx b/vcl/inc/unx/headless/svpprn.hxx new file mode 100644 index 000000000000..f7e6a671f4b3 --- /dev/null +++ b/vcl/inc/unx/headless/svpprn.hxx @@ -0,0 +1,57 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPPRN_HXX +#define _SVP_SVPPRN_HXX + +#include "vcl/jobdata.hxx" + +#include "printergfx.hxx" +#include "printerjob.hxx" +#include + +#include "vclpluginapi.h" + +class PspGraphics; + +class SvpSalInfoPrinter : public PspSalInfoPrinter +{ +public: + virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); +}; + +class SvpSalPrinter : public PspSalPrinter +{ +public: + SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {} +}; + +#endif // _SVP_SVPPRN_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svppspgraphics.hxx b/vcl/inc/unx/headless/svppspgraphics.hxx new file mode 100644 index 000000000000..1ce9109918d5 --- /dev/null +++ b/vcl/inc/unx/headless/svppspgraphics.hxx @@ -0,0 +1,189 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_PSPGRAPHICS_HXX +#define _SVP_PSPGRAPHICS_HXX + + +#include "vcl/fontmanager.hxx" + +#include "sallayout.hxx" +#include "salgdi.hxx" + +namespace psp { struct JobData; class PrinterGfx; } + +class ServerFont; +class ImplDevFontAttributes; +class SalInfoPrinter; + +class PspGraphics : public SalGraphics +{ + psp::JobData* m_pJobData; + psp::PrinterGfx* m_pPrinterGfx; + String* m_pPhoneNr; + bool m_bSwallowFaxNo; + String m_aPhoneCollection; + bool m_bPhoneCollectionActive; + + ServerFont* m_pServerFont[ MAX_FALLBACK ]; + bool m_bFontVertical; + SalInfoPrinter* m_pInfoPrinter; + +protected: + virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); + virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); + +public: + PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) + : m_pJobData( pJob ), + m_pPrinterGfx( pGfx ), + m_pPhoneNr( pPhone ), + m_bSwallowFaxNo( bSwallow ), + m_bPhoneCollectionActive( false ), + m_bFontVertical( false ), + m_pInfoPrinter( pInfoPrinter ) + { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } + virtual ~PspGraphics(); + + // helper methods for sharing with X11SalGraphics + static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); + static void DoFreeEmbedFontData( const void* pData, long nLen ); + static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); + static void DoGetGlyphWidths( psp::fontID aFont, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& ); + static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& ); + + // overload all pure virtual methods + virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); + virtual sal_uInt16 GetBitCount() const; + virtual long GetGraphicsWidth() const; + + virtual void ResetClipRegion(); + virtual bool setClipRegion( const Region& ); + + virtual void SetLineColor(); + virtual void SetLineColor( SalColor nSalColor ); + virtual void SetFillColor(); + virtual void SetFillColor( SalColor nSalColor ); + virtual void SetXORMode( bool bSet, bool ); + virtual void SetROPLineColor( SalROPColor nROPColor ); + virtual void SetROPFillColor( SalROPColor nROPColor ); + + virtual void SetTextColor( SalColor nSalColor ); + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + virtual void GetDevFontList( ImplDevFontList* ); + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData*, + sal_Int32* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo + ); + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + virtual void drawPixel( long nX, long nY ); + virtual void drawPixel( long nX, long nY, SalColor nSalColor ); + virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); + virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + virtual void drawPolyPolygon( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + PCONSTSALPOINT* pPtAry ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, + const SalPoint* pPtAry, + const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, + const sal_uInt32* pPoints, + const SalPoint* const* pPtAry, + const sal_uInt8* const* pFlgAry ); + + virtual void copyArea( long nDestX, + long nDestY, + long nSrcX, + long nSrcY, + long nSrcWidth, + long nSrcHeight, + sal_uInt16 nFlags ); + virtual void copyBits( const SalTwoRect* pPosAry, + SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); + virtual SalColor getPixel( long nX, long nY ); + virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); + virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; +}; + +#endif // _SVP_PSPGRAPHICS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/headless/svpvd.hxx b/vcl/inc/unx/headless/svpvd.hxx new file mode 100644 index 000000000000..211cf36846f9 --- /dev/null +++ b/vcl/inc/unx/headless/svpvd.hxx @@ -0,0 +1,62 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVP_SVPVD_HXX +#define _SVP_SVPVD_HXX + +#include +#include "svpelement.hxx" + +#include + +class SvpSalGraphics; + +class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement +{ + sal_uInt16 m_nBitCount; + basebmp::BitmapDeviceSharedPtr m_aDevice; + std::list< SvpSalGraphics* > m_aGraphics; + +public: + SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} + virtual ~SvpSalVirtualDevice(); + + // SvpElement + virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } + + // SalVirtualDevice + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +#endif // _SVP_SVPVD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index 07dc4e58d395..d6a181a77f30 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -25,4 +25,6 @@ * instead of those above. */ -#include "../../gtk/gdi/salnativewidgets-gtk.cxx" +#include "../../headless/svpdi.hxx" +#include "../../headless/svpdi.hxx" + diff --git a/vcl/unx/headless/svpbmp.cxx b/vcl/unx/headless/svpbmp.cxx index 2d8309af5eba..eccdd2bb97b3 100644 --- a/vcl/unx/headless/svpbmp.cxx +++ b/vcl/unx/headless/svpbmp.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "svpbmp.hxx" +#include "unx/headless/svpbmp.hxx" #include #include diff --git a/vcl/unx/headless/svpbmp.hxx b/vcl/unx/headless/svpbmp.hxx deleted file mode 100644 index b3adb3b9951f..000000000000 --- a/vcl/unx/headless/svpbmp.hxx +++ /dev/null @@ -1,72 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef SVP_SVBMP_HXX -#define SVP_SVBMP_HXX - -#include -#include "svpelement.hxx" - -class SvpSalBitmap : public SalBitmap, public SvpElement -{ - basebmp::BitmapDeviceSharedPtr m_aBitmap; -public: - SvpSalBitmap() {} - virtual ~SvpSalBitmap(); - - const basebmp::BitmapDeviceSharedPtr& getBitmap() const { return m_aBitmap; } - void setBitmap( const basebmp::BitmapDeviceSharedPtr& rSrc ) { m_aBitmap = rSrc; } - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aBitmap; } - - // SalBitmap - virtual bool Create( const Size& rSize, - sal_uInt16 nBitCount, - const BitmapPalette& rPal ); - virtual bool Create( const SalBitmap& rSalBmp ); - virtual bool Create( const SalBitmap& rSalBmp, - SalGraphics* pGraphics ); - virtual bool Create( const SalBitmap& rSalBmp, - sal_uInt16 nNewBitCount ); - virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, - Size& rSize, - bool bMask = false ); - virtual void Destroy(); - virtual Size GetSize() const; - virtual sal_uInt16 GetBitCount() const; - - virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); - virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); - virtual bool GetSystemData( BitmapSystemData& rData ); - -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx index 3bf1a4da9cc0..326ad814651f 100644 --- a/vcl/unx/headless/svpdummies.cxx +++ b/vcl/unx/headless/svpdummies.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpdummies.hxx" -#include "svpinst.hxx" +#include "unx/headless/svpdummies.hxx" +#include "unx/headless/svpinst.hxx" #include // SalObject diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx deleted file mode 100644 index bc46e9b22f70..000000000000 --- a/vcl/unx/headless/svpdummies.hxx +++ /dev/null @@ -1,100 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPDUMMIES_HXX - -#include - -#include -#include -#include - -class SalGraphics; - -class SvpSalObject : public SalObject -{ -public: - SystemChildData m_aSystemChildData; - - SvpSalObject(); - virtual ~SvpSalObject(); - - // overload all pure virtual methods - virtual void ResetClipRegion(); - virtual sal_uInt16 GetClipRegionType(); - virtual void BeginSetClipRegion( sal_uLong nRects ); - virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual void EndSetClipRegion(); - - virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); - virtual void Show( sal_Bool bVisible ); - virtual void Enable( sal_Bool nEnable ); - virtual void GrabFocus(); - - virtual void SetBackground(); - virtual void SetBackground( SalColor nSalColor ); - - virtual const SystemEnvData* GetSystemData() const; - - virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); -}; - -class SvpImeStatus : public SalI18NImeStatus -{ - public: - SvpImeStatus() {} - virtual ~SvpImeStatus(); - - virtual bool canToggle(); - virtual void toggle(); -}; - -class SvpSalSystem : public SalSystem -{ - public: - SvpSalSystem() {} - virtual ~SvpSalSystem(); - // get info about the display - virtual unsigned int GetDisplayScreenCount(); - virtual bool IsMultiDisplay(); - virtual unsigned int GetDefaultDisplayNumber(); - virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); - virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); - virtual rtl::OUString GetScreenName( unsigned int nScreen ); - - - virtual int ShowNativeMessageBox( const String& rTitle, - const String& rMessage, - int nButtonCombination, - int nDefaultButton); -}; - - -#endif // _SVP_SVPDUMMIES_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpelement.cxx b/vcl/unx/headless/svpelement.cxx index b6bf4822b576..785f3377e9af 100644 --- a/vcl/unx/headless/svpelement.cxx +++ b/vcl/unx/headless/svpelement.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#include "svpelement.hxx" +#include "unx/headless/svpelement.hxx" #include #include @@ -39,9 +39,9 @@ #include #include -#include "svpvd.hxx" -#include "svpbmp.hxx" -#include "svpframe.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpbmp.hxx" +#include "unx/headless/svpframe.hxx" #include #include diff --git a/vcl/unx/headless/svpelement.hxx b/vcl/unx/headless/svpelement.hxx deleted file mode 100644 index c7f647cf3a03..000000000000 --- a/vcl/unx/headless/svpelement.hxx +++ /dev/null @@ -1,49 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPELEMENT_HXX -#define _SVP_SVPELEMENT_HXX - -#include - -#define SVP_DEFAULT_BITMAP_FORMAT basebmp::Format::TWENTYFOUR_BIT_TC_MASK - -class SvpElement -{ - protected: - SvpElement(); - virtual ~SvpElement(); - public: - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const = 0; - - static sal_uInt32 getBitCountFromScanlineFormat( sal_Int32 nFormat ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpframe.cxx b/vcl/unx/headless/svpframe.cxx index 1b8455557fac..bd15389cb1c0 100644 --- a/vcl/unx/headless/svpframe.cxx +++ b/vcl/unx/headless/svpframe.cxx @@ -26,9 +26,9 @@ * ************************************************************************/ -#include "svpframe.hxx" -#include "svpinst.hxx" -#include "svpgdi.hxx" +#include "unx/headless/svpframe.hxx" +#include "unx/headless/svpinst.hxx" +#include "unx/headless/svpgdi.hxx" #include #include diff --git a/vcl/unx/headless/svpframe.hxx b/vcl/unx/headless/svpframe.hxx deleted file mode 100644 index e57381780f61..000000000000 --- a/vcl/unx/headless/svpframe.hxx +++ /dev/null @@ -1,132 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPFRAME_HXX - -#include - -#include -#include "svpelement.hxx" - -#include - -class SvpSalInstance; -class SvpSalGraphics; - -class SvpSalFrame : public SalFrame, public SvpElement -{ - SvpSalInstance* m_pInstance; - SvpSalFrame* m_pParent; // pointer to parent frame - std::list< SvpSalFrame* > m_aChildren; // List of child frames - sal_uLong m_nStyle; - bool m_bVisible; - long m_nMinWidth; - long m_nMinHeight; - long m_nMaxWidth; - long m_nMaxHeight; - - SystemEnvData m_aSystemChildData; - - basebmp::BitmapDeviceSharedPtr m_aFrame; - std::list< SvpSalGraphics* > m_aGraphics; - - static SvpSalFrame* s_pFocusFrame; -public: - SvpSalFrame( SvpSalInstance* pInstance, - SalFrame* pParent, - sal_uLong nSalFrameStyle, - SystemParentData* pSystemParent = NULL ); - virtual ~SvpSalFrame(); - - void GetFocus(); - void LoseFocus(); - void PostPaint() const; - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aFrame; } - - // SalFrame - virtual SalGraphics* GetGraphics(); - virtual void ReleaseGraphics( SalGraphics* pGraphics ); - - virtual sal_Bool PostEvent( void* pData ); - - virtual void SetTitle( const XubString& rTitle ); - virtual void SetIcon( sal_uInt16 nIcon ); - virtual void SetMenu( SalMenu* pMenu ); - virtual void DrawMenuBar(); - - virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ); - virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); - virtual void Enable( sal_Bool bEnable ); - virtual void SetMinClientSize( long nWidth, long nHeight ); - virtual void SetMaxClientSize( long nWidth, long nHeight ); - virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); - virtual void GetClientSize( long& rWidth, long& rHeight ); - virtual void GetWorkArea( Rectangle& rRect ); - virtual SalFrame* GetParent() const; - virtual void SetWindowState( const SalFrameState* pState ); - virtual sal_Bool GetWindowState( SalFrameState* pState ); - virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); - virtual void StartPresentation( sal_Bool bStart ); - virtual void SetAlwaysOnTop( sal_Bool bOnTop ); - virtual void ToTop( sal_uInt16 nFlags ); - virtual void SetPointer( PointerStyle ePointerStyle ); - virtual void CaptureMouse( sal_Bool bMouse ); - virtual void SetPointerPos( long nX, long nY ); - using SalFrame::Flush; - virtual void Flush(); - virtual void Sync(); - virtual void SetInputContext( SalInputContext* pContext ); - virtual void EndExtTextInput( sal_uInt16 nFlags ); - virtual String GetKeyName( sal_uInt16 nKeyCode ); - virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); - virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); - virtual LanguageType GetInputLanguage(); - virtual SalBitmap* SnapShot(); - virtual void UpdateSettings( AllSettings& rSettings ); - virtual void Beep( SoundType eSoundType ); - virtual const SystemEnvData* GetSystemData() const; - virtual SalPointerState GetPointerState(); - virtual SalIndicatorState GetIndicatorState(); - virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); - virtual void SetParent( SalFrame* pNewParent ); - virtual bool SetPluginParent( SystemParentData* pNewParent ); - virtual void SetBackgroundBitmap( SalBitmap* pBitmap ); - virtual void ResetClipRegion(); - virtual void BeginSetClipRegion( sal_uLong nRects ); - virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); - virtual void EndSetClipRegion(); - - /*TODO: functional implementation */ - virtual void SetScreenNumber( unsigned int nScreen ) { (void)nScreen; } - virtual void SetApplicationID(const rtl::OUString &rApplicationID) { (void) rApplicationID; } -}; -#endif // _SVP_SVPFRAME_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpgdi.cxx b/vcl/unx/headless/svpgdi.cxx index 0a7041661d4e..7025b7d18b7d 100644 --- a/vcl/unx/headless/svpgdi.cxx +++ b/vcl/unx/headless/svpgdi.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpgdi.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svpgdi.hxx" +#include "unx/headless/svpbmp.hxx" #include #include @@ -46,7 +46,7 @@ #include #endif -#include +#include "unx/headless/svppspgraphics.hxx" #include using namespace basegfx; diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx deleted file mode 100644 index 8291a3c2f7bc..000000000000 --- a/vcl/unx/headless/svpgdi.hxx +++ /dev/null @@ -1,174 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPGDI_HXX - -#include -#include - -#include -#include - -class ServerFont; - -class SvpSalGraphics : public SalGraphics -{ - basebmp::BitmapDeviceSharedPtr m_aDevice; - basebmp::BitmapDeviceSharedPtr m_aOrigDevice; - basebmp::BitmapDeviceSharedPtr m_aClipMap; - - bool m_bUseLineColor; - basebmp::Color m_aLineColor; - bool m_bUseFillColor; - basebmp::Color m_aFillColor; - basebmp::Color m_aTextColor; - - basebmp::DrawMode m_aDrawMode; - - ServerFont* m_pServerFont[ MAX_FALLBACK ]; - sal_uInt32 m_eTextFmt; - -protected: - virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); - virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); - -public: - SvpSalGraphics(); - virtual ~SvpSalGraphics(); - - const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } - void setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ); - - // overload all pure virtual methods - virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual sal_uInt16 GetBitCount() const; - virtual long GetGraphicsWidth() const; - - virtual void ResetClipRegion(); - virtual bool setClipRegion( const Region& ); - - virtual void SetLineColor(); - virtual void SetLineColor( SalColor nSalColor ); - virtual void SetFillColor(); - - virtual void SetFillColor( SalColor nSalColor ); - - virtual void SetXORMode( bool bSet, bool ); - - virtual void SetROPLineColor( SalROPColor nROPColor ); - virtual void SetROPFillColor( SalROPColor nROPColor ); - - virtual void SetTextColor( SalColor nSalColor ); - virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); - virtual const ImplFontCharMap* GetImplFontCharMap() const; - virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; - virtual void GetDevFontList( ImplDevFontList* ); - virtual void GetDevFontSubstList( OutputDevice* ); - virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, - const ImplFontData*, - sal_Int32* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo - ); - virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); - virtual const void* GetEmbedFontData( const ImplFontData*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen ); - virtual void FreeEmbedFontData( const void* pData, long nDataLen ); - virtual void GetGlyphWidths( const ImplFontData*, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); - virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); - virtual void DrawServerFontLayout( const ServerFontLayout& ); - virtual bool supportsOperation( OutDevSupportType ) const; - virtual void drawPixel( long nX, long nY ); - virtual void drawPixel( long nX, long nY, SalColor nSalColor ); - virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); - virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); - virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); - virtual void drawPolyPolygon( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, - const sal_uInt8* const* pFlgAry ); - - virtual void copyArea( long nDestX, - long nDestY, - long nSrcX, - long nSrcY, - long nSrcWidth, - long nSrcHeight, - sal_uInt16 nFlags ); - virtual void copyBits( const SalTwoRect* pPosAry, - SalGraphics* pSrcGraphics ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nTransparentColor ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - const SalBitmap& rTransparentBitmap ); - virtual void drawMask( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nMaskColor ); - virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); - virtual SalColor getPixel( long nX, long nY ); - virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); - - virtual SystemGraphicsData GetGraphicsData() const; - virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpinst.cxx b/vcl/unx/headless/svpinst.cxx index c9e011c1a67a..41d268a7a437 100644 --- a/vcl/unx/headless/svpinst.cxx +++ b/vcl/unx/headless/svpinst.cxx @@ -35,11 +35,11 @@ #include -#include "svpinst.hxx" -#include "svpframe.hxx" -#include "svpdummies.hxx" -#include "svpvd.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svpinst.hxx" +#include "unx/headless/svpframe.hxx" +#include "unx/headless/svpdummies.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpbmp.hxx" #include #include diff --git a/vcl/unx/headless/svpinst.hxx b/vcl/unx/headless/svpinst.hxx deleted file mode 100644 index 6fcafe0c7f66..000000000000 --- a/vcl/unx/headless/svpinst.hxx +++ /dev/null @@ -1,204 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SALINST_HXX -#define _SVP_SALINST_HXX - -#include - -#include -#include -#include -#include -#include - -#include - -#include // timeval - -#define VIRTUAL_DESKTOP_WIDTH 1024 -#define VIRTUAL_DESKTOP_HEIGHT 768 -#define VIRTUAL_DESKTOP_DEPTH 24 - -// ------------------------------------------------------------------------- -// SalYieldMutex -// ------------------------------------------------------------------------- - -class SvpSalYieldMutex : public ::vcl::SolarMutexObject -{ -protected: - sal_uLong mnCount; - oslThreadIdentifier mnThreadId; - -public: - SvpSalYieldMutex(); - - virtual void acquire(); - virtual void release(); - virtual sal_Bool tryToAcquire(); - - sal_uLong GetAcquireCount() const { return mnCount; } - oslThreadIdentifier GetThreadId() const { return mnThreadId; } -}; - -// --------------- -// - SalTimer - -// --------------- -class SvpSalInstance; -class SvpSalTimer : public SalTimer -{ - SvpSalInstance* m_pInstance; -public: - SvpSalTimer( SvpSalInstance* pInstance ) : m_pInstance( pInstance ) {} - virtual ~SvpSalTimer(); - - // overload all pure virtual methods - virtual void Start( sal_uLong nMS ); - virtual void Stop(); -}; - -// --------------- -// - SalInstance - -// --------------- -class SvpSalFrame; -class SvpSalInstance : public SalInstance -{ - timeval m_aTimeout; - sal_uLong m_nTimeoutMS; - int m_pTimeoutFDS[2]; - SvpSalYieldMutex m_aYieldMutex; - - // internal event queue - struct SalUserEvent - { - const SalFrame* m_pFrame; - void* m_pData; - sal_uInt16 m_nEvent; - - SalUserEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent = SALEVENT_USEREVENT ) - : m_pFrame( pFrame ), - m_pData( pData ), - m_nEvent( nEvent ) - {} - }; - - oslMutex m_aEventGuard; - std::list< SalUserEvent > m_aUserEvents; - - std::list< SalFrame* > m_aFrames; - - bool isFrameAlive( const SalFrame* pFrame ) const; - -public: - static SvpSalInstance* s_pDefaultInstance; - - SvpSalInstance(); - virtual ~SvpSalInstance(); - - void PostEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - void CancelEvent( const SalFrame* pFrame, void* pData, sal_uInt16 nEvent ); - - void StartTimer( sal_uLong nMS ); - void StopTimer(); - void Wakeup(); - - void registerFrame( SalFrame* pFrame ) { m_aFrames.push_back( pFrame ); } - void deregisterFrame( SalFrame* pFrame ); - const std::list< SalFrame* >& getFrames() const { return m_aFrames; } - - bool CheckTimeout( bool bExecuteTimers = true ); - - // Frame - virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); - virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); - virtual void DestroyFrame( SalFrame* pFrame ); - - // Object (System Child Window) - virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); - virtual void DestroyObject( SalObject* pObject ); - - // VirtualDevice - // nDX and nDY in Pixel - // nBitCount: 0 == Default(=as window) / 1 == Mono - // pData allows for using a system dependent graphics or device context - virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, - long nDX, long nDY, - sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); - virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); - - // Printer - // pSetupData->mpDriverData can be 0 - // pSetupData must be updatet with the current - // JobSetup - virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pSetupData ); - virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); - virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); - virtual void DestroyPrinter( SalPrinter* pPrinter ); - - virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); - virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); - virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); - virtual String GetDefaultPrinter(); - - // SalTimer - virtual SalTimer* CreateSalTimer(); - // SalI18NImeStatus - virtual SalI18NImeStatus* CreateI18NImeStatus(); - // SalSystem - virtual SalSystem* CreateSalSystem(); - // SalBitmap - virtual SalBitmap* CreateSalBitmap(); - - // YieldMutex - virtual osl::SolarMutex* GetYieldMutex(); - virtual sal_uLong ReleaseYieldMutex(); - virtual void AcquireYieldMutex( sal_uLong nCount ); - virtual bool CheckYieldMutex(); - - // wait next event and dispatch - // must returned by UserEvent (SalFrame::PostEvent) - // and timer - virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); - virtual bool AnyInput( sal_uInt16 nType ); - - // may return NULL to disable session management - virtual SalSession* CreateSalSession(); - - virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); - - virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); - - virtual void updatePrinterUpdate(); - virtual void jobStartedPrinterUpdate(); - virtual void jobEndedPrinterUpdate(); -}; - -#endif // _SV_SALINST_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 6f30f2d38969..64929876de17 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -41,9 +41,9 @@ #include "print.h" #include "salptype.hxx" -#include "svpprn.hxx" -#include "svppspgraphics.hxx" -#include "svpinst.hxx" +#include "unx/headless/svpprn.hxx" +#include "unx/headless/svppspgraphics.hxx" +#include "unx/headless/svpinst.hxx" using namespace psp; diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx deleted file mode 100644 index f7e6a671f4b3..000000000000 --- a/vcl/unx/headless/svpprn.hxx +++ /dev/null @@ -1,57 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPPRN_HXX -#define _SVP_SVPPRN_HXX - -#include "vcl/jobdata.hxx" - -#include "printergfx.hxx" -#include "printerjob.hxx" -#include - -#include "vclpluginapi.h" - -class PspGraphics; - -class SvpSalInfoPrinter : public PspSalInfoPrinter -{ -public: - virtual sal_Bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ); -}; - -class SvpSalPrinter : public PspSalPrinter -{ -public: - SvpSalPrinter( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter(pInfoPrinter) {} -}; - -#endif // _SVP_SVPPRN_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 82f3ac43df96..7b463a338e13 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -54,8 +54,8 @@ #include "outfont.hxx" #include "fontsubset.hxx" #include "printergfx.hxx" -#include "svppspgraphics.hxx" -#include "svpbmp.hxx" +#include "unx/headless/svppspgraphics.hxx" +#include "unx/headless/svpbmp.hxx" #include "region.h" using namespace psp; diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx deleted file mode 100644 index 1ce9109918d5..000000000000 --- a/vcl/unx/headless/svppspgraphics.hxx +++ /dev/null @@ -1,189 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_PSPGRAPHICS_HXX -#define _SVP_PSPGRAPHICS_HXX - - -#include "vcl/fontmanager.hxx" - -#include "sallayout.hxx" -#include "salgdi.hxx" - -namespace psp { struct JobData; class PrinterGfx; } - -class ServerFont; -class ImplDevFontAttributes; -class SalInfoPrinter; - -class PspGraphics : public SalGraphics -{ - psp::JobData* m_pJobData; - psp::PrinterGfx* m_pPrinterGfx; - String* m_pPhoneNr; - bool m_bSwallowFaxNo; - String m_aPhoneCollection; - bool m_bPhoneCollectionActive; - - ServerFont* m_pServerFont[ MAX_FALLBACK ]; - bool m_bFontVertical; - SalInfoPrinter* m_pInfoPrinter; - -protected: - virtual bool drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ); - virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); - -public: - PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) - : m_pJobData( pJob ), - m_pPrinterGfx( pGfx ), - m_pPhoneNr( pPhone ), - m_bSwallowFaxNo( bSwallow ), - m_bPhoneCollectionActive( false ), - m_bFontVertical( false ), - m_pInfoPrinter( pInfoPrinter ) - { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } - virtual ~PspGraphics(); - - // helper methods for sharing with X11SalGraphics - static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); - static void DoFreeEmbedFontData( const void* pData, long nLen ); - static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); - static void DoGetGlyphWidths( psp::fontID aFont, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - static ImplDevFontAttributes Info2DevFontAttributes( const psp::FastPrintFontInfo& ); - static void AnnounceFonts( ImplDevFontList*, const psp::FastPrintFontInfo& ); - - // overload all pure virtual methods - virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ); - virtual sal_uInt16 GetBitCount() const; - virtual long GetGraphicsWidth() const; - - virtual void ResetClipRegion(); - virtual bool setClipRegion( const Region& ); - - virtual void SetLineColor(); - virtual void SetLineColor( SalColor nSalColor ); - virtual void SetFillColor(); - virtual void SetFillColor( SalColor nSalColor ); - virtual void SetXORMode( bool bSet, bool ); - virtual void SetROPLineColor( SalROPColor nROPColor ); - virtual void SetROPFillColor( SalROPColor nROPColor ); - - virtual void SetTextColor( SalColor nSalColor ); - virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); - virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); - virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); - virtual const ImplFontCharMap* GetImplFontCharMap() const; - virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; - virtual void GetDevFontList( ImplDevFontList* ); - virtual void GetDevFontSubstList( OutputDevice* ); - virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); - virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, - const ImplFontData*, - sal_Int32* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo - ); - virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); - virtual const void* GetEmbedFontData( const ImplFontData*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen ); - virtual void FreeEmbedFontData( const void* pData, long nDataLen ); - virtual void GetGlyphWidths( const ImplFontData*, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); - virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); - virtual void DrawServerFontLayout( const ServerFontLayout& ); - virtual bool supportsOperation( OutDevSupportType ) const; - virtual void drawPixel( long nX, long nY ); - virtual void drawPixel( long nX, long nY, SalColor nSalColor ); - virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); - virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); - virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); - virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); - virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); - virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); - virtual void drawPolyPolygon( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - PCONSTSALPOINT* pPtAry ); - virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, - const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ); - virtual sal_Bool drawPolyPolygonBezier( sal_uInt32 nPoly, - const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, - const sal_uInt8* const* pFlgAry ); - - virtual void copyArea( long nDestX, - long nDestY, - long nSrcX, - long nSrcY, - long nSrcWidth, - long nSrcHeight, - sal_uInt16 nFlags ); - virtual void copyBits( const SalTwoRect* pPosAry, - SalGraphics* pSrcGraphics ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nTransparentColor ); - virtual void drawBitmap( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - const SalBitmap& rTransparentBitmap ); - virtual void drawMask( const SalTwoRect* pPosAry, - const SalBitmap& rSalBitmap, - SalColor nMaskColor ); - virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); - virtual SalColor getPixel( long nX, long nY ); - virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags ); - virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); - - virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); - virtual bool filterText( const String& rOrigText, String& rNewText, xub_StrLen nIndex, xub_StrLen& rLen, xub_StrLen& rCutStart, xub_StrLen& rCutStop ); - - virtual SystemGraphicsData GetGraphicsData() const; - virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; -}; - -#endif // _SVP_PSPGRAPHICS_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 18531baf1b52..4d3424605ba2 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -43,9 +43,9 @@ #include #include -#include "svpgdi.hxx" -#include "svpbmp.hxx" -#include "svppspgraphics.hxx" +#include "unx/headless/svpgdi.hxx" +#include "unx/headless/svpbmp.hxx" +#include "unx/headless/svppspgraphics.hxx" using namespace basegfx; using namespace basebmp; diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx index 8477da7b3bfc..c1de04b8d865 100644 --- a/vcl/unx/headless/svpvd.cxx +++ b/vcl/unx/headless/svpvd.cxx @@ -26,8 +26,8 @@ * ************************************************************************/ -#include "svpvd.hxx" -#include "svpgdi.hxx" +#include "unx/headless/svpvd.hxx" +#include "unx/headless/svpgdi.hxx" #include #include diff --git a/vcl/unx/headless/svpvd.hxx b/vcl/unx/headless/svpvd.hxx deleted file mode 100644 index 211cf36846f9..000000000000 --- a/vcl/unx/headless/svpvd.hxx +++ /dev/null @@ -1,62 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVP_SVPVD_HXX -#define _SVP_SVPVD_HXX - -#include -#include "svpelement.hxx" - -#include - -class SvpSalGraphics; - -class SvpSalVirtualDevice : public SalVirtualDevice, public SvpElement -{ - sal_uInt16 m_nBitCount; - basebmp::BitmapDeviceSharedPtr m_aDevice; - std::list< SvpSalGraphics* > m_aGraphics; - -public: - SvpSalVirtualDevice( sal_uInt16 nBitCount ) : SvpElement(), m_nBitCount(nBitCount) {} - virtual ~SvpSalVirtualDevice(); - - // SvpElement - virtual const basebmp::BitmapDeviceSharedPtr& getDevice() const { return m_aDevice; } - - // SalVirtualDevice - virtual SalGraphics* GetGraphics(); - virtual void ReleaseGraphics( SalGraphics* pGraphics ); - - virtual sal_Bool SetSize( long nNewDX, long nNewDY ); - virtual void GetSize( long& rWidth, long& rHeight ); -}; - -#endif // _SVP_SVPVD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ec2ba4881538f485ed17dd1c44c2a9fd0a5d971a Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Fri, 24 Jun 2011 14:56:31 +0100 Subject: update component factory methods to use new prefixes, to add lib merging --- sot/source/unoolestorage/register.cxx | 4 ++-- sot/util/sot.component | 2 +- svl/source/fsstor/fsfactory.cxx | 4 ++-- svl/source/fsstor/fsstorage.component | 2 +- svl/source/passwordcontainer/passwordcontainer.component | 2 +- svl/source/passwordcontainer/passwordcontainer.cxx | 4 ++-- svl/source/uno/registerservices.cxx | 4 ++-- svl/util/svl.component | 2 +- svtools/source/hatchwindow/hatchwindowfactory.component | 2 +- svtools/source/hatchwindow/hatchwindowfactory.cxx | 4 ++-- svtools/source/productregistration/productregistration.cxx | 4 ++-- svtools/source/productregistration/productregistration.uno.component | 2 +- svtools/source/uno/miscservices.cxx | 4 ++-- svtools/util/svt.component | 2 +- toolkit/source/helper/registerservices.cxx | 4 ++-- toolkit/util/tk.component | 2 +- unotools/source/ucbhelper/xtempfile.cxx | 4 ++-- unotools/util/utl.component | 2 +- vcl/source/components/factory.cxx | 4 ++-- vcl/vcl.macosx.component | 2 +- vcl/vcl.unx.component | 2 +- vcl/vcl.windows.component | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 696e0cefed93..30f417b29625 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,12 +41,12 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) +SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_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 @@ * **********************************************************************--> - diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index a641a5d80c04..db6fc301a0d0 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -235,13 +235,13 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL fsstorage_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 @@ * **********************************************************************--> - 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 @@ * **********************************************************************--> - diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index 6e922ea29cd7..d584a1c77725 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1538,13 +1538,13 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL passwordcontainer_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/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 5caca580694f..3fa8b0e7ebef 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -55,13 +55,13 @@ DECLARE_CREATEINSTANCE( PathService ) extern "C" { -SVL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment ( +SVL_DLLPUBLIC void SAL_CALL svl_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 @@ * **********************************************************************--> - diff --git a/svtools/source/hatchwindow/hatchwindowfactory.component b/svtools/source/hatchwindow/hatchwindowfactory.component index 153fc8796281..b9ebbaefdd04 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.component +++ b/svtools/source/hatchwindow/hatchwindowfactory.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index a0ff0d4daf17..13f78b3e353b 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -109,13 +109,13 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OHatchWindowFactory::getSupportedServi extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL hatchwindowfactory_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 hatchwindowfactory_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx index a4251652aac2..ebedda0ad071 100644 --- a/svtools/source/productregistration/productregistration.cxx +++ b/svtools/source/productregistration/productregistration.cxx @@ -453,13 +453,13 @@ namespace svt extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL productregistration_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 productregistration_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { void * pResult = 0; diff --git a/svtools/source/productregistration/productregistration.uno.component b/svtools/source/productregistration/productregistration.uno.component index da2cfd37c483..f57860ef6463 100644 --- a/svtools/source/productregistration/productregistration.uno.component +++ b/svtools/source/productregistration/productregistration.uno.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index c652b6028bf0..1b20ef518683 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -96,13 +96,13 @@ DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL ) extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( +SAL_DLLPUBLIC_EXPORT void SAL_CALL svt_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 svt_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey) { void * pResult = 0; diff --git a/svtools/util/svt.component b/svtools/util/svt.component index e15970547a38..2ba695d72e92 100644 --- a/svtools/util/svt.component +++ b/svtools/util/svt.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index cadd228d1c4b..6e11e72970be 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -236,12 +236,12 @@ extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, extern "C" { -TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) +TOOLKIT_DLLPUBLIC void SAL_CALL tk_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) +TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component index 4d4713e87c45..f6638794de12 100644 --- a/toolkit/util/tk.component +++ b/toolkit/util/tk.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 7883a3e85cb2..d73981670d5d 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -486,7 +486,7 @@ throw ( ::css::uno::RuntimeException ) // C functions to implement this as a component -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( +extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL utl_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; @@ -499,7 +499,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron * @param pRegistryKey registry data key to read and write component persistent data * @return a component factory (generic uno interface) */ -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL utl_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; diff --git a/unotools/util/utl.component b/unotools/util/utl.component index 8c8198741f55..ab4b67b61da4 100644 --- a/unotools/util/utl.component +++ b/unotools/util/utl.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index 04b0e122cbce..f4665832a9a8 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -83,14 +83,14 @@ namespace rsvg extern "C" { - VCL_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( + VCL_DLLPUBLIC void SAL_CALL vcl_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** /*ppEnv*/ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - VCL_DLLPUBLIC void* SAL_CALL component_getFactory( + VCL_DLLPUBLIC void* SAL_CALL vcl_component_getFactory( const sal_Char* pImplementationName, void* pXUnoSMgr, void* /*pXUnoKey*/ diff --git a/vcl/vcl.macosx.component b/vcl/vcl.macosx.component index 023f805672bd..a4f551c63a79 100644 --- a/vcl/vcl.macosx.component +++ b/vcl/vcl.macosx.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/vcl.unx.component b/vcl/vcl.unx.component index ea14667d17c1..c58bb8fa3c47 100644 --- a/vcl/vcl.unx.component +++ b/vcl/vcl.unx.component @@ -26,7 +26,7 @@ * **********************************************************************--> - diff --git a/vcl/vcl.windows.component b/vcl/vcl.windows.component index df786c4d832b..5dd80ebe0029 100644 --- a/vcl/vcl.windows.component +++ b/vcl/vcl.windows.component @@ -26,7 +26,7 @@ * **********************************************************************--> - -- cgit v1.2.3 From 74ce447f370de298f88e0907c4283ee941c69505 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 26 Jun 2011 00:54:31 +0300 Subject: Include also for Android --- vcl/inc/unx/saldata.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx index 7bce61cc9ce7..825c148cfa1f 100644 --- a/vcl/inc/unx/saldata.hxx +++ b/vcl/inc/unx/saldata.hxx @@ -46,7 +46,8 @@ class SalPrinter; // -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #if defined LINUX || defined NETBSD || defined AIX || \ - defined FREEBSD || defined OPENBSD || defined DRAGONFLY + defined FREEBSD || defined OPENBSD || defined DRAGONFLY || \ + defined ANDROID #include #else typedef unsigned int pthread_t; -- cgit v1.2.3 From 1dc2221b2639820a3949f37721243a18cfb74dd1 Mon Sep 17 00:00:00 2001 From: Luke Symes Date: Sun, 26 Jun 2011 22:13:01 +1200 Subject: Fix ScrollToAbsPos to work when we have an empty list. --- svtools/source/contnr/svimpbox.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index fd5a649d833c..e0e9efca6f59 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -1014,6 +1014,8 @@ void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, sal_Bool bMoveToTop ) void SvImpLBox::ScrollToAbsPos( long nPos ) { + if( pView->GetVisibleCount() == 0 ) + return; long nLastEntryPos = pView->GetAbsPos( pView->Last() ); if( nPos < 0 ) -- cgit v1.2.3 From 27ba00f563353033369ad325b5cb45a3fafa9749 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 27 Jun 2011 17:34:15 +0200 Subject: do not set minimal size for fullscreen windows - otherwise they cannot shrink when downsizing resolution of the screen --- vcl/unx/gtk/window/gtkframe.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 089a67344271..faa8a719b331 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1431,7 +1431,7 @@ void GtkSalFrame::setMinMaxSize() int aHints = 0; if( m_nStyle & SAL_FRAME_STYLE_SIZEABLE ) { - if( m_aMinSize.Width() && m_aMinSize.Height() ) + if( m_aMinSize.Width() && m_aMinSize.Height() && ! m_bFullscreen ) { aGeo.min_width = m_aMinSize.Width()+CONTAINER_ADJUSTMENT; aGeo.min_height = m_aMinSize.Height()+CONTAINER_ADJUSTMENT; @@ -1446,11 +1446,12 @@ void GtkSalFrame::setMinMaxSize() } else { - aGeo.min_width = maGeometry.nWidth; - aGeo.min_height = maGeometry.nHeight; - aHints |= GDK_HINT_MIN_SIZE; if( ! m_bFullscreen ) { + aGeo.min_width = maGeometry.nWidth; + aGeo.min_height = maGeometry.nHeight; + aHints |= GDK_HINT_MIN_SIZE; + aGeo.max_width = maGeometry.nWidth; aGeo.max_height = maGeometry.nHeight; aHints |= GDK_HINT_MAX_SIZE; -- cgit v1.2.3 From c3a0be5e2a884c4be85b2da6e9f26ae6e7c4f324 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 27 Jun 2011 23:14:00 +0100 Subject: remove insanely stubbed methods --- tools/inc/tools/string.hxx | 4 ---- tools/source/string/tstring.cxx | 20 -------------------- 2 files changed, 24 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index f77d9630d962..d027a2f25610 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -154,8 +154,6 @@ class TOOLS_DLLPUBLIC ByteString { friend class UniString; - TOOLS_DLLPRIVATE void InitStringRes( const UniString& rStr ); - private: ByteStringData* mpData; @@ -212,8 +210,6 @@ public: static const ByteString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; - float ToFloat() const; - double ToDouble() const; ByteString& Assign( const ByteString& rStr ); ByteString& Assign( const rtl::OString& rStr ); diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index c7a5f380fb72..1f962d4deae9 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -161,26 +161,6 @@ sal_Int64 ByteString::ToInt64() const // ----------------------------------------------------------------------- -float ByteString::ToFloat() const -{ - DBG_CHKTHIS( ByteString, DbgCheckByteString ); - - OSL_FAIL("ByteString::ToFloat unusable"); - return 0; -} - -// ----------------------------------------------------------------------- - -double ByteString::ToDouble() const -{ - DBG_CHKTHIS( ByteString, DbgCheckByteString ); - - OSL_FAIL("ByteString::ToDouble unusable"); - return 0; -} - -// ----------------------------------------------------------------------- - sal_Bool ByteString::IsLowerAscii() const { DBG_CHKTHIS( ByteString, DbgCheckByteString ); -- cgit v1.2.3 From 3be39b7ee512114f7a9e7db30175564aaeb723b5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 27 Jun 2011 23:49:50 +0100 Subject: remove deprecated ByteString::CreateFromDouble use OString::valueOf(double) instead --- tools/inc/tools/string.hxx | 1 - tools/source/string/tstring.cxx | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index d027a2f25610..75c2a6dcd7f0 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -206,7 +206,6 @@ public: static ByteString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 ); static ByteString CreateFromInt64( sal_Int64 n, sal_Int16 nRadix = 10 ); static ByteString CreateFromFloat( float f ); - static ByteString CreateFromDouble( double d ); static const ByteString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index 1f962d4deae9..f2af016158fe 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -125,16 +125,6 @@ ByteString ByteString::CreateFromFloat( float f ) // ----------------------------------------------------------------------- -ByteString ByteString::CreateFromDouble( double d ) -{ - sal_Char aBuf[RTL_STR_MAX_VALUEOFDOUBLE]; - BOOST_STATIC_ASSERT(RTL_STR_MAX_VALUEOFDOUBLE <= STRING_MAXLEN); - return ByteString( - aBuf, static_cast< xub_StrLen >(rtl_str_valueOfDouble( aBuf, d )) ); -} - -// ----------------------------------------------------------------------- - namespace { struct Empty : public rtl::Static< const ByteString, Empty> {}; } const ByteString& ByteString::EmptyString() { -- cgit v1.2.3 From 28e79aa91e502fbabee1198193a3cb4f125f330a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 27 Jun 2011 23:57:02 +0100 Subject: remove unused ByteString::CreateFromFloat --- tools/inc/tools/string.hxx | 1 - tools/source/string/tstring.cxx | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 75c2a6dcd7f0..366dd6909198 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -205,7 +205,6 @@ public: static ByteString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 ); static ByteString CreateFromInt64( sal_Int64 n, sal_Int16 nRadix = 10 ); - static ByteString CreateFromFloat( float f ); static const ByteString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index f2af016158fe..fb5cafa357c5 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -115,16 +115,6 @@ ByteString ByteString::CreateFromInt64( sal_Int64 n, sal_Int16 nRadix ) // ----------------------------------------------------------------------- -ByteString ByteString::CreateFromFloat( float f ) -{ - sal_Char aBuf[RTL_STR_MAX_VALUEOFFLOAT]; - BOOST_STATIC_ASSERT(RTL_STR_MAX_VALUEOFFLOAT <= STRING_MAXLEN); - return ByteString( - aBuf, static_cast< xub_StrLen >(rtl_str_valueOfFloat( aBuf, f )) ); -} - -// ----------------------------------------------------------------------- - namespace { struct Empty : public rtl::Static< const ByteString, Empty> {}; } const ByteString& ByteString::EmptyString() { -- cgit v1.2.3 From 62cdb33fe18b37488dd908ceb315abe890eb14b8 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Tue, 28 Jun 2011 14:43:44 +0200 Subject: typo fix/silence warning C4819 on Windows --- svl/inc/svl/style.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 broadcasten. +must broadcast this using broadcasts. The class is used for this, it contains an Action-Id and a pointer to the . The actions are: -- cgit v1.2.3 From 7fe95cc52cf08b9351bd9af0a0a99941e4795233 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 09:02:15 +0100 Subject: remove deprecated ByteString::CreateFromInt64 --- l10ntools/source/export.cxx | 6 +- svtools/bmpmaker/bmpsum.cxx | 2 +- svtools/source/svhtml/htmlout.cxx | 2 +- tools/source/ref/pstm.cxx | 12 +-- tools/source/stream/strmunx.cxx | 25 +++--- vcl/unx/generic/fontmanager/fontcache.cxx | 121 +++++++++++++++--------------- 6 files changed, 89 insertions(+), 79 deletions(-) diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 69f1e967b13c..6d08da4144f7 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -1268,7 +1268,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(pResData->nWidth))); sOutput += "\t"; sOutput += sCur; sOutput += "\t"; @@ -1369,7 +1369,7 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList, // ByteString a("Export::WriteExportList::pEntry"); // Export::DumpMap( a, *pEntry ); - ByteString sLID( ByteString::CreateFromInt64( i + 1 )); + ByteString sLID(rtl::OString::valueOf(static_cast(i + 1))); for( unsigned int n = 0; n < aLanguages.size(); n++ ){ sCur = aLanguages[ n ]; if ( (*pEntry)[ SOURCE_LANGUAGE ].Len() ) @@ -1520,7 +1520,7 @@ 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 ); } diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 8d7d34240d94..215329aa41ff 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -411,7 +411,7 @@ void BmpSum::ProcessFileList( const String& rInFileList, // write new entries for( sal_uInt32 i = 0; i < aFileNameVector.size(); ++i ) { - ByteString aStr( ByteString::CreateFromInt64( aPair.first ) ); + ByteString aStr(rtl::OString::valueOf(static_cast(aPair.first))); ByteString aFileName( aFileNameVector[ i ] ); DirEntry aSrcFile( aFileName ); diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index 31e60e1ab1a1..b1b428d8fd3b 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -485,7 +485,7 @@ void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest, rDest += *pBuffer++; (((rDest += '&') += '#') += - ByteString::CreateFromInt64( (sal_uInt32)c )) += ';'; + ByteString(rtl::OString::valueOf(static_cast(c)))) += ';'; if( pNonConvertableChars && STRING_NOTFOUND == pNonConvertableChars->Search( c ) ) pNonConvertableChars->Append( c ); diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 75781b427c89..0507048ad12c 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -31,6 +31,7 @@ #include #include +#include #define STOR_NO_OPTIMIZE @@ -152,11 +153,12 @@ SvPersistStream& operator >> ( SvPersistStream & rStm, #ifdef DBG_UTIL if( nObjLen + nObjPos != rStm.Tell() ) { - ByteString aStr( "false list len: read = " ); - aStr += ByteString::CreateFromInt32( (long)(rStm.Tell() - nObjPos) ); - aStr += ", should = "; - aStr += ByteString::CreateFromInt64(nObjLen); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr( + RTL_CONSTASCII_STRINGPARAM("false list len: read = ")); + aStr.append(static_cast(rStm.Tell() - nObjPos)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(", should = ")); + aStr.append(static_cast(nObjLen)); + OSL_FAIL(aStr.getStr()); } #else (void)nObjLen; diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx index d9d177ce9658..9c84eeae54f8 100644 --- a/tools/source/stream/strmunx.cxx +++ b/tools/source/stream/strmunx.cxx @@ -48,6 +48,7 @@ // class FileBase #include #include +#include using namespace osl; @@ -355,11 +356,13 @@ sal_uInt16 SvFileStream::IsA() const sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) { #ifdef DBG_UTIL - ByteString aTraceStr( "SvFileStream::GetData(): " ); - aTraceStr += ByteString::CreateFromInt64(nSize); - aTraceStr += " Bytes from "; - aTraceStr += ByteString(aFilename, osl_getThreadTextEncoding()); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("SvFileStream::GetData(): ")); + aTraceStr.append(static_cast(nSize)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" Bytes from ")); + aTraceStr.append(rtl::OUStringToOString(aFilename, + osl_getThreadTextEncoding())); + OSL_TRACE("%s", aTraceStr.getStr()); #endif int nRead = 0; @@ -381,11 +384,13 @@ sal_Size SvFileStream::GetData( void* pData, sal_Size nSize ) sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize ) { #ifdef DBG_UTIL - ByteString aTraceStr( "SvFileStrean::PutData: " ); - aTraceStr += ByteString::CreateFromInt64(nSize); - aTraceStr += " Bytes to "; - aTraceStr += ByteString(aFilename, osl_getThreadTextEncoding()); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("SvFileStream::PutData(): ")); + aTraceStr.append(static_cast(nSize)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" Bytes to ")); + aTraceStr.append(rtl::OUStringToOString(aFilename, + osl_getThreadTextEncoding())); + OSL_TRACE("%s", aTraceStr.getStr()); #endif int nWrite = 0; diff --git a/vcl/unx/generic/fontmanager/fontcache.cxx b/vcl/unx/generic/fontmanager/fontcache.cxx index e7a4008f07f0..e47c95ec07ca 100644 --- a/vcl/unx/generic/fontmanager/fontcache.cxx +++ b/vcl/unx/generic/fontmanager/fontcache.cxx @@ -40,6 +40,8 @@ #include "tools/stream.hxx" +#include + #include #include @@ -132,13 +134,14 @@ void FontCache::flush() const FontDirMap& rDir( dir_it->second.m_aEntries ); ByteString aDirectory( rManager.getDirectory( dir_it->first ) ); - ByteString aLine( "FontCacheDirectory:" ); - aLine.Append( ByteString::CreateFromInt64( dir_it->second.m_nTimestamp ) ); - aLine.Append( ':' ); - aLine.Append( aDirectory ); + rtl::OStringBuffer aLine( + RTL_CONSTASCII_STRINGPARAM("FontCacheDirectory:")); + aLine.append(dir_it->second.m_nTimestamp); + aLine.append(':'); + aLine.append(aDirectory); if( rDir.empty() && dir_it->second.m_bNoFiles ) - aLine.Insert( "Empty", 0 ); - aStream.WriteLine( aLine ); + aLine.insert(0, RTL_CONSTASCII_STRINGPARAM("Empty")); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); for( FontDirMap::const_iterator entry_it = rDir.begin(); entry_it != rDir.end(); ++entry_it ) { @@ -147,16 +150,16 @@ void FontCache::flush() if( rEntry.begin() == rEntry.end() ) continue; - aLine = "File:"; - aLine.Append( ByteString( entry_it->first ) ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("File:")); + aLine.append(entry_it->first); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); int nEntrySize = entry_it->second.m_aEntry.size(); // write: type;nfonts - aLine = ByteString::CreateFromInt32( rEntry.front()->m_eType ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( nEntrySize ) ); - aStream.WriteLine( aLine ); + aLine.append(static_cast(rEntry.front()->m_eType)); + aLine.append(';'); + aLine.append(static_cast(nEntrySize)); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); sal_Int32 nSubEntry = 0; for( FontCacheEntry::const_iterator it = rEntry.begin(); it != rEntry.end(); ++it, nSubEntry++ ) @@ -171,73 +174,73 @@ void FontCache::flush() else nSubEntry = -1; - aLine = OUStringToOString( pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName ), RTL_TEXTENCODING_UTF8 ); + aLine.append(OUStringToOString(pAtoms->getString( ATOM_FAMILYNAME, (*it)->m_nFamilyName), RTL_TEXTENCODING_UTF8)); for( ::std::list< int >::const_iterator name_it = (*it)->m_aAliases.begin(); name_it != (*it)->m_aAliases.end(); ++name_it ) { const OUString& rAdd( pAtoms->getString( ATOM_FAMILYNAME, *name_it ) ); if( rAdd.getLength() ) { - aLine.Append( ';' ); - aLine.Append( ByteString( String( rAdd ), RTL_TEXTENCODING_UTF8 ) ); + aLine.append(';'); + aLine.append(OUStringToOString(rAdd, RTL_TEXTENCODING_UTF8)); } } - aStream.WriteLine( aLine ); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); const OUString& rPSName( pAtoms->getString( ATOM_PSNAME, (*it)->m_nPSName ) ); - aLine = ByteString::CreateFromInt32( nSubEntry ); - aLine.Append( ';' ); - aLine.Append( ByteString( String( rPSName ), RTL_TEXTENCODING_UTF8 ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eItalic ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWeight ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_eWidth ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_ePitch ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aEncoding ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nAscend ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nDescend ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_nLeading ) ); - aLine.Append( ';' ); - aLine.Append( (*it)->m_bHaveVerticalSubstitutedGlyphs ? "1" : "0" ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.width ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricX.height ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.width ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( (*it)->m_aGlobalMetricY.height ) ); - aLine.Append( ';' ); - aLine.Append( (*it)->m_bUserOverride ? "1" : "0" ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( 0 ) ); - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( 0 ) ); + aLine.append(nSubEntry); + aLine.append(';'); + aLine.append(OUStringToOString(rPSName, RTL_TEXTENCODING_UTF8)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eItalic)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eWeight)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_eWidth)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_ePitch)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aEncoding)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nAscend)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nDescend)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_nLeading)); + aLine.append(';'); + aLine.append((*it)->m_bHaveVerticalSubstitutedGlyphs ? '1' : '0'); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricX.width )); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricX.height)); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricY.width )); + aLine.append(';'); + aLine.append(static_cast((*it)->m_aGlobalMetricY.height)); + aLine.append(';'); + aLine.append((*it)->m_bUserOverride ? '1' : '0'); + aLine.append(';'); + aLine.append(static_cast(0)); + aLine.append(';'); + aLine.append(static_cast(0)); switch( (*it)->m_eType ) { case fonttype::Type1: - aLine.Append( ';' ); - aLine.Append( ByteString( static_cast(*it)->m_aMetricFile ) ); + aLine.append(';'); + aLine.append(static_cast(*it)->m_aMetricFile); break; case fonttype::TrueType: - aLine.Append( ';' ); - aLine.Append( ByteString::CreateFromInt32( static_cast(*it)->m_nTypeFlags ) ); + aLine.append(';'); + aLine.append(static_cast(static_cast(*it)->m_nTypeFlags)); break; default: break; } if( (*it)->m_aStyleName.getLength() ) { - aLine.Append( ';' ); - aLine.Append( ByteString( String( (*it)->m_aStyleName ), RTL_TEXTENCODING_UTF8 ) ); + aLine.append(';'); + aLine.append(OUStringToOString((*it)->m_aStyleName, RTL_TEXTENCODING_UTF8)); } - aStream.WriteLine( aLine ); + aStream.WriteLine(ByteString(aLine.makeStringAndClear())); } aStream.WriteLine( ByteString() ); } -- cgit v1.2.3 From 9e1dfa577973ba8bbe71159e76b1e7925c23f32a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 10:24:43 +0100 Subject: Related: fdo#38704 make simpleMapNativeRoleFrom::accessibleContext safer --- vcl/aqua/source/a11y/aqua11yrolehelper.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm index cfc052e96beb..9e6536da98bd 100644 --- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm +++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm @@ -42,6 +42,10 @@ using namespace ::com::sun::star::uno; +(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext { id nativeRole = nil; + + if (accessibleContext == NULL) + return nativeRole; + switch( accessibleContext -> getAccessibleRole() ) { #define MAP(a,b) \ case a: nativeRole = b; break -- cgit v1.2.3 From a0ae520db0a920b68d53592ffb7521e3dc916c05 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Thu, 23 Jun 2011 19:37:17 -0700 Subject: Replace List with std::vector< CntHTTPCookie* > --- svl/inc/svl/httpcook.hxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 #include #include +#include /*======================================================================= * @@ -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 -- cgit v1.2.3 From 1e409eadc59ac9164b1af01a821ea26c1167cdb2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:22:09 +0100 Subject: make cairo an unconditional requirement for text rendering --- canvas/prj/build.lst | 2 +- canvas/source/cairo/makefile.mk | 6 - vcl/Library_vcl.mk | 6 - vcl/Library_vclplug_gen.mk | 16 +++ vcl/aqua/source/gdi/salbmp.cxx | 2 - vcl/prj/build.lst | 2 +- vcl/unx/generic/gdi/salgdi3.cxx | 256 ++++++---------------------------------- 7 files changed, 51 insertions(+), 239 deletions(-) diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index dad6e28c0ea5..4719f157dfca 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -4,7 +4,7 @@ cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL cv canvas\source\vcl nmake - all cv_vcl cv_tools cv_inc NULL cv canvas\source\simplecanvas nmake - all cv_simplecanvas cv_tools cv_inc NULL -cv canvas\source\cairo nmake - all cv_cairo cv_tools cv_inc NULL +cv canvas\source\cairo nmake - u cv_cairo cv_tools cv_inc NULL cv canvas\source\directx nmake - w cv_directx cv_tools cv_inc NULL cv canvas\source\null nmake - all cv_null cv_tools cv_inc NULL cv canvas\source\factory nmake - all cv_factory cv_inc NULL diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index bde5fac59a2e..3be1d52e6c3b 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -37,17 +37,11 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk DLLPRE = -# --- Nothing to do if we're compiling with --disable-cairo ----------- -.IF "$(ENABLE_CAIRO)" != "TRUE" -@all: - @echo "Building without cairo support..." -.ELSE # --- X11 Mac build currently doesn't work with cairo ----------- .IF "$(OS)" == "MACOSX" && "$(GUIBASE)" == "unx" @all: @echo "Cannot build cairocanvas with X11..." .ENDIF -.ENDIF # --- Common ---------------------------------------------------------- diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 8811bda29661..e012d7129452 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -90,12 +90,6 @@ $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ $$(OBJCXXFLAGS) \ )) -ifeq ($(ENABLE_CAIRO),TRUE) -$(eval $(call gb_Library_set_defs,vclplug_gen,\ - $$(DEFS) \ - -DCAIRO \ -)) -endif $(eval $(call gb_Library_add_objcxxobjects,vcl,\ vcl/aqua/source/a11y/aqua11yactionwrapper \ vcl/aqua/source/a11y/aqua11ycomponentwrapper \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index b5cca31d365f..783d56b61f65 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -64,6 +64,17 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ $(gb_STDLIBS) \ )) +ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_ldflags,vclplug_gen,\ + $$(LDFLAGS) \ + $$(CAIRO_LIBS) \ +)) +else +$(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ + cairo \ +)) +endif + $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ vcl/unx/generic/app/i18n_cb \ vcl/unx/generic/app/i18n_ic \ @@ -119,6 +130,11 @@ $(eval $(call gb_Library_set_defs,vclplug_gen,\ -DVCLPLUG_GEN_IMPLEMENTATION \ )) +## unconditional cairo +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ +)) ## handle RandR ifneq ($(ENABLE_RANDR),) diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index bfb15f0a8076..6afad341e5b0 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -871,7 +871,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) { bRet = true; -#ifdef CAIRO if ((CGBitmapContextGetBitsPerPixel(mxGraphicContext) == 32) && (CGBitmapContextGetBitmapInfo(mxGraphicContext) & kCGBitmapByteOrderMask) != kCGBitmapByteOrder32Host) { /** @@ -904,7 +903,6 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) CGImageRelease( xImage ); mxGraphicContext = mxGraphicContextNew; } -#endif rData.rImageContext = (void *) mxGraphicContext; rData.mnWidth = mnWidth; diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 646a45563dde..4b0ece6b1d46 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 67874ff2c7d2..17240c90080a 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -78,28 +78,15 @@ #include "salframe.hxx" #include "outdev.h" - - #ifdef ENABLE_GRAPHITE #include #include #endif -struct cairo_surface_t; -struct cairo_t; -struct cairo_font_face_t; -typedef void* FT_Face; -struct cairo_matrix_t { - double xx; double yx; - double xy; double yy; - double x0; double y0; -}; -struct cairo_glyph_t -{ - unsigned long index; - double x; - double y; -}; +#include +#include +#include + struct BOX { short x1, x2, y1, y2; @@ -249,183 +236,12 @@ void ImplServerFontEntry::HandleFontOptions( void ) //-------------------------------------------------------------------------- -namespace { - -class CairoWrapper +namespace { -private: - osl::Module mpCairoLib; - - cairo_surface_t* (*mp_xlib_surface_create_with_xrender_format)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int ); - void (*mp_surface_destroy)(cairo_surface_t *); - cairo_t* (*mp_create)(cairo_surface_t *); - void (*mp_destroy)(cairo_t*); - void (*mp_clip)(cairo_t*); - void (*mp_rectangle)(cairo_t*, double, double, double, double); - cairo_font_face_t * (*mp_ft_font_face_create_for_ft_face)(FT_Face, int); - cairo_font_face_t * (*mp_ft_font_face_create_for_pattern)(void*); - void (*mp_set_font_face)(cairo_t *, cairo_font_face_t *); - void (*mp_font_face_destroy)(cairo_font_face_t *); - void (*mp_matrix_init_identity)(cairo_matrix_t *); - void (*mp_matrix_scale)(cairo_matrix_t *, double, double); - void (*mp_matrix_rotate)(cairo_matrix_t *, double); - void (*mp_set_font_matrix)(cairo_t *, const cairo_matrix_t *); - void (*mp_show_glyphs)(cairo_t *, const cairo_glyph_t *, int ); - void (*mp_set_source_rgb)(cairo_t *, double , double , double ); - void (*mp_set_font_options)(cairo_t *, const void *); - void (*mp_ft_font_options_substitute)(const void*, void*); - - bool canEmbolden() const { return mp_ft_font_face_create_for_pattern != NULL; } - - CairoWrapper(); -public: - static CairoWrapper& get(); - bool isValid() const { return (mpCairoLib != NULL); } - bool isCairoRenderable(const ServerFont& rFont); - - cairo_surface_t* xlib_surface_create_with_xrender_format(Display *pDisplay, Drawable drawable, Screen *pScreen, XRenderPictFormat *pFormat, int width, int height) - { return (*mp_xlib_surface_create_with_xrender_format)(pDisplay, drawable, pScreen, pFormat, width, height); } - void surface_destroy(cairo_surface_t *surface) { (*mp_surface_destroy)(surface); } - cairo_t* create(cairo_surface_t *surface) { return (*mp_create)(surface); } - void destroy(cairo_t *cr) { (*mp_destroy)(cr); } - void clip(cairo_t *cr) { (*mp_clip)(cr); } - void rectangle(cairo_t *cr, double x, double y, double width, double height) - { (*mp_rectangle)(cr, x, y, width, height); } - cairo_font_face_t* ft_font_face_create_for_ft_face(FT_Face face, int load_flags) - { return (*mp_ft_font_face_create_for_ft_face)(face, load_flags); } - cairo_font_face_t* ft_font_face_create_for_pattern(void *pattern) + bool isCairoRenderable(const ServerFont& rFont) { - return mp_ft_font_face_create_for_pattern - ? (*mp_ft_font_face_create_for_pattern)(pattern) - : NULL; + return rFont.GetFtFace() && rFont.GetAntialiasAdvice(); } - void set_font_face(cairo_t *cr, cairo_font_face_t *font_face) - { (*mp_set_font_face)(cr, font_face); } - void font_face_destroy(cairo_font_face_t *font_face) - { (*mp_font_face_destroy)(font_face); } - void matrix_init_identity(cairo_matrix_t *matrix) - { (*mp_matrix_init_identity)(matrix); } - void matrix_scale(cairo_matrix_t *matrix, double sx, double sy) - { (*mp_matrix_scale)(matrix, sx, sy); } - void matrix_rotate(cairo_matrix_t *matrix, double radians) - { (*mp_matrix_rotate)(matrix, radians); } - void set_font_matrix(cairo_t *cr, const cairo_matrix_t *matrix) - { (*mp_set_font_matrix)(cr, matrix); } - void show_glyphs(cairo_t *cr, const cairo_glyph_t *glyphs, int no_glyphs) - { (*mp_show_glyphs)(cr, glyphs, no_glyphs); } - void set_source_rgb(cairo_t *cr, double red, double green, double blue) - { (*mp_set_source_rgb)(cr, red, green, blue); } - void set_font_options(cairo_t *cr, const void *options) - { (*mp_set_font_options)(cr, options); } - void ft_font_options_substitute(const void *options, void *pattern) - { (*mp_ft_font_options_substitute)(options, pattern); } -}; - -static CairoWrapper* pCairoInstance = NULL; - -CairoWrapper& CairoWrapper::get() -{ - if( ! pCairoInstance ) - pCairoInstance = new CairoWrapper(); - return *pCairoInstance; -} - -CairoWrapper::CairoWrapper() -{ - static const char* pDisableCairoText = getenv( "SAL_DISABLE_CAIROTEXT" ); - if( pDisableCairoText && (pDisableCairoText[0] != '0') ) - return; - - int nDummy; - if( !XQueryExtension( GetX11SalData()->GetDisplay()->GetDisplay(), "RENDER", &nDummy, &nDummy, &nDummy ) ) - return; - -#ifdef MACOSX - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.2.dylib" )); -#else - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( "libcairo.so.2" )); -#endif - if ( !mpCairoLib.load( aLibName, SAL_LOADMODULE_DEFAULT ) ) - return; - -#ifdef DEBUG - // check cairo version - int (*p_version)(); - p_version = (int(*)()) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_version" ); - const int nVersion = p_version ? (*p_version)() : 0; - fprintf( stderr, "CAIRO version=%d\n", nVersion ); -#endif - - mp_xlib_surface_create_with_xrender_format = (cairo_surface_t* (*)(Display *, Drawable , Screen *, XRenderPictFormat *, int , int )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_xlib_surface_create_with_xrender_format" ); - mp_surface_destroy = (void(*)(cairo_surface_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" ); - mp_create = (cairo_t*(*)(cairo_surface_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" ); - mp_destroy = (void(*)(cairo_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" ); - mp_clip = (void(*)(cairo_t*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_clip" ); - mp_rectangle = (void(*)(cairo_t*, double, double, double, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_rectangle" ); - mp_ft_font_face_create_for_ft_face = (cairo_font_face_t * (*)(FT_Face, int)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_ft_face" ); - mp_ft_font_face_create_for_pattern = (cairo_font_face_t * (*)(void*)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_face_create_for_pattern" ); - mp_set_font_face = (void (*)(cairo_t *, cairo_font_face_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_face" ); - mp_font_face_destroy = (void (*)(cairo_font_face_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_font_face_destroy" ); - mp_matrix_init_identity = (void (*)(cairo_matrix_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" ); - mp_matrix_scale = (void (*)(cairo_matrix_t *, double, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" ); - mp_matrix_rotate = (void (*)(cairo_matrix_t *, double)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" ); - mp_set_font_matrix = (void (*)(cairo_t *, const cairo_matrix_t *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_matrix" ); - mp_show_glyphs = (void (*)(cairo_t *, const cairo_glyph_t *, int )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_show_glyphs" ); - mp_set_source_rgb = (void (*)(cairo_t *, double , double , double )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_source_rgb" ); - mp_set_font_options = (void (*)(cairo_t *, const void *options )) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_set_font_options" ); - mp_ft_font_options_substitute = (void (*)(const void *, void *)) - osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_ft_font_options_substitute" ); - - if( !( - mp_xlib_surface_create_with_xrender_format && - mp_surface_destroy && - mp_create && - mp_destroy && - mp_clip && - mp_rectangle && - mp_ft_font_face_create_for_ft_face && - mp_set_font_face && - mp_font_face_destroy && - mp_matrix_init_identity && - mp_matrix_scale && - mp_matrix_rotate && - mp_set_font_matrix && - mp_show_glyphs && - mp_set_source_rgb && - mp_set_font_options && - mp_ft_font_options_substitute - ) ) - { - mpCairoLib.unload(); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "not all needed symbols were found\n" ); -#endif - } -} - -bool CairoWrapper::isCairoRenderable(const ServerFont& rFont) -{ - return rFont.GetFtFace() && isValid() && rFont.GetAntialiasAdvice() && - (rFont.NeedsArtificialBold() ? canEmbolden() : true); -} - } //namespace CairoFontsCache::LRUFonts CairoFontsCache::maLRUFonts; @@ -441,10 +257,9 @@ CairoFontsCache::~CairoFontsCache() --mnRefCount; if (!mnRefCount && !maLRUFonts.empty()) { - CairoWrapper &rCairo = CairoWrapper::get(); LRUFonts::iterator aEnd = maLRUFonts.end(); for (LRUFonts::iterator aI = maLRUFonts.begin(); aI != aEnd; ++aI) - rCairo.font_face_destroy((cairo_font_face_t*)aI->first); + cairo_font_face_destroy((cairo_font_face_t*)aI->first); } } @@ -453,8 +268,7 @@ void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId maLRUFonts.push_front( std::pair(pFont, rId) ); if (maLRUFonts.size() > 8) { - CairoWrapper &rCairo = CairoWrapper::get(); - rCairo.font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first); + cairo_font_face_destroy((cairo_font_face_t*)maLRUFonts.back().first); maLRUFonts.pop_back(); } } @@ -493,11 +307,9 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) if( !pVisualFormat ) return; - CairoWrapper &rCairo = CairoWrapper::get(); - Display* pDisplay = GetXDisplay(); - cairo_surface_t *surface = rCairo.xlib_surface_create_with_xrender_format (pDisplay, + cairo_surface_t *surface = cairo_xlib_surface_create_with_xrender_format (pDisplay, hDrawable_, ScreenOfDisplay(pDisplay, m_nScreen), pVisualFormat, SAL_MAX_INT16, SAL_MAX_INT16); /* @@ -506,26 +318,26 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) * least change the SalFrame etc impls to dtor the SalGraphics *before* the * destruction of the windows they reference */ - cairo_t *cr = rCairo.create(surface); - rCairo.surface_destroy(surface); + cairo_t *cr = cairo_create(surface); + cairo_surface_destroy(surface); if (const void *pOptions = Application::GetSettings().GetStyleSettings().GetCairoFontOptions()) - rCairo.set_font_options( cr, pOptions); + cairo_set_font_options(cr, static_cast(pOptions)); if( mpClipRegion && !XEmptyRegion( mpClipRegion ) ) { for (long i = 0; i < mpClipRegion->numRects; ++i) { - rCairo.rectangle(cr, - mpClipRegion->rects[i].x1, - mpClipRegion->rects[i].y1, - mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1, - mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1); + cairo_rectangle(cr, + mpClipRegion->rects[i].x1, + mpClipRegion->rects[i].y1, + mpClipRegion->rects[i].x2 - mpClipRegion->rects[i].x1, + mpClipRegion->rects[i].y2 - mpClipRegion->rects[i].y1); } - rCairo.clip(cr); + cairo_clip(cr); } - rCairo.set_source_rgb(cr, + cairo_set_source_rgb(cr, SALCOLOR_RED(nTextColor_)/255.0, SALCOLOR_GREEN(nTextColor_)/255.0, SALCOLOR_BLUE(nTextColor_)/255.0); @@ -545,30 +357,30 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) const ImplFontOptions *pOptions = rFont.GetFontOptions().get(); void *pPattern = pOptions ? pOptions->GetPattern(pFace, aId.mbEmbolden) : NULL; if (pPattern) - font_face = rCairo.ft_font_face_create_for_pattern(pPattern); + font_face = cairo_ft_font_face_create_for_pattern(reinterpret_cast(pPattern)); if (!font_face) - font_face = rCairo.ft_font_face_create_for_ft_face(pFace, rFont.GetLoadFlags()); + font_face = cairo_ft_font_face_create_for_ft_face(reinterpret_cast(pFace), rFont.GetLoadFlags()); m_aCairoFontsCache.CacheFont(font_face, aId); } - rCairo.set_font_face(cr, font_face); + cairo_set_font_face(cr, font_face); cairo_matrix_t m; const ImplFontSelectData& rFSD = rFont.GetFontSelData(); int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight; - rCairo.matrix_init_identity(&m); + cairo_matrix_init_identity(&m); if (rLayout.GetOrientation()) - rCairo.matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); - rCairo.matrix_scale(&m, nWidth, rFSD.mnHeight); + cairo_matrix_scale(&m, nWidth, rFSD.mnHeight); if (rFont.NeedsArtificialItalic()) m.xy = -m.xx * 0x6000L / 0x10000L; - rCairo.set_font_matrix(cr, &m); - rCairo.show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); - rCairo.destroy(cr); + cairo_set_font_matrix(cr, &m); + cairo_show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); + cairo_destroy(cr); } //-------------------------------------------------------------------------- @@ -928,7 +740,7 @@ void X11SalGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ServerFont& rFont = rLayout.GetServerFont(); const bool bVertical = rFont.GetFontSelData().mbVertical; - if( !bVertical && CairoWrapper::get().isCairoRenderable(rFont) ) + if( !bVertical && isCairoRenderable(rFont) ) DrawCairoAAFontString( rLayout ); else { @@ -1087,16 +899,14 @@ void X11SalGraphics::GetDevFontSubstList( OutputDevice* ) // ---------------------------------------------------------------------------- -void cairosubcallback( void* pPattern ) +void cairosubcallback(void* pPattern) { - CairoWrapper& rCairo = CairoWrapper::get(); - if( !rCairo.isValid() ) - return; const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); const void* pFontOptions = rStyleSettings.GetCairoFontOptions(); if( !pFontOptions ) return; - rCairo.ft_font_options_substitute( pFontOptions, pPattern ); + cairo_ft_font_options_substitute(static_cast(pFontOptions), + static_cast(pPattern)); } ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) -- cgit v1.2.3 From 9302fd5dc62c4e04bc19f1e993f83baa21f14c98 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:29:39 +0100 Subject: dead pre-gbuild makefile.mks --- vcl/source/components/makefile.mk | 55 ----- vcl/source/gdi/makefile.mk | 127 ----------- vcl/util/makefile.mk | 465 -------------------------------------- 3 files changed, 647 deletions(-) delete mode 100644 vcl/source/components/makefile.mk delete mode 100755 vcl/source/gdi/makefile.mk delete mode 100755 vcl/util/makefile.mk diff --git a/vcl/source/components/makefile.mk b/vcl/source/components/makefile.mk deleted file mode 100644 index 41f21bfa3749..000000000000 --- a/vcl/source/components/makefile.mk +++ /dev/null @@ -1,55 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=vcl -TARGET=components -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/util$/makefile.pmk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile2.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= $(SLO)$/display.obj \ - $(SLO)$/dtranscomp.obj \ - $(SLO)$/fontident.obj \ - $(SLO)$/stringmirror.obj \ - $(SLO)$/rasterizer_rsvg.obj \ - $(SLO)$/factory.obj - -EXCEPTIONSFILES= $(SLO)$/rasterizer_rsvg.obj - - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk -.INCLUDE : $(PRJ)$/util$/target.pmk diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk deleted file mode 100755 index e124dc343eba..000000000000 --- a/vcl/source/gdi/makefile.mk +++ /dev/null @@ -1,127 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=vcl -TARGET=gdi - -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -.INCLUDE : $(PRJ)$/util$/makefile2.pmk - -.IF "$(COM)"=="ICC" -CDEFS+=-D_STD_NO_NAMESPACE -D_VOS_NO_NAMESPACE -D_UNO_NO_NAMESPACE -.ENDIF -.IF "$(ENABLE_GRAPHITE)" == "TRUE" -CDEFS+=-DENABLE_GRAPHITE -.IF "$(SYSTEM_GRAPHITE)" != "YES" -CDEFS+=-DGR2_STATIC -.ENDIF -.ENDIF - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES= $(SLO)$/salmisc.obj \ - $(SLO)$/animate.obj \ - $(SLO)$/base14.obj \ - $(SLO)$/bitmap.obj \ - $(SLO)$/bitmap2.obj \ - $(SLO)$/bitmapex.obj \ - $(SLO)$/bmpconv.obj \ - $(SLO)$/configsettings.obj \ - $(SLO)$/cvtgrf.obj \ - $(SLO)$/cvtsvm.obj \ - $(SLO)$/gdimtf.obj \ - $(SLO)$/gfxlink.obj \ - $(SLO)$/graph.obj \ - $(SLO)$/graphictools.obj \ - $(SLO)$/image.obj \ - $(SLO)$/imagerepository.obj \ - $(SLO)$/impanmvw.obj \ - $(SLO)$/impgraph.obj \ - $(SLO)$/impimage.obj \ - $(SLO)$/impimagetree.obj \ - $(SLO)$/impvect.obj \ - $(SLO)$/jobset.obj \ - $(SLO)$/lineinfo.obj \ - $(SLO)$/metaact.obj \ - $(SLO)$/metric.obj \ - $(SLO)$/oldprintadaptor.obj \ - $(SLO)$/outdev.obj \ - $(SLO)$/outdev2.obj \ - $(SLO)$/outdev3.obj \ - $(SLO)$/outdev4.obj \ - $(SLO)$/outdev5.obj \ - $(SLO)$/outdev6.obj \ - $(SLO)$/outdevnative.obj \ - $(SLO)$/outmap.obj \ - $(SLO)$/pdfextoutdevdata.obj \ - $(SLO)$/pdffontcache.obj\ - $(SLO)$/pdfwriter.obj \ - $(SLO)$/pdfwriter_impl.obj \ - $(SLO)$/pdfwriter_impl2.obj \ - $(SLO)$/pngread.obj \ - $(SLO)$/pngwrite.obj \ - $(SLO)$/print.obj \ - $(SLO)$/print2.obj \ - $(SLO)$/print3.obj \ - $(SLO)$/rendergraphic.obj \ - $(SLO)$/rendergraphicrasterizer.obj \ - $(SLO)$/salgdilayout.obj \ - $(SLO)$/sallayout.obj \ - $(SLO)$/salnativewidgets-none.obj \ - $(SLO)$/svgread.obj \ - $(SLO)$/textlayout.obj \ - $(SLO)$/virdev.obj \ - $(SLO)$/wall.obj - -SLOFILES= $(EXCEPTIONSFILES) \ - $(SLO)$/bitmap3.obj \ - $(SLO)$/bitmap4.obj \ - $(SLO)$/alpha.obj \ - $(SLO)$/bmpacc.obj \ - $(SLO)$/bmpacc2.obj \ - $(SLO)$/bmpacc3.obj \ - $(SLO)$/bmpfast.obj \ - $(SLO)$/font.obj \ - $(SLO)$/gradient.obj \ - $(SLO)$/hatch.obj \ - $(SLO)$/impbmp.obj \ - $(SLO)$/mapmod.obj \ - $(SLO)$/octree.obj \ - $(SLO)$/regband.obj \ - $(SLO)$/region.obj \ - $(SLO)$/extoutdevdata.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk deleted file mode 100755 index c8dc1012dd8f..000000000000 --- a/vcl/util/makefile.mk +++ /dev/null @@ -1,465 +0,0 @@ -#************************************************************************* -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -PRJNAME=vcl -TARGET=vcl -TARGETTYPE=GUI -USE_DEFFILE=TRUE -GEN_HID_OTHER=TRUE - -.IF "$(SNDFILE_LIBS)"!="" -SNDFILELIB=$(SNDFILE_LIBS) -.ENDIF - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : makefile.pmk -.INCLUDE : makefile2.pmk - -.IF "$(OS)" == "SOLARIS" -.IF "$(CPUNAME)" == "SPARC" && "$(CPU)" == "U" -LINKFLAGSRUNPATH_OOO := -R/usr/sfw/lib/64 $(LINKFLAGSRUNPATH_OOO) -.ELSE -LINKFLAGSRUNPATH_OOO := -R/usr/sfw/lib $(LINKFLAGSRUNPATH_OOO) -.ENDIF -.ENDIF - -# --- Allgemein ---------------------------------------------------------- - -HXXDEPNLST= $(INC)$/vcl$/accel.hxx \ - $(INC)$/vcl$/animate.hxx \ - $(INC)$/vcl$/apptypes.hxx \ - $(INC)$/vcl$/bitmap.hxx \ - $(INC)$/vcl$/bitmapex.hxx \ - $(INC)$/vcl$/bmpacc.hxx \ - $(INC)$/vcl$/btndlg.hxx \ - $(INC)$/vcl$/button.hxx \ - $(INC)$/vcl$/ctrl.hxx \ - $(INC)$/vcl$/cursor.hxx \ - $(INC)$/vcl$/cmdevt.hxx \ - $(INC)$/vcl$/decoview.hxx \ - $(INC)$/vcl$/dialog.hxx \ - $(INC)$/vcl$/dllapi.h \ - $(INC)$/vcl$/dockwin.hxx \ - $(INC)$/vcl$/edit.hxx \ - $(INC)$/vcl$/event.hxx \ - $(INC)$/vcl$/field.hxx \ - $(INC)$/vcl$/fixed.hxx \ - $(INC)$/vcl$/floatwin.hxx \ - $(INC)$/vcl$/font.hxx \ - $(INC)$/vcl$/floatwin.hxx \ - $(INC)$/vcl$/graph.hxx \ - $(INC)$/vcl$/group.hxx \ - $(INC)$/vcl$/help.hxx \ - $(INC)$/vcl$/jobset.hxx \ - $(INC)$/vcl$/keycodes.hxx \ - $(INC)$/vcl$/keycod.hxx \ - $(INC)$/vcl$/image.hxx \ - $(INC)$/vcl$/lstbox.h \ - $(INC)$/vcl$/lstbox.hxx \ - $(INC)$/vcl$/mapmod.hxx \ - $(INC)$/vcl$/metaact.hxx \ - $(INC)$/vcl$/menu.hxx \ - $(INC)$/vcl$/menubtn.hxx \ - $(INC)$/vcl$/metric.hxx \ - $(INC)$/vcl$/morebtn.hxx \ - $(INC)$/vcl$/msgbox.hxx \ - $(INC)$/vcl$/octree.hxx \ - $(INC)$/vcl$/outdev.hxx \ - $(INC)$/vcl$/pointr.hxx \ - $(INC)$/vcl$/ptrstyle.hxx \ - $(INC)$/vcl$/prntypes.hxx \ - $(INC)$/vcl$/print.hxx \ - $(INC)$/vcl$/prndlg.hxx \ - $(INC)$/vcl$/region.hxx \ - $(INC)$/vcl$/rendergraphic.hxx \ - $(INC)$/vcl$/rendergraphicrasterizer.hxx \ - $(INC)$/vcl$/salbtype.hxx \ - $(INC)$/vcl$/scrbar.hxx \ - $(INC)$/vcl$/slider.hxx \ - $(INC)$/vcl$/seleng.hxx \ - $(INC)$/vcl$/settings.hxx \ - $(INC)$/vcl$/sound.hxx \ - $(INC)$/vcl$/sndstyle.hxx \ - $(INC)$/vcl$/split.hxx \ - $(INC)$/vcl$/splitwin.hxx \ - $(INC)$/vcl$/spin.hxx \ - $(INC)$/vcl$/spinfld.hxx \ - $(INC)$/vcl$/status.hxx \ - $(INC)$/vcl$/stdtext.hxx \ - $(INC)$/vcl$/sv.h \ - $(INC)$/vcl$/svapp.hxx \ - $(INC)$/vcl$/syschild.hxx \ - $(INC)$/vcl$/sysdata.hxx \ - $(INC)$/vcl$/syswin.hxx \ - $(INC)$/vcl$/tabctrl.hxx \ - $(INC)$/vcl$/tabdlg.hxx \ - $(INC)$/vcl$/tabpage.hxx \ - $(INC)$/vcl$/toolbox.hxx \ - $(INC)$/vcl$/timer.hxx \ - $(INC)$/vcl$/virdev.hxx \ - $(INC)$/vcl$/wall.hxx \ - $(INC)$/vcl$/waitobj.hxx \ - $(INC)$/vcl$/window.hxx \ - $(INC)$/vcl$/wrkwin.hxx - -.IF "$(linkinc)" != "" -SHL11FILE= $(MISC)$/app.slo -SHL12FILE= $(MISC)$/gdi.slo -SHL13FILE= $(MISC)$/win.slo -SHL14FILE= $(MISC)$/ctrl.slo -SHL16FILE= $(MISC)$/salapp.slo -SHL17FILE= $(MISC)$/salwin.slo -SHL18FILE= $(MISC)$/salgdi.slo -.ENDIF - -LIB1TARGET= $(SLB)$/$(TARGET).lib -LIB1FILES= $(SLB)$/app.lib \ - $(SLB)$/gdi.lib \ - $(SLB)$/win.lib \ - $(SLB)$/ctrl.lib \ - $(SLB)$/helper.lib \ - $(SLB)$/fontsubset.lib \ - $(SLB)$/components.lib - -.IF "$(GUI)" == "UNX" && "$(GUIBASE)"!="aqua" -LIB1FILES+= $(SLB)$/salplug.lib \ - $(SLB)$/fontman.lib \ - $(SLB)$/printer.lib -.ELSE -LIB1FILES+= \ - $(SLB)$/salwin.lib \ - $(SLB)$/salgdi.lib \ - $(SLB)$/salapp.lib -.IF "$(GUIBASE)" == "aqua" -LIB1FILES+= $(SLB)$/dtransaqua.lib -.ENDIF -.ENDIF - -SHL1TARGET= vcl$(DLLPOSTFIX) -SHL1IMPLIB= ivcl -SHL1STDLIBS+=\ - $(SOTLIB) \ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(I18NPAPERLIB) \ - $(I18NISOLANGLIB) \ - $(I18NUTILLIB) \ - $(COMPHELPERLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - $(BASEGFXLIB) \ - $(ICUUCLIB) \ - $(ICUDATALIB) \ - $(ICULELIB) \ - $(JVMACCESSLIB) - -.IF "$(GUI)" == "UNX" -.IF "$(ENABLE_GRAPHITE)" != "" -.IF "$(SYSTEM_GRAPHITE)" == "YES" -SHL1STDLIBS+= $(GRAPHITE_LIBS) -.ELSE -SHL1STDLIBS+= -lgraphite2_off -.ENDIF -.ENDIF -.ENDIF -SHL1USE_EXPORTS=name - -.IF "$(GUIBASE)"=="aqua" -SHL1STDLIBS+= \ - $(BASEBMPLIB) \ - -lAppleRemote$(DLLPOSTFIX) \ - -framework QuickTime - -LIB1FILES+= \ - $(SLB)$/sala11y.lib -.ENDIF - -.IF "$(USE_BUILTIN_RASTERIZER)"!="" - LIB1FILES += $(SLB)$/glyphs.lib - SHL1STDLIBS+= $(FREETYPELIB) -.ELSE -.IF "$(ENABLE_GRAPHITE)" == "TRUE" - LIB1FILES += $(SLB)$/glyphs.lib -.ENDIF -.ENDIF # USE_BUILTIN_RASTERIZER - -SHL1LIBS= $(LIB1TARGET) - -.IF "$(GUI)" != "UNX" -SHL1RES= $(RES)$/salsrc.res -.ENDIF - -SHL1DEF= $(MISC)$/$(SHL1TARGET).def - -DEF1NAME =$(SHL1TARGET) -DEF1DEPN = $(HXXDEPNLST) \ - $(LIB1TARGET) -DEF1DES =VCL -DEFLIB1NAME =vcl - -# --- W32 ---------------------------------------------------------------- - -.IF "$(GUI)" == "WNT" - -.IF "$(ENABLE_GRAPHITE)" == "TRUE" -.IF "$(COM)" == "GCC" -SHL1STDLIBS += -Wl,-Bstatic -lgraphite2_off -Wl,-Bdynamic -#SHL1STDLIBS += -lgraphite2_off -.ELSE -SHL1STDLIBS += graphite2_off.lib -.ENDIF -.ENDIF - -SHL1STDLIBS += $(UWINAPILIB) \ - $(GDI32LIB) \ - $(GDIPLUSLIB) \ - $(MSIMG32LIB) \ - $(WINSPOOLLIB) \ - $(OLE32LIB) \ - $(SHELL32LIB) \ - $(ADVAPI32LIB) \ - $(VERSIONLIB) - -SHL1STDLIBS += $(IMM32LIB) - -.IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI" -LINKFLAGSSHL += /ENTRY:LibMain@12 -.ENDIF -.ENDIF - -# --- UNX ---------------------------------------------------------------- - -# UNX sal plugins -.IF "$(GUI)" == "UNX" && "$(GUIBASE)" != "aqua" - -# desktop detector -LIB7TARGET=$(SLB)$/idet -LIB7FILES=$(SLB)$/dtdetect.lib -SHL7TARGET=desktop_detector$(DLLPOSTFIX) -SHL7STDLIBS=\ - $(SALLIB) \ - $(X11LINK_DYNAMIC) -SHL7IMPLIB=idet -SHL7LIBS=$(LIB7TARGET) - -# basic pure X11 plugin -LIB2TARGET=$(SLB)$/ipure_x -LIB2FILES= \ - $(SLB)$/dtransX11.lib \ - $(SLB)$/printergfx.lib \ - $(SLB)$/salwin.lib \ - $(SLB)$/salgdi.lib \ - $(SLB)$/salapp.lib -SHL2TARGET=vclplug_gen$(DLLPOSTFIX) -SHL2IMPLIB=ipure_x -SHL2LIBS=$(LIB2TARGET) -SHL2DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) - -# libs for generic plugin -SHL2STDLIBS=\ - $(VCLLIB)\ - $(I18NPAPERLIB) \ - $(I18NISOLANGLIB) \ - $(TOOLSLIB) \ - $(BASEGFXLIB) \ - $(UNOTOOLSLIB) \ - $(COMPHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -# prepare linking of Xinerama -.IF "$(USE_XINERAMA)" != "NO" - -.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX" -XINERAMALIBS=-lXinerama -.ELSE -.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg" -.IF "$(XINERAMA_LINK)" == "dynamic" -XINERAMALIBS= -lXinerama -.ELSE -XINERAMALIBS= -Wl,-Bstatic -lXinerama -Wl,-Bdynamic -.ENDIF # XINERAMA_LINK == dynamic -.ENDIF # OS == SOLARIS -.ENDIF # OS == MACOSX - -SHL2STDLIBS += $(XINERAMALIBS) -.ENDIF # USE_XINERAMA != NO - -.IF "$(XRENDER_LINK)" == "YES" -SHL2STDLIBS+=`pkg-config --libs xrender` -.ENDIF - -.IF "$(GUIBASE)"=="unx" - -SHL2STDLIBS += -lXext -lSM -lICE -lX11 -.IF "$(OS)"!="MACOSX" && "$(OS)"!="FREEBSD" && "$(OS)"!="NETBSD" && \ - && "$(OS)"!="OPENBSD" "$(OS)"!="DRAGONFLY" -# needed by salprnpsp.cxx -SHL2STDLIBS+= -ldl -.ENDIF - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL2STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -.ENDIF # "$(GUIBASE)"=="unx" - -# gtk plugin -.IF "$(ENABLE_GTK)" != "" -PKGCONFIG_MODULES=gtk+-2.0 gthread-2.0 -.IF "$(ENABLE_DBUS)" != "" -PKGCONFIG_MODULES+= dbus-glib-1 -.ENDIF -.INCLUDE: pkg_config.mk - -LIB4TARGET=$(SLB)$/igtk_plug_ -LIB4FILES=\ - $(SLB)$/gtkapp.lib\ - $(SLB)$/gtka11y.lib \ - $(SLB)$/gtkgdi.lib\ - $(SLB)$/gtkwin.lib - -SHL4TARGET=vclplug_gtk$(DLLPOSTFIX) -SHL4IMPLIB=igtk_plug_ -SHL4LIBS=$(LIB4TARGET) -SHL4DEPN=$(SHL1IMPLIBN) $(SHL1TARGETN) $(SHL2IMPLIBN) $(SHL2TARGETN) -# libs for gtk plugin -SHL4STDLIBS+=$(PKGCONFIG_LIBS:s/ -lpangoxft-1.0//) -# hack for faked SO environment -.IF "$(PKGCONFIG_ROOT)"!="" -SHL4SONAME+=-z nodefs -SHL4NOCHECK=TRUE -.ENDIF # "$(PKGCONFIG_ROOT)"!="" - - -SHL4STDLIBS+=-l$(SHL2TARGET) -SHL4STDLIBS+=\ - $(VCLLIB) \ - $(TOOLSLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL4STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -.ENDIF # "$(ENABLE_GTK)" != "" - -# KDE plugin -.IF "$(ENABLE_KDE)" != "" -.IF "$(KDE_ROOT)"!="" -EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib -.IF "$(OS)$(CPU)" == "LINUXX" -EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 -.ENDIF -.ENDIF -LIB5TARGET=$(SLB)$/ikde_plug_ -LIB5FILES=$(SLB)$/kdeplug.lib -SHL5TARGET=vclplug_kde$(DLLPOSTFIX) -SHL5IMPLIB=ikde_plug_ -SHL5LIBS=$(LIB5TARGET) -SHL5DEPN=$(SHL2TARGETN) -# libs for KDE plugin -SHL5STDLIBS+=-l$(SHL2TARGET) -SHL5STDLIBS+=\ - $(VCLLIB) \ - $(TOOLSLIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL5STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -SHL5LINKFLAGS+=$(KDE_LIBS) - -.ENDIF # "$(ENABLE_KDE)" != "" - -# KDE4 plugin -.IF "$(ENABLE_KDE4)" != "" -.IF "$(KDE4_ROOT)"!="" -EXTRALIBPATHS+=-L$(KDE4_ROOT)$/lib -.ENDIF -LIB6TARGET=$(SLB)$/ikde4_plug_ -LIB6FILES=$(SLB)$/kde4plug.lib -SHL6TARGET=vclplug_kde4$(DLLPOSTFIX) -SHL6IMPLIB=ikde4_plug_ -SHL6LIBS=$(LIB6TARGET) -SHL6DEPN=$(SHL2TARGETN) -# libs for KDE4 plugin -SHL6STDLIBS+=-l$(SHL2TARGET) -SHL6STDLIBS+=\ - $(VCLLIB) \ - $(PSPLIB) \ - $(TOOLSLIB) \ - $(SALLIB) \ - $(X11LINK_DYNAMIC) - -.IF "$(ENABLE_RANDR)" != "" -.IF "$(XRANDR_DLOPEN)" == "FALSE" -SHL6STDLIBS+= $(XRANDR_LIBS) -.ENDIF -.ENDIF - -SHL6STDLIBS+=$(KDE4_LIBS) $(KDE_GLIB_LIBS) - -.ENDIF # "$(ENABLE_KDE4)" != "" - -.ENDIF # UNX - -# --- Allgemein ---------------------------------------------------------- - -.INCLUDE : target.mk - -ALLTAR : $(MISC)/vcl.component - -.IF "$(OS)" == "MACOSX" -my_platform = .macosx -.ELIF "$(OS)" == "WNT" -my_platform = .windows -.END - -$(MISC)/vcl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - vcl.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt vcl$(my_platform).component -- cgit v1.2.3 From ced906ea4d0b2ab93fc1c6417097db513fbef5a7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 29 Jun 2011 16:40:32 +0100 Subject: tweak for internal cairo --- vcl/Library_vclplug_gen.mk | 16 ++++++++++------ vcl/unx/generic/gdi/salgdi3.cxx | 6 ++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 783d56b61f65..d1954004b3d3 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -65,11 +65,21 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ )) ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ + -DSYSTEM_CAIRO \ +)) $(eval $(call gb_Library_set_ldflags,vclplug_gen,\ $$(LDFLAGS) \ $$(CAIRO_LIBS) \ )) else +$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ + $$(CXXFLAGS) \ + $$(FONTCONFIG_CFLAGS) \ + $$(FREETYPE_CFLAGS) \ +)) $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ cairo \ )) @@ -130,12 +140,6 @@ $(eval $(call gb_Library_set_defs,vclplug_gen,\ -DVCLPLUG_GEN_IMPLEMENTATION \ )) -## unconditional cairo -$(eval $(call gb_Library_set_cxxflags,vclplug_gen,\ - $$(CXXFLAGS) \ - $$(CAIRO_CFLAGS) \ -)) - ## handle RandR ifneq ($(ENABLE_RANDR),) $(eval $(call gb_Library_set_defs,vclplug_gen,\ diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 17240c90080a..25dc002cfdc5 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -83,9 +83,15 @@ #include #endif +#ifdef SYSTEM_CAIRO #include #include #include +#else +#include +#include +#include +#endif struct BOX { -- cgit v1.2.3 From b03b96fc6e8197d2c3b37df526c12b74dddca40d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Jun 2011 09:59:59 +0100 Subject: remove deprecated ByteString::CreateFromInt64 --- tools/inc/tools/string.hxx | 1 - tools/source/string/tstring.cxx | 13 +++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 366dd6909198..4268973e9b05 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -204,7 +204,6 @@ public: } static ByteString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 ); - static ByteString CreateFromInt64( sal_Int64 n, sal_Int16 nRadix = 10 ); static const ByteString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index fb5cafa357c5..e8830fd27de9 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -104,21 +104,14 @@ ByteString ByteString::CreateFromInt32( sal_Int32 n, sal_Int16 nRadix ) // ----------------------------------------------------------------------- -ByteString ByteString::CreateFromInt64( sal_Int64 n, sal_Int16 nRadix ) +namespace { - sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64]; - BOOST_STATIC_ASSERT(RTL_STR_MAX_VALUEOFINT64 <= STRING_MAXLEN); - return ByteString( - aBuf, - static_cast< xub_StrLen >(rtl_str_valueOfInt64( aBuf, n, nRadix )) ); + struct theEmpty : public rtl::Static< const ByteString, theEmpty> {}; } -// ----------------------------------------------------------------------- - -namespace { struct Empty : public rtl::Static< const ByteString, Empty> {}; } const ByteString& ByteString::EmptyString() { - return Empty::get(); + return theEmpty::get(); } // ----------------------------------------------------------------------- -- cgit v1.2.3 From 8d22e8e7d32a1f06cb5dbd72856f3cf841d3d163 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Jun 2011 10:44:56 +0100 Subject: unused pure-virtual WorkOnRessourceEnd body --- l10ntools/source/cfgmerge.cxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index c4f24edeb487..f2a713ce5a75 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 ) /*****************************************************************************/ -- cgit v1.2.3 From 5f241208f1f413f01d68dce527b229d45fd912b7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Jun 2011 10:50:21 +0100 Subject: callcatcher: unused code --- l10ntools/inc/export.hxx | 9 ---- l10ntools/source/export.cxx | 25 --------- l10ntools/source/export2.cxx | 113 ----------------------------------------- l10ntools/source/helpmerge.cxx | 2 +- l10ntools/source/xrmmerge.cxx | 1 - 5 files changed, 1 insertion(+), 149 deletions(-) diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index 0d707abe9898..aedf7fdfd956 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -345,23 +345,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::const_iterator& begin , std::vector::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 +371,6 @@ private: static std::vector aLanguages; static std::vector 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,7 +385,6 @@ 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 ); diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 6d08da4144f7..2ef0f1467b9f 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -1155,31 +1155,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 ) /*****************************************************************************/ diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index 0b7fb44d8a95..35e46da64891 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -140,75 +140,6 @@ std::vector Export::GetForcedLanguages(){ std::vector Export::aLanguages = std::vector(); std::vector Export::aForcedLanguages = std::vector(); - -/*****************************************************************************/ -void Export::QuotHTMLXRM( ByteString &rString ) -/*****************************************************************************/ -{ - ByteString sReturn; - for ( sal_uInt16 i = 0; i < rString.Len(); i++ ) { - ByteString sTemp = rString.Copy( i ); - if ( sTemp.Search( ""; - 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 +=""; - 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 +=""; - 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,29 +377,6 @@ 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 ) /*****************************************************************************/ @@ -611,15 +513,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 +560,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/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 9203fd94b5e7..5a0ffa193edd 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -454,7 +454,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 ) diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 875fd457cf93..e682463bf523 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -648,7 +648,6 @@ void XRMResMerge::WorkOnText( { rText = sContent; ConvertStringToXMLFormat( rText ); - //Export::QuotHTMLXRM( rText ); } } } -- cgit v1.2.3 From fe26694b03e30c63952e54b1139a6009dc1448bb Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 29 Jun 2011 20:52:44 +0300 Subject: Add Emacs and vim mode lines to *.mm files, too --- vcl/aqua/source/a11y/aqua11yactionwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yfactory.mm | 3 +++ vcl/aqua/source/a11y/aqua11yrolehelper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yselectionwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytablewrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ytextwrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11yutil.mm | 3 +++ vcl/aqua/source/a11y/aqua11yvaluewrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapper.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperbutton.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappercombobox.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappergroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperlist.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperrow.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappersplitter.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertextarea.mm | 3 +++ vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm | 3 +++ vcl/aqua/source/app/salnstimer.mm | 2 ++ vcl/aqua/source/app/vclnsapp.mm | 2 ++ vcl/aqua/source/gdi/aquaprintaccessoryview.mm | 3 +++ vcl/aqua/source/gdi/aquaprintview.mm | 3 +++ vcl/aqua/source/window/salframeview.mm | 2 ++ vcl/aqua/source/window/salnsmenu.mm | 2 ++ 32 files changed, 92 insertions(+) mode change 100755 => 100644 vcl/aqua/source/app/salnstimer.mm mode change 100755 => 100644 vcl/aqua/source/app/vclnsapp.mm mode change 100755 => 100644 vcl/aqua/source/gdi/aquaprintview.mm mode change 100755 => 100644 vcl/aqua/source/window/salframeview.mm mode change 100755 => 100644 vcl/aqua/source/window/salnsmenu.mm diff --git a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm index e49ad251faad..d0f8ca91c73d 100644 --- a/vcl/aqua/source/a11y/aqua11yactionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yactionwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm index c66e7c3d8515..0f50dad02c0e 100644 --- a/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ycomponentwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yfactory.mm b/vcl/aqua/source/a11y/aqua11yfactory.mm index 41b66d19e578..944a8e9ea90a 100644 --- a/vcl/aqua/source/a11y/aqua11yfactory.mm +++ b/vcl/aqua/source/a11y/aqua11yfactory.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,5 @@ static bool enabled = false; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yrolehelper.mm b/vcl/aqua/source/a11y/aqua11yrolehelper.mm index 9e6536da98bd..e989f38f4a1b 100644 --- a/vcl/aqua/source/a11y/aqua11yrolehelper.mm +++ b/vcl/aqua/source/a11y/aqua11yrolehelper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm index 5b8d604f3b1a..960afb384caa 100644 --- a/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yselectionwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -94,3 +95,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm index 110cb42ffee7..47b766df2223 100644 --- a/vcl/aqua/source/a11y/aqua11ytablewrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytablewrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -210,3 +211,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm index 2122f56e9565..5a4628edb76e 100644 --- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -254,3 +255,5 @@ using namespace ::rtl; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm index d956d2beb0b7..cb6fae77a7a9 100644 --- a/vcl/aqua/source/a11y/aqua11ytextwrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextwrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -299,3 +300,5 @@ using namespace ::rtl; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yutil.mm b/vcl/aqua/source/a11y/aqua11yutil.mm index 74de0a19aa41..b244f1f67855 100644 --- a/vcl/aqua/source/a11y/aqua11yutil.mm +++ b/vcl/aqua/source/a11y/aqua11yutil.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,3 +53,5 @@ using namespace ::com::sun::star::awt; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm index fb257921b13e..fc10d44058d8 100644 --- a/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm +++ b/vcl/aqua/source/a11y/aqua11yvaluewrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapper.mm b/vcl/aqua/source/a11y/aqua11ywrapper.mm index bf8de98c3318..2376111eb427 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapper.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1145,3 +1146,5 @@ Reference < XAccessibleContext > hitTestRunner ( com::sun::star::awt::Point poin } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm index e51ceff14af9..dd9b95901d13 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperbutton.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,3 +61,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm index 6bf2aa2f8340..1c70d774d0eb 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappercheckbox.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm index 6f8e9d05d112..1fd7468f8858 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappercombobox.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,5 @@ using namespace ::com::sun::star::uno; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm index 536cc9bba8eb..f3e1dcf769c5 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappergroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappergroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm index d70679ed6966..9c7f5f6fe932 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperlist.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperlist.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm index 4c1e9047d65e..af4fda68a86e 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperradiobutton.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm index 52e71620ceed..47668005376a 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperradiogroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm index 0fd65fd01365..8ecd37aafc1c 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperrow.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperrow.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm index 8a481b64926d..7c9c6f12fc63 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollarea.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm index 42b67b739602..5087ae5e3f3e 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperscrollbar.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -49,3 +50,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm index 37821f25e423..96f8c6413cc9 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappersplitter.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ using namespace ::com::sun::star::accessibility; } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm index d5afe0962904..d280264a36bd 100644 --- a/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm +++ b/vcl/aqua/source/a11y/aqua11ywrapperstatictext.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm index fb4e66ad9b90..09fa3d2b6947 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertabgroup.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm index a90fe7ae28aa..074b6d84d427 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertextarea.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm index 29ddaf540266..636be7b2fd32 100644 --- a/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm +++ b/vcl/aqua/source/a11y/aqua11ywrappertoolbar.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -48,3 +49,5 @@ } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/app/salnstimer.mm b/vcl/aqua/source/app/salnstimer.mm old mode 100755 new mode 100644 index f44c3d698f73..d78a3ae8462e --- a/vcl/aqua/source/app/salnstimer.mm +++ b/vcl/aqua/source/app/salnstimer.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,4 @@ } @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm old mode 100755 new mode 100644 index cfb4d5e62454..5206c17dd2d7 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -506,3 +507,4 @@ @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm index 2bb67dcc1940..abe314f27f8f 100644 --- a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm +++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1389,3 +1390,5 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm old mode 100755 new mode 100644 index 692435fc00f0..a7a527a9289b --- a/vcl/aqua/source/gdi/aquaprintview.mm +++ b/vcl/aqua/source/gdi/aquaprintview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ mpController->printFilteredPage( nPage-1 ); } @end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm old mode 100755 new mode 100644 index ade5594ec667..54ebe8090f1c --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*n*********************************************************************** * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1728,3 +1729,4 @@ private: @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/window/salnsmenu.mm b/vcl/aqua/source/window/salnsmenu.mm old mode 100755 new mode 100644 index b86caa49d870..c2f182773ce6 --- a/vcl/aqua/source/window/salnsmenu.mm +++ b/vcl/aqua/source/window/salnsmenu.mm @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,4 @@ @end +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 094092d47489fd040668bbcc6315a1221bbfc42b Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Fri, 1 Jul 2011 07:31:14 +0200 Subject: Do not include filedlg.hxx when not necessary --- svtools/bmpmaker/bmp.cxx | 1 - svtools/source/uno/unoiface.cxx | 1 - 2 files changed, 2 deletions(-) diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx index dce36f039730..a66312f60710 100644 --- a/svtools/bmpmaker/bmp.cxx +++ b/svtools/bmpmaker/bmp.cxx @@ -40,7 +40,6 @@ using namespace std; #include #include "svl/solar.hrc" -#include #include "bmpcore.hxx" #include "bmp.hrc" diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx index d2cf9cbf12cf..4bc5cae12cb6 100644 --- a/svtools/source/uno/unoiface.cxx +++ b/svtools/source/uno/unoiface.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From ae25807a8462e71433798283f29b2ff82ba3a9df Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Jun 2011 22:54:36 +0100 Subject: ByteString::CreateFromInt32 -> OString::valueOf --- sot/source/base/factory.cxx | 7 ++-- tools/bootstrp/mkunroll/mkunroll.cxx | 2 +- tools/source/generic/config.cxx | 33 +++++++++------- tools/source/inet/inetmsg.cxx | 47 +++++++++++++---------- tools/source/rc/resmgr.cxx | 74 ++++++++++++++++++++---------------- tools/source/ref/errinf.cxx | 36 ++++++++++-------- tools/source/ref/pstm.cxx | 20 +++++----- 7 files changed, 124 insertions(+), 95 deletions(-) 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 #include #include +#include /************** 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(pSotData->nSvObjCount)); + DBG_WARNING(aStr.getStr()); #endif return; } diff --git a/tools/bootstrp/mkunroll/mkunroll.cxx b/tools/bootstrp/mkunroll/mkunroll.cxx index ff958ba8e717..c1b0252a65ca 100644 --- a/tools/bootstrp/mkunroll/mkunroll.cxx +++ b/tools/bootstrp/mkunroll/mkunroll.cxx @@ -212,7 +212,7 @@ void MkFilter::Filter() { MkLine *pMkLine = (*pLine->pPrivateTnrLst)[ i ]; ByteString aLine = pMkLine->aLine; - while( aLine.SearchAndReplace( aTnr, ByteString::CreateFromInt32( n )) != (sal_uInt16)-1 ) ; + while( aLine.SearchAndReplace( aTnr, rtl::OString::valueOf(static_cast(n)) ) != (sal_uInt16)-1 ) ; fputs( aLine.GetBuffer(), pOut ); fprintf( stderr, "o" ); } diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx index 6c533459f2a7..2075bf49e300 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -45,6 +45,7 @@ #include #include #include +#include #define MAXBUFLEN 1024 // Fuer Buffer bei VOS-Funktionen @@ -1188,13 +1189,15 @@ sal_uInt16 Config::GetKeyCount() const ByteString Config::GetKeyName( sal_uInt16 nKey ) const { #ifdef DBG_UTIL - ByteString aTraceStr( "Config::GetKeyName( " ); - aTraceStr += ByteString::CreateFromInt32(nKey); - aTraceStr += " ) from "; - aTraceStr += GetGroup(); - aTraceStr += " in "; - aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 ); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("Config::GetKeyName( ")); + aTraceStr.append(static_cast(nKey)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from ")); + aTraceStr.append(GetGroup()); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in ")); + aTraceStr.append(rtl::OUStringToOString( + maFileName, RTL_TEXTENCODING_UTF8)); + OSL_TRACE("%s", aTraceStr.getStr()); #endif // Key suchen und Name zurueckgeben @@ -1223,13 +1226,15 @@ ByteString Config::GetKeyName( sal_uInt16 nKey ) const ByteString Config::ReadKey( sal_uInt16 nKey ) const { #ifdef DBG_UTIL - ByteString aTraceStr( "Config::ReadKey( " ); - aTraceStr += ByteString::CreateFromInt32( nKey ); - aTraceStr += " ) from "; - aTraceStr += GetGroup(); - aTraceStr += " in "; - aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 ); - OSL_TRACE( "%s", aTraceStr.GetBuffer() ); + rtl::OStringBuffer aTraceStr( + RTL_CONSTASCII_STRINGPARAM("Config::ReadKey( ")); + aTraceStr.append(static_cast(nKey)); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from ")); + aTraceStr.append(GetGroup()); + aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in ")); + aTraceStr.append(rtl::OUStringToOString(maFileName, + RTL_TEXTENCODING_UTF8)); + OSL_TRACE("%s", aTraceStr.getStr()); #endif // Key suchen und Value zurueckgeben diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 2fc9f5fcb8e3..0bec115de6d6 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -367,41 +368,47 @@ sal_Bool INetRFC822Message::GenerateDateField ( (rDateTime.GetHour() > 23) ) return sal_False; // Prepare output string. - ByteString rDateField; + rtl::OStringBuffer aDateField; // Insert Date. - rDateField += wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())]; - rDateField += ", "; + aDateField.append(wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())]); + aDateField.append(RTL_CONSTASCII_STRINGPARAM(", ")); sal_uInt16 nNum = rDateTime.GetDay(); - if (nNum < 10) rDateField += '0'; - rDateField += ByteString::CreateFromInt32(nNum); - rDateField += ' '; + if (nNum < 10) + aDateField.append('0'); + aDateField.append(static_cast(nNum)); + aDateField.append(' '); - rDateField += months[(sal_uInt16)(rDateTime.GetMonth() - 1)]; - rDateField += ' '; + aDateField.append(months[(sal_uInt16)(rDateTime.GetMonth() - 1)]); + aDateField.append(' '); - rDateField += ByteString::CreateFromInt32(rDateTime.GetYear()); - rDateField += ' '; + aDateField.append(static_cast(rDateTime.GetYear())); + aDateField.append(' '); // Insert Time. nNum = rDateTime.GetHour(); - if (nNum < 10) rDateField += '0'; - rDateField += ByteString::CreateFromInt32(nNum); - rDateField += ':'; + if (nNum < 10) + aDateField.append('0'); + aDateField.append(static_cast(nNum)); + aDateField.append(':'); nNum = rDateTime.GetMin(); - if (nNum < 10) rDateField += '0'; - rDateField += ByteString::CreateFromInt32(nNum); - rDateField += ':'; + if (nNum < 10) + aDateField.append('0'); + aDateField.append(static_cast(nNum)); + aDateField.append(':'); nNum = rDateTime.GetSec(); - if (nNum < 10) rDateField += '0'; - rDateField += ByteString::CreateFromInt32(nNum); - rDateField += " GMT"; + if (nNum < 10) + aDateField.append('0'); + aDateField.append(static_cast(nNum)); + aDateField.append(RTL_CONSTASCII_STRINGPARAM(" GMT")); // Done. - rDateFieldW = UniString (rDateField, RTL_TEXTENCODING_ASCII_US); + rDateFieldW = rtl::OStringToOUString(aDateField.makeStringAndClear(), + RTL_TEXTENCODING_ASCII_US); + return sal_True; } diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx index d4b7225a22d4..8b53ebb81823 100644 --- a/tools/source/rc/resmgr.cxx +++ b/tools/source/rc/resmgr.cxx @@ -590,19 +590,20 @@ InternalResMgr::~InternalResMgr() { SvFileStream aStm( UniString( pLogFile, RTL_TEXTENCODING_ASCII_US ), STREAM_WRITE ); aStm.Seek( STREAM_SEEK_TO_END ); - ByteString aLine( "FileName: " ); - aLine.Append( ByteString( OUStringToOString( aFileName, RTL_TEXTENCODING_UTF8 ) ) ); - aStm.WriteLine( aLine ); + rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("FileName: ")); + aLine.append(rtl::OUStringToOString(aFileName, + RTL_TEXTENCODING_UTF8)); + aStm.WriteLine(aLine.makeStringAndClear()); for( boost::unordered_map::const_iterator it = pResUseDump->begin(); it != pResUseDump->end(); ++it ) { sal_uInt64 nKeyId = it->first; - aLine.Assign( "Type/Id: " ); - aLine.Append( ByteString::CreateFromInt32( sal::static_int_cast< sal_Int32 >((nKeyId >> 32) & 0xFFFFFFFF) ) ); - aLine.Append( '/' ); - aLine.Append( ByteString::CreateFromInt32( sal::static_int_cast< sal_Int32 >(nKeyId & 0xFFFFFFFF) ) ); - aStm.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("Type/Id: ")); + aLine.append(sal::static_int_cast< sal_Int32 >((nKeyId >> 32) & 0xFFFFFFFF)); + aLine.append('/'); + aLine.append(sal::static_int_cast< sal_Int32 >(nKeyId & 0xFFFFFFFF)); + aStm.WriteLine(aLine.makeStringAndClear()); } } } @@ -817,31 +818,37 @@ void ResMgr::RscError_Impl( const sal_Char* pMessage, ResMgr* pResMgr, ResMgr* pNewResMgr = new ResMgr( pImp ); - ByteString aStr = OUStringToOString( pResMgr->GetFileName(), RTL_TEXTENCODING_UTF8 ); - if ( aStr.Len() ) - aStr += '\n'; + rtl::OStringBuffer aStr(rtl::OUStringToOString(pResMgr->GetFileName(), + RTL_TEXTENCODING_UTF8)); - aStr.Append( "Class: " ); - aStr.Append( ByteString( GetTypeRes_Impl( ResId( nRT, *pNewResMgr ) ), RTL_TEXTENCODING_UTF8 ) ); - aStr.Append( ", Id: " ); - aStr.Append( ByteString::CreateFromInt32( (long)nId ) ); - aStr.Append( ". " ); - aStr.Append( pMessage ); + if (aStr.getLength()) + aStr.append('\n'); - aStr.Append( "\nResource Stack\n" ); + aStr.append(RTL_CONSTASCII_STRINGPARAM("Class: ")); + aStr.append(rtl::OUStringToOString(GetTypeRes_Impl(ResId(nRT, *pNewResMgr)), + RTL_TEXTENCODING_UTF8)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(", Id: ")); + aStr.append(static_cast(nId)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(". ")); + aStr.append(pMessage); + + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nResource Stack\n")); while( nDepth > 0 ) { - aStr.Append( "Class: " ); - aStr.Append( ByteString( GetTypeRes_Impl( ResId( rResStack[nDepth].pResource->GetRT(), *pNewResMgr ) ), RTL_TEXTENCODING_UTF8 ) ); - aStr.Append( ", Id: " ); - aStr.Append( ByteString::CreateFromInt32( (long)rResStack[nDepth].pResource->GetId() ) ); + aStr.append(RTL_CONSTASCII_STRINGPARAM("Class: ")); + aStr.append(rtl::OUStringToOString(GetTypeRes_Impl( + ResId(rResStack[nDepth].pResource->GetRT(), *pNewResMgr)), + RTL_TEXTENCODING_UTF8)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(", Id: ")); + aStr.append(static_cast( + rResStack[nDepth].pResource->GetId())); nDepth--; } // clean up delete pNewResMgr; - OSL_FAIL( aStr.GetBuffer() ); + OSL_FAIL(aStr.getStr()); } #endif @@ -1207,15 +1214,18 @@ sal_Bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj ) if( pFallbackResMgr ) { pTop->Flags |= RC_FALLBACK_DOWN; - #ifdef DBG_UTIL - ByteString aMess( "found resource " ); - aMess.Append( ByteString::CreateFromInt32( nId ) ); - aMess.Append( " in fallback " ); - aMess.Append( ByteString( OUStringToOString( pFallbackResMgr->GetFileName(), osl_getThreadTextEncoding() ) ) ); - aMess.Append( "\n" ); - RscError_Impl( aMess.GetBuffer(), - this, nRT, nId, aStack, nCurStack-1 ); - #endif +#ifdef DBG_UTIL + rtl::OStringBuffer aMess( + RTL_CONSTASCII_STRINGPARAM("found resource ")); + aMess.append(static_cast(nId)); + aMess.append(RTL_CONSTASCII_STRINGPARAM(" in fallback ")); + aMess.append(rtl::OUStringToOString( + pFallbackResMgr->GetFileName(), + osl_getThreadTextEncoding())); + aMess.append('\n'); + RscError_Impl(aMess.getStr(), + this, nRT, nId, aStack, nCurStack-1); +#endif } else { diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx index 9ad9b71dcba3..9a3dece87cf9 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -34,6 +34,7 @@ #include #include #include +#include class ErrorHandler; @@ -429,30 +430,33 @@ sal_Bool SimpleErrorHandler::CreateString( const ErrorInfo *pInfo, String &rStr, sal_uInt16 &) const { sal_uIntPtr nId = pInfo->GetErrorCode(); - ByteString aStr; - aStr="Id "; - aStr+=ByteString::CreateFromInt32(nId); - aStr+=" only handled by SimpleErrorHandler"; - aStr+="\nErrorCode: "; - aStr+=ByteString::CreateFromInt32(nId & ((1L << ERRCODE_CLASS_SHIFT) - 1 )); - aStr+="\nErrorClass: "; - aStr+=ByteString::CreateFromInt32((nId & ERRCODE_CLASS_MASK) >> ERRCODE_CLASS_SHIFT); - aStr+="\nErrorArea: "; - aStr+=ByteString::CreateFromInt32((nId & ERRCODE_ERROR_MASK & - ~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Id ")); + aStr.append(static_cast(nId)); + aStr.append(RTL_CONSTASCII_STRINGPARAM( + " only handled by SimpleErrorHandler")); + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorCode: ")); + aStr.append(static_cast( + nId & ((1L << ERRCODE_CLASS_SHIFT) - 1 ))); + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorClass: ")); + aStr.append(static_cast( + (nId & ERRCODE_CLASS_MASK) >> ERRCODE_CLASS_SHIFT)); + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nErrorArea: ")); + aStr.append(static_cast((nId & ERRCODE_ERROR_MASK & + ~((1 << ERRCODE_AREA_SHIFT ) -1 ) ) >> ERRCODE_AREA_SHIFT)); DynamicErrorInfo *pDyn=PTR_CAST(DynamicErrorInfo,pInfo); if(pDyn) { - aStr+="\nDId "; - aStr+=ByteString::CreateFromInt32((sal_uIntPtr)*pDyn); + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nDId ")); + aStr.append(static_cast(*pDyn)); } StandardErrorInfo *pStd=PTR_CAST(StandardErrorInfo,pInfo); if(pStd) { - aStr+="\nXId "; - aStr+=ByteString::CreateFromInt32(pStd->GetExtendedErrorCode()); + aStr.append(RTL_CONSTASCII_STRINGPARAM("\nXId ")); + aStr.append(static_cast(pStd->GetExtendedErrorCode())); } - rStr = String( aStr, RTL_TEXTENCODING_ASCII_US ); + rStr = rtl::OStringToOUString(aStr.makeStringAndClear(), + RTL_TEXTENCODING_ASCII_US); return sal_True; } diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 0507048ad12c..51692e966848 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -762,10 +762,11 @@ sal_uInt32 SvPersistStream::ReadObj if( !pFunc ) { #ifdef DBG_UTIL - ByteString aStr( "no class with id: " ); - aStr += ByteString::CreateFromInt32( nClassId ); - aStr += " registered"; - DBG_WARNING( aStr.GetBuffer() ); + rtl::OStringBuffer aStr( + RTL_CONSTASCII_STRINGPARAM("no class with id: " )); + aStr.append(static_cast(nClassId)); + aStr.append(RTL_CONSTASCII_STRINGPARAM(" registered")); + DBG_WARNING(aStr.getStr()); #else (void)nObjLen; #endif @@ -790,11 +791,12 @@ sal_uInt32 SvPersistStream::ReadObj #ifdef DBG_UTIL if( nObjLen + nObjPos != Tell() ) { - ByteString aStr( "false object len: read = " ); - aStr += ByteString::CreateFromInt32( (long)(Tell() - nObjPos) ); - aStr += ", should = "; - aStr += ByteString::CreateFromInt32( nObjLen ); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr( + RTL_CONSTASCII_STRINGPARAM("false object len: read = ")); + aStr.append(static_cast((long)(Tell() - nObjPos))); + aStr.append(RTL_CONSTASCII_STRINGPARAM(", should = ")); + aStr.append(static_cast(nObjLen)); + OSL_FAIL(aStr.getStr()); } #endif rpObj->RestoreNoDelete(); -- cgit v1.2.3 From d4b3fa6abed08b072f838c500b1cf5c7f9747179 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 1 Jul 2011 08:59:03 +0100 Subject: ByteString->rtl::OStringBuffer --- rsc/inc/rscdef.hxx | 3 +- rsc/source/misc/rscdbl.cxx | 2 +- rsc/source/parser/erscerr.cxx | 4 +-- rsc/source/parser/rscyacc.cxx | 7 +++-- rsc/source/rsc/rsc.cxx | 15 +++++----- rsc/source/tools/rscdef.cxx | 65 +++++++++++++++++++------------------------ 6 files changed, 45 insertions(+), 51 deletions(-) diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index 4ff5e2201dd6..c5973e4a9bc8 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -30,6 +30,7 @@ #include #include +#include #include /****************** 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 ***************************************************/ diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx index 5e6faeb47c22..da2106366f9f 100644 --- a/rsc/source/misc/rscdbl.cxx +++ b/rsc/source/misc/rscdbl.cxx @@ -52,7 +52,7 @@ REResourceList * InsertList( Atom nClassName, const RscId& rId, if( pStrClass ) aStrClass = pStrClass; else - aStrClass = ByteString::CreateFromInt32( (long)nClassName ); + aStrClass = rtl::OString::valueOf(static_cast(nClassName)); pSubList = new REResourceList( pList, aStrClass, rId ); 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(nErrors )).getStr()); else - StdLstErr( ByteString::CreateFromInt32( (nErrors -1) ).GetBuffer() ); + StdLstErr(rtl::OString::valueOf(static_cast(nErrors -1)).getStr()); StdLstErr( " Error" ); StdLstErr( " found!!" ); } 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/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index f8e308a7a47f..6fbc6976aedc 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -1248,7 +1248,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 +1276,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(aEntryVector[ i ].second)); + aEntryString.append(RTL_CONSTASCII_STRINGPARAM("; >;")); - aOStm.WriteLine( aEntryString ); + aOStm.WriteLine(aEntryString.makeStringAndClear()); } aOStm.WriteLine( "};" ); diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index ad4bab1412a2..86ad2828973c 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -170,17 +170,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; + return aStr.makeStringAndClear(); } /************************************************************************* @@ -190,14 +190,14 @@ ByteString RscId::GetName() const *************************************************************************/ ByteString RscId::GetMacro() const { - ByteString aStr; + rtl::OStringBuffer aStr; if ( aExp.IsDefinition() ) - aStr = aExp.aExp.pDef->GetMacro(); + aStr.append(aExp.aExp.pDef->GetMacro()); else - aExp.GetMacro( aStr ); + aExp.AppendMacro(aStr); - return aStr; + return aStr.makeStringAndClear(); } /****************** R s c D e f i n e ************************************/ @@ -259,7 +259,7 @@ void RscDefine::DefineToNumber() if( pExp ) delete pExp; pExp = NULL; - SetName( ByteString::CreateFromInt32( lId ) ); + SetName(rtl::OString::valueOf(lId)); } /************************************************************************* @@ -314,7 +314,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 ****************************/ @@ -459,23 +459,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 +546,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 ****************************************/ -- cgit v1.2.3 From 5e692599df6d47b614b488796747f5faadea63f7 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 29 Jun 2011 15:53:55 +0200 Subject: remove executable bit from .cxx files --- vcl/source/window/syschild.cxx | 0 vcl/source/window/toolbox.cxx | 0 vcl/source/window/window.cxx | 0 vcl/source/window/wrkwin.cxx | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 vcl/source/window/syschild.cxx mode change 100755 => 100644 vcl/source/window/toolbox.cxx mode change 100755 => 100644 vcl/source/window/window.cxx mode change 100755 => 100644 vcl/source/window/wrkwin.cxx diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx old mode 100755 new mode 100644 diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx old mode 100755 new mode 100644 -- cgit v1.2.3 From ce5702fca8e7bc6c6f82a0de24abeafc6b316fef Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 1 Jul 2011 22:27:20 +0100 Subject: ByteString::CreateFromInt32 -> OString::valueOf --- l10ntools/inc/cfgmerge.hxx | 3 +- l10ntools/inc/export.hxx | 13 +- l10ntools/source/cfglex.l | 6 +- l10ntools/source/cfgmerge.cxx | 44 +++--- l10ntools/source/export.cxx | 351 +++++++++++++++++++++++------------------- l10ntools/source/export2.cxx | 29 ++-- l10ntools/source/gsicheck.cxx | 27 +++- l10ntools/source/lngmerge.cxx | 9 +- l10ntools/source/tagtest.cxx | 14 +- l10ntools/source/xrmlex.l | 6 +- l10ntools/source/xrmmerge.cxx | 16 +- 11 files changed, 290 insertions(+), 228 deletions(-) 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 #include -typedef boost::unordered_map - ByteStringHashMap; +typedef boost::unordered_map ByteStringHashMap; // diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index aedf7fdfd956..addfd7a88f7f 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -84,8 +84,7 @@ class PFormEntrys; class MergeData; typedef std::set ByteStringSet; -typedef boost::unordered_map - ByteStringHashMap; +typedef boost::unordered_map ByteStringHashMap; typedef boost::unordered_map 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; @@ -389,8 +388,8 @@ private: 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 ); 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 f2a713ce5a75..55aed2c4210c 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -644,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 ) { @@ -663,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/export.cxx b/l10ntools/source/export.cxx index 2ef0f1467b9f..94f1650ef4b0 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -35,9 +35,10 @@ #include "tokens.h" #include #include +#include -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" ) { @@ -1169,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 ); @@ -1198,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 ]; } } @@ -1345,44 +1363,47 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList, // Export::DumpMap( a, *pEntry ); ByteString sLID(rtl::OString::valueOf(static_cast(i + 1))); - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + 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; @@ -1408,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; @@ -1468,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(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 ); @@ -1502,7 +1524,7 @@ void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) // new fallback } - if ( Export::isSourceLanguage( nListLang ) ) { + if ( Export::isSourceLanguage( m_sListLang ) ) { if( nList == LIST_PAIRED ){ (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; } @@ -1512,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++; } @@ -1727,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; @@ -1780,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); } } @@ -1818,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(nListIndex)); if ( pResData->sGId.Len()) pResData->sGId += "."; @@ -1893,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 ); @@ -2103,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; @@ -2130,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 ] ) @@ -2229,7 +2270,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) } } else - pResData->sId = ByteString::CreateFromInt32( ++nIdx ); + pResData->sId = rtl::OString::valueOf(static_cast(++nIdx)); } else break; @@ -2291,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 35e46da64891..d7d39a453511 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -381,25 +381,27 @@ ByteString Export::GetFallbackLanguage( const ByteString nLanguage ) 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 ]; @@ -432,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 ]; } 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 #include -// local includes +#include + #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(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(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(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(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(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(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/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/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 +#include #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(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 e682463bf523..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; } /*****************************************************************************/ -- cgit v1.2.3 From 8d4d7b1062d2a73c3d0de24c342aa9bde3799ce7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 1 Jul 2011 23:01:39 +0100 Subject: ByteString::CreateFromInt32 -> OString::valueOf --- svl/source/items/style.cxx | 4 +- svl/source/items/whassert.hxx | 10 ++-- svl/source/numbers/zforlist.cxx | 104 +++++++++------------------------------- 3 files changed, 30 insertions(+), 88 deletions(-) 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(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 -#include +#include //------------------------------------------------------------------------ @@ -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(nId)); \ + DbgError(aMsg.getStr(), __FILE__, __LINE__); \ } \ } \ } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index ffdb583261f7..b112f43e32f1 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -2091,8 +2092,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 +2111,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 +2119,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(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 @@ -3533,21 +3532,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 +3547,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 - } } -- cgit v1.2.3 From 98cabfbb707567fec39d6c71c5ee6a0dbea571d2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 1 Jul 2011 23:05:38 +0100 Subject: tweak appendLocaleInfo to return a new string --- unotools/inc/unotools/localedatawrapper.hxx | 2 +- unotools/source/i18n/localedatawrapper.cxx | 42 +++++++++++++++-------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx index 306316683b94..8ff4e46da058 100644 --- a/unotools/inc/unotools/localedatawrapper.hxx +++ b/unotools/inc/unotools/localedatawrapper.hxx @@ -346,7 +346,7 @@ public: /** Append locale info to string, used with locale data checking. A string similar to "de_DE requested\n en_US loaded" is appended. */ - String& appendLocaleInfo( String& rDebugMsg ) const; + rtl::OUString appendLocaleInfo(const rtl::OUString& rDebugMsg) const; /** Ouput a message during locale data checking. The (UTF-8) string is written to stderr and in a non-product build or if DBG_UTIL is enabled diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index 656453dde274..a8e1dccf0727 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -51,6 +51,7 @@ #include #include +#include #include #define LOCALEDATA_LIBRARYNAME "i18npool" @@ -770,7 +771,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -882,7 +883,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() { // bad luck if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -931,7 +932,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() scanCurrFormatImpl( pFormatArr[nElem].Code, 0, nSign, nPar, nNum, nBlank, nSym ); if (areChecksEnabled() && (nNum == STRING_NOTFOUND || nSym == STRING_NOTFOUND)) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -962,7 +963,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() nSym == STRING_NOTFOUND || (nPar == STRING_NOTFOUND && nSign == STRING_NOTFOUND))) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1098,7 +1099,7 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode ) { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::scanDateFormat: not all DMY present")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1121,7 +1122,7 @@ DateFormat LocaleDataWrapper::scanDateFormatImpl( const String& rCode ) { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::scanDateFormat: no magic applyable")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1140,7 +1141,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { // bad luck if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no date formats")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1185,7 +1186,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no edit")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1193,7 +1194,7 @@ void LocaleDataWrapper::getDateFormatsImpl() { if (areChecksEnabled()) { - String aMsg( RTL_CONSTASCII_USTRINGPARAM( + rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getDateFormatsImpl: no default")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } @@ -1930,20 +1931,21 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals, } -String& LocaleDataWrapper::appendLocaleInfo( String& rDebugMsg ) const +rtl::OUString LocaleDataWrapper::appendLocaleInfo(const rtl::OUString& rDebugMsg) const { ::utl::ReadWriteGuard aGuard( aMutex, ::utl::ReadWriteGuardMode::nBlockCritical ); - rDebugMsg += '\n'; - rDebugMsg += String( aLocale.Language); - rDebugMsg += '_'; - rDebugMsg += String( aLocale.Country); - rDebugMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " requested\n" ) ); + rtl::OUStringBuffer aDebugMsg(rDebugMsg); + aDebugMsg.append(static_cast('\n')); + aDebugMsg.append(aLocale.Language); + aDebugMsg.append(static_cast('_')); + aDebugMsg.append(aLocale.Country); + aDebugMsg.appendAscii(RTL_CONSTASCII_STRINGPARAM(" requested\n")); lang::Locale aLoaded = getLoadedLocale(); - rDebugMsg += String( aLoaded.Language); - rDebugMsg += '_'; - rDebugMsg += String( aLoaded.Country); - rDebugMsg.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " loaded" ) ); - return rDebugMsg; + aDebugMsg.append(aLoaded.Language); + aDebugMsg.append(static_cast('_')); + aDebugMsg.append(aLoaded.Country); + aDebugMsg.appendAscii(RTL_CONSTASCII_STRINGPARAM(" loaded")); + return aDebugMsg.makeStringAndClear(); } -- cgit v1.2.3 From 0fa72e369349edf0084964a03d280668debe5975 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 2 Jul 2011 23:05:34 +0100 Subject: ByteString::CreateFromInt32->rtl::OString::valueOf --- vcl/source/gdi/cvtsvm.cxx | 10 ++-- vcl/unx/generic/printer/jobdata.cxx | 69 ++++++++++++++------------ vcl/unx/generic/printer/printerinfomanager.cxx | 41 ++++++++------- vcl/unx/generic/printergfx/common_gfx.cxx | 2 +- vcl/unx/generic/printergfx/printerjob.cxx | 11 ++-- 5 files changed, 72 insertions(+), 61 deletions(-) diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx index 21f977a45396..193c066b1d98 100644 --- a/vcl/source/gdi/cvtsvm.cxx +++ b/vcl/source/gdi/cvtsvm.cxx @@ -41,6 +41,7 @@ #include #include #include +#include // ----------- // - Defines - @@ -2431,10 +2432,11 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, #ifdef DBG_UTIL default: { - ByteString aStr( "Missing implementation for Action#: " ); - aStr += ByteString::CreateFromInt32( pAction->GetType() ); - aStr += '!'; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM( + "Missing implementation for Action#: ")); + aStr.append(static_cast(pAction->GetType())); + aStr.append('!'); + OSL_FAIL(aStr.getStr()); } break; #endif diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index 03d676470ecb..872e880adc61 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -34,7 +34,8 @@ #include "tools/stream.hxx" -#include "sal/alloca.h" +#include +#include using namespace psp; @@ -122,48 +123,52 @@ bool JobData::getStreamBuffer( void*& pData, int& bytes ) return false; SvMemoryStream aStream; - ByteString aLine; // write header job data aStream.WriteLine( "JobData 1" ); - aLine = "printer="; - aLine += ByteString( String( m_aPrinterName ), RTL_TEXTENCODING_UTF8 ); - aStream.WriteLine( aLine ); + rtl::OStringBuffer aLine; + + aLine.append(RTL_CONSTASCII_STRINGPARAM("printer=")); + aLine.append(rtl::OUStringToOString(m_aPrinterName, RTL_TEXTENCODING_UTF8)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "orientation="; - aLine += m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait"; - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("orientation=")); + if (m_eOrientation == orientation::Landscape) + aLine.append(RTL_CONSTASCII_STRINGPARAM("Landscape")); + else + aLine.append(RTL_CONSTASCII_STRINGPARAM("Portrait")); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "copies="; - aLine += ByteString::CreateFromInt32( m_nCopies ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("copies=")); + aLine.append(static_cast(m_nCopies)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "margindajustment="; - aLine += ByteString::CreateFromInt32( m_nLeftMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nRightMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nTopMarginAdjust ); - aLine += ','; - aLine += ByteString::CreateFromInt32( m_nBottomMarginAdjust ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("margindajustment=")); + aLine.append(static_cast(m_nLeftMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nRightMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nTopMarginAdjust)); + aLine.append(','); + aLine.append(static_cast(m_nBottomMarginAdjust)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "colordepth="; - aLine += ByteString::CreateFromInt32( m_nColorDepth ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("colordepth=")); + aLine.append(static_cast(m_nColorDepth)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "pslevel="; - aLine += ByteString::CreateFromInt32( m_nPSLevel ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("pslevel=")); + aLine.append(static_cast(m_nPSLevel)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "pdfdevice="; - aLine += ByteString::CreateFromInt32( m_nPDFDevice ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("pdfdevice=")); + aLine.append(static_cast(m_nPDFDevice)); + aStream.WriteLine(aLine.makeStringAndClear()); - aLine = "colordevice="; - aLine += ByteString::CreateFromInt32( m_nColorDevice ); - aStream.WriteLine( aLine ); + aLine.append(RTL_CONSTASCII_STRINGPARAM("colordevice=")); + aLine.append(static_cast(m_nColorDevice)); + aStream.WriteLine(aLine.makeStringAndClear()); // now append the PPDContext stream buffer aStream.WriteLine( "PPDContexData" ); diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index e29855c939d1..144821173962 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -772,30 +772,30 @@ bool PrinterInfoManager::writePrinterConfig() pConfig->DeleteGroup( it->second.m_aGroup ); // else some old keys may remain pConfig->SetGroup( it->second.m_aGroup ); - ByteString aValue( String( it->second.m_aInfo.m_aDriverName ), RTL_TEXTENCODING_UTF8 ); - aValue += '/'; - aValue += ByteString( String( it->first ), RTL_TEXTENCODING_UTF8 ); - pConfig->WriteKey( "Printer", aValue ); + rtl::OStringBuffer aValue(rtl::OUStringToOString(it->second.m_aInfo.m_aDriverName, RTL_TEXTENCODING_UTF8)); + aValue.append('/'); + aValue.append(rtl::OUStringToOString(it->first, RTL_TEXTENCODING_UTF8)); + pConfig->WriteKey("Printer", aValue.makeStringAndClear()); pConfig->WriteKey( "DefaultPrinter", it->first == m_aDefaultPrinter ? "1" : "0" ); pConfig->WriteKey( "Location", ByteString( String( it->second.m_aInfo.m_aLocation ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Comment", ByteString( String( it->second.m_aInfo.m_aComment ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Command", ByteString( String( it->second.m_aInfo.m_aCommand ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "QuickCommand", ByteString( String( it->second.m_aInfo.m_aQuickCommand ), RTL_TEXTENCODING_UTF8 ) ); pConfig->WriteKey( "Features", ByteString( String( it->second.m_aInfo.m_aFeatures ), RTL_TEXTENCODING_UTF8 ) ); - pConfig->WriteKey( "Copies", ByteString::CreateFromInt32( it->second.m_aInfo.m_nCopies ) ); + pConfig->WriteKey("Copies", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nCopies))); pConfig->WriteKey( "Orientation", it->second.m_aInfo.m_eOrientation == orientation::Landscape ? "Landscape" : "Portrait" ); - pConfig->WriteKey( "PSLevel", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPSLevel ) ); - pConfig->WriteKey( "PDFDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nPDFDevice ) ); - pConfig->WriteKey( "ColorDevice", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDevice ) ); - pConfig->WriteKey( "ColorDepth", ByteString::CreateFromInt32( it->second.m_aInfo.m_nColorDepth ) ); - aValue = ByteString::CreateFromInt32( it->second.m_aInfo.m_nLeftMarginAdjust ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nRightMarginAdjust ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nTopMarginAdjust ); - aValue += ','; - aValue += ByteString::CreateFromInt32( it->second.m_aInfo.m_nBottomMarginAdjust ); - pConfig->WriteKey( "MarginAdjust", aValue ); + pConfig->WriteKey("PSLevel", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nPSLevel))); + pConfig->WriteKey("PDFDevice", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nPDFDevice))); + pConfig->WriteKey("ColorDevice", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nColorDevice))); + pConfig->WriteKey("ColorDepth", rtl::OString::valueOf(static_cast(it->second.m_aInfo.m_nColorDepth))); + aValue.append(static_cast(it->second.m_aInfo.m_nLeftMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nRightMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nTopMarginAdjust)); + aValue.append(','); + aValue.append(static_cast(it->second.m_aInfo.m_nBottomMarginAdjust)); + pConfig->WriteKey("MarginAdjust", aValue.makeStringAndClear()); if( it->second.m_aInfo.m_aDriverName.compareToAscii( "CUPS:", 5 ) != 0 ) { @@ -807,8 +807,11 @@ bool PrinterInfoManager::writePrinterConfig() aKey += ByteString( pKey->getKey(), RTL_TEXTENCODING_ISO_8859_1 ); const PPDValue* pValue = it->second.m_aInfo.m_aContext.getValue( pKey ); - aValue = pValue ? ByteString( pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1 ) : ByteString( "*nil" ); - pConfig->WriteKey( aKey, aValue ); + if (pValue) + aValue.append(rtl::OUStringToOString(pValue->m_aOption, RTL_TEXTENCODING_ISO_8859_1)); + else + aValue.append(RTL_CONSTASCII_STRINGPARAM("*nil")); + pConfig->WriteKey(aKey, aValue.makeStringAndClear()); } } diff --git a/vcl/unx/generic/printergfx/common_gfx.cxx b/vcl/unx/generic/printergfx/common_gfx.cxx index 7cae4586bf6e..71ae6962ad73 100644 --- a/vcl/unx/generic/printergfx/common_gfx.cxx +++ b/vcl/unx/generic/printergfx/common_gfx.cxx @@ -1230,7 +1230,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize static sal_uInt16 nEps = 0; if( ! aDocTitle.Len() ) - aDocTitle = ByteString::CreateFromInt32( (sal_Int32)(nEps++) ); + aDocTitle = rtl::OString::valueOf(static_cast(nEps++)); if( fLeft != fRight && fTop != fBottom ) { diff --git a/vcl/unx/generic/printergfx/printerjob.cxx b/vcl/unx/generic/printergfx/printerjob.cxx index 827b5c7cf269..9fb50947bcf4 100644 --- a/vcl/unx/generic/printergfx/printerjob.cxx +++ b/vcl/unx/generic/printergfx/printerjob.cxx @@ -1191,12 +1191,13 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob ) if( ! bExternalDialog && rJob.m_nCopies > 1 ) { // setup code - ByteString aLine( "/#copies " ); - aLine += ByteString::CreateFromInt32( rJob.m_nCopies ); - aLine += " def\n"; + rtl::OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("/#copies ")); + aLine.append(static_cast(rJob.m_nCopies)); + aLine.append(RTL_CONSTASCII_STRINGPARAM(" def\n")); sal_uInt64 nWritten = 0; - bSuccess = pFile->write( aLine.GetBuffer(), aLine.Len(), nWritten ) - || nWritten != aLine.Len() ? false : true; + bSuccess = pFile->write(aLine.getStr(), aLine.getLength(), nWritten) + || nWritten != static_cast(aLine.getLength()) ? + false : true; if( bSuccess && GetPostscriptLevel( &rJob ) >= 2 ) WritePS (pFile, "<< /NumCopies null /Policies << /NumCopies 1 >> >> setpagedevice\n" ); -- cgit v1.2.3 From a0a3c24609fd50b0672be800043554e3094c84ee Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 2 Jul 2011 23:17:56 +0100 Subject: ByteString::CreateFromInt32->rtl::OString::valueOf --- svtools/source/misc/transfer.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 4b24ed4330fd..2c93a1045e89 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include // -------------- @@ -879,15 +880,16 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, { case( SOT_FORMATSTR_ID_SOLK ): { - ByteString sURL( rBmk.GetURL(), eSysCSet ), - sDesc( rBmk.GetDescription(), eSysCSet ); - ByteString sOut( ByteString::CreateFromInt32( sURL.Len() )); - ( sOut += '@' ) += sURL; - sOut += ByteString::CreateFromInt32( sDesc.Len() ); - ( sOut += '@' ) += sDesc; - - Sequence< sal_Int8 > aSeq( sOut.Len() ); - memcpy( aSeq.getArray(), sOut.GetBuffer(), sOut.Len() ); + rtl::OString sURL(rtl::OUStringToOString(rBmk.GetURL(), eSysCSet)); + rtl::OString sDesc(rtl::OUStringToOString(rBmk.GetDescription(), eSysCSet)); + rtl::OStringBuffer sOut; + sOut.append(sURL.getLength()); + sOut.append('@').append(sURL); + sOut.append(sDesc.getLength()); + sOut.append('@').append(sDesc); + + Sequence< sal_Int8 > aSeq(sOut.getLength()); + memcpy(aSeq.getArray(), sOut.getStr(), sOut.getLength()); maAny <<= aSeq; } break; -- cgit v1.2.3 From 1df73a8a61e3b90a65426265a8fa12e0302f2107 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Jul 2011 01:07:08 +0100 Subject: callcatcher: unused MacroParser --- rsc/inc/rscpar.hxx | 1 - rsc/source/parser/rsclex.cxx | 34 ---------------------------------- 2 files changed, 35 deletions(-) diff --git a/rsc/inc/rscpar.hxx b/rsc/inc/rscpar.hxx index 69037ba8c027..77b037d841f5 100644 --- a/rsc/inc/rscpar.hxx +++ b/rsc/inc/rscpar.hxx @@ -88,7 +88,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/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: */ -- cgit v1.2.3 From 23a90a9923ea81865de56010f962d190958c57d3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Jul 2011 01:12:01 +0100 Subject: callcatcher: unused InputFile --- rsc/inc/rsctools.hxx | 1 - rsc/source/tools/rsctools.cxx | 23 ----------------------- 2 files changed, 24 deletions(-) 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/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 @@ -175,29 +175,6 @@ sal_Bool Append( ByteString aOutputSrs, ByteString aTmpFile ) return bRet; } -/************************************************************************* -|* -|* 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 -- cgit v1.2.3 From d8ba18651cdca6037ee187b586d3c309a9db3528 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Jul 2011 12:30:00 +0100 Subject: Related: #i46388# busted ole2 wrapper --- sot/source/sdstor/stgstrms.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) -- cgit v1.2.3 From e484593e2c3ef4005840bb409c76f40a6d2d57fd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jul 2011 12:41:29 +0100 Subject: link unconditionally to cairo for librsvg --- vcl/Library_vcl.mk | 17 ++++ vcl/source/components/rasterizer_rsvg.cxx | 136 +++++------------------------- 2 files changed, 37 insertions(+), 116 deletions(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index e012d7129452..7105599bde14 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -433,6 +433,23 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ endif endif +## handle Cairo +ifeq ($(SYSTEM_CAIRO),YES) +$(eval $(call gb_Library_set_cxxflags,vcl,\ + $$(CXXFLAGS) \ + $$(CAIRO_CFLAGS) \ + -DSYSTEM_CAIRO \ +)) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + $$(CAIRO_LIBS) \ +)) +else +$(eval $(call gb_Library_add_linked_libs,vcl,\ + cairo \ +)) +endif + ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx index 006b30b28e28..b68aaa1fda8c 100644 --- a/vcl/source/components/rasterizer_rsvg.cxx +++ b/vcl/source/components/rasterizer_rsvg.cxx @@ -37,23 +37,25 @@ #include #include +#ifdef SYSTEM_CAIRO +#include +#else +#include +#endif + #include #if defined MACOSX #define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.0.dylib" - #define VCL_RSVG_CAIRO_LIBNAME "libcairo.2.dylib" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.2.dylib" #elif defined UNX #define VCL_RSVG_GOBJECT_LIBNAME "libgobject-2.0.so" - #define VCL_RSVG_CAIRO_LIBNAME "libcairo.so" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2.so" #elif defined WNT #define VCL_RSVG_GOBJECT_LIBNAME "gobjectlo.dll" - #define VCL_RSVG_CAIRO_LIBNAME "cairo.dll" #define VCL_RSVG_LIBRSVG_LIBNAME "librsvg-2-2.dll" #else #define VCL_RSVG_GOBJECT_LIBNAME "nogobjectlib" - #define VCL_RSVG_CAIRO_LIBNAME "nocairolib" #define VCL_RSVG_LIBRSVG_LIBNAME "nolibrsvglib" #endif @@ -72,18 +74,6 @@ typedef void* gpointer; struct GError; -enum cairo_format_t { CAIRO_FORMAT_ARGB32 = 0 }; -enum cairo_status_t { CAIRO_STATUS_SUCCESS = 0 }; - -struct cairo_surface_t; -struct cairo_t; -struct cairo_matrix_t -{ - double xx; double yx; - double xy; double yy; - double x0; double y0; -}; - struct RsvgHandle; struct RsvgDimensionData { @@ -126,29 +116,11 @@ public: static LibraryWrapper& get(); - bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpCairoLib != NULL ) && ( mpRSVGLib != NULL ) ); } + bool isValid() const { return( ( mpGObjectLib != NULL ) && ( mpRSVGLib != NULL ) ); } // G-Object gpointer g_object_unref( gpointer pointer ) { return( (*mp_g_object_unref)( pointer ) ); }; - // LibRSVG - - // Cairo - cairo_surface_t* image_surface_create( cairo_format_t format, int width, int height ) { return( (*mp_image_surface_create)( format, width, height ) ); } - void surface_destroy( cairo_surface_t* surface ) { (*mp_surface_destroy)( surface ); } - cairo_status_t surface_status( cairo_surface_t* surface ) { return( (*mp_surface_status)( surface ) ); } - cairo_t* create( cairo_surface_t* surface ) { return( (*mp_create)( surface ) ); } - void destroy( cairo_t* cairo ) { (*mp_destroy )( cairo ); } - void matrix_init_identity( cairo_matrix_t* matrix ){ (*mp_matrix_init_identity)( matrix ); } - void matrix_translate( cairo_matrix_t* matrix, double nx, double ny ) { (*mp_matrix_translate)( matrix, nx, ny ); } - void matrix_scale( cairo_matrix_t* matrix, double sx, double sy ) {( *mp_matrix_scale )( matrix, sx, sy ); } - void matrix_rotate( cairo_matrix_t* matrix, double radians ) { ( *mp_matrix_rotate )( matrix, radians ); } - void transform( cairo_t* cairo, cairo_matrix_t *matrix ) { (*mp_transform)( cairo, matrix ); } - unsigned char* image_surface_get_data(cairo_surface_t* surface) { return( (*mp_image_surface_get_data)( surface ) ); } - int image_surface_get_width(cairo_surface_t* surface) { return( (*mp_image_surface_get_width)( surface ) ); } - int image_surface_get_height(cairo_surface_t* surface) { return( (*mp_image_surface_get_height)( surface ) ); } - int image_surface_get_stride(cairo_surface_t* surface) { return( (*mp_image_surface_get_stride)( surface ) ); } - // LibRSVG void rsvg_init() { (*mp_rsvg_init)(); } RsvgHandle* rsvg_handle_new_from_data( const guint8* data, gsize size, GError** error) { return( (*mp_rsvg_handle_new_from_data)( data, size, error ) ); } @@ -164,28 +136,11 @@ private: private: oslModule mpGObjectLib; - oslModule mpCairoLib; oslModule mpRSVGLib; // GObject gpointer (*mp_g_object_unref)( gpointer ); - // Cairo - cairo_surface_t* (*mp_image_surface_create)(cairo_format_t,int,int); - void (*mp_surface_destroy )(cairo_surface_t*); - cairo_status_t (*mp_surface_status)(cairo_surface_t*); - cairo_t* (*mp_create)(cairo_surface_t*); - void (*mp_destroy)(cairo_t*); - void (*mp_matrix_init_identity)(cairo_matrix_t*); - void (*mp_matrix_translate)( cairo_matrix_t*, double, double); - void (*mp_matrix_scale )( cairo_matrix_t*, double, double); - void (*mp_matrix_rotate)( cairo_matrix_t*, double); - void (*mp_transform)( cairo_t*, cairo_matrix_t*); - unsigned char* (*mp_image_surface_get_data)( cairo_surface_t* ); - int (*mp_image_surface_get_width)(cairo_surface_t* surface); - int (*mp_image_surface_get_height)(cairo_surface_t* surface); - int (*mp_image_surface_get_stride)(cairo_surface_t* surface); - // LibRSVG void (*mp_rsvg_init)( void ); RsvgHandle* (*mp_rsvg_handle_new_from_data)( const guint8*, gsize, GError** ); @@ -211,11 +166,9 @@ LibraryWrapper& LibraryWrapper::get() LibraryWrapper::LibraryWrapper() : mpGObjectLib( NULL ), - mpCairoLib( NULL ), mpRSVGLib( NULL ) { const ::rtl::OUString aGObjectLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_GOBJECT_LIBNAME ) ); - const ::rtl::OUString aCairoLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_CAIRO_LIBNAME ) ); const ::rtl::OUString aRSVGLibName( RTL_CONSTASCII_USTRINGPARAM( VCL_RSVG_LIBRSVG_LIBNAME ) ); bool bCont = true; @@ -235,47 +188,6 @@ LibraryWrapper::LibraryWrapper() : } } - // Cairo - if( bCont && ( NULL != ( mpCairoLib = osl_loadModule( aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) ) || - NULL != ( mpCairoLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get, - aCairoLibName.pData, SAL_LOADMODULE_DEFAULT ) ) - ) ) - { - mp_image_surface_create = ( cairo_surface_t* (*)( cairo_format_t, int, int ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_create" ); - mp_surface_destroy = ( void (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_destroy" ); - mp_surface_status = ( cairo_status_t (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_surface_status" ); - mp_create = ( cairo_t* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_create" ); - mp_destroy = ( void (*)( cairo_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_destroy" ); - mp_matrix_init_identity = ( void (*)( cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_init_identity" ); - mp_matrix_translate = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_translate" ); - mp_matrix_scale = ( void (*)( cairo_matrix_t*, double, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_scale" ); - mp_matrix_rotate = ( void (*)( cairo_matrix_t*, double ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_matrix_rotate" ); - mp_transform = ( void (*)( cairo_t*, cairo_matrix_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_transform" ); - mp_image_surface_get_data = ( unsigned char* (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_data" ); - mp_image_surface_get_width = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_width" ); - mp_image_surface_get_height = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_height" ); - mp_image_surface_get_stride = ( int (*)( cairo_surface_t* ) ) osl_getAsciiFunctionSymbol( mpCairoLib, "cairo_image_surface_get_stride" ); - - if( !( mp_image_surface_create && - mp_surface_destroy && - mp_surface_status && - mp_create && - mp_destroy && - mp_matrix_init_identity && - mp_matrix_translate && - mp_matrix_scale && - mp_matrix_rotate && - mp_transform && - mp_image_surface_get_data && - mp_image_surface_get_width && - mp_image_surface_get_height && - mp_image_surface_get_stride ) ) - { - OSL_TRACE( "not all needed symbols were found in cairo library" ); - bCont = false; - } - } - // LibRSVG if( bCont && ( NULL != ( mpRSVGLib = osl_loadModule( aRSVGLibName.pData, SAL_LOADMODULE_DEFAULT ) ) || NULL != ( mpRSVGLib = osl_loadModuleRelative( (oslGenericFunction)LibraryWrapper::get, @@ -302,10 +214,9 @@ LibraryWrapper::LibraryWrapper() : } OSL_ENSURE( mpGObjectLib, "g-object library could not be loaded" ); - OSL_ENSURE( mpCairoLib, "cairo library could not be loaded" ); OSL_ENSURE( mpRSVGLib, "librsvg library could not be loaded" ); - bCont = bCont && mpGObjectLib != NULL && mpCairoLib != NULL && mpRSVGLib != NULL; + bCont = bCont && mpGObjectLib != NULL && mpRSVGLib != NULL; // unload all libraries in case of failure if( !bCont ) @@ -316,12 +227,6 @@ LibraryWrapper::LibraryWrapper() : mpRSVGLib = NULL; } - if( mpCairoLib ) - { - osl_unloadModule( mpCairoLib ); - mpCairoLib = NULL; - } - if( mpGObjectLib ) { osl_unloadModule( mpGObjectLib ); @@ -426,11 +331,10 @@ void Rasterizer::implFreeRsvgHandle() uno::Reference< graphic::XGraphic > Rasterizer::implGetXGraphicFromSurface( cairo_surface_t* pSurface ) const { - LibraryWrapper& rLib = LibraryWrapper::get(); - unsigned char* pData = rLib.image_surface_get_data( pSurface ); - const sal_Int32 nWidth = rLib.image_surface_get_width( pSurface ); - const sal_Int32 nHeight =rLib.image_surface_get_height( pSurface ); - const sal_Int32 nStride = rLib.image_surface_get_stride( pSurface ); + unsigned char* pData = cairo_image_surface_get_data( pSurface ); + const sal_Int32 nWidth = cairo_image_surface_get_width( pSurface ); + const sal_Int32 nHeight = cairo_image_surface_get_height( pSurface ); + const sal_Int32 nStride = cairo_image_surface_get_stride( pSurface ); uno::Reference< graphic::XGraphic > xRet; @@ -563,31 +467,31 @@ uno::Reference< graphic::XGraphic > SAL_CALL Rasterizer::rasterize( ::sal_uInt32 if( mpRsvgHandle && rLib.isValid() && nWidth && nHeight && mnDefaultWidth && mnDefaultHeight ) { - cairo_surface_t* pSurface = rLib.image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight ); + cairo_surface_t* pSurface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, nWidth, nHeight ); - if( pSurface && ( CAIRO_STATUS_SUCCESS == rLib.surface_status( pSurface ) ) ) + if( pSurface && ( CAIRO_STATUS_SUCCESS == cairo_surface_status( pSurface ) ) ) { - cairo_t* pCr = rLib.create( pSurface ); + cairo_t* pCr = cairo_create( pSurface ); if( pCr ) { cairo_matrix_t aMatrix; - rLib.matrix_init_identity( &aMatrix ); - rLib.matrix_scale( &aMatrix, + cairo_matrix_init_identity( &aMatrix ); + cairo_matrix_scale( &aMatrix, static_cast< double >( nWidth ) / mnDefaultWidth, static_cast< double >( nHeight ) / mnDefaultHeight ); - rLib.transform( pCr, &aMatrix ); + cairo_transform( pCr, &aMatrix ); if( rLib.rsvg_handle_render_cairo( mpRsvgHandle, pCr ) ) { xRet = implGetXGraphicFromSurface( pSurface ); } - rLib.destroy( pCr ); + cairo_destroy( pCr ); } - rLib.surface_destroy( pSurface ); + cairo_surface_destroy( pSurface ); OSL_ENSURE( xRet.is(), "SVG *not* rendered successfully" ); } } -- cgit v1.2.3 From 64c7d47de69e2e7a249556d9322d40104fed72c1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jul 2011 13:53:26 +0100 Subject: conditionalize this for librsvg --- vcl/Library_vcl.mk | 12 +++++++++++- vcl/source/components/factory.cxx | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 7105599bde14..1bf73031d27d 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -245,7 +245,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/components/dtranscomp \ vcl/source/components/factory \ vcl/source/components/fontident \ - vcl/source/components/rasterizer_rsvg \ vcl/source/components/stringmirror \ vcl/source/control/button \ vcl/source/control/combobox \ @@ -434,6 +433,16 @@ endif endif ## handle Cairo +ifneq ($(ENABLE_LIBRSVG),NO) + +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/source/components/rasterizer_rsvg \ +)) + +$(eval $(call gb_Library_set_defs,vcl,\ + $$(DEFS) \ + -DENABLE_LIBRSVG \ +)) ifeq ($(SYSTEM_CAIRO),YES) $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CXXFLAGS) \ @@ -449,6 +458,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ )) endif +endif ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_ldflags,vcl,\ diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index f4665832a9a8..de76b6e84c58 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -144,12 +144,14 @@ extern "C" { xMgr, vcl::DropTarget_getImplementationName(), vcl::DropTarget_createInstance, vcl::DropTarget_getSupportedServiceNames() ); } +#ifdef ENABLE_LIBRSVG else if( vcl::rsvg::Rasterizer_getImplementationName().equalsAscii( pImplementationName ) ) { xFactory = ::cppu::createSingleFactory( xMgr, vcl::rsvg::Rasterizer_getImplementationName(), vcl::rsvg::Rasterizer_createInstance, vcl::rsvg::Rasterizer_getSupportedServiceNames() ); } +#endif if( xFactory.is() ) { xFactory->acquire(); -- cgit v1.2.3 From 0bcbc58743199aacbd0beb7f096974c943065a11 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 4 Jul 2011 21:26:01 +0300 Subject: Cannot build cairocanvas without cairo --- canvas/source/cairo/makefile.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index 3be1d52e6c3b..076deb2f17bf 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -37,12 +37,16 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk DLLPRE = -# --- X11 Mac build currently doesn't work with cairo ----------- .IF "$(OS)" == "MACOSX" && "$(GUIBASE)" == "unx" @all: @echo "Cannot build cairocanvas with X11..." .ENDIF +.IF "$(OS)" == "ANDROID" +@all: + @echo "Cannot build cairocanvas without cairo..." +.ENDIF + # --- Common ---------------------------------------------------------- -- cgit v1.2.3 From 4281dfd19a1f36f1bf286f3ea85d432b829bf175 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 4 Jul 2011 21:27:35 +0300 Subject: Experimental dummy hacks for Android and iOS --- vcl/Library_vcl.mk | 17 ++++++++++++++ vcl/null/printerinfomanager.cxx | 51 +++++++++++++++++++++++++++++++++++++++++ vcl/vcl.android.component | 43 ++++++++++++++++++++++++++++++++++ vcl/vcl.ios.component | 43 ++++++++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+) create mode 100644 vcl/null/printerinfomanager.cxx create mode 100644 vcl/vcl.android.component create mode 100644 vcl/vcl.ios.component diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1bf73031d27d..9ce6dee48124 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -31,6 +31,10 @@ ifeq ($(OS),MACOSX) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.macosx,vcl/vcl)) else ifeq ($(OS),WNT) $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.windows,vcl/vcl)) +else ifeq ($(GUIBASE),android) +$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.android,vcl/vcl)) +else ifeq ($(OS),IOS) +$(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.ios,vcl/vcl)) else $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx,vcl/vcl)) endif @@ -191,6 +195,19 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ )) endif +ifeq ($(GUIBASE),android) +$(eval $(call gb_Library_set_defs,vcl,\ + $$(DEFS) \ + -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \ + -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \ + -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ +)) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/unx/generic/plugadapt/salplug \ + vcl/null/printerinfomanager \ +)) +endif + ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/win/source/app/saldata \ diff --git a/vcl/null/printerinfomanager.cxx b/vcl/null/printerinfomanager.cxx new file mode 100644 index 000000000000..7361606c35b3 --- /dev/null +++ b/vcl/null/printerinfomanager.cxx @@ -0,0 +1,51 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "vcl/printerinfomanager.hxx" + +#include "unx/saldata.hxx" + +using namespace psp; +using namespace osl; + +using ::rtl::OUString; +using ::rtl::OString; +using ::rtl::OStringToOUString; +using ::rtl::OUStringHash; + +void PrinterInfoManager::release() +{ + SalData* pSalData = GetSalData(); + delete pSalData->m_pPIManager; + pSalData->m_pPIManager = NULL; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/vcl.android.component b/vcl/vcl.android.component new file mode 100644 index 000000000000..5dd80ebe0029 --- /dev/null +++ b/vcl/vcl.android.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + diff --git a/vcl/vcl.ios.component b/vcl/vcl.ios.component new file mode 100644 index 000000000000..5dd80ebe0029 --- /dev/null +++ b/vcl/vcl.ios.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 1123974f67b317ee14d426b45afc74b73b98310b Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Tue, 5 Jul 2011 08:40:22 +0900 Subject: removed obsolete code/comments --- i18nutil/inc/i18nutil/oneToOneMapping.hxx | 4 ---- i18nutil/inc/i18nutil/x_rtl_ustring.h | 10 +--------- 2 files changed, 1 insertion(+), 13 deletions(-) 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: */ -- cgit v1.2.3 From 7ae4abd2936c707eda8c151c8223ff1d5bae3943 Mon Sep 17 00:00:00 2001 From: Christina Rossmanith Date: Wed, 29 Jun 2011 22:56:28 +0200 Subject: Added SvStream::ReadLine( rtl::OString& ) --- tools/inc/tools/stream.hxx | 2 ++ tools/source/stream/stream.cxx | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 0e5094561734..fc1a96c2285f 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -34,6 +34,7 @@ #include #include #include +#include class FileCopier; class StreamData; @@ -403,6 +404,7 @@ public: sal_Bool ReadCString( String& rStr ) { return ReadCString( rStr, GetStreamCharSet()); } sal_Bool ReadLine( ByteString& rStr ); + sal_Bool ReadLine( rtl::OString& rStr ); sal_Bool WriteLine( const ByteString& rStr ); sal_Bool WriteLines( const ByteString& rStr ); diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index bf0c2f49b24c..0cd38bf90365 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -43,6 +43,7 @@ #include + #define SWAPNIBBLES(c) \ unsigned char nSwapTmp=c; \ nSwapTmp <<= 4; \ @@ -719,6 +720,15 @@ sal_Bool SvStream::ReadLine( ByteString& rStr ) return bEnd; } +sal_Bool SvStream::ReadLine( rtl::OString& rStr ) +{ + ByteString aFoo; + sal_Bool ret; + ret = ReadLine(aFoo); + rStr = aFoo; + return ret; +} + sal_Bool SvStream::ReadUniStringLine( String& rStr ) { sal_Unicode buf[256+1]; -- cgit v1.2.3 From a1b214effc2d6c3c579a9e822cf04db888cb408d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 13:08:02 +0100 Subject: add regression testing infrastructure for wmf/emf --- svtools/CppunitTest_svtools_filters_test.mk | 75 ++++++++ svtools/Module_svtools.mk | 4 + svtools/prj/build.lst | 2 +- svtools/qa/cppunit/data/emf/fail/.gitignore | 0 .../qa/cppunit/data/emf/indeterminate/.gitignore | 0 svtools/qa/cppunit/data/emf/pass/.gitignore | 0 svtools/qa/cppunit/data/wmf/fail/.gitignore | 0 .../qa/cppunit/data/wmf/indeterminate/.gitignore | 0 svtools/qa/cppunit/data/wmf/pass/.gitignore | 0 svtools/qa/cppunit/filters-test.cxx | 214 +++++++++++++++++++++ 10 files changed, 294 insertions(+), 1 deletion(-) create mode 100755 svtools/CppunitTest_svtools_filters_test.mk create mode 100644 svtools/qa/cppunit/data/emf/fail/.gitignore create mode 100644 svtools/qa/cppunit/data/emf/indeterminate/.gitignore create mode 100644 svtools/qa/cppunit/data/emf/pass/.gitignore create mode 100644 svtools/qa/cppunit/data/wmf/fail/.gitignore create mode 100644 svtools/qa/cppunit/data/wmf/indeterminate/.gitignore create mode 100644 svtools/qa/cppunit/data/wmf/pass/.gitignore create mode 100644 svtools/qa/cppunit/filters-test.cxx diff --git a/svtools/CppunitTest_svtools_filters_test.mk b/svtools/CppunitTest_svtools_filters_test.mk new file mode 100755 index 000000000000..952ec02cbecc --- /dev/null +++ b/svtools/CppunitTest_svtools_filters_test.mk @@ -0,0 +1,75 @@ +#************************************************************************* +# 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. +# 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 Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,svtools_filters_test)) + +$(eval $(call gb_CppunitTest_add_exception_objects,svtools_filters_test, \ + svtools/qa/cppunit/filters-test \ +)) + +$(eval $(call gb_CppunitTest_add_linked_libs,svtools_filters_test, \ + comphelper \ + cppu \ + cppuhelper \ + sal \ + svt \ + tl \ + vcl \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_CppunitTest_set_include,svtools_filters_test,\ + $$(INCLUDE) \ + -I$(OUTDIR)/inc \ +)) + +$(eval $(call gb_CppunitTest_add_api,svtools_filters_test,\ + udkapi \ + offapi \ +)) + +$(eval $(call gb_CppunitTest_uses_ure,svtools_filters_test)) + +$(eval $(call gb_CppunitTest_add_type_rdbs,svtools_filters_test,\ + types \ +)) + +$(eval $(call gb_CppunitTest_add_service_rdbs,svtools_filters_test,\ + svtools_filters_test \ +)) + +$(eval $(call gb_CppunitTest_set_args,svtools_filters_test,\ + --headless \ + --invisible \ + --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ +)) + +$(eval $(call gb_RdbTarget_RdbTarget,svtools_filters_test)) + +# vim: set noet sw=4 ts=4: diff --git a/svtools/Module_svtools.mk b/svtools/Module_svtools.mk index 0b669d9dee1b..ac2fff8623a3 100644 --- a/svtools/Module_svtools.mk +++ b/svtools/Module_svtools.mk @@ -39,6 +39,10 @@ $(eval $(call gb_Module_add_targets,svtools,\ Package_inc \ )) +$(eval $(call gb_Module_add_check_targets,svtools,\ + CppunitTest_svtools_filters_test \ +)) + $(eval $(call gb_Module_add_subsequentcheck_targets,svtools,\ JunitTest_svtools_unoapi \ )) diff --git a/svtools/prj/build.lst b/svtools/prj/build.lst index a438456220a0..d18c9f9df2a2 100644 --- a/svtools/prj/build.lst +++ b/svtools/prj/build.lst @@ -1,2 +1,2 @@ -st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt NULL +st svtools : TRANSLATIONS:translations svl offapi toolkit ucbhelper unotools JPEG:jpeg cppu cppuhelper comphelper sal salhelper sot jvmfwk LIBXSLT:libxslt ure test NULL st svtools\prj nmake - all st_prj NULL diff --git a/svtools/qa/cppunit/data/emf/fail/.gitignore b/svtools/qa/cppunit/data/emf/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/data/emf/indeterminate/.gitignore b/svtools/qa/cppunit/data/emf/indeterminate/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/data/emf/pass/.gitignore b/svtools/qa/cppunit/data/emf/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/data/wmf/fail/.gitignore b/svtools/qa/cppunit/data/wmf/fail/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/data/wmf/indeterminate/.gitignore b/svtools/qa/cppunit/data/wmf/indeterminate/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/data/wmf/pass/.gitignore b/svtools/qa/cppunit/data/wmf/pass/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/svtools/qa/cppunit/filters-test.cxx b/svtools/qa/cppunit/filters-test.cxx new file mode 100644 index 000000000000..c5d43af4bb9b --- /dev/null +++ b/svtools/qa/cppunit/filters-test.cxx @@ -0,0 +1,214 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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. 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 + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Caolán McNamara + * + * 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. + */ + +#include +#include + +#include +#include + +#include + +#include + +#include + +#include +#include + +#include + +const int indeterminate = 2; + +using namespace ::com::sun::star; + +/* Implementation of Filters test */ + +class FiltersTest : public CppUnit::TestFixture +{ +public: + FiltersTest(); + ~FiltersTest(); + + virtual void setUp(); + virtual void tearDown(); + + void recursiveScan(const rtl::OUString &rURL, int nExpected); + bool load(const rtl::OUString &rURL); + + /** + * Ensure CVEs remain unbroken + */ + void testCVEs(); + + CPPUNIT_TEST_SUITE(FiltersTest); + CPPUNIT_TEST(testCVEs); + CPPUNIT_TEST_SUITE_END(); + +private: + uno::Reference m_xContext; + uno::Reference m_xFactory; + ::rtl::OUString m_aSrcRoot; +}; + +bool FiltersTest::load(const rtl::OUString &rURL) +{ + GraphicFilter aGraphicFilter(false); + SvFileStream aFileStream(rURL, STREAM_READ); + Graphic aGraphic; + return aGraphicFilter.ImportGraphic(aGraphic, rURL, aFileStream) == 0; +} + +void FiltersTest::recursiveScan(const rtl::OUString &rURL, int nExpected) +{ + osl::Directory aDir(rURL); + + CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.open()); + osl::DirectoryItem aItem; + osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type); + while (aDir.getNextItem(aItem) == osl::FileBase::E_None) + { + aItem.getFileStatus(aFileStatus); + rtl::OUString sURL = aFileStatus.getFileURL(); + if (aFileStatus.getFileType() == osl::FileStatus::Directory) + recursiveScan(sURL, nExpected); + else + { + sal_Int32 nLastSlash = sURL.lastIndexOf('/'); + + //ignore .files + if ( + (nLastSlash != -1) && (nLastSlash+1 < sURL.getLength()) && + (sURL.getStr()[nLastSlash+1] == '.') + ) + { + continue; + } + + rtl::OString aRes(rtl::OUStringToOString(sURL, + osl_getThreadTextEncoding())); + if (nExpected == indeterminate) + { + fprintf(stderr, "loading %s\n", aRes.getStr()); + } + sal_uInt32 nStartTime = osl_getGlobalTimer(); + bool bRes = load(sURL); + sal_uInt32 nEndTime = osl_getGlobalTimer(); + if (nExpected == indeterminate) + { + fprintf(stderr, "pass/fail was %d (%"SAL_PRIuUINT32" ms)\n", + bRes, nEndTime-nStartTime); + continue; + } + CPPUNIT_ASSERT_MESSAGE(aRes.getStr(), bRes == nExpected); + } + } + CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.close()); +} + +void FiltersTest::testCVEs() +{ + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/wmf/pass")), true); + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/wmf/fail")), false); + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/wmf/indeterminate")), 2); + + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/emf/pass")), true); + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/emf/fail")), false); + recursiveScan(m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/libs-gui/svtools/qa/cppunit/data/emf/indeterminate")), 2); +} + +FiltersTest::FiltersTest() + : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://")) +{ + m_xContext = cppu::defaultBootstrap_InitialComponentContext(); + m_xFactory = m_xContext->getServiceManager(); + + uno::Reference xSM(m_xFactory, uno::UNO_QUERY_THROW); + + //Without this we're crashing because callees are using + //getProcessServiceFactory. In general those should be removed in favour + //of retaining references to the root ServiceFactory as its passed around + comphelper::setProcessServiceFactory(xSM); +#if 0 + // initialise UCB-Broker + uno::Sequence aUcbInitSequence(2); + aUcbInitSequence[0] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Local")); + aUcbInitSequence[1] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office")); + bool bInitUcb = ucbhelper::ContentBroker::initialize(xSM, aUcbInitSequence); + CPPUNIT_ASSERT_MESSAGE("Should be able to initialize UCB", bInitUcb); + + uno::Reference xUcb = + ucbhelper::ContentBroker::get()->getContentProviderManagerInterface(); + uno::Reference xFileProvider(xSM->createInstance( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY); + xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True); + + // force locale (and resource files loaded) to en-US + const LanguageType eLang=LANGUAGE_ENGLISH_US; + + rtl::OUString aLang, aCountry; + MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry); + lang::Locale aLocale(aLang, aCountry, rtl::OUString()); + ResMgr::SetDefaultLocale( aLocale ); + + SvtSysLocaleOptions aLocalOptions; + aLocalOptions.SetUILocaleConfigString( + MsLangId::convertLanguageToIsoString( eLang ) ); +#endif + + InitVCL(xSM); + + const char* pSrcRoot = getenv( "SRC_ROOT" ); + CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0); + +#ifdef WNT + if (pSrcRoot[1] == ':') + m_aSrcRoot += rtl::OUString::createFromAscii( "/" ); +#endif + m_aSrcRoot += rtl::OUString::createFromAscii( pSrcRoot ); +} + +void FiltersTest::setUp() +{ +} + +FiltersTest::~FiltersTest() +{ + uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose(); +} + +void FiltersTest::tearDown() +{ +} + +CPPUNIT_TEST_SUITE_REGISTRATION(FiltersTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 645361f80286bd316dbec0b26f29c50bac7afa32 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 13:17:03 +0100 Subject: add some wmf test-cases --- svtools/qa/cppunit/data/wmf/fail/CVE-2005-2124-1.wmf | Bin 0 -> 218 bytes svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-1.wmf | Bin 0 -> 68 bytes svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-2.wmf | Bin 0 -> 68 bytes svtools/qa/cppunit/data/wmf/pass/CVE-2005-2123-1.wmf | Bin 0 -> 684 bytes svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf | Bin 0 -> 68 bytes svtools/qa/cppunit/data/wmf/pass/CVE-2007-1090-1.wmf | Bin 0 -> 238 bytes svtools/qa/cppunit/data/wmf/pass/CVE-2007-1238-1.wmf | Bin 0 -> 382 bytes svtools/qa/cppunit/data/wmf/pass/CVE-2007-1245-1.wmf | Bin 0 -> 382 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 svtools/qa/cppunit/data/wmf/fail/CVE-2005-2124-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-2.wmf create mode 100644 svtools/qa/cppunit/data/wmf/pass/CVE-2005-2123-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/pass/CVE-2007-1090-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/pass/CVE-2007-1238-1.wmf create mode 100644 svtools/qa/cppunit/data/wmf/pass/CVE-2007-1245-1.wmf diff --git a/svtools/qa/cppunit/data/wmf/fail/CVE-2005-2124-1.wmf b/svtools/qa/cppunit/data/wmf/fail/CVE-2005-2124-1.wmf new file mode 100644 index 000000000000..5826a98277c2 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/fail/CVE-2005-2124-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-1.wmf b/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-1.wmf new file mode 100644 index 000000000000..07db62c2a48c Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-2.wmf b/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-2.wmf new file mode 100644 index 000000000000..5b99a4883ce8 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/fail/CVE-2006-0143-2.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/pass/CVE-2005-2123-1.wmf b/svtools/qa/cppunit/data/wmf/pass/CVE-2005-2123-1.wmf new file mode 100644 index 000000000000..6af243b587c5 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/pass/CVE-2005-2123-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf b/svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf new file mode 100644 index 000000000000..794a7ef9af08 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/pass/CVE-2006-4071-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1090-1.wmf b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1090-1.wmf new file mode 100644 index 000000000000..c050fa6e3b4d Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1090-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1238-1.wmf b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1238-1.wmf new file mode 100644 index 000000000000..a01e310089b0 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1238-1.wmf differ diff --git a/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1245-1.wmf b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1245-1.wmf new file mode 100644 index 000000000000..a01e310089b0 Binary files /dev/null and b/svtools/qa/cppunit/data/wmf/pass/CVE-2007-1245-1.wmf differ -- cgit v1.2.3 From 8ba39261d635a764993d0fd002a47a3ec48a5cf2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 13:41:52 +0100 Subject: handle busted emf lengths --- svtools/source/filter/wmf/enhwmf.cxx | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/svtools/source/filter/wmf/enhwmf.cxx b/svtools/source/filter/wmf/enhwmf.cxx index 23990473aa60..ce7842b0c270 100644 --- a/svtools/source/filter/wmf/enhwmf.cxx +++ b/svtools/source/filter/wmf/enhwmf.cxx @@ -261,22 +261,27 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) } bEMFPlus = true; + sal_Size pos = pWMF->Tell(); void *buffer = malloc( length ); - - int pos = pWMF->Tell(); pOut->PassEMFPlus( buffer, pWMF->Read( buffer, length ) ); + free( buffer ); pWMF->Seek( pos ); bHaveDC = false; - length -= 4; + OSL_ASSERT(length >= 4); + //reduce by 32bit length itself, skip in SeekRel if + //impossibly unavailble + sal_uInt32 nRemainder = length >= 4 ? length-4 : length; - while (length > 0) { - sal_uInt16 type, flags; - sal_uInt32 size, dataSize; - sal_uInt32 next; + const size_t nRequiredHeaderSize = 12; + while (nRemainder > nRequiredHeaderSize) + { + sal_uInt16 type(0), flags(0); + sal_uInt32 size(0), dataSize(0); *pWMF >> type >> flags >> size >> dataSize; + nRemainder -= nRequiredHeaderSize; EMFP_DEBUG(printf ("\t\tEMF+ record type: %d\n", type)); @@ -286,14 +291,16 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) EMFP_DEBUG(printf ("\t\tEMF+ lock DC (device context)\n", type)); } - next = pWMF->Tell() + ( size - 12 ); - - length -= size; - - pWMF->Seek( next ); + //Get the length of the remaining data of this record based + //on the alleged size + sal_uInt32 nRemainingRecordData = size >= nRequiredHeaderSize ? + size-nRequiredHeaderSize : 0; + //clip to available size + nRemainingRecordData = std::min(nRemainingRecordData, nRemainder); + pWMF->SeekRel(nRemainingRecordData); + nRemainder -= nRemainingRecordData; } - - free( buffer ); + pWMF->SeekRel(nRemainder); } void EnhWMFReader::ReadGDIComment() -- cgit v1.2.3 From bac1a3ff168afc98a1a20b69256c8a89ee7ee581 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 6 Jul 2011 07:05:32 -0700 Subject: Remove unused class INetMessageHeaderIterator --- tools/inc/tools/inetmsg.hxx | 30 ------------------------------ tools/source/inet/inetmsg.cxx | 28 ---------------------------- 2 files changed, 58 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index f59f9d1d3590..26a650df9635 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -240,36 +240,6 @@ public: } }; -/*======================================================================= - * - * INetMessageHeaderIterator Interface. - * - *=====================================================================*/ -class INetMessageHeaderIterator -{ - sal_uIntPtr nValueCount; - List aValueList; - UniString aEmptyString; - -public: - INetMessageHeaderIterator ( - const INetMessage& rMsg, const UniString& rHdrName); - virtual ~INetMessageHeaderIterator (void); - - sal_uIntPtr GetValueCount (void) const { return nValueCount; } - const UniString& GetValue (sal_uIntPtr nIndex) const - { - if (nIndex < nValueCount) - { - return *((UniString*)(aValueList.GetObject(nIndex))); - } - else - { - return aEmptyString; - } - } -}; - /*======================================================================= * * INetRFC822Message Interface. diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 0bec115de6d6..13ff543358ab 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -197,34 +197,6 @@ SvStream& INetMessage::operator>> (SvStream& rStrm) return rStrm; } -/*======================================================================= - * - * INetMessageHeaderIterator Implementation. - * - *=====================================================================*/ -INetMessageHeaderIterator::INetMessageHeaderIterator ( - const INetMessage& rMsg, const UniString& rHdrName) -{ - sal_uIntPtr i, n = rMsg.GetHeaderCount(); - for (i = 0; i < n; i++) - { - if (rHdrName.CompareIgnoreCaseToAscii (rMsg.GetHeaderName(i)) == 0) - { - UniString *pValue = new UniString (rMsg.GetHeaderValue(i)); - aValueList.Insert (pValue, LIST_APPEND); - } - } - nValueCount = aValueList.Count(); -} - -INetMessageHeaderIterator::~INetMessageHeaderIterator (void) -{ - sal_uIntPtr i, n = aValueList.Count(); - for (i = 0; i < n; i++) - delete ((UniString*)(aValueList.GetObject(i))); - aValueList.Clear(); -} - /*======================================================================= * * INetRFC822Message Implementation. -- cgit v1.2.3 From 004a29b9ac66f68af5ea12a2303a4b2be77d8145 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Wed, 6 Jul 2011 18:05:48 +0200 Subject: Fixed a crash: GDIMetafile was deleted twice --- svtools/source/graphic/grfcache.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index df7bfa9f88b1..47de44d7695c 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -371,7 +371,7 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj* if( mbSwappedAll ) { delete mpBmpEx, mpBmpEx = NULL; - delete mpMtf, mpMtf = NULL; + mpMtf = NULL; // No need to delete it as it has already been dereferenced delete mpAnimation, mpAnimation = NULL; } } -- cgit v1.2.3 From 7ba7f588ffca35c5a8b9574ca9e22e3a8029e388 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 13:48:19 +0100 Subject: add some emf test-cases --- svtools/qa/cppunit/data/emf/fail/CVE-2004-0209-1.emf | Bin 0 -> 576 bytes svtools/qa/cppunit/data/emf/fail/CVE-2008-1083-1.emf | Bin 0 -> 3524 bytes svtools/qa/cppunit/data/emf/fail/CVE-2009-1217-1.emf | Bin 0 -> 1075 bytes svtools/qa/cppunit/data/emf/pass/CVE-2008-1087-1.emf | Bin 0 -> 3380 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 svtools/qa/cppunit/data/emf/fail/CVE-2004-0209-1.emf create mode 100644 svtools/qa/cppunit/data/emf/fail/CVE-2008-1083-1.emf create mode 100644 svtools/qa/cppunit/data/emf/fail/CVE-2009-1217-1.emf create mode 100644 svtools/qa/cppunit/data/emf/pass/CVE-2008-1087-1.emf diff --git a/svtools/qa/cppunit/data/emf/fail/CVE-2004-0209-1.emf b/svtools/qa/cppunit/data/emf/fail/CVE-2004-0209-1.emf new file mode 100644 index 000000000000..2f77fcda3b99 Binary files /dev/null and b/svtools/qa/cppunit/data/emf/fail/CVE-2004-0209-1.emf differ diff --git a/svtools/qa/cppunit/data/emf/fail/CVE-2008-1083-1.emf b/svtools/qa/cppunit/data/emf/fail/CVE-2008-1083-1.emf new file mode 100644 index 000000000000..0cbd952de2f6 Binary files /dev/null and b/svtools/qa/cppunit/data/emf/fail/CVE-2008-1083-1.emf differ diff --git a/svtools/qa/cppunit/data/emf/fail/CVE-2009-1217-1.emf b/svtools/qa/cppunit/data/emf/fail/CVE-2009-1217-1.emf new file mode 100644 index 000000000000..ee7db91e37fe Binary files /dev/null and b/svtools/qa/cppunit/data/emf/fail/CVE-2009-1217-1.emf differ diff --git a/svtools/qa/cppunit/data/emf/pass/CVE-2008-1087-1.emf b/svtools/qa/cppunit/data/emf/pass/CVE-2008-1087-1.emf new file mode 100644 index 000000000000..9bc2a3f203fa Binary files /dev/null and b/svtools/qa/cppunit/data/emf/pass/CVE-2008-1087-1.emf differ -- cgit v1.2.3 From 43d7111c8371acf14933f1d18c835b898da64121 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 17:22:24 +0100 Subject: don't need this I believe --- svtools/CppunitTest_svtools_filters_test.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/svtools/CppunitTest_svtools_filters_test.mk b/svtools/CppunitTest_svtools_filters_test.mk index 952ec02cbecc..d091ede3f2f9 100755 --- a/svtools/CppunitTest_svtools_filters_test.mk +++ b/svtools/CppunitTest_svtools_filters_test.mk @@ -60,16 +60,10 @@ $(eval $(call gb_CppunitTest_add_type_rdbs,svtools_filters_test,\ types \ )) -$(eval $(call gb_CppunitTest_add_service_rdbs,svtools_filters_test,\ - svtools_filters_test \ -)) - $(eval $(call gb_CppunitTest_set_args,svtools_filters_test,\ --headless \ --invisible \ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \ )) -$(eval $(call gb_RdbTarget_RdbTarget,svtools_filters_test)) - # vim: set noet sw=4 ts=4: -- cgit v1.2.3 From 30804502d9cd0a8c360d4aa1ab02643c4694b924 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 6 Jul 2011 20:58:09 +0300 Subject: Drop Win9x and NT4 code --- vcl/inc/win/saldata.hxx | 2 - vcl/inc/win/salprn.h | 3 - vcl/win/source/app/salinst.cxx | 4 - vcl/win/source/gdi/salprn.cxx | 746 ++++++------------------------------- vcl/win/source/window/salframe.cxx | 54 +-- 5 files changed, 123 insertions(+), 686 deletions(-) diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index ca0a19f4361a..ba9068628c8c 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -162,8 +162,6 @@ struct SalShlData UINT mnWheelScrollChars; // WheelScrollChars UINT mnWheelMsgId; // Wheel-Message-Id fuer W95 BOOL mbWXP; // Windows XP - BOOL mbWPrinter; // true: use unicode printer functions - // false: use anis compat printer functions OSVERSIONINFO maVersionInfo; }; diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h index 6b399f99f971..80399d5eb3e9 100755 --- a/vcl/inc/win/salprn.h +++ b/vcl/inc/win/salprn.h @@ -37,15 +37,12 @@ // WNT3 #define SAL_DRIVERDATA_SYSSIGN ((sal_uIntPtr)0x574E5433) -#define SAL_DRIVERDATA_VERSION_A 1 -#define SAL_DRIVERDATA_VERSION_W 2 #pragma pack( 1 ) struct SalDriverData { sal_uIntPtr mnSysSignature; - sal_uInt16 mnVersion; sal_uInt16 mnDriverOffset; BYTE maDriverData[1]; }; diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 6db248c0ddb4..b06d3cc672d6 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -516,8 +516,6 @@ SalInstance* CreateSalInstance() // determine the windows version aSalShlData.mbWXP = 0; - aSalShlData.mbWPrinter = 0; - WORD nVer = (WORD)GetVersion(); rtl_zeroMemory( &aSalShlData.maVersionInfo, sizeof(aSalShlData.maVersionInfo) ); aSalShlData.maVersionInfo.dwOSVersionInfoSize = sizeof( aSalShlData.maVersionInfo ); if ( GetVersionEx( &aSalShlData.maVersionInfo ) ) @@ -526,8 +524,6 @@ SalInstance* CreateSalInstance() if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 || ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) ) aSalShlData.mbWXP = 1; - if( aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) - aSalShlData.mbWPrinter = 1; } pSalData->mnAppThreadId = GetCurrentThreadId(); diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index 07a6b633e11b..ae8d93382985 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -110,24 +110,11 @@ static char aImplWindows[] = "windows"; static char aImplDevices[] = "devices"; static char aImplDevice[] = "device"; -static LPDEVMODEA SAL_DEVMODE_A( const ImplJobSetup* pSetupData ) -{ - LPDEVMODEA pRet = NULL; - SalDriverData* pDrv = (SalDriverData*)pSetupData->mpDriverData; - if( pDrv->mnVersion == SAL_DRIVERDATA_VERSION_A && - pSetupData->mnDriverDataLen >= sizeof(DEVMODEA)+sizeof(SalDriverData)-1 - ) - pRet = ((LPDEVMODEA)((pSetupData->mpDriverData) + (pDrv->mnDriverOffset))); - return pRet; -} - static LPDEVMODEW SAL_DEVMODE_W( const ImplJobSetup* pSetupData ) { LPDEVMODEW pRet = NULL; SalDriverData* pDrv = (SalDriverData*)pSetupData->mpDriverData; - if( pDrv->mnVersion == SAL_DRIVERDATA_VERSION_W && - pSetupData->mnDriverDataLen >= sizeof(DEVMODEW)+sizeof(SalDriverData)-1 - ) + if( pSetupData->mnDriverDataLen >= sizeof(DEVMODEW)+sizeof(SalDriverData)-1 ) pRet = ((LPDEVMODEW)((pSetupData->mpDriverData) + (pDrv->mnDriverOffset))); return pRet; } @@ -192,140 +179,8 @@ static sal_uLong ImplWinQueueStatusToSal( DWORD nWinStatus ) // ----------------------------------------------------------------------- -static void getPrinterQueueInfoOldStyle( ImplPrnQueueList* pList ) -{ - DWORD i; - DWORD n; - DWORD nBytes = 0; - DWORD nInfoPrn2; - sal_Bool bFound = FALSE; - PRINTER_INFO_2* pWinInfo2 = NULL; - PRINTER_INFO_2* pGetInfo2; - EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoPrn2 ); - if ( nBytes ) - { - pWinInfo2 = (PRINTER_INFO_2*) rtl_allocateMemory( nBytes ); - if ( EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pWinInfo2, nBytes, &nBytes, &nInfoPrn2 ) ) - { - pGetInfo2 = pWinInfo2; - for ( i = 0; i < nInfoPrn2; i++ ) - { - SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; - pInfo->maPrinterName = ImplSalGetUniString( pGetInfo2->pPrinterName ); - pInfo->maDriver = ImplSalGetUniString( pGetInfo2->pDriverName ); - XubString aPortName; - if ( pGetInfo2->pPortName ) - aPortName = ImplSalGetUniString( pGetInfo2->pPortName ); - // pLocation can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pLocation && strlen( pGetInfo2->pLocation ) ) - pInfo->maLocation = ImplSalGetUniString( pGetInfo2->pLocation ); - else - pInfo->maLocation = aPortName; - // pComment can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pComment ) - pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment ); - pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status ); - pInfo->mnJobs = pGetInfo2->cJobs; - pInfo->mpSysData = new XubString( aPortName ); - pList->Add( pInfo ); - pGetInfo2++; - } - - bFound = TRUE; - } - } - - // read printers from win.ini - // TODO: MSDN: GetProfileString() should not be called from server - // code because it is just there for WIN16 compatibility - UINT nSize = 4096; - char* pBuf = new char[nSize]; - UINT nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize ); - while ( nRead >= nSize-2 ) - { - nSize += 2048; - delete []pBuf; - pBuf = new char[nSize]; - nRead = GetProfileStringA( aImplDevices, NULL, "", pBuf, nSize ); - } - - // extract printer names from buffer and fill list - char* pName = pBuf; - while ( *pName ) - { - char* pPortName; - char* pTmp; - char aPortBuf[256]; - GetProfileStringA( aImplDevices, pName, "", aPortBuf, sizeof( aPortBuf ) ); - - pPortName = aPortBuf; - - // create name - xub_StrLen nNameLen = sal::static_int_cast(strlen( pName )); - XubString aName( ImplSalGetUniString( pName, nNameLen ) ); - - // get driver name - pTmp = pPortName; - while ( *pTmp != ',' ) - pTmp++; - XubString aDriver( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) ); - pPortName = pTmp; - - // get port names - do - { - pPortName++; - pTmp = pPortName; - while ( *pTmp && (*pTmp != ',') ) - pTmp++; - - String aPortName( ImplSalGetUniString( pPortName, (sal_uInt16)(pTmp-pPortName) ) ); - - // create new entry - // look up if printer was already found in first loop - sal_Bool bAdd = TRUE; - if ( pWinInfo2 ) - { - pGetInfo2 = pWinInfo2; - for ( n = 0; n < nInfoPrn2; n++ ) - { - if ( aName.EqualsIgnoreCaseAscii( pGetInfo2->pPrinterName ) ) - { - bAdd = FALSE; - break; - } - pGetInfo2++; - } - } - // if it's a new printer, add it - if ( bAdd ) - { - SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; - pInfo->maPrinterName = aName; - pInfo->maDriver = aDriver; - pInfo->maLocation = aPortName; - pInfo->mnStatus = 0; - pInfo->mnJobs = QUEUE_JOBS_DONTKNOW; - pInfo->mpSysData = new XubString( aPortName ); - pList->Add( pInfo ); - } - } - while ( *pTmp == ',' ); - - pName += nNameLen + 1; - } - - delete []pBuf; - rtl_freeMemory( pWinInfo2 ); -} - void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) { - if( ! aSalShlData.mbWPrinter ) - { - getPrinterQueueInfoOldStyle( pList ); - return; - } DWORD i; DWORD nBytes = 0; DWORD nInfoPrn4 = 0; @@ -352,59 +207,8 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) // ----------------------------------------------------------------------- -static void getPrinterQueueStateOldStyle( SalPrinterQueueInfo* pInfo ) -{ - DWORD nBytes = 0; - DWORD nInfoRet; - PRINTER_INFO_2* pWinInfo2; - EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &nBytes, &nInfoRet ); - if ( nBytes ) - { - pWinInfo2 = (PRINTER_INFO_2*) rtl_allocateMemory( nBytes ); - if ( EnumPrintersA( PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pWinInfo2, nBytes, &nBytes, &nInfoRet ) ) - { - PRINTER_INFO_2* pGetInfo2 = pWinInfo2; - for ( DWORD i = 0; i < nInfoRet; i++ ) - { - if ( pInfo->maPrinterName.EqualsAscii( pGetInfo2->pPrinterName ) && - ( pInfo->maDriver.Len() == 0 || - pInfo->maDriver.EqualsAscii( pGetInfo2->pDriverName ) ) - ) - { - XubString aPortName; - if ( pGetInfo2->pPortName ) - aPortName = ImplSalGetUniString( pGetInfo2->pPortName ); - // pLocation can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pLocation && strlen( pGetInfo2->pLocation ) ) - pInfo->maLocation = ImplSalGetUniString( pGetInfo2->pLocation ); - else - pInfo->maLocation = aPortName; - // pComment can be 0 (the Windows docu doesn't describe this) - if ( pGetInfo2->pComment ) - pInfo->maComment = ImplSalGetUniString( pGetInfo2->pComment ); - pInfo->mnStatus = ImplWinQueueStatusToSal( pGetInfo2->Status ); - pInfo->mnJobs = pGetInfo2->cJobs; - if( ! pInfo->mpSysData ) - pInfo->mpSysData = new XubString( aPortName ); - break; - } - - pGetInfo2++; - } - } - - rtl_freeMemory( pWinInfo2 ); - } -} - void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) { - if( ! aSalShlData.mbWPrinter ) - { - getPrinterQueueStateOldStyle( pInfo ); - return; - } - HANDLE hPrinter = 0; LPWSTR pPrnName = reinterpret_cast(const_cast(pInfo->maPrinterName.GetBuffer())); if( OpenPrinterW( pPrnName, &hPrinter, NULL ) ) @@ -451,43 +255,19 @@ void WinSalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) // ----------------------------------------------------------------------- XubString WinSalInstance::GetDefaultPrinter() { - static bool bGetDefPrtAPI = true; - static sal_Bool(WINAPI*pGetDefaultPrinter)(LPWSTR,LPDWORD) = NULL; - // try to use GetDefaultPrinter API (not available prior to W2000) - if( bGetDefPrtAPI ) + DWORD nChars = 0; + GetDefaultPrinterW( NULL, &nChars ); + if( nChars ) { - bGetDefPrtAPI = false; - // check for W2k and XP - if( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) + LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR)); + XubString aDefPrt; + if( GetDefaultPrinterW( pStr, &nChars ) ) { - OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "winspool.drv" ) ); - oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); - oslGenericFunction pFunc = NULL; - if( pLib ) - { - OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "GetDefaultPrinterW" ) ); - pFunc = osl_getFunctionSymbol( pLib, queryFuncName.pData ); - } - - pGetDefaultPrinter = (sal_Bool(WINAPI*)(LPWSTR,LPDWORD)) pFunc; - } - } - if( pGetDefaultPrinter ) - { - DWORD nChars = 0; - pGetDefaultPrinter( NULL, &nChars ); - if( nChars ) - { - LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR)); - XubString aDefPrt; - if( pGetDefaultPrinter( pStr, &nChars ) ) - { - aDefPrt = reinterpret_cast(pStr); - } - rtl_freeMemory( pStr ); - if( aDefPrt.Len() ) - return aDefPrt; + aDefPrt = reinterpret_cast(pStr); } + rtl_freeMemory( pStr ); + if( aDefPrt.Len() ) + return aDefPrt; } // get default printer from win.ini @@ -511,30 +291,15 @@ XubString WinSalInstance::GetDefaultPrinter() static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps, BYTE* pOutput, const ImplJobSetup* pSetupData ) { - if( aSalShlData.mbWPrinter ) - { - DEVMODEW* pDevMode; - if ( !pSetupData || !pSetupData->mpDriverData ) - pDevMode = NULL; - else - pDevMode = SAL_DEVMODE_W( pSetupData ); - - return DeviceCapabilitiesW( reinterpret_cast(pPrinter->maDeviceName.GetBuffer()), - reinterpret_cast(pPrinter->maPortName.GetBuffer()), - nCaps, (LPWSTR)pOutput, pDevMode ); - } + DEVMODEW* pDevMode; + if ( !pSetupData || !pSetupData->mpDriverData ) + pDevMode = NULL; else - { - DEVMODEA* pDevMode; - if ( !pSetupData || !pSetupData->mpDriverData ) - pDevMode = NULL; - else - pDevMode = SAL_DEVMODE_A( pSetupData ); + pDevMode = SAL_DEVMODE_W( pSetupData ); - return DeviceCapabilitiesA( ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - ImplSalGetWinAnsiString( pPrinter->maPortName, TRUE ).GetBuffer(), - nCaps, (LPSTR)pOutput, pDevMode ); - } + return DeviceCapabilitiesW( reinterpret_cast(pPrinter->maDeviceName.GetBuffer()), + reinterpret_cast(pPrinter->maPortName.GetBuffer()), + nCaps, (LPWSTR)pOutput, pDevMode ); } // ----------------------------------------------------------------------- @@ -549,25 +314,15 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, // initialize versions from jobsetup // those will be overwritten with driver's version - DEVMODEA* pDevModeA = NULL; DEVMODEW* pDevModeW = NULL; LONG dmSpecVersion = -1; LONG dmDriverVersion = -1; SalDriverData* pSalDriverData = (SalDriverData*)pSetupData->mpDriverData; BYTE* pDriverData = ((BYTE*)pSalDriverData) + pSalDriverData->mnDriverOffset; - if( pSalDriverData->mnVersion == SAL_DRIVERDATA_VERSION_W ) - { - if( aSalShlData.mbWPrinter ) - pDevModeW = (DEVMODEW*)pDriverData; - } - else if( pSalDriverData->mnVersion == SAL_DRIVERDATA_VERSION_A ) - { - if( ! aSalShlData.mbWPrinter ) - pDevModeA = (DEVMODEA*)pDriverData; - } + pDevModeW = (DEVMODEW*)pDriverData; long nSysJobSize = -1; - if( pPrinter && ( pDevModeA || pDevModeW ) ) + if( pPrinter && pDevModeW ) { // just too many driver crashes in that area -> check the dmSpecVersion and dmDriverVersion fields always !!! // this prevents using the jobsetup between different Windows versions (eg from XP to 9x) but we @@ -576,31 +331,16 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, ByteString aPrinterNameA= ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); HANDLE hPrn; LPWSTR pPrinterNameW = reinterpret_cast(const_cast(pPrinter->maDeviceName.GetBuffer())); - if ( ! aSalShlData.mbWPrinter ) - { - if ( !OpenPrinterA( (LPSTR)aPrinterNameA.GetBuffer(), &hPrn, NULL ) ) - return FALSE; - } - else - if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) - return FALSE; + if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) + return FALSE; // #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded! if( hPrn == HGDI_ERROR ) return FALSE; - if( aSalShlData.mbWPrinter ) - { - nSysJobSize = DocumentPropertiesW( 0, hPrn, - pPrinterNameW, - NULL, NULL, 0 ); - } - else - { - nSysJobSize = DocumentPropertiesA( 0, hPrn, - (LPSTR)aPrinterNameA.GetBuffer(), - NULL, NULL, 0 ); - } + nSysJobSize = DocumentPropertiesW( 0, hPrn, + pPrinterNameW, + NULL, NULL, 0 ); if( nSysJobSize < 0 ) { @@ -609,18 +349,9 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, } BYTE *pBuffer = (BYTE*)_alloca( nSysJobSize ); LONG nRet = -1; - if( aSalShlData.mbWPrinter ) - { - nRet = DocumentPropertiesW( 0, hPrn, - pPrinterNameW, - (LPDEVMODEW)pBuffer, NULL, DM_OUT_BUFFER ); - } - else - { - nRet = DocumentPropertiesA( 0, hPrn, - (LPSTR)aPrinterNameA.GetBuffer(), - (LPDEVMODEA)pBuffer, NULL, DM_OUT_BUFFER ); - } + nRet = DocumentPropertiesW( 0, hPrn, + pPrinterNameW, + (LPDEVMODEW)pBuffer, NULL, DM_OUT_BUFFER ); if( nRet < 0 ) { ClosePrinter( hPrn ); @@ -630,8 +361,8 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, // the spec version differs between the windows platforms, ie 98,NT,2000/XP // this allows us to throw away printer settings from other platforms that might crash a buggy driver // we check the driver version as well - dmSpecVersion = aSalShlData.mbWPrinter ? ((DEVMODEW*)pBuffer)->dmSpecVersion : ((DEVMODEA*)pBuffer)->dmSpecVersion; - dmDriverVersion = aSalShlData.mbWPrinter ? ((DEVMODEW*)pBuffer)->dmDriverVersion : ((DEVMODEA*)pBuffer)->dmDriverVersion; + dmSpecVersion = ((DEVMODEW*)pBuffer)->dmSpecVersion; + dmDriverVersion = ((DEVMODEW*)pBuffer)->dmDriverVersion; ClosePrinter( hPrn ); } @@ -642,10 +373,6 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, (long)(pSetupData->mnDriverDataLen - pSetupDriverData->mnDriverOffset) == nSysJobSize && pSetupDriverData->mnSysSignature == SAL_DRIVERDATA_SYSSIGN ) { - if( pDevModeA && - (dmSpecVersion == pDevModeA->dmSpecVersion) && - (dmDriverVersion == pDevModeA->dmDriverVersion) ) - return TRUE; if( pDevModeW && (dmSpecVersion == pDevModeW->dmSpecVersion) && (dmDriverVersion == pDevModeW->dmDriverVersion) ) @@ -670,16 +397,8 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); HANDLE hPrn; LPWSTR pPrinterNameW = reinterpret_cast(const_cast(pPrinter->maDeviceName.GetBuffer())); - if( aSalShlData.mbWPrinter ) - { - if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) - return FALSE; - } - else - { - if ( !OpenPrinterA( (LPSTR)aPrinterNameA.GetBuffer(), &hPrn, NULL ) ) - return FALSE; - } + if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) + return FALSE; // #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded! if( hPrn == HGDI_ERROR ) return FALSE; @@ -692,16 +411,9 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup SalDriverData* pOutBuffer = NULL; BYTE* pInBuffer = NULL; - if( aSalShlData.mbWPrinter ) - { - nSysJobSize = DocumentPropertiesW( hWnd, hPrn, - pPrinterNameW, - NULL, NULL, 0 ); - } - else - nSysJobSize = DocumentPropertiesA( hWnd, hPrn, - (LPSTR)ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - NULL, NULL, 0 ); + nSysJobSize = DocumentPropertiesW( hWnd, hPrn, + pPrinterNameW, + NULL, NULL, 0 ); if ( nSysJobSize < 0 ) { ClosePrinter( hPrn ); @@ -712,7 +424,6 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup nDriverDataLen = sizeof(SalDriverData) + nSysJobSize-1; pOutBuffer = (SalDriverData*)rtl_allocateZeroMemory( nDriverDataLen ); pOutBuffer->mnSysSignature = SAL_DRIVERDATA_SYSSIGN; - pOutBuffer->mnVersion = aSalShlData.mbWPrinter ? SAL_DRIVERDATA_VERSION_W : SAL_DRIVERDATA_VERSION_A; // calculate driver data offset including structure padding pOutBuffer->mnDriverOffset = sal::static_int_cast( (char*)pOutBuffer->maDriverData - @@ -738,18 +449,9 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup nMutexCount = ImplSalReleaseYieldMutex(); BYTE* pOutDevMode = (((BYTE*)pOutBuffer) + pOutBuffer->mnDriverOffset); - if( aSalShlData.mbWPrinter ) - { - nRet = DocumentPropertiesW( hWnd, hPrn, - pPrinterNameW, - (LPDEVMODEW)pOutDevMode, (LPDEVMODEW)pInBuffer, nMode ); - } - else - { - nRet = DocumentPropertiesA( hWnd, hPrn, - (LPSTR)ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ).GetBuffer(), - (LPDEVMODEA)pOutDevMode, (LPDEVMODEA)pInBuffer, nMode ); - } + nRet = DocumentPropertiesW( hWnd, hPrn, + pPrinterNameW, + (LPDEVMODEW)pOutDevMode, (LPDEVMODEW)pInBuffer, nMode ); if ( pVisibleDlgParent ) ImplSalAcquireYieldMutex( nMutexCount ); ClosePrinter( hPrn ); @@ -761,35 +463,17 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup } // fill up string buffers with 0 so they do not influence a JobSetup's memcmp - if( aSalShlData.mbWPrinter ) + if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 64 ) { - if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 64 ) - { - sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmDeviceName ); - if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )/sizeof(sal_Unicode) ) - memset( ((LPDEVMODEW)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )-(nLen*sizeof(sal_Unicode)) ); - } - if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 166 ) - { - sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmFormName ); - if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )/sizeof(sal_Unicode) ) - memset( ((LPDEVMODEW)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )-(nLen*sizeof(sal_Unicode)) ); - } + sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmDeviceName ); + if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )/sizeof(sal_Unicode) ) + memset( ((LPDEVMODEW)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmDeviceName )-(nLen*sizeof(sal_Unicode)) ); } - else + if( ((LPDEVMODEW)pOutDevMode)->dmSize >= 166 ) { - if( ((LPDEVMODEA)pOutDevMode)->dmSize >= 32 ) - { - sal_Int32 nLen = strlen( (const char*)((LPDEVMODEA)pOutDevMode)->dmDeviceName ); - if ( nLen < sizeof( ((LPDEVMODEA)pOutDevMode)->dmDeviceName ) ) - memset( ((LPDEVMODEA)pOutDevMode)->dmDeviceName+nLen, 0, sizeof( ((LPDEVMODEA)pOutDevMode)->dmDeviceName )-nLen ); - } - if( ((LPDEVMODEA)pOutDevMode)->dmSize >= 102 ) - { - sal_Int32 nLen = strlen( (const char*)((LPDEVMODEA)pOutDevMode)->dmFormName ); - if ( nLen < sizeof( ((LPDEVMODEA)pOutDevMode)->dmFormName ) ) - memset( ((LPDEVMODEA)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEA)pOutDevMode)->dmFormName )-nLen ); - } + sal_Int32 nLen = rtl_ustr_getLength( (const sal_Unicode*)((LPDEVMODEW)pOutDevMode)->dmFormName ); + if ( nLen < sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )/sizeof(sal_Unicode) ) + memset( ((LPDEVMODEW)pOutDevMode)->dmFormName+nLen, 0, sizeof( ((LPDEVMODEW)pOutDevMode)->dmFormName )-(nLen*sizeof(sal_Unicode)) ); } // update data @@ -805,13 +489,12 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup // ----------------------------------------------------------------------- #define DECLARE_DEVMODE( i )\ - DEVMODEA* pDevModeA = SAL_DEVMODE_A(i);\ DEVMODEW* pDevModeW = SAL_DEVMODE_W(i);\ - if( pDevModeA == NULL && pDevModeW == NULL )\ + if( pDevModeW == NULL )\ return #define CHOOSE_DEVMODE(i)\ - (pDevModeW ? pDevModeW->i : pDevModeA->i) + (pDevModeW->i) static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData, sal_uLong nFlags ) { @@ -1379,75 +1062,27 @@ static HDC ImplCreateICW_WithCatch( LPWSTR pDriver, return hDC; } -static HDC ImplCreateICA_WithCatch( char* pDriver, - char* pDevice, - LPDEVMODEA pDevMode ) -{ - HDC hDC = 0; - CATCH_DRIVER_EX_BEGIN; - hDC = CreateICA( pDriver, pDevice, 0, pDevMode ); - CATCH_DRIVER_EX_END_2( "exception in CreateICW" ); - return hDC; -} - - static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetupData ) { HDC hDC = 0; - if( aSalShlData.mbWPrinter ) - { - LPDEVMODEW pDevMode; - if ( pSetupData && pSetupData->mpDriverData ) - pDevMode = SAL_DEVMODE_W( pSetupData ); - else - pDevMode = NULL; - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space - // pl: does this hold true for Unicode functions ? - if( pPrinter->maDriverName.Len() > 2048 || pPrinter->maDeviceName.Len() > 2048 ) - return 0; - sal_Unicode pDriverName[ 4096 ]; - sal_Unicode pDeviceName[ 4096 ]; - rtl_copyMemory( pDriverName, pPrinter->maDriverName.GetBuffer(), pPrinter->maDriverName.Len()*sizeof(sal_Unicode)); - memset( pDriverName+pPrinter->maDriverName.Len(), 0, 32 ); - rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.GetBuffer(), pPrinter->maDeviceName.Len()*sizeof(sal_Unicode)); - memset( pDeviceName+pPrinter->maDeviceName.Len(), 0, 32 ); - hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName), - reinterpret_cast< LPCWSTR >(pDeviceName), - pDevMode ); - } + LPDEVMODEW pDevMode; + if ( pSetupData && pSetupData->mpDriverData ) + pDevMode = SAL_DEVMODE_W( pSetupData ); else - { - LPDEVMODEA pDevMode; - if ( pSetupData && pSetupData->mpDriverData ) - pDevMode = SAL_DEVMODE_A( pSetupData ); - else - pDevMode = NULL; - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space - ByteString aDriver ( ImplSalGetWinAnsiString( pPrinter->maDriverName, TRUE ) ); - ByteString aDevice ( ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ) ); - int n = aDriver.Len() > aDevice.Len() ? aDriver.Len() : aDevice.Len(); - // #125813# under some circumstances many printer drivers really - // seem to have a problem with the names and their conversions. - // We need to get on to of this, but haven't been able to reproduce - // the problem yet. Put the names on the stack so we get them - // with an eventual crash report. - if( n >= 2048 ) - return 0; - n += 2048; - char lpszDriverName[ 4096 ]; - char lpszDeviceName[ 4096 ]; - strncpy( lpszDriverName, aDriver.GetBuffer(), n ); - strncpy( lpszDeviceName, aDevice.GetBuffer(), n ); - // HDU: the crashes usually happen in a MBCS to unicode conversion, - // so I suspect the MBCS string's end is not properly recognized. - // The longest MBCS encoding I'm aware of has six bytes per code - // => add a couple of zeroes... - memset( lpszDriverName+aDriver.Len(), 0, 16 ); - memset( lpszDeviceName+aDevice.Len(), 0, 16 ); - hDC = ImplCreateICA_WithCatch( lpszDriverName, - lpszDeviceName, - pDevMode ); - } + pDevMode = NULL; + // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space + // pl: does this hold true for Unicode functions ? + if( pPrinter->maDriverName.Len() > 2048 || pPrinter->maDeviceName.Len() > 2048 ) + return 0; + sal_Unicode pDriverName[ 4096 ]; + sal_Unicode pDeviceName[ 4096 ]; + rtl_copyMemory( pDriverName, pPrinter->maDriverName.GetBuffer(), pPrinter->maDriverName.Len()*sizeof(sal_Unicode)); + memset( pDriverName+pPrinter->maDriverName.Len(), 0, 32 ); + rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.GetBuffer(), pPrinter->maDeviceName.Len()*sizeof(sal_Unicode)); + memset( pDeviceName+pPrinter->maDeviceName.Len(), 0, 32 ); + hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName), + reinterpret_cast< LPCWSTR >(pDeviceName), + pDevMode ); return hDC; } @@ -1567,28 +1202,14 @@ void WinSalInfoPrinter::InitPaperFormats( const ImplJobSetup* pSetupData ) pPaperSizes = (POINT*)rtl_allocateZeroMemory(nCount*sizeof(POINT)); ImplDeviceCaps( this, DC_PAPERSIZE, (BYTE*)pPaperSizes, pSetupData ); - if( aSalShlData.mbWPrinter ) + sal_Unicode* pNamesBuffer = (sal_Unicode*)rtl_allocateMemory(nCount*64*sizeof(sal_Unicode)); + ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); + for( DWORD i = 0; i < nCount; ++i ) { - sal_Unicode* pNamesBuffer = (sal_Unicode*)rtl_allocateMemory(nCount*64*sizeof(sal_Unicode)); - ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); - for( DWORD i = 0; i < nCount; ++i ) - { - PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); - m_aPaperFormats.push_back( aInfo ); - } - rtl_freeMemory( pNamesBuffer ); - } - else - { - char* pNamesBuffer = (char*)rtl_allocateMemory(nCount*64); - ImplDeviceCaps( this, DC_PAPERNAMES, (BYTE*)pNamesBuffer, pSetupData ); - for( DWORD i = 0; i < nCount; ++i ) - { - PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); - m_aPaperFormats.push_back( aInfo ); - } - rtl_freeMemory( pNamesBuffer ); + PaperInfo aInfo(pPaperSizes[i].x * 10, pPaperSizes[i].y * 10); + m_aPaperFormats.push_back( aInfo ); } + rtl_freeMemory( pNamesBuffer ); rtl_freeMemory( pPaperSizes ); } @@ -1683,22 +1304,11 @@ XubString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sa DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, NULL, pSetupData ); if ( (nPaperBin < nBins) && (nBins != GDI_ERROR) ) { - if( aSalShlData.mbWPrinter ) - { - sal_Unicode* pBuffer = new sal_Unicode[nBins*24]; - DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); - if ( nRet && (nRet != GDI_ERROR) ) - aPaperBinName = pBuffer + (nPaperBin*24); - delete [] pBuffer; - } - else - { - char* pBuffer = new char[nBins*24]; - DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); - if ( nRet && (nRet != GDI_ERROR) ) - aPaperBinName = ImplSalGetUniString( (const char*)(pBuffer + (nPaperBin*24)) ); - delete [] pBuffer; - } + sal_Unicode* pBuffer = new sal_Unicode[nBins*24]; + DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); + if ( nRet && (nRet != GDI_ERROR) ) + aPaperBinName = pBuffer + (nPaperBin*24); + delete [] pBuffer; } return aPaperBinName; @@ -1832,29 +1442,6 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) // ----------------------------------------------------------------------- -static LPDEVMODEA ImplSalSetCopies( LPDEVMODEA pDevMode, sal_uLong nCopies, sal_Bool bCollate ) -{ - LPDEVMODEA pNewDevMode = pDevMode; - if ( pDevMode && (nCopies > 1) ) - { - if ( nCopies > 32765 ) - nCopies = 32765; - sal_uLong nDevSize = pDevMode->dmSize+pDevMode->dmDriverExtra; - pNewDevMode = (LPDEVMODEA)rtl_allocateMemory( nDevSize ); - memcpy( pNewDevMode, pDevMode, nDevSize ); - pDevMode = pNewDevMode; - pDevMode->dmFields |= DM_COPIES; - pDevMode->dmCopies = (short)(sal_uInt16)nCopies; - pDevMode->dmFields |= DM_COLLATE; - if ( bCollate ) - pDevMode->dmCollate = DMCOLLATE_TRUE; - else - pDevMode->dmCollate = DMCOLLATE_FALSE; - } - - return pNewDevMode; -} - static LPDEVMODEW ImplSalSetCopies( LPDEVMODEW pDevMode, sal_uLong nCopies, sal_Bool bCollate ) { LPDEVMODEW pNewDevMode = pDevMode; @@ -1951,15 +1538,6 @@ static int lcl_StartDocW( HDC hDC, DOCINFOW* pInfo, WinSalPrinter* pPrt ) return nRet; } -static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt ) -{ - int nRet = 0; - CATCH_DRIVER_EX_BEGIN; - nRet = ::StartDocA( hDC, pInfo ); - CATCH_DRIVER_EX_END( "exception in StartDocW", pPrt ); - return nRet; -} - sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString&, @@ -1973,65 +1551,28 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, mnCopies = nCopies; mbCollate = bCollate; - LPDEVMODEA pOrgDevModeA = NULL; - LPDEVMODEA pDevModeA = NULL; LPDEVMODEW pOrgDevModeW = NULL; LPDEVMODEW pDevModeW = NULL; HDC hDC = 0; - if( aSalShlData.mbWPrinter ) + if ( pSetupData && pSetupData->mpDriverData ) { - if ( pSetupData && pSetupData->mpDriverData ) - { - pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); - pDevModeW = ImplSalSetCopies( pOrgDevModeW, nCopies, bCollate ); - } - else - pDevModeW = NULL; - - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space - sal_Unicode aDrvBuf[4096]; - sal_Unicode aDevBuf[4096]; - rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.GetBuffer(), (mpInfoPrinter->maDriverName.Len()+1)*sizeof(sal_Unicode)); - rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.GetBuffer(), (mpInfoPrinter->maDeviceName.Len()+1)*sizeof(sal_Unicode)); - hDC = CreateDCW( reinterpret_cast(aDrvBuf), - reinterpret_cast(aDevBuf), - NULL, - pDevModeW ); - - if ( pDevModeW != pOrgDevModeW ) - rtl_freeMemory( pDevModeW ); - } - else - { - if ( pSetupData && pSetupData->mpDriverData ) - { - pOrgDevModeA = SAL_DEVMODE_A( pSetupData ); - pDevModeA = ImplSalSetCopies( pOrgDevModeA, nCopies, bCollate ); - } - else - pDevModeA = NULL; - - // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space - ByteString aDriver ( ImplSalGetWinAnsiString( mpInfoPrinter->maDriverName, TRUE ) ); - ByteString aDevice ( ImplSalGetWinAnsiString( mpInfoPrinter->maDeviceName, TRUE ) ); - int n = aDriver.Len() > aDevice.Len() ? aDriver.Len() : aDevice.Len(); - n += 2048; - char *lpszDriverName = new char[n]; - char *lpszDeviceName = new char[n]; - strncpy( lpszDriverName, aDriver.GetBuffer(), n ); - strncpy( lpszDeviceName, aDevice.GetBuffer(), n ); - hDC = CreateDCA( lpszDriverName, - lpszDeviceName, - NULL, - pDevModeA ); - - delete [] lpszDriverName; - delete [] lpszDeviceName; - - if ( pDevModeA != pOrgDevModeA ) - rtl_freeMemory( pDevModeA ); + pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); + pDevModeW = ImplSalSetCopies( pOrgDevModeW, nCopies, bCollate ); } + // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space + sal_Unicode aDrvBuf[4096]; + sal_Unicode aDevBuf[4096]; + rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.GetBuffer(), (mpInfoPrinter->maDriverName.Len()+1)*sizeof(sal_Unicode)); + rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.GetBuffer(), (mpInfoPrinter->maDeviceName.Len()+1)*sizeof(sal_Unicode)); + hDC = CreateDCW( reinterpret_cast(aDrvBuf), + reinterpret_cast(aDevBuf), + NULL, + pDevModeW ); + + if ( pDevModeW != pOrgDevModeW ) + rtl_freeMemory( pDevModeW ); + if ( !hDC ) { mnError = SAL_PRINTER_ERROR_GENERALERROR; @@ -2112,71 +1653,33 @@ sal_Bool WinSalPrinter::StartJob( const XubString* pFileName, } } - if( aSalShlData.mbWPrinter ) + DOCINFOW aInfo; + memset( &aInfo, 0, sizeof( DOCINFOW ) ); + aInfo.cbSize = sizeof( aInfo ); + aInfo.lpszDocName = (LPWSTR)rJobName.GetBuffer(); + if ( pFileName || aOutFileName.getLength() ) { - DOCINFOW aInfo; - memset( &aInfo, 0, sizeof( DOCINFOW ) ); - aInfo.cbSize = sizeof( aInfo ); - aInfo.lpszDocName = (LPWSTR)rJobName.GetBuffer(); - if ( pFileName || aOutFileName.getLength() ) + if ( (pFileName && pFileName->Len()) || aOutFileName.getLength() ) { - if ( (pFileName && pFileName->Len()) || aOutFileName.getLength() ) - { - aInfo.lpszOutput = (LPWSTR)( (pFileName && pFileName->Len()) ? pFileName->GetBuffer() : aOutFileName.getStr()); - } - else - aInfo.lpszOutput = L"FILE:"; + aInfo.lpszOutput = (LPWSTR)( (pFileName && pFileName->Len()) ? pFileName->GetBuffer() : aOutFileName.getStr()); } else - aInfo.lpszOutput = NULL; - - // start Job - int nRet = lcl_StartDocW( hDC, &aInfo, this ); - - if ( nRet <= 0 ) - { - long nError = GetLastError(); - if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) - mnError = SAL_PRINTER_ERROR_ABORT; - else - mnError = SAL_PRINTER_ERROR_GENERALERROR; - return FALSE; - } + aInfo.lpszOutput = L"FILE:"; } else + aInfo.lpszOutput = NULL; + + // start Job + int nRet = lcl_StartDocW( hDC, &aInfo, this ); + + if ( nRet <= 0 ) { - // Both strings must exist, if StartJob() is called - ByteString aJobName( ImplSalGetWinAnsiString( rJobName, TRUE ) ); - ByteString aFileName; - - DOCINFOA aInfo; - memset( &aInfo, 0, sizeof( DOCINFOA ) ); - aInfo.cbSize = sizeof( aInfo ); - aInfo.lpszDocName = (LPCSTR)aJobName.GetBuffer(); - if ( pFileName || aOutFileName.getLength() ) - { - if ( pFileName->Len() || aOutFileName.getLength() ) - { - aFileName = ImplSalGetWinAnsiString( pFileName ? *pFileName : static_cast(aOutFileName), TRUE ); - aInfo.lpszOutput = (LPCSTR)aFileName.GetBuffer(); - } - else - aInfo.lpszOutput = "FILE:"; - } + long nError = GetLastError(); + if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) + mnError = SAL_PRINTER_ERROR_ABORT; else - aInfo.lpszOutput = NULL; - - // start Job - int nRet = lcl_StartDocA( hDC, &aInfo, this ); - if ( nRet <= 0 ) - { - long nError = GetLastError(); - if ( (nRet == SP_USERABORT) || (nRet == SP_APPABORT) || (nError == ERROR_PRINT_CANCELLED) || (nError == ERROR_CANCELLED) ) - mnError = SAL_PRINTER_ERROR_ABORT; - else - mnError = SAL_PRINTER_ERROR_GENERALERROR; - return FALSE; - } + mnError = SAL_PRINTER_ERROR_GENERALERROR; + return FALSE; } return TRUE; @@ -2285,26 +1788,13 @@ SalGraphics* WinSalPrinter::StartPage( ImplJobSetup* pSetupData, sal_Bool bNewJo HDC hDC = mhDC; if ( pSetupData && pSetupData->mpDriverData && bNewJobData ) { - if( aSalShlData.mbWPrinter ) - { - LPDEVMODEW pOrgDevModeW; - LPDEVMODEW pDevModeW; - pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); - pDevModeW = ImplSalSetCopies( pOrgDevModeW, mnCopies, mbCollate ); - ResetDCW( hDC, pDevModeW ); - if ( pDevModeW != pOrgDevModeW ) - rtl_freeMemory( pDevModeW ); - } - else - { - LPDEVMODEA pOrgDevModeA; - LPDEVMODEA pDevModeA; - pOrgDevModeA = SAL_DEVMODE_A( pSetupData ); - pDevModeA = ImplSalSetCopies( pOrgDevModeA, mnCopies, mbCollate ); - ResetDCA( hDC, pDevModeA ); - if ( pDevModeA != pOrgDevModeA ) - rtl_freeMemory( pDevModeA ); - } + LPDEVMODEW pOrgDevModeW; + LPDEVMODEW pDevModeW; + pOrgDevModeW = SAL_DEVMODE_W( pSetupData ); + pDevModeW = ImplSalSetCopies( pOrgDevModeW, mnCopies, mbCollate ); + ResetDCW( hDC, pDevModeW ); + if ( pDevModeW != pOrgDevModeW ) + rtl_freeMemory( pDevModeW ); } int nRet = 0; CATCH_DRIVER_EX_BEGIN; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 9541593a5c51..2ccef60923b1 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -107,10 +107,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; -// The following defines are newly added in Longhorn -#ifndef WM_MOUSEHWHEEL -# define WM_MOUSEHWHEEL 0x020E -#endif #ifndef SPI_GETWHEELSCROLLCHARS # define SPI_GETWHEELSCROLLCHARS 0x006C #endif @@ -118,19 +114,10 @@ using namespace ::com::sun::star::beans; # define SPI_SETWHEELSCROLLCHARS 0x006D #endif - - #if OSL_DEBUG_LEVEL > 1 void MyOutputDebugString( char *s) { OutputDebugString( s ); } #endif -// misssing prototypes and constants for LayeredWindows -extern "C" { - //WINUSERAPI sal_Bool WINAPI SetLayeredWindowAttributes(HWND,COLORREF,BYTE,DWORD); - typedef sal_Bool ( WINAPI * SetLayeredWindowAttributes_Proc_T ) (HWND,COLORREF,BYTE,DWORD); - static SetLayeredWindowAttributes_Proc_T lpfnSetLayeredWindowAttributes; -}; - // ======================================================================= const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageA("SYSTEM_WINDOW_ACTIVATED"); @@ -139,18 +126,6 @@ sal_Bool WinSalFrame::mbInReparent = FALSE; // ======================================================================= -// Wegen Fehler in Windows-Headerfiles -#ifndef IMN_OPENCANDIDATE -#define IMN_OPENCANDIDATE 0x0005 -#endif -#ifndef IMN_CLOSECANDIDATE -#define IMN_CLOSECANDIDATE 0x0004 -#endif - -#ifndef WM_THEMECHANGED -#define WM_THEMECHANGED 0x031A -#endif - // Macros for support of WM_UNICHAR & Keyman 6.0 #define Uni_UTF32ToSurrogate1(ch) (((unsigned long) (ch) - 0x10000) / 0x400 + 0xD800) #define Uni_UTF32ToSurrogate2(ch) (((unsigned long) (ch) - 0x10000) % 0x400 + 0xDC00) @@ -326,24 +301,6 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, if( getenv( "SAL_SYNCHRONIZE" ) ) // no buffering of drawing commands GdiSetBatchLimit( 1 ); - static int bLayeredAPI = -1; - if( bLayeredAPI == -1 ) - { - bLayeredAPI = 0; - // check for W2k and XP - if ( aSalShlData.maVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aSalShlData.maVersionInfo.dwMajorVersion >= 5 ) - { - OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "user32" ) ); - oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT ); - oslGenericFunction pFunc = NULL; - if( pLib ) - pFunc = osl_getAsciiFunctionSymbol( pLib, "SetLayeredWindowAttributes" ); - - lpfnSetLayeredWindowAttributes = ( SetLayeredWindowAttributes_Proc_T ) pFunc; - - bLayeredAPI = pFunc ? 1 : 0; - } - } static const char* pEnvTransparentFloats = getenv("SAL_TRANSPARENT_FLOATS" ); // determine creation data @@ -414,7 +371,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, { pFrame->mbNoIcon = TRUE; nExSysStyle |= WS_EX_TOOLWINDOW; - if ( pEnvTransparentFloats && bLayeredAPI == 1 /*&& !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) */) + if ( pEnvTransparentFloats /*&& !(nSalFrameStyle & SAL_FRAME_STYLE_MOVEABLE) */) nExSysStyle |= WS_EX_LAYERED; } } @@ -423,7 +380,7 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, nExSysStyle |= WS_EX_TOOLWINDOW; pFrame->mbFloatWin = TRUE; - if ( (bLayeredAPI == 1) && (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) */ ) ) + if ( (pEnvTransparentFloats /* does not work remote! || (nSalFrameStyle & SAL_FRAME_STYLE_FLOAT_FOCUSABLE) */ ) ) nExSysStyle |= WS_EX_LAYERED; } @@ -493,8 +450,8 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst, ImplWriteLastError( GetLastError(), "CreateWindowEx" ); #if OSL_DEBUG_LEVEL > 1 // set transparency value - if( bLayeredAPI == 1 && GetWindowExStyle( hWnd ) & WS_EX_LAYERED ) - lpfnSetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ ); + if( GetWindowExStyle( hWnd ) & WS_EX_LAYERED ) + SetLayeredWindowAttributes( hWnd, 0, 230, 0x00000002 /*LWA_ALPHA*/ ); #endif if ( !hWnd ) { @@ -759,8 +716,7 @@ static UINT ImplSalGetWheelScrollChars() { // Depending on Windows version, use proper default or 1 (when // driver emulates hscroll) - if( VER_PLATFORM_WIN32_NT == aSalShlData.maVersionInfo.dwPlatformId && - aSalShlData.maVersionInfo.dwMajorVersion < 6 ) + if( aSalShlData.maVersionInfo.dwMajorVersion < 6 ) { // Windows 2000 & WinXP : emulating driver, use step size // of 1 -- cgit v1.2.3 From bf02d13352942ba1da54ae86888c034e71a5a50b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 6 Jul 2011 20:59:44 +0300 Subject: chmod -x --- vcl/inc/win/salbmp.h | 0 vcl/inc/win/salframe.h | 0 vcl/inc/win/salmenu.h | 0 vcl/inc/win/salnativewidgets.h | 0 vcl/inc/win/salobj.h | 0 vcl/inc/win/salprn.h | 0 vcl/inc/win/salsys.h | 0 vcl/inc/win/saltimer.h | 0 vcl/inc/win/salvd.h | 0 vcl/inc/win/wincomp.hxx | 0 vcl/win/source/app/saldata.cxx | 0 vcl/win/source/app/salinfo.cxx | 0 vcl/win/source/app/salshl.cxx | 0 vcl/win/source/app/saltimer.cxx | 0 vcl/win/source/gdi/salbmp.cxx | 0 vcl/win/source/gdi/salvd.cxx | 0 vcl/win/source/src/salsrc.rc | 0 vcl/win/source/window/salobj.cxx | 0 18 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 vcl/inc/win/salbmp.h mode change 100755 => 100644 vcl/inc/win/salframe.h mode change 100755 => 100644 vcl/inc/win/salmenu.h mode change 100755 => 100644 vcl/inc/win/salnativewidgets.h mode change 100755 => 100644 vcl/inc/win/salobj.h mode change 100755 => 100644 vcl/inc/win/salprn.h mode change 100755 => 100644 vcl/inc/win/salsys.h mode change 100755 => 100644 vcl/inc/win/saltimer.h mode change 100755 => 100644 vcl/inc/win/salvd.h mode change 100755 => 100644 vcl/inc/win/wincomp.hxx mode change 100755 => 100644 vcl/win/source/app/saldata.cxx mode change 100755 => 100644 vcl/win/source/app/salinfo.cxx mode change 100755 => 100644 vcl/win/source/app/salshl.cxx mode change 100755 => 100644 vcl/win/source/app/saltimer.cxx mode change 100755 => 100644 vcl/win/source/gdi/salbmp.cxx mode change 100755 => 100644 vcl/win/source/gdi/salvd.cxx mode change 100755 => 100644 vcl/win/source/src/salsrc.rc mode change 100755 => 100644 vcl/win/source/window/salobj.cxx diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salnativewidgets.h b/vcl/inc/win/salnativewidgets.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salobj.h b/vcl/inc/win/salobj.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/saltimer.h b/vcl/inc/win/saltimer.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/salvd.h b/vcl/inc/win/salvd.h old mode 100755 new mode 100644 diff --git a/vcl/inc/win/wincomp.hxx b/vcl/inc/win/wincomp.hxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/salinfo.cxx b/vcl/win/source/app/salinfo.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/salshl.cxx b/vcl/win/source/app/salshl.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/gdi/salvd.cxx b/vcl/win/source/gdi/salvd.cxx old mode 100755 new mode 100644 diff --git a/vcl/win/source/src/salsrc.rc b/vcl/win/source/src/salsrc.rc old mode 100755 new mode 100644 diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx old mode 100755 new mode 100644 -- cgit v1.2.3 From 750ba4b760c05112be6fcab35aea7931ee54312f Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 6 Jul 2011 07:27:00 -0700 Subject: Remove unused class INetIOStream --- tools/inc/tools/inetstrm.hxx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tools/inc/tools/inetstrm.hxx b/tools/inc/tools/inetstrm.hxx index 16de7beedd98..aa662555c14e 100644 --- a/tools/inc/tools/inetstrm.hxx +++ b/tools/inc/tools/inetstrm.hxx @@ -93,20 +93,6 @@ public: int Write (const sal_Char *pData, sal_uIntPtr nSize); }; -/* - * INetIOStream. - */ -class INetIOStream : public INetIStream, public INetOStream -{ - // Not implemented. - INetIOStream (const INetIOStream& rStrm); - INetIOStream& operator= (const INetIOStream& rStrm); - -public: - INetIOStream (sal_uIntPtr nIBufferSize = 0, sal_uIntPtr nOBufferSize = 0); - virtual ~INetIOStream (void); -}; - /*========================================================================= * * INetMessageStream Interface. -- cgit v1.2.3 From ce30b112e3be46e5bab963af49abf13a2c7fb4ac Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 7 Jul 2011 12:05:01 +0200 Subject: fdo#38963: crash in number format dialog --- svl/source/numbers/zforlist.cxx | 59 ++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index b112f43e32f1..933c1b2df4db 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -2748,7 +2748,6 @@ void SvNumberFormatter::GenerateFormat(String& sString, const String& rThSep = GetNumThousandSep(); SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nIndex); - sal_Bool insertBrackets = pFormat->IsNegativeInBracket(); if (nAnzLeading == 0) { @@ -2842,36 +2841,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; + } } } -- cgit v1.2.3 From 930450f44e1d7b1f4490dea47c5825972490a74f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 6 Jul 2011 23:43:15 +0100 Subject: ByteString::CreateFromInt32->rtl::OString::valueOf --- svtools/source/filter/wmf/emfwr.cxx | 4 +++- svtools/source/svrtf/rtfout.cxx | 10 +++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/svtools/source/filter/wmf/emfwr.cxx b/svtools/source/filter/wmf/emfwr.cxx index 4efaa1bbbb88..d1beacbcd01f 100644 --- a/svtools/source/filter/wmf/emfwr.cxx +++ b/svtools/source/filter/wmf/emfwr.cxx @@ -1429,7 +1429,9 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) break; default: - OSL_FAIL( ( ByteString( "EMFWriter::ImplWriteActions: unsupported MetaAction #" ) += ByteString::CreateFromInt32( nType ) ).GetBuffer() ); + OSL_FAIL(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM( + "EMFWriter::ImplWriteActions: unsupported MetaAction #" )). + append(static_cast(nType)).getStr()); break; } } diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index 21368c0b14d3..d17148bd291a 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -141,11 +141,15 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c, // then write as unicode - character if (*pUCMode != nLen) { - rStream << "\\uc" << ByteString::CreateFromInt32(nLen).GetBuffer() << " "; // #i47831# add an additional whitespace, so that "document whitespaces" are not ignored.; + // #i47831# add an additional whitespace, so that + // "document whitespaces" are not ignored.; + rStream << "\\uc" + << rtl::OString::valueOf(nLen).getStr() << " "; *pUCMode = nLen; } - ByteString sNo(ByteString::CreateFromInt32(c)); - rStream << "\\u" << sNo.GetBuffer(); + rStream << "\\u" + << rtl::OString::valueOf( + static_cast(c)).getStr(); } for (sal_Int32 nI = 0; nI < nLen; ++nI) -- cgit v1.2.3 From 3b88fce03981b6c54ae545cece8bb3843be5143f Mon Sep 17 00:00:00 2001 From: Katarina Machalkova Date: Thu, 7 Jul 2011 16:14:30 +0300 Subject: Duplicate entries in Directory definition are no longer treated as errors Fixes a problem where cetain XLS documents open as blank in LibreOffice. Described in the non-public bnc#682484. --- sot/source/sdstor/stgdir.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3 From 2d360f03978c310371c5565bdb6b94595ef189b8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 7 Jul 2011 16:07:38 +0100 Subject: bodge this in to help people build for the moment --- vcl/Library_vcl.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 9ce6dee48124..70bdad3fecd9 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -474,6 +474,12 @@ else $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ )) +ifeq ($(OS),LINUX) +$(eval $(call gb_Library_add_linked_libs,vcl,\ + freetype \ + fontconfig \ +)) +endif endif endif -- cgit v1.2.3 From b1fdf9dc77de7be1d23e0c84ebad934ee6a398b7 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Thu, 7 Jul 2011 19:10:14 -0700 Subject: Replace List with std::vector< INetMessageHeader* > --- tools/inc/tools/inetmsg.hxx | 64 +++++++++++++++++++++++-------------------- tools/source/inet/inetmsg.cxx | 23 ++++++++-------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index 26a650df9635..24928cf0c335 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -36,6 +36,7 @@ #include #include #include +#include class DateTime; @@ -108,13 +109,14 @@ public: * INetMessage Interface. * *=====================================================================*/ + typedef ::std::vector< INetMessageHeader* > HeaderList_impl; class INetMessage { - List m_aHeaderList; + HeaderList_impl m_aHeaderList; - sal_uIntPtr m_nDocSize; - UniString m_aDocName; - SvLockBytesRef m_xDocLB; + sal_uIntPtr m_nDocSize; + UniString m_aDocName; + SvLockBytesRef m_xDocLB; void ListCleanup_Impl (void); void ListCopy (const INetMessage& rMsg); @@ -123,38 +125,36 @@ protected: UniString GetHeaderName_Impl ( sal_uIntPtr nIndex, rtl_TextEncoding eEncoding) const { - INetMessageHeader *p = - (INetMessageHeader*)(m_aHeaderList.GetObject(nIndex)); - if (p) - return UniString(p->GetName(), eEncoding); - else + if ( nIndex < m_aHeaderList.size() ) { + return UniString( m_aHeaderList[ nIndex ]->GetName(), eEncoding ); + } else { return UniString(); + } } UniString GetHeaderValue_Impl ( sal_uIntPtr nIndex, INetMIME::HeaderFieldType eType) const { - INetMessageHeader *p = - (INetMessageHeader*)(m_aHeaderList.GetObject(nIndex)); - if (p) - return INetMIME::decodeHeaderFieldBody (eType, p->GetValue()); - else + if ( nIndex < m_aHeaderList.size() ) { + return INetMIME::decodeHeaderFieldBody(eType, m_aHeaderList[ nIndex ]->GetValue()); + } else { return UniString(); + } } void SetHeaderField_Impl ( const INetMessageHeader &rHeader, sal_uIntPtr &rnIndex) { INetMessageHeader *p = new INetMessageHeader (rHeader); - if (m_aHeaderList.Count() <= rnIndex) + if (m_aHeaderList.size() <= rnIndex) { - m_aHeaderList.Insert (p, LIST_APPEND); - rnIndex = m_aHeaderList.Count() - 1; + rnIndex = m_aHeaderList.size(); + m_aHeaderList.push_back( p ); } else { - p = (INetMessageHeader*)(m_aHeaderList.Replace(p, rnIndex)); - delete p; + delete m_aHeaderList[ rnIndex ]; + m_aHeaderList[ rnIndex ] = p; } } @@ -188,7 +188,7 @@ public: return *this; } - sal_uIntPtr GetHeaderCount (void) const { return m_aHeaderList.Count(); } + sal_uIntPtr GetHeaderCount (void) const { return m_aHeaderList.size(); } UniString GetHeaderName (sal_uIntPtr nIndex) const { @@ -202,21 +202,23 @@ public: INetMessageHeader GetHeaderField (sal_uIntPtr nIndex) const { - INetMessageHeader *p = - (INetMessageHeader*)(m_aHeaderList.GetObject(nIndex)); - if (p) - return INetMessageHeader(*p); - else + if ( nIndex < m_aHeaderList.size() ) { + return INetMessageHeader( *m_aHeaderList[ nIndex ] ); + } else { return INetMessageHeader(); + } } sal_uIntPtr SetHeaderField ( const UniString& rName, const UniString& rValue, - sal_uIntPtr nIndex = LIST_APPEND); + sal_uIntPtr nIndex = ((sal_uIntPtr)-1) + ); virtual sal_uIntPtr SetHeaderField ( - const INetMessageHeader &rField, sal_uIntPtr nIndex = LIST_APPEND); + const INetMessageHeader &rField, + sal_uIntPtr nIndex = ((sal_uIntPtr)-1) + ); sal_uIntPtr GetDocumentSize (void) const { return m_nDocSize; } void SetDocumentSize (sal_uIntPtr nSize) { m_nDocSize = nSize; } @@ -287,7 +289,9 @@ public: using INetMessage::SetHeaderField; virtual sal_uIntPtr SetHeaderField ( - const INetMessageHeader &rHeader, sal_uIntPtr nIndex = LIST_APPEND); + const INetMessageHeader &rHeader, + sal_uIntPtr nIndex = ((sal_uIntPtr)-1) + ); /** Header fields. */ @@ -489,7 +493,9 @@ public: using INetRFC822Message::SetHeaderField; virtual sal_uIntPtr SetHeaderField ( - const INetMessageHeader &rHeader, sal_uIntPtr nIndex = LIST_APPEND); + const INetMessageHeader &rHeader, + sal_uIntPtr nIndex = ((sal_uIntPtr)-1) + ); /** Header fields. */ diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 13ff543358ab..776df97e75db 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -64,7 +64,6 @@ inline sal_Unicode ascii_toLowerCase( sal_Unicode ch ) * *=====================================================================*/ #define CONSTASCII_STRINGPARAM(a) (a), RTL_TEXTENCODING_ASCII_US -#define HEADERFIELD INetMessageHeader /* * ~INetMessage. @@ -80,10 +79,10 @@ INetMessage::~INetMessage (void) void INetMessage::ListCleanup_Impl (void) { // Cleanup. - sal_uIntPtr i, n = m_aHeaderList.Count(); + sal_uIntPtr i, n = m_aHeaderList.size(); for (i = 0; i < n; i++) - delete ((HEADERFIELD*)(m_aHeaderList.GetObject(i))); - m_aHeaderList.Clear(); + delete m_aHeaderList[ i ]; + m_aHeaderList.clear(); } /* @@ -100,8 +99,8 @@ void INetMessage::ListCopy (const INetMessage &rMsg) sal_uIntPtr i, n = rMsg.GetHeaderCount(); for (i = 0; i < n; i++) { - HEADERFIELD *p = (HEADERFIELD*)(rMsg.m_aHeaderList.GetObject(i)); - m_aHeaderList.Insert (new HEADERFIELD(*p), LIST_APPEND); + INetMessageHeader *p = rMsg.m_aHeaderList[ i ]; + m_aHeaderList.push_back( new INetMessageHeader(*p) ); } } } @@ -156,11 +155,11 @@ SvStream& INetMessage::operator<< (SvStream& rStrm) const rStrm << static_cast(m_nDocSize); rStrm.WriteByteString (m_aDocName, RTL_TEXTENCODING_UTF8); - sal_uIntPtr i, n = m_aHeaderList.Count(); + sal_uIntPtr i, n = m_aHeaderList.size(); rStrm << static_cast(n); for (i = 0; i < n; i++) - rStrm << *((HEADERFIELD *)(m_aHeaderList.GetObject(i))); + rStrm << *( m_aHeaderList[ i ] ); return rStrm; } @@ -188,9 +187,9 @@ SvStream& INetMessage::operator>> (SvStream& rStrm) for (i = 0; i < n; i++) { - HEADERFIELD *p = new HEADERFIELD(); + INetMessageHeader *p = new INetMessageHeader(); rStrm >> *p; - m_aHeaderList.Insert (p, LIST_APPEND); + m_aHeaderList.push_back( p ); } // Done. @@ -740,7 +739,7 @@ sal_uIntPtr INetRFC822Message::SetHeaderField ( case INETMSG_RFC822_OK: pData = pStop; SetHeaderField_Impl ( - HEADERFIELD (HDR(nIdx), rHeader.GetValue()), + INetMessageHeader (HDR(nIdx), rHeader.GetValue()), m_nIndex[nIdx]); nNewIndex = m_nIndex[nIdx]; break; @@ -1186,7 +1185,7 @@ sal_uIntPtr INetMIMEMessage::SetHeaderField ( case INETMSG_MIME_OK: pData = pStop; SetHeaderField_Impl ( - HEADERFIELD (MIMEHDR(nIdx), rHeader.GetValue()), + INetMessageHeader (MIMEHDR(nIdx), rHeader.GetValue()), m_nIndex[nIdx]); nNewIndex = m_nIndex[nIdx]; break; -- cgit v1.2.3 From 1737c0501328ac481601688021a662d4eccdfd5d Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Fri, 8 Jul 2011 18:12:46 +0900 Subject: header for rtl::OStringBuffer --- svtools/source/filter/wmf/emfwr.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/svtools/source/filter/wmf/emfwr.cxx b/svtools/source/filter/wmf/emfwr.cxx index d1beacbcd01f..09cd1876bf96 100644 --- a/svtools/source/filter/wmf/emfwr.cxx +++ b/svtools/source/filter/wmf/emfwr.cxx @@ -30,6 +30,7 @@ #include "precompiled_svtools.hxx" #include "emfwr.hxx" +#include #include #include #include -- cgit v1.2.3 From bdbb385c77831a97090ffd019c49a39d3ae86e1e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 7 Jul 2011 21:28:25 +0100 Subject: catch by const reference --- i18npool/source/paper/paper.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); -- cgit v1.2.3 From a7d7624d5fca34f926fb9a73bb8d3c1e5d0063bb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 7 Jul 2011 21:33:24 +0100 Subject: catch by const reference --- unotools/source/config/configmgr.cxx | 56 +++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index 2ddc11340bc7..4f83a861b416 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -156,21 +156,23 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider() UNO_QUERY); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) - { - static sal_Bool bMessage = sal_True; - if(bMessage) - { - bMessage = sal_False; - OString sMsg("CreateInstance with arguments exception: "); - sMsg += OString(rEx.Message.getStr(), - rEx.Message.getLength(), - RTL_TEXTENCODING_ASCII_US); - OSL_FAIL(sMsg.getStr()); - } - } + catch (const Exception& rEx) + { + static sal_Bool bMessage = sal_True; + if(bMessage) + { + bMessage = sal_False; + OString sMsg("CreateInstance with arguments exception: "); + sMsg += OString(rEx.Message.getStr(), + rEx.Message.getLength(), + RTL_TEXTENCODING_ASCII_US); + OSL_FAIL(sMsg.getStr()); + } + } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif } } @@ -282,7 +284,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem& OUString::createFromAscii(pAccessSrvc), aArgs); } - catch(Exception& rEx) + catch (const Exception& rEx) { if (CONFIG_MODE_PROPAGATE_ERRORS & rCfgItem.GetMode()) { @@ -489,7 +491,9 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) aArgs); } - catch(Exception&){} + catch (const Exception&) + { + } Reference xDirectAccess(xIFace, UNO_QUERY); if(xDirectAccess.is()) { @@ -514,7 +518,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) { aRet = xDirectAccess->getByName(sProperty); } - catch(Exception&) + catch (const Exception&) { #if OSL_DEBUG_LEVEL > 0 rtl::OStringBuffer aBuf(256); @@ -619,7 +623,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt aArgs); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("CreateInstance exception: "); sMsg += OString(rEx.Message.getStr(), @@ -628,7 +632,9 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt OSL_FAIL(sMsg.getStr()); } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif } return Reference(xIFace, UNO_QUERY); @@ -650,7 +656,7 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty) aRet = xAccess->getByName(sProperty); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("GetLocalProperty: "); sMsg += OString(rEx.Message.getStr(), @@ -659,7 +665,9 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty) OSL_FAIL(sMsg.getStr()); } #else - catch(Exception&){} + catch (const Exception&) + { + } #endif return aRet; } @@ -680,7 +688,7 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu xNodeReplace->replaceByName(sProperty, rValue); } #if OSL_DEBUG_LEVEL > 1 - catch(Exception& rEx) + catch (const Exception& rEx) { OString sMsg("PutLocalProperty: "); sMsg += OString(rEx.Message.getStr(), @@ -689,7 +697,9 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu OSL_FAIL(sMsg.getStr()); } #else - catch(Exception& ){} + catch (const Exception&) + { + } #endif } } -- cgit v1.2.3 From d6f788b984636116ad704986bbb2aa0c2beac4ae Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Fri, 8 Jul 2011 07:28:01 -0700 Subject: Replace List with std::vector< INetMIMEMessage* > I also removed "sal_uIntPtr nNumChildren;". The use was question able at best. Its count could be off because AttachChild() set it to size() if the child was added; however, if the child wasn't added the person doing the AttachChild() was also incrementing the count. Related to the removal of nNumChildren, I also removed the GetChildCount() & SetChildCount() methods because they where only used around the broken AttachChild() code. --- tools/inc/tools/inetmsg.hxx | 17 ++++++++--------- tools/source/inet/inetmsg.cxx | 24 ++++++++++-------------- tools/source/inet/inetstrm.cxx | 2 -- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index 24928cf0c335..45b9241a976d 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -455,19 +455,19 @@ enum INetMessageContainerType INETMSG_MULTIPART_FORM_DATA }; +class INetMIMEMessage; +typedef ::std::vector< INetMIMEMessage* > INetMIMEMessgeList_impl; class TOOLS_DLLPUBLIC INetMIMEMessage : public INetRFC822Message { - sal_uIntPtr m_nIndex[INETMSG_MIME_NUMHDR]; + sal_uIntPtr m_nIndex[INETMSG_MIME_NUMHDR]; - INetMIMEMessage *pParent; - sal_uIntPtr nNumChildren; - List aChildren; - ByteString m_aBoundary; - sal_Bool bHeaderParsed; + INetMIMEMessage* pParent; + INetMIMEMessgeList_impl aChildren; + ByteString m_aBoundary; + sal_Bool bHeaderParsed; friend class INetMIMEMessageStream; - void SetChildCount (sal_uIntPtr nCount) { nNumChildren = nCount; } const ByteString& GetMultipartBoundary (void) const { return m_aBoundary; } void SetMultipartBoundary (const ByteString& rBnd) { m_aBoundary = rBnd; } @@ -554,10 +554,9 @@ public: return (aType.CompareIgnoreCaseToAscii("multipart/", 10) == 0); } - sal_uIntPtr GetChildCount (void) const { return nNumChildren; } INetMIMEMessage* GetChild (sal_uIntPtr nIndex) const { - return ((INetMIMEMessage *)(aChildren.GetObject (nIndex))); + return ( nIndex < aChildren.size() ) ? aChildren[ nIndex ] : NULL; } INetMIMEMessage* GetParent (void) const { return pParent; } diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 776df97e75db..72767a8c48f1 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -960,7 +960,6 @@ enum _ImplINetMIMEMessageHeaderState INetMIMEMessage::INetMIMEMessage (void) : INetRFC822Message (), pParent (NULL), - nNumChildren (0), bHeaderParsed (sal_False) { for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++) @@ -1008,9 +1007,10 @@ INetMIMEMessage::~INetMIMEMessage (void) */ void INetMIMEMessage::CleanupImp (void) { - INetMIMEMessage *pChild = NULL; - while ((pChild = (INetMIMEMessage *)(aChildren.Remove())) != NULL) - if (pChild->pParent == this) delete pChild; + for( size_t i = 0, n = aChildren.size(); i < n; ++i ) { + delete aChildren[ i ]; + } + aChildren.clear(); } /* @@ -1020,24 +1020,22 @@ void INetMIMEMessage::CopyImp (const INetMIMEMessage& rMsg) { bHeaderParsed = rMsg.bHeaderParsed; - sal_uInt16 i; + size_t i; for (i = 0; i < INETMSG_MIME_NUMHDR; i++) m_nIndex[i] = rMsg.m_nIndex[i]; m_aBoundary = rMsg.m_aBoundary; - nNumChildren = rMsg.nNumChildren; - for (i = 0; i < rMsg.aChildren.Count(); i++) + for (i = 0; i < rMsg.aChildren.size(); i++) { - INetMIMEMessage *pChild = - (INetMIMEMessage *)(rMsg.aChildren.GetObject (i)); + INetMIMEMessage *pChild = rMsg.aChildren[ i ]; if (pChild->pParent == &rMsg) { pChild = pChild->CreateMessage (*pChild); pChild->pParent = this; } - aChildren.Insert (pChild, LIST_APPEND); + aChildren.push_back( pChild ); } } @@ -1366,8 +1364,7 @@ sal_Bool INetMIMEMessage::AttachChild ( if (IsContainer() /*&& rChildMsg.GetContentType().Len() */) { if (bOwner) rChildMsg.pParent = this; - aChildren.Insert (&rChildMsg, LIST_APPEND); - nNumChildren = aChildren.Count(); + aChildren.push_back( &rChildMsg ); return sal_True; } @@ -1582,7 +1579,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const #else rStrm.WriteByteString (m_aBoundary); #endif - rStrm << static_cast(nNumChildren); + rStrm << static_cast(aChildren.size()); return rStrm; } @@ -1607,7 +1604,6 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm) rStrm.ReadByteString (m_aBoundary); #endif rStrm >> nTemp; - nNumChildren = nTemp; return rStrm; } diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index 07d404b090ad..ff90411c8cee 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -1621,7 +1621,6 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize) if( !pChildStrm ) { // Encapsulated message. - pMsg->SetChildCount( pMsg->GetChildCount() + 1); INetMIMEMessage* pNewMessage = new INetMIMEMessage; pNewMessage->SetDocumentLB ( new SvAsyncLockBytes(new SvCacheStream, sal_False)); @@ -1731,7 +1730,6 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize) != COMPARE_EQUAL ) { // Encapsulated message. - pMsg->SetChildCount(pMsg->GetChildCount() + 1); INetMIMEMessage* pNewMessage = new INetMIMEMessage; pNewMessage->SetDocumentLB ( -- cgit v1.2.3 From 59c08b6f768ee8b797ec51a03d1d22c7bf6138bb Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Fri, 8 Jul 2011 17:06:13 +0200 Subject: Stop pretending to stay compatible with non-XKB X servers --- tools/inc/tools/prex.h | 10 ---------- vcl/unx/generic/app/i18n_xkb.cxx | 34 +++------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/tools/inc/tools/prex.h b/tools/inc/tools/prex.h index 151b0fe46279..e1e11f256b5a 100644 --- a/tools/inc/tools/prex.h +++ b/tools/inc/tools/prex.h @@ -44,22 +44,12 @@ extern "C" { #endif -// FIXME: should really check for xfree86 or for X11R6.1 and higher -#if defined(LINUX) || defined(FREEBSD) || defined(MACOSX) || defined(NETBSD) || \ - defined(OPENBSD) || defined(DRAGONFLY) -#define __XKeyboardExtension__ 1 -#else -#define __XKeyboardExtension__ 0 -#endif - #include #include #include #include #include -#if __XKeyboardExtension__ #include -#endif typedef unsigned long Pixel; #undef DestroyAll diff --git a/vcl/unx/generic/app/i18n_xkb.cxx b/vcl/unx/generic/app/i18n_xkb.cxx index cb93f48b6bd7..c9e42dda6751 100644 --- a/vcl/unx/generic/app/i18n_xkb.cxx +++ b/vcl/unx/generic/app/i18n_xkb.cxx @@ -36,16 +36,10 @@ #include "unx/saldata.hxx" #include "unx/i18n_xkb.hxx" -SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* -#if __XKeyboardExtension__ -pDisplay -#endif -) - : mbUseExtension( (sal_Bool)__XKeyboardExtension__ ), +SalI18N_KeyboardExtension::SalI18N_KeyboardExtension( Display* pDisplay ) + : mbUseExtension( sal_True ), mnDefaultGroup( 0 ) { - #if __XKeyboardExtension__ - mpDisplay = pDisplay; // allow user to set the default keyboard group idx or to disable the usage @@ -94,19 +88,11 @@ pDisplay XkbGetState( mpDisplay, XkbUseCoreKbd, &aStateRecord ); mnGroup = aStateRecord.group; } - - #endif // __XKeyboardExtension__ } void -SalI18N_KeyboardExtension::Dispatch( XEvent* -#if __XKeyboardExtension__ -pEvent -#endif -) +SalI18N_KeyboardExtension::Dispatch( XEvent* pEvent ) { - #if __XKeyboardExtension__ - // must the event be handled? if ( !mbUseExtension || (pEvent->type != mnEventBase) ) @@ -130,21 +116,13 @@ pEvent #endif break; } - #endif // __XKeyboardExtension__ } -#if __XKeyboardExtension__ sal_uInt32 SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32 nKeyCode, sal_uInt32 nShiftState, sal_uInt32 nGroup ) const -#else -sal_uInt32 -SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 ) const -#endif { - #if __XKeyboardExtension__ - if ( !mbUseExtension ) return NoSymbol; @@ -153,12 +131,6 @@ SalI18N_KeyboardExtension::LookupKeysymInGroup( sal_uInt32,sal_uInt32,sal_uInt32 KeySym nKeySymbol; nKeySymbol = XkbKeycodeToKeysym( mpDisplay, nKeyCode, nGroup, nShiftState ); return nKeySymbol; - - #else - - return NoSymbol; - - #endif // __XKeyboardExtension__ } -- cgit v1.2.3 From 648e382b3bf2e7986b4154ec86f63e3e1c5a7c8f Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Fri, 8 Jul 2011 21:20:12 -0700 Subject: Whitespace cleanup. I'm have a lot of Lists to cleanup; so lets just get the whitespace fixed first. --- vcl/inc/vcl/animate.hxx | 138 ++++++++++++++++++++++++++++-------------------- 1 file changed, 80 insertions(+), 58 deletions(-) diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index e53a51e0e932..8196b9ffe6bd 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -71,20 +71,25 @@ struct VCL_DLLPUBLIC AnimationBitmap Size aSizePix; long nWait; Disposal eDisposal; - sal_Bool bUserInput; + sal_Bool bUserInput; AnimationBitmap() {} - AnimationBitmap( const BitmapEx& rBmpEx, const Point& rPosPix, - const Size& rSizePix, long _nWait = 0L, - Disposal _eDisposal = DISPOSE_NOT ) : - aBmpEx ( rBmpEx ), - aPosPix ( rPosPix ), - aSizePix ( rSizePix ), - nWait ( _nWait ), - eDisposal ( _eDisposal ), - bUserInput ( sal_False ) {} - - sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const + AnimationBitmap( + const BitmapEx& rBmpEx, + const Point& rPosPix, + const Size& rSizePix, + long _nWait = 0L, + Disposal _eDisposal = DISPOSE_NOT + ) : + aBmpEx ( rBmpEx ), + aPosPix ( rPosPix ), + aSizePix ( rSizePix ), + nWait ( _nWait ), + eDisposal ( _eDisposal ), + bUserInput ( sal_False ) + {} + + sal_Bool operator==( const AnimationBitmap& rAnimBmp ) const { return( rAnimBmp.aBmpEx == aBmpEx && rAnimBmp.aPosPix == aPosPix && @@ -94,9 +99,10 @@ struct VCL_DLLPUBLIC AnimationBitmap rAnimBmp.bUserInput == bUserInput ); } - sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const { return !( *this == rAnimBmp ); } + sal_Bool operator!=( const AnimationBitmap& rAnimBmp ) const + { return !( *this == rAnimBmp ); } - sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const + sal_Bool IsEqual( const AnimationBitmap& rAnimBmp ) const { return( rAnimBmp.aPosPix == aPosPix && rAnimBmp.aSizePix == aSizePix && @@ -106,7 +112,7 @@ struct VCL_DLLPUBLIC AnimationBitmap rAnimBmp.aBmpEx.IsEqual( aBmpEx ) ); } - sal_uLong GetChecksum() const; + sal_uLong GetChecksum() const; }; // ------------------- @@ -125,8 +131,8 @@ struct AInfo OutputDevice* pOutDev; void* pViewData; long nExtraData; - sal_Bool bWithSize; - sal_Bool bPause; + sal_Bool bWithSize; + sal_Bool bPause; AInfo() : pOutDev( NULL ), pViewData( NULL ), @@ -156,11 +162,11 @@ class VCL_DLLPUBLIC Animation long mnPos; Disposal meLastDisposal; CycleMode meCycleMode; - sal_Bool mbFirst; - sal_Bool mbIsInAnimation; - sal_Bool mbWithSize; - sal_Bool mbLoopTerminated; - sal_Bool mbIsWaiting; + sal_Bool mbFirst; + sal_Bool mbIsInAnimation; + sal_Bool mbWithSize; + sal_Bool mbLoopTerminated; + sal_Bool mbIsWaiting; SAL_DLLPRIVATE void ImplRestartTimer( sal_uLong nTimeout ); @@ -170,7 +176,7 @@ public: SAL_DLLPRIVATE static void ImplIncAnimCount() { mnAnimCount++; } SAL_DLLPRIVATE static void ImplDecAnimCount() { mnAnimCount--; } - SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; } + SAL_DLLPRIVATE sal_uLong ImplGetCurPos() const { return mnPos; } public: @@ -179,28 +185,38 @@ public: ~Animation(); Animation& operator=( const Animation& rAnimation ); - sal_Bool operator==( const Animation& rAnimation ) const; - sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); } + sal_Bool operator==( const Animation& rAnimation ) const; + sal_Bool operator!=( const Animation& rAnimation ) const + { return !(*this==rAnimation); } - sal_Bool IsEqual( const Animation& rAnimation ) const; + sal_Bool IsEqual( const Animation& rAnimation ) const; - sal_Bool IsEmpty() const; + sal_Bool IsEmpty() const; void SetEmpty(); void Clear(); - sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, long nExtraData = 0, - OutputDevice* pFirstFrameOutDev = NULL ); - sal_Bool Start( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz, long nExtraData = 0, - OutputDevice* pFirstFrameOutDev = NULL ); + sal_Bool Start( + OutputDevice* pOutDev, + const Point& rDestPt, + long nExtraData = 0, + OutputDevice* pFirstFrameOutDev = NULL + ); + sal_Bool Start( + OutputDevice* pOutDev, + const Point& rDestPt, + const Size& rDestSz, + long nExtraData = 0, + OutputDevice* pFirstFrameOutDev = NULL + ); void Stop( OutputDevice* pOutDev = NULL, long nExtraData = 0 ); void Draw( OutputDevice* pOutDev, const Point& rDestPt ) const; void Draw( OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz ) const; - sal_Bool IsInAnimation() const { return mbIsInAnimation; } - sal_Bool IsTransparent() const; - sal_Bool IsTerminated() const { return mbLoopTerminated; } + sal_Bool IsInAnimation() const { return mbIsInAnimation; } + sal_Bool IsTransparent() const; + sal_Bool IsTerminated() const { return mbLoopTerminated; } const Size& GetDisplaySizePixel() const { return maGlobalSize; } void SetDisplaySizePixel( const Size& rSize ) { maGlobalSize = rSize; } @@ -208,7 +224,7 @@ public: const BitmapEx& GetBitmapEx() const { return maBitmapEx; } void SetBitmapEx( const BitmapEx& rBmpEx ) { maBitmapEx = rBmpEx; } - sal_uLong GetLoopCount() const { return mnLoopCount; } + sal_uLong GetLoopCount() const { return mnLoopCount; } void SetLoopCount( const sal_uLong nLoopCount ); void ResetLoopCount(); @@ -218,36 +234,42 @@ public: void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; } const Link& GetNotifyHdl() const { return maNotifyLink; } - sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } - sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); + sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } + sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); List* GetAInfoList() { return &maAInfoList; } - sal_uLong GetSizeBytes() const; - sal_uLong GetChecksum() const; + sal_uLong GetSizeBytes() const; + sal_uLong GetChecksum() const; public: - sal_Bool Convert( BmpConversion eConversion ); - sal_Bool ReduceColors( sal_uInt16 nNewColorCount, - BmpReduce eReduce = BMP_REDUCE_SIMPLE ); - sal_Bool Invert(); - sal_Bool Mirror( sal_uLong nMirrorFlags ); - sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); - sal_Bool Adjust( short nLuminancePercent = 0, - short nContrastPercent = 0, - short nChannelRPercent = 0, - short nChannelGPercent = 0, - short nChannelBPercent = 0, - double fGamma = 1.0, - sal_Bool bInvert = sal_False ); - sal_Bool Filter( BmpFilter eFilter, - const BmpFilterParam* pFilterParam = NULL, - const Link* pProgress = NULL ); - - friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation ); - friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation ); + sal_Bool Convert( BmpConversion eConversion ); + sal_Bool ReduceColors( + sal_uInt16 nNewColorCount, + BmpReduce eReduce = BMP_REDUCE_SIMPLE + ); + sal_Bool Invert(); + sal_Bool Mirror( sal_uLong nMirrorFlags ); + sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); + sal_Bool Adjust( + short nLuminancePercent = 0, + short nContrastPercent = 0, + short nChannelRPercent = 0, + short nChannelGPercent = 0, + short nChannelBPercent = 0, + double fGamma = 1.0, + sal_Bool bInvert = sal_False + ); + sal_Bool Filter( + BmpFilter eFilter, + const BmpFilterParam* pFilterParam = NULL, + const Link* pProgress = NULL + ); + + friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStream, Animation& rAnimation ); + friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStream, const Animation& rAnimation ); }; #endif // _SV_ANIMATE_HXX -- cgit v1.2.3 From 1203a32cb6c424db599e74c11c4ea2a321938ab0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 9 Jul 2011 15:07:39 +0300 Subject: Build cpputools only for desktop OSes --- i18npool/prj/build.lst | 2 +- vcl/prj/build.lst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/vcl/prj/build.lst b/vcl/prj/build.lst index 4b0ece6b1d46..29b3a4031e86 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc DESKTOP:cpputools svl LIBXSLT:libxslt CAIRO:cairo NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL -- cgit v1.2.3 From 2da3b7076c00d510b2e2010bba2f362ba7df54d1 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 07:12:22 -0700 Subject: Replace List with std::vector< AnimationBitmap* > --- vcl/inc/vcl/animate.hxx | 10 ++- vcl/source/gdi/animate.cxx | 183 +++++++++++++++++++++++++-------------------- 2 files changed, 107 insertions(+), 86 deletions(-) diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 8196b9ffe6bd..687a4300cb3e 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -145,11 +145,13 @@ struct AInfo // - AnimationBitmap - // ------------------- +typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl; + class VCL_DLLPUBLIC Animation { - SAL_DLLPRIVATE static sal_uLong mnAnimCount; + SAL_DLLPRIVATE static sal_uLong mnAnimCount; - List maList; + AnimationBitmapList_impl maList; List maAInfoList; Link maNotifyLink; BitmapEx maBitmapEx; @@ -159,7 +161,7 @@ class VCL_DLLPUBLIC Animation void* mpExtraData; long mnLoopCount; long mnLoops; - long mnPos; + size_t mnPos; Disposal meLastDisposal; CycleMode meCycleMode; sal_Bool mbFirst; @@ -234,7 +236,7 @@ public: void SetNotifyHdl( const Link& rLink ) { maNotifyLink = rLink; } const Link& GetNotifyHdl() const { return maNotifyLink; } - sal_uInt16 Count() const { return (sal_uInt16) maList.Count(); } + size_t Count() const { return maList.size(); } sal_Bool Insert( const AnimationBitmap& rAnimationBitmap ); const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 63d0010bd5d2..ce05dc1b2ca7 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -117,8 +117,8 @@ Animation::Animation( const Animation& rAnimation ) : { DBG_CTOR( Animation, NULL ); - for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ ) - maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND ); + for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ ) + maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); mpViewList = new List; @@ -134,8 +134,8 @@ Animation::~Animation() if( mbIsInAnimation ) Stop(); - for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() ) - delete (AnimationBitmap*) pStepBmp; + for( size_t i = 0, n = maList.size(); i < n; ++i ) + delete maList[ i ]; for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) delete (ImplAnimView*) pView; @@ -149,8 +149,8 @@ Animation& Animation::operator=( const Animation& rAnimation ) { Clear(); - for( long i = 0, nCount = rAnimation.maList.Count(); i < nCount; i++ ) - maList.Insert( new AnimationBitmap( *(AnimationBitmap*) rAnimation.maList.GetObject( i ) ), LIST_APPEND ); + for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ ) + maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maGlobalSize = rAnimation.maGlobalSize; maBitmapEx = rAnimation.maBitmapEx; @@ -168,20 +168,20 @@ Animation& Animation::operator=( const Animation& rAnimation ) sal_Bool Animation::operator==( const Animation& rAnimation ) const { - const sal_uLong nCount = maList.Count(); - sal_Bool bRet = sal_False; + const size_t nCount = maList.size(); + sal_Bool bRet = sal_False; - if( rAnimation.maList.Count() == nCount && - rAnimation.maBitmapEx == maBitmapEx && - rAnimation.maGlobalSize == maGlobalSize && - rAnimation.meCycleMode == meCycleMode ) + if( rAnimation.maList.size() == nCount + && rAnimation.maBitmapEx == maBitmapEx + && rAnimation.maGlobalSize == maGlobalSize + && rAnimation.meCycleMode == meCycleMode + ) { bRet = sal_True; - for( sal_uLong n = 0; n < nCount; n++ ) + for( size_t n = 0; n < nCount; n++ ) { - if( ( *(AnimationBitmap*) maList.GetObject( n ) ) != - ( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) ) + if( ( *maList[ n ] ) != ( *rAnimation.maList[ n ] ) ) { bRet = sal_False; break; @@ -196,16 +196,17 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const sal_Bool Animation::IsEqual( const Animation& rAnimation ) const { - const sal_uLong nCount = maList.Count(); - sal_Bool bRet = sal_False; + const size_t nCount = maList.size(); + sal_Bool bRet = sal_False; - if( rAnimation.maList.Count() == nCount && - rAnimation.maBitmapEx.IsEqual( maBitmapEx ) && - rAnimation.maGlobalSize == maGlobalSize && - rAnimation.meCycleMode == meCycleMode ) + if( rAnimation.maList.size() == nCount + && rAnimation.maBitmapEx.IsEqual( maBitmapEx ) + && rAnimation.maGlobalSize == maGlobalSize + && rAnimation.meCycleMode == meCycleMode + ) { - for( sal_uLong n = 0; ( n < nCount ) && !bRet; n++ ) - if( ( (AnimationBitmap*) maList.GetObject( n ) )->IsEqual( *(AnimationBitmap*) rAnimation.maList.GetObject( n ) ) ) + for( size_t n = 0; ( n < nCount ) && !bRet; n++ ) + if( maList[ n ]->IsEqual( *rAnimation.maList[ n ] ) ) bRet = sal_True; } @@ -216,7 +217,7 @@ sal_Bool Animation::IsEqual( const Animation& rAnimation ) const sal_Bool Animation::IsEmpty() const { - return( maBitmapEx.IsEmpty() && !maList.Count() ); + return( maBitmapEx.IsEmpty() && maList.empty() ); } // ------------------------------------------------------------------ @@ -228,9 +229,9 @@ void Animation::SetEmpty() maGlobalSize = Size(); maBitmapEx.SetEmpty(); - for( void* pStepBmp = maList.First(); pStepBmp; pStepBmp = maList.Next() ) - delete (AnimationBitmap*) pStepBmp; - maList.Clear(); + for( size_t i = 0, n = maList.size(); i < n; ++i ) + delete maList[ i ]; + maList.clear(); for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) delete (ImplAnimView*) pView; @@ -256,11 +257,13 @@ sal_Bool Animation::IsTransparent() const // ersetzt werden soll, muessen wir 'transparent' sein, um // richtig dargestellt zu werden, da die Appl. aus Optimierungsgruenden // kein Invalidate auf nicht-transp. Grafiken ausfuehren - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i ); + const AnimationBitmap* pAnimBmp = maList[ i ]; - if( DISPOSE_BACK == pAnimBmp->eDisposal && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect ) + if( DISPOSE_BACK == pAnimBmp->eDisposal + && Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect + ) { bRet = sal_True; break; @@ -279,9 +282,9 @@ sal_uLong Animation::GetSizeBytes() const { sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes(); - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - const AnimationBitmap* pAnimBmp = (AnimationBitmap*) maList.GetObject( i ); + const AnimationBitmap* pAnimBmp = maList[ i ]; nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes(); } @@ -295,7 +298,7 @@ sal_uLong Animation::GetChecksum() const SVBT32 aBT32; sal_uInt32 nCrc = GetBitmapEx().GetChecksum(); - UInt32ToSVBT32( maList.Count(), aBT32 ); + UInt32ToSVBT32( maList.size(), aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); UInt32ToSVBT32( maGlobalSize.Width(), aBT32 ); @@ -307,9 +310,9 @@ sal_uLong Animation::GetChecksum() const UInt32ToSVBT32( (long) meCycleMode, aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); - for( long i = 0, nCount = maList.Count(); i < nCount; i++ ) + for( size_t i = 0, nCount = maList.size(); i < nCount; i++ ) { - UInt32ToSVBT32( ( (AnimationBitmap*) maList.GetObject( i ) )->GetChecksum(), aBT32 ); + UInt32ToSVBT32( maList[ i ]->GetChecksum(), aBT32 ); nCrc = rtl_crc32( nCrc, aBT32, 4 ); } @@ -331,10 +334,12 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& { sal_Bool bRet = sal_False; - if( maList.Count() ) + if( !maList.empty() ) { - if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) && !mbLoopTerminated && - ( ANIMATION_TIMEOUT_ON_CLICK != ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ) ) + if( ( pOut->GetOutDevType() == OUTDEV_WINDOW ) + && !mbLoopTerminated + && ( ANIMATION_TIMEOUT_ON_CLICK != maList[ mnPos ]->nWait ) + ) { ImplAnimView* pView; ImplAnimView* pMatch = NULL; @@ -371,7 +376,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& if( !mbIsInAnimation ) { - ImplRestartTimer( ( (AnimationBitmap*) maList.GetObject( mnPos ) )->nWait ); + ImplRestartTimer( maList[ mnPos ]->nWait ); mbIsInAnimation = sal_True; } } @@ -419,19 +424,21 @@ void Animation::Draw( OutputDevice* pOut, const Point& rDestPt ) const void Animation::Draw( OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz ) const { - const sal_uLong nCount = maList.Count(); + const size_t nCount = maList.size(); if( nCount ) { - AnimationBitmap* pObj = (AnimationBitmap*) maList.GetObject( Min( mnPos, (long) nCount - 1L ) ); + AnimationBitmap* pObj = maList[ Min( mnPos, nCount - 1 ) ]; - if( pOut->GetConnectMetaFile() || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) ) - ( (AnimationBitmap*) maList.GetObject( 0 ) )->aBmpEx.Draw( pOut, rDestPt, rDestSz ); + if( pOut->GetConnectMetaFile() + || ( pOut->GetOutDevType() == OUTDEV_PRINTER ) + ) + maList[ 0 ]->aBmpEx.Draw( pOut, rDestPt, rDestSz ); else if( ANIMATION_TIMEOUT_ON_CLICK == pObj->nWait ) pObj->aBmpEx.Draw( pOut, rDestPt, rDestSz ); else { - const sal_uLong nOldPos = mnPos; + const size_t nOldPos = mnPos; ( (Animation*) this )->mnPos = mbLoopTerminated ? ( nCount - 1UL ) : mnPos; delete new ImplAnimView( (Animation*) this, pOut, rDestPt, rDestSz, 0 ); ( (Animation*) this )->mnPos = nOldPos; @@ -451,12 +458,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout ) IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) { - const sal_uLong nAnimCount = maList.Count(); + const size_t nAnimCount = maList.size(); if( nAnimCount ) { ImplAnimView* pView; - sal_Bool bGlobalPause = sal_True; + sal_Bool bGlobalPause = sal_True; if( maNotifyLink.IsSet() ) { @@ -518,7 +525,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) ImplRestartTimer( 10 ); else { - AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.GetObject( ++mnPos ); + AnimationBitmap* pStepBmp = (++mnPos < maList.size()) ? maList[ mnPos ] : NULL; if( !pStepBmp ) { @@ -527,7 +534,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) Stop(); mbLoopTerminated = sal_True; mnPos = nAnimCount - 1UL; - maBitmapEx = ( (AnimationBitmap*) maList.GetObject( mnPos ) )->aBmpEx; + maBitmapEx = maList[ mnPos ]->aBmpEx; return 0L; } else @@ -536,7 +543,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) mnLoops--; mnPos = 0; - pStepBmp = (AnimationBitmap*) maList.GetObject( mnPos ); + pStepBmp = maList[ mnPos ]; } } @@ -583,10 +590,10 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp ) Rectangle aGlobalRect( aPoint, maGlobalSize ); maGlobalSize = aGlobalRect.Union( Rectangle( rStepBmp.aPosPix, rStepBmp.aSizePix ) ).GetSize(); - maList.Insert( new AnimationBitmap( rStepBmp ), LIST_APPEND ); + maList.push_back( new AnimationBitmap( rStepBmp ) ); // zunaechst nehmen wir die erste BitmapEx als Ersatz-BitmapEx - if( maList.Count() == 1 ) + if( maList.size() == 1 ) maBitmapEx = rStepBmp.aBmpEx; bRet = sal_True; @@ -599,24 +606,33 @@ sal_Bool Animation::Insert( const AnimationBitmap& rStepBmp ) const AnimationBitmap& Animation::Get( sal_uInt16 nAnimation ) const { - DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" ); - return *(AnimationBitmap*) maList.GetObject( nAnimation ); + DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" ); + return *maList[ nAnimation ]; } // ----------------------------------------------------------------------- void Animation::Replace( const AnimationBitmap& rNewAnimationBitmap, sal_uInt16 nAnimation ) { - DBG_ASSERT( ( nAnimation < maList.Count() ), "No object at this position" ); + DBG_ASSERT( ( nAnimation < maList.size() ), "No object at this position" ); - delete (AnimationBitmap*) maList.Replace( new AnimationBitmap( rNewAnimationBitmap ), nAnimation ); + delete maList[ nAnimation ]; + maList[ nAnimation ] = new AnimationBitmap( rNewAnimationBitmap ); // Falls wir an erster Stelle einfuegen, // muessen wir natuerlich auch, // auch die Ersatzdarstellungs-BitmapEx // aktualisieren; - if ( ( !nAnimation && ( !mbLoopTerminated || ( maList.Count() == 1 ) ) ) || - ( ( nAnimation == maList.Count() - 1 ) && mbLoopTerminated ) ) + if ( ( !nAnimation + && ( !mbLoopTerminated + || ( maList.size() == 1 ) + ) + ) + || + ( ( nAnimation == maList.size() - 1 ) + && mbLoopTerminated + ) + ) { maBitmapEx = rNewAnimationBitmap.aBmpEx; } @@ -646,12 +662,12 @@ sal_Bool Animation::Convert( BmpConversion eConversion ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Convert( eConversion ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Convert( eConversion ); maBitmapEx.Convert( eConversion ); } @@ -669,12 +685,12 @@ sal_Bool Animation::ReduceColors( sal_uInt16 nNewColorCount, BmpReduce eReduce ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.ReduceColors( nNewColorCount, eReduce ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.ReduceColors( nNewColorCount, eReduce ); maBitmapEx.ReduceColors( nNewColorCount, eReduce ); } @@ -692,12 +708,12 @@ sal_Bool Animation::Invert() sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Invert(); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Invert(); maBitmapEx.Invert(); } @@ -715,16 +731,15 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; if( nMirrorFlags ) { - for( AnimationBitmap* pStepBmp = (AnimationBitmap*) maList.First(); - pStepBmp && bRet; - pStepBmp = (AnimationBitmap*) maList.Next() ) + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) { + AnimationBitmap* pStepBmp = maList[ i ]; if( ( bRet = pStepBmp->aBmpEx.Mirror( nMirrorFlags ) ) == sal_True ) { if( nMirrorFlags & BMP_MIRROR_HORZ ) @@ -752,12 +767,12 @@ sal_Bool Animation::Dither( sal_uLong nDitherFlags ) sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Dither( nDitherFlags ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Dither( nDitherFlags ); maBitmapEx.Dither( nDitherFlags ); } @@ -777,15 +792,19 @@ sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent, sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) { - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Adjust( nLuminancePercent, nContrastPercent, - nChannelRPercent, nChannelGPercent, nChannelBPercent, - fGamma, bInvert ); + bRet = maList[ i ]->aBmpEx.Adjust( nLuminancePercent, + nContrastPercent, + nChannelRPercent, + nChannelGPercent, + nChannelBPercent, + fGamma, bInvert + ); } maBitmapEx.Adjust( nLuminancePercent, nContrastPercent, @@ -806,12 +825,12 @@ sal_Bool Animation::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterPara sal_Bool bRet; - if( !IsInAnimation() && maList.Count() ) + if( !IsInAnimation() && !maList.empty() ) { bRet = sal_True; - for( void* pStepBmp = maList.First(); pStepBmp && bRet; pStepBmp = maList.Next() ) - bRet = ( ( AnimationBitmap*) pStepBmp )->aBmpEx.Filter( eFilter, pFilterParam, pProgress ); + for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) + bRet = maList[ i ]->aBmpEx.Filter( eFilter, pFilterParam, pProgress ); maBitmapEx.Filter( eFilter, pFilterParam, pProgress ); } @@ -830,7 +849,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation ) if( nCount ) { const ByteString aDummyStr; - const sal_uInt32 nDummy32 = 0UL; + const sal_uInt32 nDummy32 = 0UL; // Falls keine BitmapEx gesetzt wurde, schreiben wir // einfach die erste Bitmap der Animation -- cgit v1.2.3 From 7d1a41c189e800c453c4855d2b38843bbd2dd209 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 16:01:45 -0700 Subject: Replace List with std::vector< AInfo* > I actually moved the List member from the class to a class method. I think this is safe because the member was only used in one method and it's life- span was limited to the one method (populate, process, dispose - all in one "if" block. I also removed all the member's export methods since no one used them. --- svtools/inc/svtools/grfmgr.hxx | 1 - svtools/source/graphic/grfmgr.cxx | 5 ----- vcl/inc/impgraph.hxx | 2 -- vcl/inc/vcl/animate.hxx | 2 -- vcl/inc/vcl/graph.hxx | 2 -- vcl/source/gdi/animate.cxx | 13 ++++++++----- vcl/source/gdi/graph.cxx | 7 ------- vcl/source/gdi/impgraph.cxx | 7 ------- 8 files changed, 8 insertions(+), 31 deletions(-) diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index e81458644d50..0395a9d5afe5 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -409,7 +409,6 @@ public: sal_Bool HasRenderGraphic() const { return mbHasRenderGraphic; } void ResetAnimationLoopCount(); - List* GetAnimationInfoList() const; Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); } void SetAnimationNotifyHdl( const Link& rLink ); diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index fdfa92a72b00..63df21b3993d 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -547,11 +547,6 @@ void GraphicObject::SetAnimationNotifyHdl( const Link& rLink ) maGraphic.SetAnimationNotifyHdl( rLink ); } -List* GraphicObject::GetAnimationInfoList() const -{ - return maGraphic.GetAnimationInfoList(); -} - sal_Bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, const GraphicAttr* pAttr, sal_uLong nFlags ) { diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 6b6bce184770..592f6a73c050 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -144,8 +144,6 @@ private: sal_uLong ImplGetAnimationLoopCount() const; void ImplResetAnimationLoopCount(); - List* ImplGetAnimationInfoList() const; - private: GraphicReader* ImplGetContext(); diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 687a4300cb3e..90a49de5d023 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -152,7 +152,6 @@ class VCL_DLLPUBLIC Animation SAL_DLLPRIVATE static sal_uLong mnAnimCount; AnimationBitmapList_impl maList; - List maAInfoList; Link maNotifyLink; BitmapEx maBitmapEx; Timer maTimer; @@ -241,7 +240,6 @@ public: const AnimationBitmap& Get( sal_uInt16 nAnimation ) const; void Replace( const AnimationBitmap& rNewAnimationBmp, sal_uInt16 nAnimation ); - List* GetAInfoList() { return &maAInfoList; } sal_uLong GetSizeBytes() const; sal_uLong GetChecksum() const; diff --git a/vcl/inc/vcl/graph.hxx b/vcl/inc/vcl/graph.hxx index d613c2d8432b..2ca801cfb97b 100644 --- a/vcl/inc/vcl/graph.hxx +++ b/vcl/inc/vcl/graph.hxx @@ -178,8 +178,6 @@ public: sal_uLong GetAnimationLoopCount() const; void ResetAnimationLoopCount(); - List* GetAnimationInfoList() const; - sal_uLong GetChecksum() const; public: diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index ce05dc1b2ca7..cfc8656dfc0b 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -455,10 +455,12 @@ void Animation::ImplRestartTimer( sal_uLong nTimeout ) } // ----------------------------------------------------------------------- +typedef ::std::vector< AInfo* > AInfoList_impl; IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) { const size_t nAnimCount = maList.size(); + AInfoList_impl aAInfoList; if( nAnimCount ) { @@ -471,13 +473,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) // create AInfo-List for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) - maAInfoList.Insert( pView->ImplCreateAInfo() ); + aAInfoList.push_back( pView->ImplCreateAInfo() ); maNotifyLink.Call( this ); // set view state from AInfo structure - for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() ) + for( size_t i = 0, n = aAInfoList.size(); i < n; ++i ) { + pAInfo = aAInfoList[ i ]; if( !pAInfo->pViewData ) { pView = new ImplAnimView( this, pAInfo->pOutDev, @@ -493,9 +496,9 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) } // delete AInfo structures - for( pAInfo = (AInfo*) maAInfoList.First(); pAInfo; pAInfo = (AInfo*) maAInfoList.Next() ) - delete (AInfo*) pAInfo; - maAInfoList.Clear(); + for( size_t i = 0, n = aAInfoList.size(); i < n; ++i ) + delete aAInfoList[ i ]; + aAInfoList.clear(); // delete all unmarked views and reset marked state pView = (ImplAnimView*) mpViewList->First(); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index eb22d31937df..8fa11e969aa8 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -662,13 +662,6 @@ void Graphic::ResetAnimationLoopCount() // ------------------------------------------------------------------------ -List* Graphic::GetAnimationInfoList() const -{ - return mpImpGraphic->ImplGetAnimationInfoList(); -} - -// ------------------------------------------------------------------------ - GraphicReader* Graphic::GetContext() { return mpImpGraphic->ImplGetContext(); diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 9d995f361329..bd457f3fda22 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -928,13 +928,6 @@ void ImpGraphic::ImplResetAnimationLoopCount() // ------------------------------------------------------------------------ -List* ImpGraphic::ImplGetAnimationInfoList() const -{ - return( mpAnimation ? mpAnimation->GetAInfoList() : NULL ); -} - -// ------------------------------------------------------------------------ - GraphicReader* ImpGraphic::ImplGetContext() { return mpContext; -- cgit v1.2.3 From dd1e686fed8dddf641266637c51b48754c75d280 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sat, 9 Jul 2011 19:55:39 -0700 Subject: Replace List with std::vector< ImplAnimView* > Ok, the list was a pointer to the list; however, the constructor always created one and it was never replaced. Thus, I don't see a reason for the member to be a pointer. --- vcl/inc/vcl/animate.hxx | 4 ++- vcl/source/gdi/animate.cxx | 69 +++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index 90a49de5d023..aaf88c8b6e76 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -145,18 +145,20 @@ struct AInfo // - AnimationBitmap - // ------------------- +class ImplAnimView; typedef ::std::vector< AnimationBitmap* > AnimationBitmapList_impl; +typedef ::std::vector< ImplAnimView* > AnimViewList_impl; class VCL_DLLPUBLIC Animation { SAL_DLLPRIVATE static sal_uLong mnAnimCount; AnimationBitmapList_impl maList; + AnimViewList_impl maViewList; Link maNotifyLink; BitmapEx maBitmapEx; Timer maTimer; Size maGlobalSize; - List* mpViewList; void* mpExtraData; long mnLoopCount; long mnLoops; diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index cfc8656dfc0b..8cb6a47d902e 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -100,7 +100,6 @@ Animation::Animation() : { DBG_CTOR( Animation, NULL ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); - mpViewList = new List; } // ----------------------------------------------------------------------- @@ -121,7 +120,6 @@ Animation::Animation( const Animation& rAnimation ) : maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) ); maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) ); - mpViewList = new List; mnLoops = mbLoopTerminated ? 0 : mnLoopCount; } @@ -137,10 +135,8 @@ Animation::~Animation() for( size_t i = 0, n = maList.size(); i < n; ++i ) delete maList[ i ]; - for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) - delete (ImplAnimView*) pView; - - delete mpViewList; + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + delete maViewList[ i ]; } // ----------------------------------------------------------------------- @@ -233,9 +229,9 @@ void Animation::SetEmpty() delete maList[ i ]; maList.clear(); - for( void* pView = mpViewList->First(); pView; pView = mpViewList->Next() ) - delete (ImplAnimView*) pView; - mpViewList->Clear(); + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + delete maViewList[ i ]; + maViewList.clear(); } // ----------------------------------------------------------------------- @@ -344,8 +340,9 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& ImplAnimView* pView; ImplAnimView* pMatch = NULL; - for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) + for( size_t i = 0; i < maViewList.size(); ++i ) { + pView = maViewList[ i ]; if( pView->ImplMatches( pOut, nExtraData ) ) { if( pView->ImplGetOutPos() == rDestPt && @@ -356,7 +353,8 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } else { - delete (ImplAnimView*) mpViewList->Remove( pView ); + delete maViewList[ i ]; + maViewList.erase( maViewList.begin() + i ); pView = NULL; } @@ -364,7 +362,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } } - if( !mpViewList->Count() ) + if( maViewList.empty() ) { maTimer.Stop(); mbIsInAnimation = sal_False; @@ -372,7 +370,7 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& } if( !pMatch ) - mpViewList->Insert( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ), LIST_APPEND ); + maViewList.push_back( new ImplAnimView( this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev ) ); if( !mbIsInAnimation ) { @@ -393,20 +391,21 @@ sal_Bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& void Animation::Stop( OutputDevice* pOut, long nExtraData ) { - ImplAnimView* pView = (ImplAnimView*) mpViewList->First(); - - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + + + ImplAnimView* pView = maViewList[ i ]; if( pView->ImplMatches( pOut, nExtraData ) ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else - pView = (ImplAnimView*) mpViewList->Next(); + i++; } - if( !mpViewList->Count() ) + if( maViewList.empty() ) { maTimer.Stop(); mbIsInAnimation = sal_False; @@ -472,8 +471,8 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) AInfo* pAInfo; // create AInfo-List - for( pView = (ImplAnimView*) mpViewList->First(); pView; pView = (ImplAnimView*) mpViewList->Next() ) - aAInfoList.push_back( pView->ImplCreateAInfo() ); + for( size_t i = 0, n = maViewList.size(); i < n; ++i ) + aAInfoList.push_back( maViewList[ i ]->ImplCreateAInfo() ); maNotifyLink.Call( this ); @@ -486,7 +485,7 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) pView = new ImplAnimView( this, pAInfo->pOutDev, pAInfo->aStartOrg, pAInfo->aStartSize, pAInfo->nExtraData ); - mpViewList->Insert( pView, LIST_APPEND ); + maViewList.push_back( pView ); } else pView = (ImplAnimView*) pAInfo->pViewData; @@ -501,13 +500,13 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) aAInfoList.clear(); // delete all unmarked views and reset marked state - pView = (ImplAnimView*) mpViewList->First(); - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + pView = maViewList[ i ]; if( !pView->ImplIsMarked() ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else { @@ -515,14 +514,14 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) bGlobalPause = sal_False; pView->ImplSetMarked( sal_False ); - pView = (ImplAnimView*) mpViewList->Next(); + i++; } } } else bGlobalPause = sal_False; - if( !mpViewList->Count() ) + if( maViewList.empty() ) Stop(); else if( bGlobalPause ) ImplRestartTimer( 10 ); @@ -554,22 +553,22 @@ IMPL_LINK( Animation, ImplTimeoutHdl, Timer*, EMPTYARG ) // marked; in this case remove view, because area of output // lies out of display area of window; mark state is // set from view itself - pView = (ImplAnimView*) mpViewList->First(); - while( pView ) + for( size_t i = 0; i < maViewList.size(); ) { + pView = maViewList[ i ]; pView->ImplDraw( mnPos ); if( pView->ImplIsMarked() ) { - delete (ImplAnimView*) mpViewList->Remove( pView ); - pView = (ImplAnimView*) mpViewList->GetCurObject(); + delete pView; + maViewList.erase( maViewList.begin() + i ); } else - pView = (ImplAnimView*) mpViewList->Next(); + i++; } // stop or restart timer - if( !mpViewList->Count() ) + if( maViewList.empty() ) Stop(); else ImplRestartTimer( pStepBmp->nWait ); -- cgit v1.2.3 From 0abcc8b6e3721e6bc50651bb961cafc72d824bb6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 10 Jul 2011 09:32:13 +0300 Subject: Don't pointlessly build the i18npool build-time tools when cross-compiling --- i18npool/source/breakiterator/makefile.mk | 4 ++++ i18npool/source/collator/makefile.mk | 4 ++++ i18npool/source/indexentry/makefile.mk | 5 ++++- i18npool/source/localedata/makefile.mk | 4 ++++ i18npool/source/textconversion/makefile.mk | 4 ++++ 5 files changed, 20 insertions(+), 1 deletion(-) 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/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/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/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/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 -- cgit v1.2.3 From a259b3da31c4e606455854138807a3d5246ac28b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 10 Jul 2011 10:20:25 +0300 Subject: Don't pointlessly build build-time tools when cross-compiling --- tools/Module_tools.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/Module_tools.mk b/tools/Module_tools.mk index a16310587a1f..064f6d74de7d 100644 --- a/tools/Module_tools.mk +++ b/tools/Module_tools.mk @@ -29,10 +29,6 @@ $(eval $(call gb_Module_Module,tools)) $(eval $(call gb_Module_add_targets,tools,\ - Executable_bestreversemap \ - Executable_mkunroll \ - Executable_rscdep \ - Executable_so_checksum \ Library_tl \ Package_inc \ Package_reversemap \ @@ -40,4 +36,13 @@ $(eval $(call gb_Module_add_targets,tools,\ StaticLibrary_toolshelpers \ )) +ifneq ($(CROSS_COMPILING),YES) +$(eval $(call gb_Module_add_targets,tools,\ + Executable_bestreversemap \ + Executable_mkunroll \ + Executable_rscdep \ + Executable_so_checksum \ +)) +endif + # vim: set noet sw=4 ts=4: -- cgit v1.2.3 From 40c9e4f82e4340fc0fdd962187cad0d9dcee04c7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 10 Jul 2011 10:23:08 +0300 Subject: Building rsc makes sense only for desktop OSes --- svl/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/prj/build.lst b/svl/prj/build.lst index 2e01ff682242..5fc7d0e223a3 100644 --- a/svl/prj/build.lst +++ b/svl/prj/build.lst @@ -1,3 +1,3 @@ -sl svl : TRANSLATIONS:translations rsc offapi 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 -- cgit v1.2.3 From c60e9ceaf2564ec3a8005aad84bbef0cf211e5ec Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 9 Jul 2011 20:49:13 +0200 Subject: Enable test/sax To compile some adjustments had to be made. --- sax/prj/build.lst | 1 + sax/test/saxdemo.cxx | 46 ++++++++++++++++++++++++---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sax/prj/build.lst b/sax/prj/build.lst index 849700087ae7..658ec97e8e79 100644 --- a/sax/prj/build.lst +++ b/sax/prj/build.lst @@ -4,3 +4,4 @@ ax sax\source\expatwrap nmake - all ax_expatwrap NULL ax sax\source\tools nmake - all ax_tools NULL ax sax\source\fastparser nmake - all ax_fastparser ax_expatwrap ax_tools NULL ax sax\qa\cppunit nmake - all ax_qa_cppunit ax_tools NULL +ax sax\test nmake - all ax_test NULL 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 #include +#include #include #include @@ -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(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(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(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 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 ) ); -- cgit v1.2.3 From 859d10e7abab03cb35f2081e979a407cfe120d20 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sun, 10 Jul 2011 10:18:24 +0200 Subject: Bulid fix: use SAL_PRIxUINT32 format string --- sax/test/testcomponent.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx index e395add9f662..6d7ff0f03c86 100644 --- a/sax/test/testcomponent.cxx +++ b/sax/test/testcomponent.cxx @@ -195,7 +195,7 @@ int main (int argc, char **argv) Sequence 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 +206,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 ); -- cgit v1.2.3 From 53fea04d6a827bb47294c7a26685755ca459dc43 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 11 Jul 2011 09:11:08 +0200 Subject: FcPatternAddFTFace is 2.4.x feature and our baseline is 2.2.0 --- vcl/unx/generic/fontmanager/fontconfig.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 693bf3b6a3d5..66faa526872c 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -864,7 +864,10 @@ public: } virtual void *GetPattern(void * face, bool bEmbolden) const { - FcPatternAddFTFace(mpPattern, FC_FT_FACE, static_cast(face)); + FcValue value; + value.type = FcTypeFTFace; + value.u.f = face; + FcPatternAdd (mpPattern, FC_FT_FACE, value, FcTrue); FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse); return mpPattern; } -- cgit v1.2.3 From 2d3796fcd3053f9e58f018f6a11072b4e2a775f7 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Mon, 11 Jul 2011 09:23:08 +0200 Subject: Include cairo.h explicitely for builds with cairoless gtk+ --- vcl/inc/unx/gtk/gtkframe.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 6caf39dc9644..78aea06017a8 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -30,6 +30,7 @@ #define _VCL_GTKFRAME_HXX #include +#include #include #include #include -- cgit v1.2.3 From 6c4a4c200eda74ab0f958a10f38d3808df423e02 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:05:56 +0100 Subject: callcatcher: remove unused IsHighContrastBlackAndWhite --- vcl/inc/vcl/settings.hxx | 1 - vcl/source/app/settings.cxx | 40 ---------------------------------------- 2 files changed, 41 deletions(-) diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx index 0ade4c63f295..2494f4fa5d08 100644 --- a/vcl/inc/vcl/settings.hxx +++ b/vcl/inc/vcl/settings.hxx @@ -713,7 +713,6 @@ public: { CopyData(); mpData->mnHighContrast = bHighContrast; } sal_Bool GetHighContrastMode() const { return (sal_Bool) mpData->mnHighContrast; } - sal_Bool IsHighContrastBlackAndWhite() const; void SetUseSystemUIFonts( sal_Bool bUseSystemUIFonts ) { CopyData(); mpData->mnUseSystemUIFonts = bUseSystemUIFonts; } sal_Bool GetUseSystemUIFonts() const diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 9ffb8bc373da..1683faf1613a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -964,46 +964,6 @@ inline sal_Bool ImplIsBackOrWhite( const Color& rColor ) return ( nLuminance < 8 ) || ( nLuminance > 250 ); } -sal_Bool StyleSettings::IsHighContrastBlackAndWhite() const -{ - sal_Bool bBWOnly = sal_True; - - // Only use B&W if fully B&W, like on GNOME. - // Some colors like CheckedColor and HighlightColor are not B&W in Windows Standard HC Black, - // and we don't want to be B&W then, so check these color first, very probably not B&W. - - // Unfortunately, GNOME uses a very very dark color (0x000033) instead of BLACK (0x000000) - - if ( !ImplIsBackOrWhite( GetFaceColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetHighlightTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetWindowColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetWindowTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetButtonTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetGroupTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetLabelTextColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetDialogColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetFieldColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuBarColor() ) ) - bBWOnly = sal_False; - else if ( !ImplIsBackOrWhite( GetMenuHighlightColor() ) ) - bBWOnly = sal_False; - - return bBWOnly; -} - // ----------------------------------------------------------------------- sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const -- cgit v1.2.3 From 9cec47773b6c93239c75127e99e638f2e2b2aa86 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:08:28 +0100 Subject: callcatcher: remove unused createRFC822Mailbox --- svl/inc/svl/adrparse.hxx | 22 ------- svl/source/misc/adrparse.cxx | 138 ------------------------------------------- 2 files changed, 160 deletions(-) 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 (i.e., 'e-mail address'). - - @param rPhrase Either an empty string (the will have no - an will be of the form ), or some text that will - become the part of a form . Non - US-ASCII characters within the text are put into a - verbatim, so the result may actually not be a valid RFC 822 , - but a more human-readable representation. - - @param rAddrSpec A valid RFC 822 . (An RFC 822 - including a cannot be created by this method.) - - @param rMailbox If this method returns true, this parameter returns - the created RFC 822 (rather, a more human-readable - representation thereof). Otherwise, this parameter is not modified. - - @return True, if rAddrSpec is a valid RFC 822 . - */ - static bool createRFC822Mailbox(String const & rPhrase, - String const & rAddrSpec, - String & rMailbox); }; inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex) 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: */ -- cgit v1.2.3 From 1568e883ecfa789e3e8f1e637d37c5adf47fa277 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:11:35 +0100 Subject: callcatcher: remove unused setGrad* methods --- vcl/inc/vcl/graphictools.hxx | 12 ------------ vcl/source/gdi/graphictools.cxx | 20 -------------------- 2 files changed, 32 deletions(-) diff --git a/vcl/inc/vcl/graphictools.hxx b/vcl/inc/vcl/graphictools.hxx index edd29ab9db01..333c9163d57a 100644 --- a/vcl/inc/vcl/graphictools.hxx +++ b/vcl/inc/vcl/graphictools.hxx @@ -424,18 +424,6 @@ public: void setHatchType ( HatchType aHatchType ); /// Set color used for drawing the hatch void setHatchColor ( Color aHatchColor ); - /// Set type of gradient used - void setGradientType ( GradientType aGradType ); - /// Set start color of the gradient - void setGradient1stColor ( Color aColor ); - /// Set end color of the gradient - void setGradient2ndColor ( Color aColor ); - /** Set the numbers of steps to render the gradient. - - @param aCount - The step count. gradientStepsInfinite means use infinitely many. - */ - void setGradientStepCount( int aCount ); /// Set the texture graphic used void setGraphic ( const Graphic& rGraphic ); diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx index 2e20a3639790..251261d0943e 100644 --- a/vcl/source/gdi/graphictools.cxx +++ b/vcl/source/gdi/graphictools.cxx @@ -675,26 +675,6 @@ void SvtGraphicFill::setHatchColor( Color aHatchColor ) maHatchColor = aHatchColor; } -void SvtGraphicFill::setGradientType( GradientType aGradType ) -{ - maGradientType = aGradType; -} - -void SvtGraphicFill::setGradient1stColor( Color aColor ) -{ - maGradient1stColor = aColor; -} - -void SvtGraphicFill::setGradient2ndColor( Color aColor ) -{ - maGradient2ndColor = aColor; -} - -void SvtGraphicFill::setGradientStepCount( int aCount ) -{ - maGradientStepCount = aCount; -} - void SvtGraphicFill::setGraphic( const Graphic& rGraphic ) { maFillGraphic = rGraphic; -- cgit v1.2.3 From d208b1094a5947a7f2605759ccfd1f422ababb1f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:15:19 +0100 Subject: callcatcher: remove unused PIList* methods --- svtools/inc/svtools/helpopt.hxx | 4 ---- svtools/source/config/helpopt.cxx | 18 ------------------ 2 files changed, 22 deletions(-) diff --git a/svtools/inc/svtools/helpopt.hxx b/svtools/inc/svtools/helpopt.hxx index 5947b8d034b1..92a2ad3793c7 100644 --- a/svtools/inc/svtools/helpopt.hxx +++ b/svtools/inc/svtools/helpopt.hxx @@ -85,10 +85,6 @@ public: void SetWelcomeScreen( sal_Bool b ); sal_Bool IsWelcomeScreen() const; - IdList* GetPIStarterList(); - void AddToPIStarterList( sal_Int32 nId ); - void RemoveFromPIStarterList( sal_Int32 nId ); - String GetLocale() const; String GetSystem() const; }; diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx index 6e80db6fcf6c..f8cbbcc2b838 100644 --- a/svtools/source/config/helpopt.cxx +++ b/svtools/source/config/helpopt.cxx @@ -62,7 +62,6 @@ static sal_Int32 nRefCount = 0; class SvtHelpOptions_Impl : public utl::ConfigItem { - IdList* pList; sal_Int32 nHelpAgentTimeoutPeriod; sal_Int32 nHelpAgentRetryLimit; sal_Bool bExtendedHelp; @@ -105,9 +104,6 @@ public: void SetWelcomeScreen( sal_Bool b ) { bWelcomeScreen = b; SetModified(); } sal_Bool IsWelcomeScreen() const { return bWelcomeScreen; } - IdList* GetPIStarterList() { return pList; } - void AddToPIStarterList( sal_Int32 nId ); - void RemoveFromPIStarterList( sal_Int32 nId ); String GetLocale() const { return aLocale; } String GetSystem() const { return aSystem; } @@ -168,7 +164,6 @@ Sequence< OUString > SvtHelpOptions_Impl::GetPropertyNames() SvtHelpOptions_Impl::SvtHelpOptions_Impl() : ConfigItem( OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Help" )) ) - , pList( 0 ) , bExtendedHelp( sal_False ) , bHelpTips( sal_True ) , bHelpAgentEnabled( sal_False ) @@ -733,19 +728,6 @@ sal_Bool SvtHelpOptions::IsWelcomeScreen() const return pImp->IsWelcomeScreen(); } -IdList* SvtHelpOptions::GetPIStarterList() -{ - return pImp->GetPIStarterList(); -} - -void SvtHelpOptions::AddToPIStarterList( sal_Int32 ) -{ -} - -void SvtHelpOptions::RemoveFromPIStarterList( sal_Int32 ) -{ -} - String SvtHelpOptions::GetLocale() const { return pImp->GetLocale(); -- cgit v1.2.3 From 2c838eb1351129283c4c296468b4e64f48fd972b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:19:39 +0100 Subject: callcatcher: remove unused hasReminderDateCome --- unotools/inc/unotools/regoptions.hxx | 6 ----- unotools/source/config/regoptions.cxx | 51 ----------------------------------- 2 files changed, 57 deletions(-) diff --git a/unotools/inc/unotools/regoptions.hxx b/unotools/inc/unotools/regoptions.hxx index e43d61f9ba6b..0303ca300e91 100644 --- a/unotools/inc/unotools/regoptions.hxx +++ b/unotools/inc/unotools/regoptions.hxx @@ -111,12 +111,6 @@ namespace utl

If this method is called, the reminder for the dialog will be removed. */ void removeReminder(); - - /** checks if the reminder date has come - -

Returns if the current date is greater or equal the reminder date. - */ - bool hasReminderDateCome() const; }; //........................................................................ diff --git a/unotools/source/config/regoptions.cxx b/unotools/source/config/regoptions.cxx index 9b0550a8cdc5..6207c5544429 100644 --- a/unotools/source/config/regoptions.cxx +++ b/unotools/source/config/regoptions.cxx @@ -189,7 +189,6 @@ namespace utl void markSessionDone( ); void activateReminder( sal_Int32 _nDaysFromNow ); void removeReminder(); - bool hasReminderDateCome() const; }; //-------------------------------------------------------------------- @@ -382,48 +381,6 @@ namespace utl return nBuildId; } - //-------------------------------------------------------------------- - bool RegOptionsImpl::hasReminderDateCome() const - { - bool bRet = false; - sal_Int32 nDate = 0; - ::rtl::OUString sDate; - m_aRegistrationNode.getNodeValue( lcl_getReminderDateName() ) >>= sDate; - if ( sDate.getLength() ) - { - if ( sDate.indexOf( lcl_getPatchName() ) == 0) - { - if (sDate.equals( lcl_getPatchName() )) - bRet = true; - else if (sDate.getLength() > lcl_getPatchName().getLength() ) - { - // Check the build ID to determine if the registration - // dialog needs to be shown. - sal_Int32 nBuildId = getBuildId(); - ::rtl::OUString aStoredBuildId( sDate.copy(lcl_getPatchName().getLength())); - - // remind if the current build ID is not the same as the stored one - if ( nBuildId != aStoredBuildId.toInt32() ) - bRet = true; - } - } - else - { - nDate = lcl_convertString2Date( sDate ); - if ( nDate > 0 ) - { - Date aReminderDate; - aReminderDate.SetDate( nDate ); - bRet = aReminderDate <= Date(); - } - } - } - else - bRet = true; - - return bRet; - } - //-------------------------------------------------------------------- void RegOptionsImpl::markSessionDone( ) { @@ -533,14 +490,6 @@ namespace utl const_cast< RegOptions* >( this )->ensureImpl( ); m_pImpl->removeReminder(); } - - //-------------------------------------------------------------------- - bool RegOptions::hasReminderDateCome() const - { - const_cast< RegOptions* >( this )->ensureImpl( ); - return m_pImpl->hasReminderDateCome(); - } - //........................................................................ } // namespace utl //........................................................................ -- cgit v1.2.3 From 1090953a4d23f7c080d2ab6050b9204161c35ba2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:21:52 +0100 Subject: callcatcher: remove unused GetTempNameBaseDirectory --- unotools/inc/unotools/tempfile.hxx | 1 - unotools/source/ucbhelper/tempfile.cxx | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/unotools/inc/unotools/tempfile.hxx b/unotools/inc/unotools/tempfile.hxx index 3565396dd612..2030b1ab0791 100644 --- a/unotools/inc/unotools/tempfile.hxx +++ b/unotools/inc/unotools/tempfile.hxx @@ -154,7 +154,6 @@ public: It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all. */ static String SetTempNameBaseDirectory( const String &rBaseName ); - static String GetTempNameBaseDirectory(); }; } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 99f0b85d68b8..33a3ca6fb8f4 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -484,18 +484,6 @@ String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) return aTmp; } - -String TempFile::GetTempNameBaseDirectory() -{ - const ::rtl::OUString &rTempNameBase_Impl = TempNameBase_Impl::get(); - if ( !rTempNameBase_Impl.getLength() ) - return String(); - - rtl::OUString aTmp; - FileBase::getSystemPathFromFileURL( rTempNameBase_Impl, aTmp ); - return aTmp; -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From e78eeb33c4a56608a1daa3375a2287ee978f6c55 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:22:39 +0100 Subject: callcatcher: remove unused GetTempNameBaseDirectory --- tools/inc/tools/tempfile.hxx | 1 - tools/source/fsys/tempfile.cxx | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/tools/inc/tools/tempfile.hxx b/tools/inc/tools/tempfile.hxx index d356e7bf66fc..d81914e1f0e7 100644 --- a/tools/inc/tools/tempfile.hxx +++ b/tools/inc/tools/tempfile.hxx @@ -72,7 +72,6 @@ public: // The argument must be a simple name, not a complete URL. // The return value of both methods is the complete URL of the tempname base folder. static String SetTempNameBaseDirectory( const String &rBaseName ); - static String GetTempNameBaseDirectory(); }; #endif diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx index 078e91834975..b859fa9ab1e3 100644 --- a/tools/source/fsys/tempfile.cxx +++ b/tools/source/fsys/tempfile.cxx @@ -289,15 +289,4 @@ String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) return aTmp; } -String TempFile::GetTempNameBaseDirectory() -{ - ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get(); - if ( !rTempNameBase_Impl.getLength() ) - rTempNameBase_Impl = GetSystemTempDir_Impl(); - - rtl::OUString aTmp; - aTmp = rTempNameBase_Impl; - return aTmp; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 75b074f7875448a811750865eaa8e7dc69bbd7fc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:34:00 +0100 Subject: callcatcher: unused listPositionAt --- vcl/inc/list.h | 1 - vcl/source/fontsubset/list.c | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/vcl/inc/list.h b/vcl/inc/list.h index 78c7edce2839..6651deab846a 100644 --- a/vcl/inc/list.h +++ b/vcl/inc/list.h @@ -75,7 +75,6 @@ extern "C" int listSkipForward(list, int n); int listToFirst(list); int listToLast(list); - int listPositionAt(list, int n); /* Expensive! */ /*- adding and removing elements */ list listAppend(list, void *); diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c index def5faa7b553..90a075466447 100644 --- a/vcl/source/fontsubset/list.c +++ b/vcl/source/fontsubset/list.c @@ -201,21 +201,6 @@ int listToLast(list this) return 0; } -int listPositionAt(list this, int n) /*- returns the actual position number */ -{ - int m = 0; - assert(this != 0); - - this->cptr = this->head; - while (n != 0) { - if (this->cptr->next == 0) break; - this->cptr = this->cptr->next; - n--; - m++; - } - return m; -} - list listAppend(list this, void *el) { assert(this != 0); -- cgit v1.2.3 From 2fcd82ae659ef8a61da08748f684ca928a2d3dc3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:34:35 +0100 Subject: callcatcher: unused listPositionAt --- vcl/inc/list.h | 2 -- vcl/source/fontsubset/list.c | 18 ------------------ 2 files changed, 20 deletions(-) diff --git a/vcl/inc/list.h b/vcl/inc/list.h index 6651deab846a..34e9cee266b1 100644 --- a/vcl/inc/list.h +++ b/vcl/inc/list.h @@ -66,8 +66,6 @@ extern "C" int listAtLast(list); int listPosition(list); /* Expensive! */ #endif -/*- search */ - int listFind(list, void *); /* Returns true/false */ /*- positioning functions */ /*- return the number of elements by which the current position in the list changes */ diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c index 90a075466447..8b0b0f827a20 100644 --- a/vcl/source/fontsubset/list.c +++ b/vcl/source/fontsubset/list.c @@ -140,24 +140,6 @@ int listIsEmpty(list this) return this->aCount == 0; } -int listFind(list this, void *el) -{ - lnode *ptr; - assert(this != 0); - - ptr = this->head; - - while (ptr) { - if (ptr->value == el) { - this->cptr = ptr; - return 1; - } - ptr = ptr->next; - } - - return 0; -} - int listNext(list this) { return listSkipForward(this, 1); -- cgit v1.2.3 From 34a4f4ea3589a06dc22d1c28b893fca0c35d29d2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:49:15 +0100 Subject: callcatcher: WriteWindowMetafile moved to binfilter long ago, remove this copy --- svtools/inc/svtools/filter.hxx | 1 - svtools/inc/svtools/wmf.hxx | 2 -- svtools/source/filter/wmf/wmf.cxx | 7 ------- 3 files changed, 10 deletions(-) diff --git a/svtools/inc/svtools/filter.hxx b/svtools/inc/svtools/filter.hxx index 4ea0bce85ee0..da3a7cb036c8 100644 --- a/svtools/inc/svtools/filter.hxx +++ b/svtools/inc/svtools/filter.hxx @@ -376,7 +376,6 @@ public: // ------------------------------------ SVT_DLLPUBLIC sal_Bool ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF, FilterConfigItem* pConfigItem ); -SVT_DLLPUBLIC sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ); SVT_DLLPUBLIC sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ); #endif //_FILTER_HXX diff --git a/svtools/inc/svtools/wmf.hxx b/svtools/inc/svtools/wmf.hxx index 3c1f07774a45..a455f443e26e 100644 --- a/svtools/inc/svtools/wmf.hxx +++ b/svtools/inc/svtools/wmf.hxx @@ -63,8 +63,6 @@ SVT_DLLPUBLIC sal_Bool ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStre sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream, FilterConfigItem* pConfigItem = NULL ); -SVT_DLLPUBLIC sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ); - SVT_DLLPUBLIC sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ); #endif diff --git a/svtools/source/filter/wmf/wmf.cxx b/svtools/source/filter/wmf/wmf.cxx index 9b2a8edf2d6e..03923ddc508a 100644 --- a/svtools/source/filter/wmf/wmf.cxx +++ b/svtools/source/filter/wmf/wmf.cxx @@ -102,13 +102,6 @@ sal_Bool ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetSt // ----------------------------------------------------------------------------- -sal_Bool WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF ) -{ - return WMFWriter().WriteWMF( rMTF, rStream, NULL ); -} - -// ----------------------------------------------------------------------------- - sal_Bool WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF ) { return WMFWriter().WriteWMF( rMTF, rStream, NULL, sal_False ); -- cgit v1.2.3 From 403f458b9511230801c2b26bfeb29d9f3f939094 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 00:51:32 +0100 Subject: remove unused TraceBands --- vcl/source/gdi/region.cxx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 3992b774630d..e4c1a3a7c4f7 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -382,34 +382,6 @@ const char* ImplDbgTestRegion( const void* pObj ) return NULL; } -void TraceBands (const ImplRegionBand* pFirstBand) -{ - int nBandIndex (0); - const ImplRegionBand* pBand = pFirstBand; - while (pBand != NULL) - { - OSL_TRACE(" band %d %d->%d : ", nBandIndex++, - pBand->mnYTop, pBand->mnYBottom); - - ImplRegionBandPoint* pPoint = pBand->mpFirstBandPoint; - while (pPoint != NULL) - { - OSL_TRACE(" %d ", pPoint->mnX); - pPoint = pPoint->mpNextBandPoint; - } - OSL_TRACE(" | "); - - ImplRegionBandSep* pSep = pBand->mpFirstSep; - while (pSep != NULL) - { - OSL_TRACE(" %d->%d ", pSep->mnXLeft, pSep->mnXRight); - pSep = pSep->mpNextSep; - } - OSL_TRACE("\n"); - - pBand = pBand->mpNextBand; - } -} #endif // ======================================================================= -- cgit v1.2.3 From 0e3e30c57e74be7cb9d8263f2abdde1cfd1d5c84 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:03:31 +0100 Subject: remove unused and archaic ImpPolarToCart --- svtools/source/dialogs/mcvmath.cxx | 17 ----------------- svtools/source/dialogs/mcvmath.hxx | 2 -- svtools/source/filter/sgfbram.cxx | 12 ------------ svtools/source/filter/sgvtext.cxx | 16 ---------------- 4 files changed, 47 deletions(-) diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index 5d5ad14c82c2..0d2407493c53 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -271,21 +271,4 @@ void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ) } } -/************************************************************************** -|* -|* ImpPolarToCart() -|* -|* Beschreibung Koordinaaten-Wandlung -|* -**************************************************************************/ - -void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ) -{ - FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos() - fc.GetReal().MultBig( rR ); - rX = sal::static_int_cast< short >(long( fc.GetReal() )); - fc.GetImag().MultBig( rR ); - rY = sal::static_int_cast< short >(long( fc.GetImag() )); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index 5e0d47e655ef..8b8e9c67be12 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -220,8 +220,6 @@ Fix ImpMultBig2( const Fix& a, const Fix& b ); FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ); -void ImpPolarToCart( const Fix& rR, const sal_uInt16 Phi, short& rX, short& rY ); - sal_uInt16 ImpSqrt( sal_uLong nRadi ); sal_uInt16 ImpATan2( const short x, const short y ); FixCpx ImpExPI( sal_uInt16 nPhi ); diff --git a/svtools/source/filter/sgfbram.cxx b/svtools/source/filter/sgfbram.cxx index 8559cbee30eb..0ba3c5ed5833 100644 --- a/svtools/source/filter/sgfbram.cxx +++ b/svtools/source/filter/sgfbram.cxx @@ -561,18 +561,6 @@ sal_Bool SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf) return(bRet); } - -/************************************************************************* -|* -|* SgfFilterPScr() -|* -*************************************************************************/ -sal_Bool SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&) -{ - return sal_False; // PostSrcipt wird noch nicht unterstuetzt ! -} - - /************************************************************************* |* |* CheckSgfTyp() diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx index ddda27f2efa2..3409652cf309 100644 --- a/svtools/source/filter/sgvtext.cxx +++ b/svtools/source/filter/sgvtext.cxx @@ -235,23 +235,7 @@ short hPoint2Sgf(short a) return short(b); } -short Sgf2hPoint(short a) -{ - long b; - b=long(a)*5*144/(127*SgfDpmm); - return short(b); -} - // End of Misc.Pas -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// - - - -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// // AbsRead.Pas // ====================================================================== -- cgit v1.2.3 From 27c6b816bc6d4c3191f31a9d0fab3467fcb0a53a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:04:01 +0100 Subject: remove unused and archaic ImpCartToPolar --- svtools/source/dialogs/mcvmath.cxx | 25 ------------------------- svtools/source/dialogs/mcvmath.hxx | 1 - 2 files changed, 26 deletions(-) diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index 0d2407493c53..c9ad99e404f6 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -246,29 +246,4 @@ sal_uInt16 ImpATan2( const short x, const short y ) return ImpATanx2( fx, fy ); } -/************************************************************************** -|* -|* ImpCartToPolar() -|* -|* Beschreibung Koordinaaten-Wandlung -|* -**************************************************************************/ - -void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ) -{ - rRad = Fix( ImpSqrt( sal_uLong( long(x)*x+long(y)*y ) ) ); - - if ( !rRad.x ) - rPhi=0; - else - { - // Normiere auf Einheitskreis - Fix fx = x; - fx.DivBig(rRad); - Fix fy = y; - fy.DivBig(rRad); - rPhi = ImpATanx2(fx, fy); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index 8b8e9c67be12..b2fa51d356cc 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -219,7 +219,6 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b ) Fix ImpMultBig2( const Fix& a, const Fix& b ); FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); -void ImpCartToPolar( const short x, const short y, Fix& rRad, sal_uInt16& rPhi ); sal_uInt16 ImpSqrt( sal_uLong nRadi ); sal_uInt16 ImpATan2( const short x, const short y ); FixCpx ImpExPI( sal_uInt16 nPhi ); -- cgit v1.2.3 From 9615f8797f7a1cb18b4e185042579e4b3b416ace Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:11:38 +0100 Subject: callcatcher: GetAutofallback unused --- vcl/inc/sallayout.hxx | 1 - vcl/source/gdi/sallayout.cxx | 85 -------------------------------------------- 2 files changed, 86 deletions(-) diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index b91185769b27..9c727a895581 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -149,7 +149,6 @@ sal_UCS4 GetVerticalChar( sal_UCS4 ); // #i80090# GetMirroredChar also needed outside vcl, moved to svapp.hxx // VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 ); sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType ); -VCL_PLUGIN_PUBLIC const char* GetAutofallback( sal_UCS4 ) ; // ------------- // - SalLayout - diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 9679170df9b9..8b04476a1bea 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -159,91 +159,6 @@ VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 nChar ) // ----------------------------------------------------------------------- -// Get simple approximations for unicodes -const char* GetAutofallback( sal_UCS4 nChar ) -{ - const char* pStr = NULL; - switch( nChar ) - { - case 0x01C0: - case 0x2223: - case 0x2758: - pStr = "|"; break; - case 0x02DC: - pStr = "~"; break; - case 0x037E: - pStr = ";"; break; - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - case 0x2004: - case 0x2005: - case 0x2006: - case 0x2007: - case 0x2008: - case 0x2009: - case 0x200A: - case 0x202F: - pStr = " "; break; - case 0x2010: - case 0x2011: - case 0x2012: - case 0x2013: - case 0x2014: - pStr = "-"; break; - case 0x2015: - pStr = "--"; break; - case 0x2016: - pStr = "||"; break; - case 0x2017: - pStr = "_"; break; - case 0x2018: - case 0x2019: - case 0x201B: - pStr = "\'"; break; - case 0x201A: - pStr = ","; break; - case 0x201C: - case 0x201D: - case 0x201E: - case 0x201F: - case 0x2033: - pStr = "\""; break; - case 0x2039: - pStr = "<"; break; - case 0x203A: - pStr = ">"; break; - case 0x203C: - pStr = "!!"; break; - case 0x203D: - pStr = "?"; break; - case 0x2044: - case 0x2215: - pStr = "/"; break; - case 0x2048: - pStr = "?!"; break; - case 0x2049: - pStr = "!?"; break; - case 0x2216: - pStr = "\\"; break; - case 0x2217: - pStr = "*"; break; - case 0x2236: - pStr = ":"; break; - case 0x2264: - pStr = "<="; break; - case 0x2265: - pStr = "<="; break; - case 0x2303: - pStr = "^"; break; - } - - return pStr; -} - -// ----------------------------------------------------------------------- - sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang ) { // currently only conversion from ASCII digits is interesting -- cgit v1.2.3 From d7f18c8f6004d11ac7ee39b43b0c526cba120cc4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:12:33 +0100 Subject: callcatcher: unused GetSchnittBit --- svtools/source/filter/sgvtext.cxx | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx index 3409652cf309..ed83389d8fee 100644 --- a/svtools/source/filter/sgvtext.cxx +++ b/svtools/source/filter/sgvtext.cxx @@ -288,32 +288,6 @@ UCHAR ConvertTextChar(UCHAR c) return c; } - - -sal_uInt16 GetSchnittBit(UCHAR c) -{ - sal_uInt16 r=0; - switch (c) { - case EscBold : r=TextBoldBit; break; - case EscRSlnt: r=TextRSlnBit; break; - case EscUndln: r=TextUndlBit; break; - case EscStrik: r=TextStrkBit; break; - case EscDbUnd: r=TextDbUnBit; break; - case EscDbStk: r=TextDbStBit; break; - case EscSupSc: r=TextSupSBit; break; - case EscSubSc: r=TextSubSBit; break; - case EscKaptF: r=TextKaptBit; break; - case EscLSlnt: r=TextLSlnBit; break; - case Esc2DShd: r=TextSh2DBit; break; - case Esc3DShd: r=TextSh3DBit; break; - case Esc4DShd: r=TextSh4DBit; break; - case EscEbShd: r=TextShEbBit; - } - return r; -} - - - long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal) { long r=0; -- cgit v1.2.3 From 583166b5193ecb1cfaa24ab5f2780ed2eff91191 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:43:53 +0100 Subject: callcatcher: remove this unused ImpMultBig2 variant --- svtools/source/dialogs/mcvmath.cxx | 17 ----------------- svtools/source/dialogs/mcvmath.hxx | 5 ----- 2 files changed, 22 deletions(-) diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index c9ad99e404f6..5b14cb1fcbf7 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -69,23 +69,6 @@ Fix ImpMultBig2( const Fix& a, const Fix& b ) return f; } -/************************************************************************** -|* -|* ImpMultBig2() -|* -|* Beschreibung Multiplikation fuer FixPoint-Berechnungen -|* -**************************************************************************/ - -// first parameter should be the bigger one - -FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ) -{ - Fix rr = ImpMultBig2(ra.r,rb.r)-ImpMultBig2(ra.i,rb.i); - Fix ii = ImpMultBig2(ra.r,rb.i)+ImpMultBig2(ra.i,rb.r); - return FixCpx( rr,ii ); -} - /************************************************************************** |* |* ImpSqrt() diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index b2fa51d356cc..9d36b2665793 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -75,8 +75,6 @@ private: friend class FixCpx; friend class ColWheel; -// friend Fix ImpMultBig2( const Fix& a, const Fix& b ); - public: long x; @@ -122,8 +120,6 @@ public: class FixCpx { -// friend FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); - public: Fix r; Fix i; @@ -217,7 +213,6 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b ) // ----------------------------------------------------------------------- Fix ImpMultBig2( const Fix& a, const Fix& b ); -FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb ); sal_uInt16 ImpSqrt( sal_uLong nRadi ); sal_uInt16 ImpATan2( const short x, const short y ); -- cgit v1.2.3 From 4c24f23da9a0da27aec0e60d889b5204b96ad00e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 01:44:45 +0100 Subject: callcatcher: [Byte|UniString]::SearchCharBackward unused --- tools/inc/impstrg.hxx | 6 ----- tools/inc/tools/string.hxx | 2 -- tools/source/string/strcvt.cxx | 55 ------------------------------------------ tools/source/string/strimp.cxx | 30 ----------------------- 4 files changed, 93 deletions(-) diff --git a/tools/inc/impstrg.hxx b/tools/inc/impstrg.hxx index e99e2b3990b3..178bccec26e8 100644 --- a/tools/inc/impstrg.hxx +++ b/tools/inc/impstrg.hxx @@ -46,12 +46,6 @@ const char* DbgCheckUniString( const void* pString ); xub_StrLen ImplStringLen( const sal_Char* pStr ); xub_StrLen ImplStringLen( const sal_Unicode* pStr ); -// ------------------------------------ -// - Zugriff fuer International class - -// ------------------------------------ - -sal_Unicode* ImplGet1ByteUnicodeTab( rtl_TextEncoding eTextEncoding ); - #endif // _IMPSTRG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 4268973e9b05..c3cd6348f0e3 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -315,7 +315,6 @@ public: xub_StrLen Search( const sal_Char* pCharStr, xub_StrLen nIndex = 0 ) const; xub_StrLen SearchBackward( sal_Char c, xub_StrLen nIndex = STRING_LEN ) const; xub_StrLen SearchChar( const sal_Char* pChars, xub_StrLen nIndex = 0 ) const; - xub_StrLen SearchCharBackward( const sal_Char* pChars, xub_StrLen nIndex = STRING_LEN ) const; xub_StrLen SearchAndReplace( sal_Char c, sal_Char cRep, xub_StrLen nIndex = 0 ); xub_StrLen SearchAndReplace( const ByteString& rStr, const ByteString& rRepStr, @@ -608,7 +607,6 @@ public: xub_StrLen SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = 0 ) const; xub_StrLen SearchBackward( sal_Unicode c, xub_StrLen nIndex = STRING_LEN ) const; xub_StrLen SearchChar( const sal_Unicode* pChars, xub_StrLen nIndex = 0 ) const; - xub_StrLen SearchCharBackward( const sal_Unicode* pChars, xub_StrLen nIndex = STRING_LEN ) const; xub_StrLen SearchAndReplace( sal_Unicode c, sal_Unicode cRep, xub_StrLen nIndex = 0 ); diff --git a/tools/source/string/strcvt.cxx b/tools/source/string/strcvt.cxx index 54169c3c0716..c7519bdc6df5 100644 --- a/tools/source/string/strcvt.cxx +++ b/tools/source/string/strcvt.cxx @@ -169,61 +169,6 @@ struct Impl1ByteConvertTabData Impl1ByteConvertTabData* mpNext; }; -// ======================================================================= - -sal_Unicode* ImplGet1ByteUnicodeTab( rtl_TextEncoding eTextEncoding ) -{ -#ifndef BOOTSTRAP - TOOLSINDATA* pToolsData = ImplGetToolsInData(); -#else - TOOLSINDATA* pToolsData = 0x0; -#endif - Impl1ByteUnicodeTabData* pTab = pToolsData->mpFirstUniTabData; - - while ( pTab ) - { - if ( pTab->meTextEncoding == eTextEncoding ) - return pTab->maUniTab; - pTab = pTab->mpNext; - } - - // get TextEncodingInfo - rtl_TextEncodingInfo aTextEncInfo; - aTextEncInfo.StructSize = sizeof( aTextEncInfo ); - rtl_getTextEncodingInfo( eTextEncoding, &aTextEncInfo ); - - if ( aTextEncInfo.MaximumCharSize == 1 ) - { - pTab = new Impl1ByteUnicodeTabData; - pTab->meTextEncoding = eTextEncoding; - pTab->mpNext = pToolsData->mpFirstUniTabData; - - rtl_TextToUnicodeConverter hConverter; - sal_uInt32 nInfo; - sal_Size nSrcBytes; - sal_Size nDestChars; - hConverter = rtl_createTextToUnicodeConverter( eTextEncoding ); - nDestChars = rtl_convertTextToUnicode( hConverter, 0, - (const sal_Char*)aImplByteTab, 256, - pTab->maUniTab, 256, - RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE | - RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT | - RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT, - &nInfo, &nSrcBytes ); - rtl_destroyTextToUnicodeConverter( hConverter ); - - if ( (nSrcBytes != 256) || (nDestChars != 256) ) - delete pTab; - else - { - pToolsData->mpFirstUniTabData = pTab; - return pTab->maUniTab; - } - } - - return NULL; -} - // ----------------------------------------------------------------------- static sal_uChar* ImplGet1ByteConvertTab( rtl_TextEncoding eSrcTextEncoding, diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 21065f999958..3d22a1811a0f 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -1668,36 +1668,6 @@ xub_StrLen STRING::SearchChar( const STRCODE* pChars, xub_StrLen nIndex ) const // ----------------------------------------------------------------------- -xub_StrLen STRING::SearchCharBackward( const STRCODE* pChars, xub_StrLen nIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - if ( nIndex > mpData->mnLen ) - nIndex = (xub_StrLen)mpData->mnLen; - - const STRCODE* pStr = mpData->maStr; - pStr += nIndex; - - while ( nIndex ) - { - nIndex--; - pStr--; - - STRCODE c =*pStr; - const STRCODE* pCompStr = pChars; - while ( *pCompStr ) - { - if ( *pCompStr == c ) - return nIndex; - ++pCompStr; - } - } - - return STRING_NOTFOUND; -} - -// ----------------------------------------------------------------------- - xub_StrLen STRING::SearchAndReplace( STRCODE c, STRCODE cRep, xub_StrLen nIndex ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); -- cgit v1.2.3 From ae0e8ff40caefa3f1667645ddbba30a2551a4283 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 21:43:54 +0100 Subject: callcatcher: unused ImpATan2 --- svtools/source/dialogs/mcvmath.cxx | 22 ---------------------- svtools/source/dialogs/mcvmath.hxx | 1 - 2 files changed, 23 deletions(-) diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index 5b14cb1fcbf7..4dcfbd519aa8 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -207,26 +207,4 @@ static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY ) return phi0+phi; } -/************************************************************************** -|* -|* ImpATan2() -|* -|* Beschreibung ATAN-Funktion fuer FixPoint-Berechnungen -|* -**************************************************************************/ - -sal_uInt16 ImpATan2( const short x, const short y ) -{ - Fix rRad = ImpSqrt(sal_uLong(long(x)*x+long(y)*y)); - - if ( !rRad.x ) - return 0; - Fix fx = x; - fx.DivBig( rRad ); // Normiere auf Einheitskreis - Fix fy = y; - fy.DivBig( rRad ); - - return ImpATanx2( fx, fy ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx index 9d36b2665793..c3e2005352ab 100644 --- a/svtools/source/dialogs/mcvmath.hxx +++ b/svtools/source/dialogs/mcvmath.hxx @@ -215,7 +215,6 @@ inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b ) Fix ImpMultBig2( const Fix& a, const Fix& b ); sal_uInt16 ImpSqrt( sal_uLong nRadi ); -sal_uInt16 ImpATan2( const short x, const short y ); FixCpx ImpExPI( sal_uInt16 nPhi ); #endif // _MCVMATH_HXX -- cgit v1.2.3 From 0e4a38bb6eff9db60caa30af5cc96bcc2bb76a54 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 21:51:12 +0100 Subject: callcatcher: unused FieldToMapUnit --- svtools/inc/svtools/unitconv.hxx | 1 - svtools/source/misc/unitconv.cxx | 7 ------- 2 files changed, 8 deletions(-) diff --git a/svtools/inc/svtools/unitconv.hxx b/svtools/inc/svtools/unitconv.hxx index 51aa3aa61f30..03865882772c 100644 --- a/svtools/inc/svtools/unitconv.hxx +++ b/svtools/inc/svtools/unitconv.hxx @@ -51,7 +51,6 @@ SVT_DLLPUBLIC long ItemToControl( long nIn, SfxMapUnit eItem, SfxFieldUnit SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit eItem ); SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit ); -SVT_DLLPUBLIC MapUnit FieldToMapUnit( const SfxFieldUnit eUnit ); SVT_DLLPUBLIC long ConvertValueToMap( long nVal, SfxMapUnit eUnit ); SVT_DLLPUBLIC long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ); diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index 17adaeaecd81..ab51323abbfb 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -293,13 +293,6 @@ FieldUnit MapToFieldUnit( const SfxMapUnit eUnit ) // ----------------------------------------------------------------------- -MapUnit FieldToMapUnit( const SfxFieldUnit /*eUnit*/ ) -{ - return MAP_APPFONT; -} - -// ----------------------------------------------------------------------- - long ConvertValueToMap( long nVal, SfxMapUnit eUnit ) { long nNew = nVal; -- cgit v1.2.3 From e6a9ee2d30f08958b82320659c31011efc84fc03 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 21:52:25 +0100 Subject: callcatcher: unused methods --- svtools/inc/svtools/unitconv.hxx | 3 --- svtools/source/misc/unitconv.cxx | 51 ---------------------------------------- 2 files changed, 54 deletions(-) diff --git a/svtools/inc/svtools/unitconv.hxx b/svtools/inc/svtools/unitconv.hxx index 03865882772c..d50c89dc7c19 100644 --- a/svtools/inc/svtools/unitconv.hxx +++ b/svtools/inc/svtools/unitconv.hxx @@ -52,9 +52,6 @@ SVT_DLLPUBLIC long ControlToItem( long nIn, SfxFieldUnit eCtrl, SfxMapUnit SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const SfxMapUnit eUnit ); -SVT_DLLPUBLIC long ConvertValueToMap( long nVal, SfxMapUnit eUnit ); -SVT_DLLPUBLIC long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ); - SVT_DLLPUBLIC void SetMetricValue( MetricField& rField, long lCoreValue, SfxMapUnit eUnit ); SVT_DLLPUBLIC long GetCoreValue( const MetricField& rField, SfxMapUnit eUnit ); diff --git a/svtools/source/misc/unitconv.cxx b/svtools/source/misc/unitconv.cxx index ab51323abbfb..189c7e24e4bb 100644 --- a/svtools/source/misc/unitconv.cxx +++ b/svtools/source/misc/unitconv.cxx @@ -293,57 +293,6 @@ FieldUnit MapToFieldUnit( const SfxMapUnit eUnit ) // ----------------------------------------------------------------------- -long ConvertValueToMap( long nVal, SfxMapUnit eUnit ) -{ - long nNew = nVal; - - switch ( eUnit ) - { - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_10TH_INCH: - nNew *= 10; - break; - - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_100TH_INCH: - nNew *= 100; - break; - - case SFX_MAPUNIT_1000TH_INCH: - nNew *= 1000; - default: ;//prevent warning - } - return nNew; -} - -// ----------------------------------------------------------------------- - -long ConvertValueToUnit( long nVal, SfxMapUnit eUnit ) -{ - long nNew = nVal; - - switch ( eUnit ) - { - case SFX_MAPUNIT_10TH_MM: - case SFX_MAPUNIT_10TH_INCH: - nNew /= 10; - break; - - case SFX_MAPUNIT_100TH_MM: - case SFX_MAPUNIT_100TH_INCH: - nNew /= 100; - break; - - case SFX_MAPUNIT_1000TH_INCH: - nNew /= 1000; - break; - default: ;//prevent warning - } - return nNew; -} - -// ----------------------------------------------------------------------- - long CalcToPoint( long nIn, SfxMapUnit eUnit, sal_uInt16 nFaktor ) { DBG_ASSERT( eUnit == SFX_MAPUNIT_TWIP || -- cgit v1.2.3 From ac4a660da59acbd172c341f433ab96684a083da6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 21:58:57 +0100 Subject: callcatcher: unused ByteString::EmptyString --- tools/inc/tools/string.hxx | 1 - tools/source/string/tstring.cxx | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index c3cd6348f0e3..4dede058d162 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -204,7 +204,6 @@ public: } static ByteString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 ); - static const ByteString& EmptyString(); sal_Int32 ToInt32() const; sal_Int64 ToInt64() const; diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index e8830fd27de9..b89a51ba7cdc 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include @@ -104,18 +103,6 @@ ByteString ByteString::CreateFromInt32( sal_Int32 n, sal_Int16 nRadix ) // ----------------------------------------------------------------------- -namespace -{ - struct theEmpty : public rtl::Static< const ByteString, theEmpty> {}; -} - -const ByteString& ByteString::EmptyString() -{ - return theEmpty::get(); -} - -// ----------------------------------------------------------------------- - sal_Int32 ByteString::ToInt32() const { DBG_CHKTHIS( ByteString, DbgCheckByteString ); -- cgit v1.2.3 From 2aa6ecdc65e972c53849d96510e1459847911fbe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:11:06 +0100 Subject: shrink ByteString api by removing unused methods --- tools/inc/tools/string.hxx | 20 --- tools/source/string/strimp.cxx | 316 --------------------------------------- tools/source/string/tustring.cxx | 316 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 316 insertions(+), 336 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 4dede058d162..46760c07f003 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -239,8 +239,6 @@ public: xub_StrLen Len() const { return (xub_StrLen)mpData->mnLen; } ByteString& Insert( const ByteString& rStr, xub_StrLen nIndex = STRING_LEN ); - ByteString& Insert( const ByteString& rStr, xub_StrLen nPos, xub_StrLen nLen, - xub_StrLen nIndex = STRING_LEN ); ByteString& Insert( const sal_Char* pCharStr, xub_StrLen nIndex = STRING_LEN ); ByteString& Insert( sal_Char c, xub_StrLen nIndex = STRING_LEN ); ByteString& Replace( xub_StrLen nIndex, xub_StrLen nCount, const ByteString& rStr ); @@ -254,7 +252,6 @@ public: ByteString& EraseTrailingChars( sal_Char c = ' ' ); ByteString& EraseLeadingAndTrailingChars( sal_Char c = ' ' ); ByteString& EraseAllChars( sal_Char c = ' ' ); - ByteString& Reverse(); ByteString& Convert( rtl_TextEncoding eSource, rtl_TextEncoding eTarget, @@ -301,21 +298,14 @@ public: xub_StrLen nIndex, xub_StrLen nLen ) const; sal_Bool Equals( const sal_Char* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const; - sal_Bool EqualsIgnoreCaseAscii( const ByteString& rStr, - xub_StrLen nIndex, xub_StrLen nLen ) const; - sal_Bool EqualsIgnoreCaseAscii( const sal_Char* pCharStr, - xub_StrLen nIndex, xub_StrLen nLen ) const; xub_StrLen Match( const ByteString& rStr ) const; - xub_StrLen Match( const sal_Char* pCharStr ) const; xub_StrLen Search( sal_Char c, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const ByteString& rStr, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const sal_Char* pCharStr, xub_StrLen nIndex = 0 ) const; xub_StrLen SearchBackward( sal_Char c, xub_StrLen nIndex = STRING_LEN ) const; - xub_StrLen SearchChar( const sal_Char* pChars, xub_StrLen nIndex = 0 ) const; - xub_StrLen SearchAndReplace( sal_Char c, sal_Char cRep, xub_StrLen nIndex = 0 ); xub_StrLen SearchAndReplace( const ByteString& rStr, const ByteString& rRepStr, xub_StrLen nIndex = 0 ); xub_StrLen SearchAndReplace( const sal_Char* pCharStr, const ByteString& rRepStr, @@ -330,9 +320,6 @@ public: ByteString GetToken( xub_StrLen nToken, sal_Char cTok, xub_StrLen& rIndex ) const; ByteString GetToken( xub_StrLen nToken, sal_Char cTok = ';' ) const; - xub_StrLen GetQuotedTokenCount( const ByteString& rQuotedPairs, sal_Char cTok = ';' ) const; - ByteString GetQuotedToken( xub_StrLen nToken, const ByteString& rQuotedPairs, - sal_Char cTok, xub_StrLen& rIndex ) const; ByteString GetQuotedToken( xub_StrLen nToken, const ByteString& rQuotedPairs, sal_Char cTok = ';' ) const; @@ -390,13 +377,6 @@ inline ByteString ByteString::GetToken( xub_StrLen nToken, sal_Char cTok ) const return GetToken( nToken, cTok, nTempPos ); } -inline ByteString ByteString::GetQuotedToken( xub_StrLen nToken, const ByteString& rQuotedPairs, - sal_Char cTok ) const -{ - xub_StrLen nTempPos = 0; - return GetQuotedToken( nToken, rQuotedPairs, cTok, nTempPos ); -} - // ----------------------------------------------------------------------- // ------------------------ diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 3d22a1811a0f..452905c415e1 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -691,52 +691,6 @@ STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex ) // ----------------------------------------------------------------------- -STRING& STRING::Insert( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen, - xub_StrLen nIndex ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - - // Stringlaenge ermitteln - if ( nPos > rStr.mpData->mnLen ) - nLen = 0; - else - { - // Laenge korrigieren, wenn noetig - sal_Int32 nMaxLen = rStr.mpData->mnLen-nPos; - if ( nLen > nMaxLen ) - nLen = static_cast< xub_StrLen >(nMaxLen); - } - - // Ueberlauf abfangen - sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen ); - - // Ist der einzufuegende String ein Leerstring - if ( !nCopyLen ) - return *this; - - // Index groesser als Laenge - if ( nIndex > mpData->mnLen ) - nIndex = static_cast< xub_StrLen >(mpData->mnLen); - - // Neue Laenge ermitteln und neuen String anlegen - STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen ); - - // String kopieren - memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr+nPos, nCopyLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex, - (mpData->mnLen-nIndex)*sizeof( STRCODE ) ); - - // Alte Daten loeschen und Neue zuweisen - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - - return *this; -} - -// ----------------------------------------------------------------------- - STRING& STRING::Insert( const STRCODE* pCharStr, xub_StrLen nIndex ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); @@ -1061,30 +1015,6 @@ STRING& STRING::EraseAllChars( STRCODE c ) // ----------------------------------------------------------------------- -STRING& STRING::Reverse() -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - if ( !mpData->mnLen ) - return *this; - - // Daten kopieren, wenn noetig - ImplCopyData(); - - // Reverse - sal_Int32 nCount = mpData->mnLen / 2; - for ( sal_Int32 i = 0; i < nCount; ++i ) - { - STRCODE cTemp = mpData->maStr[i]; - mpData->maStr[i] = mpData->maStr[mpData->mnLen-i-1]; - mpData->maStr[mpData->mnLen-i-1] = cTemp; - } - - return *this; -} - -// ----------------------------------------------------------------------- - STRING& STRING::ToLowerAscii() { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); @@ -1419,41 +1349,6 @@ sal_Bool STRING::Equals( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen // ----------------------------------------------------------------------- -sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - - // Are there enough codes for comparing? - if ( nIndex > mpData->mnLen ) - return (rStr.mpData->mnLen == 0); - sal_Int32 nMaxLen = mpData->mnLen-nIndex; - if ( nMaxLen < nLen ) - { - if ( rStr.mpData->mnLen != nMaxLen ) - return sal_False; - nLen = static_cast< xub_StrLen >(nMaxLen); - } - - // String vergleichen - return (ImplStringICompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0); -} - -// ----------------------------------------------------------------------- - -sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - // Are there enough codes for comparing? - if ( nIndex > mpData->mnLen ) - return (*pCharStr == 0); - - return (ImplStringICompare( mpData->maStr+nIndex, pCharStr, nLen ) == 0); -} - -// ----------------------------------------------------------------------- - xub_StrLen STRING::Match( const STRING& rStr ) const { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); @@ -1482,32 +1377,6 @@ xub_StrLen STRING::Match( const STRING& rStr ) const // ----------------------------------------------------------------------- -xub_StrLen STRING::Match( const STRCODE* pCharStr ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - // Ist dieser String leer - if ( !mpData->mnLen ) - return STRING_MATCH; - - // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen - const STRCODE* pStr = mpData->maStr; - xub_StrLen i = 0; - while ( i < mpData->mnLen ) - { - // Stimmt das Zeichen nicht ueberein, dann abbrechen - if ( *pStr != *pCharStr ) - return i; - ++pStr, - ++pCharStr, - ++i; - } - - return STRING_MATCH; -} - -// ----------------------------------------------------------------------- - xub_StrLen STRING::Search( STRCODE c, xub_StrLen nIndex ) const { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); @@ -1642,56 +1511,6 @@ xub_StrLen STRING::SearchBackward( STRCODE c, xub_StrLen nIndex ) const // ----------------------------------------------------------------------- -xub_StrLen STRING::SearchChar( const STRCODE* pChars, xub_StrLen nIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - sal_Int32 nLen = mpData->mnLen; - const STRCODE* pStr = mpData->maStr; - pStr += nIndex; - while ( nIndex < nLen ) - { - STRCODE c = *pStr; - const STRCODE* pCompStr = pChars; - while ( *pCompStr ) - { - if ( *pCompStr == c ) - return nIndex; - ++pCompStr; - } - ++pStr, - ++nIndex; - } - - return STRING_NOTFOUND; -} - -// ----------------------------------------------------------------------- - -xub_StrLen STRING::SearchAndReplace( STRCODE c, STRCODE cRep, xub_StrLen nIndex ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - sal_Int32 nLen = mpData->mnLen; - const STRCODE* pStr = mpData->maStr; - pStr += nIndex; - while ( nIndex < nLen ) - { - if ( *pStr == c ) - { - ImplCopyData(); - mpData->maStr[nIndex] = cRep; - return nIndex; - } - ++pStr, - ++nIndex; - } - - return STRING_NOTFOUND; -} - -// ----------------------------------------------------------------------- - xub_StrLen STRING::SearchAndReplace( const STRING& rStr, const STRING& rRepStr, xub_StrLen nIndex ) { @@ -1893,141 +1712,6 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, xub_StrLen& rIndex ) c // ----------------------------------------------------------------------- -xub_StrLen STRING::GetQuotedTokenCount( const STRING& rQuotedPairs, STRCODE cTok ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rQuotedPairs, STRING, DBGCHECKSTRING ); - DBG_ASSERT( !(rQuotedPairs.Len()%2), "String::GetQuotedTokenCount() - QuotedString%2 != 0" ); - DBG_ASSERT( rQuotedPairs.Search(cTok) == STRING_NOTFOUND, "String::GetQuotedTokenCount() - cTok in QuotedString" ); - - // Leerer String: TokenCount per Definition 0 - if ( !mpData->mnLen ) - return 0; - - xub_StrLen nTokCount = 1; - sal_Int32 nLen = mpData->mnLen; - xub_StrLen nQuotedLen = rQuotedPairs.Len(); - STRCODE cQuotedEndChar = 0; - const STRCODE* pQuotedStr = rQuotedPairs.mpData->maStr; - const STRCODE* pStr = mpData->maStr; - sal_Int32 nIndex = 0; - while ( nIndex < nLen ) - { - STRCODE c = *pStr; - if ( cQuotedEndChar ) - { - // Ende des Quotes erreicht ? - if ( c == cQuotedEndChar ) - cQuotedEndChar = 0; - } - else - { - // Ist das Zeichen ein Quote-Anfang-Zeichen ? - xub_StrLen nQuoteIndex = 0; - while ( nQuoteIndex < nQuotedLen ) - { - if ( pQuotedStr[nQuoteIndex] == c ) - { - cQuotedEndChar = pQuotedStr[nQuoteIndex+1]; - break; - } - else - nQuoteIndex += 2; - } - - // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount - if ( c == cTok ) - ++nTokCount; - } - - ++pStr, - ++nIndex; - } - - return nTokCount; -} - -// ----------------------------------------------------------------------- - -STRING STRING::GetQuotedToken( xub_StrLen nToken, const STRING& rQuotedPairs, - STRCODE cTok, xub_StrLen& rIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rQuotedPairs, STRING, DBGCHECKSTRING ); - DBG_ASSERT( !(rQuotedPairs.Len()%2), "String::GetQuotedToken() - QuotedString%2 != 0" ); - DBG_ASSERT( rQuotedPairs.Search(cTok) == STRING_NOTFOUND, "String::GetQuotedToken() - cTok in QuotedString" ); - - const STRCODE* pStr = mpData->maStr; - const STRCODE* pQuotedStr = rQuotedPairs.mpData->maStr; - STRCODE cQuotedEndChar = 0; - xub_StrLen nQuotedLen = rQuotedPairs.Len(); - xub_StrLen nLen = (xub_StrLen)mpData->mnLen; - xub_StrLen nTok = 0; - xub_StrLen nFirstChar = rIndex; - xub_StrLen i = nFirstChar; - - // Bestimme die Token-Position und Laenge - pStr += i; - while ( i < nLen ) - { - STRCODE c = *pStr; - if ( cQuotedEndChar ) - { - // Ende des Quotes erreicht ? - if ( c == cQuotedEndChar ) - cQuotedEndChar = 0; - } - else - { - // Ist das Zeichen ein Quote-Anfang-Zeichen ? - xub_StrLen nQuoteIndex = 0; - while ( nQuoteIndex < nQuotedLen ) - { - if ( pQuotedStr[nQuoteIndex] == c ) - { - cQuotedEndChar = pQuotedStr[nQuoteIndex+1]; - break; - } - else - nQuoteIndex += 2; - } - - // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount - if ( c == cTok ) - { - ++nTok; - - if ( nTok == nToken ) - nFirstChar = i+1; - else - { - if ( nTok > nToken ) - break; - } - } - } - - ++pStr, - ++i; - } - - if ( nTok >= nToken ) - { - if ( i < nLen ) - rIndex = i+1; - else - rIndex = STRING_NOTFOUND; - return Copy( nFirstChar, i-nFirstChar ); - } - else - { - rIndex = STRING_NOTFOUND; - return STRING(); - } -} - -// ----------------------------------------------------------------------- - STRCODE* STRING::GetBufferAccess() { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index 5edd160b5d69..fe0feb51b85b 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -155,4 +155,320 @@ double UniString::ToDouble() const return rtl_ustr_toDouble( mpData->maStr ); } +// ----------------------------------------------------------------------- + +xub_StrLen STRING::SearchChar( const STRCODE* pChars, xub_StrLen nIndex ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + sal_Int32 nLen = mpData->mnLen; + const STRCODE* pStr = mpData->maStr; + pStr += nIndex; + while ( nIndex < nLen ) + { + STRCODE c = *pStr; + const STRCODE* pCompStr = pChars; + while ( *pCompStr ) + { + if ( *pCompStr == c ) + return nIndex; + ++pCompStr; + } + ++pStr, + ++nIndex; + } + + return STRING_NOTFOUND; +} + +// ----------------------------------------------------------------------- + +xub_StrLen STRING::SearchAndReplace( STRCODE c, STRCODE cRep, xub_StrLen nIndex ) +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + sal_Int32 nLen = mpData->mnLen; + const STRCODE* pStr = mpData->maStr; + pStr += nIndex; + while ( nIndex < nLen ) + { + if ( *pStr == c ) + { + ImplCopyData(); + mpData->maStr[nIndex] = cRep; + return nIndex; + } + ++pStr, + ++nIndex; + } + + return STRING_NOTFOUND; +} + +// ----------------------------------------------------------------------- + +STRING& STRING::Reverse() +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + if ( !mpData->mnLen ) + return *this; + + // Daten kopieren, wenn noetig + ImplCopyData(); + + // Reverse + sal_Int32 nCount = mpData->mnLen / 2; + for ( sal_Int32 i = 0; i < nCount; ++i ) + { + STRCODE cTemp = mpData->maStr[i]; + mpData->maStr[i] = mpData->maStr[mpData->mnLen-i-1]; + mpData->maStr[mpData->mnLen-i-1] = cTemp; + } + + return *this; +} + +// ----------------------------------------------------------------------- + +xub_StrLen STRING::Match( const STRCODE* pCharStr ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + // Ist dieser String leer + if ( !mpData->mnLen ) + return STRING_MATCH; + + // Suche bis Stringende nach dem ersten nicht uebereinstimmenden Zeichen + const STRCODE* pStr = mpData->maStr; + xub_StrLen i = 0; + while ( i < mpData->mnLen ) + { + // Stimmt das Zeichen nicht ueberein, dann abbrechen + if ( *pStr != *pCharStr ) + return i; + ++pStr, + ++pCharStr, + ++i; + } + + return STRING_MATCH; +} + +// ----------------------------------------------------------------------- + +STRING& STRING::Insert( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen, + xub_StrLen nIndex ) +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); + + // Stringlaenge ermitteln + if ( nPos > rStr.mpData->mnLen ) + nLen = 0; + else + { + // Laenge korrigieren, wenn noetig + sal_Int32 nMaxLen = rStr.mpData->mnLen-nPos; + if ( nLen > nMaxLen ) + nLen = static_cast< xub_StrLen >(nMaxLen); + } + + // Ueberlauf abfangen + sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen ); + + // Ist der einzufuegende String ein Leerstring + if ( !nCopyLen ) + return *this; + + // Index groesser als Laenge + if ( nIndex > mpData->mnLen ) + nIndex = static_cast< xub_StrLen >(mpData->mnLen); + + // Neue Laenge ermitteln und neuen String anlegen + STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen ); + + // String kopieren + memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) ); + memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr+nPos, nCopyLen*sizeof( STRCODE ) ); + memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex, + (mpData->mnLen-nIndex)*sizeof( STRCODE ) ); + + // Alte Daten loeschen und Neue zuweisen + STRING_RELEASE((STRING_TYPE *)mpData); + mpData = pNewData; + + return *this; +} + +// ----------------------------------------------------------------------- + +xub_StrLen STRING::GetQuotedTokenCount( const STRING& rQuotedPairs, STRCODE cTok ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + DBG_CHKOBJ( &rQuotedPairs, STRING, DBGCHECKSTRING ); + DBG_ASSERT( !(rQuotedPairs.Len()%2), "String::GetQuotedTokenCount() - QuotedString%2 != 0" ); + DBG_ASSERT( rQuotedPairs.Search(cTok) == STRING_NOTFOUND, "String::GetQuotedTokenCount() - cTok in QuotedString" ); + + // Leerer String: TokenCount per Definition 0 + if ( !mpData->mnLen ) + return 0; + + xub_StrLen nTokCount = 1; + sal_Int32 nLen = mpData->mnLen; + xub_StrLen nQuotedLen = rQuotedPairs.Len(); + STRCODE cQuotedEndChar = 0; + const STRCODE* pQuotedStr = rQuotedPairs.mpData->maStr; + const STRCODE* pStr = mpData->maStr; + sal_Int32 nIndex = 0; + while ( nIndex < nLen ) + { + STRCODE c = *pStr; + if ( cQuotedEndChar ) + { + // Ende des Quotes erreicht ? + if ( c == cQuotedEndChar ) + cQuotedEndChar = 0; + } + else + { + // Ist das Zeichen ein Quote-Anfang-Zeichen ? + xub_StrLen nQuoteIndex = 0; + while ( nQuoteIndex < nQuotedLen ) + { + if ( pQuotedStr[nQuoteIndex] == c ) + { + cQuotedEndChar = pQuotedStr[nQuoteIndex+1]; + break; + } + else + nQuoteIndex += 2; + } + + // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount + if ( c == cTok ) + ++nTokCount; + } + + ++pStr, + ++nIndex; + } + + return nTokCount; +} + +// ----------------------------------------------------------------------- + +STRING STRING::GetQuotedToken( xub_StrLen nToken, const STRING& rQuotedPairs, + STRCODE cTok, xub_StrLen& rIndex ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + DBG_CHKOBJ( &rQuotedPairs, STRING, DBGCHECKSTRING ); + DBG_ASSERT( !(rQuotedPairs.Len()%2), "String::GetQuotedToken() - QuotedString%2 != 0" ); + DBG_ASSERT( rQuotedPairs.Search(cTok) == STRING_NOTFOUND, "String::GetQuotedToken() - cTok in QuotedString" ); + + const STRCODE* pStr = mpData->maStr; + const STRCODE* pQuotedStr = rQuotedPairs.mpData->maStr; + STRCODE cQuotedEndChar = 0; + xub_StrLen nQuotedLen = rQuotedPairs.Len(); + xub_StrLen nLen = (xub_StrLen)mpData->mnLen; + xub_StrLen nTok = 0; + xub_StrLen nFirstChar = rIndex; + xub_StrLen i = nFirstChar; + + // Bestimme die Token-Position und Laenge + pStr += i; + while ( i < nLen ) + { + STRCODE c = *pStr; + if ( cQuotedEndChar ) + { + // Ende des Quotes erreicht ? + if ( c == cQuotedEndChar ) + cQuotedEndChar = 0; + } + else + { + // Ist das Zeichen ein Quote-Anfang-Zeichen ? + xub_StrLen nQuoteIndex = 0; + while ( nQuoteIndex < nQuotedLen ) + { + if ( pQuotedStr[nQuoteIndex] == c ) + { + cQuotedEndChar = pQuotedStr[nQuoteIndex+1]; + break; + } + else + nQuoteIndex += 2; + } + + // Stimmt das Tokenzeichen ueberein, dann erhoehe TokCount + if ( c == cTok ) + { + ++nTok; + + if ( nTok == nToken ) + nFirstChar = i+1; + else + { + if ( nTok > nToken ) + break; + } + } + } + + ++pStr, + ++i; + } + + if ( nTok >= nToken ) + { + if ( i < nLen ) + rIndex = i+1; + else + rIndex = STRING_NOTFOUND; + return Copy( nFirstChar, i-nFirstChar ); + } + else + { + rIndex = STRING_NOTFOUND; + return STRING(); + } +} + +// ----------------------------------------------------------------------- + +sal_Bool STRING::EqualsIgnoreCaseAscii( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); + + // Are there enough codes for comparing? + if ( nIndex > mpData->mnLen ) + return (rStr.mpData->mnLen == 0); + sal_Int32 nMaxLen = mpData->mnLen-nIndex; + if ( nMaxLen < nLen ) + { + if ( rStr.mpData->mnLen != nMaxLen ) + return sal_False; + nLen = static_cast< xub_StrLen >(nMaxLen); + } + + // String vergleichen + return (ImplStringICompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0); +} + +// ----------------------------------------------------------------------- + +sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + // Are there enough codes for comparing? + if ( nIndex > mpData->mnLen ) + return (*pCharStr == 0); + + return (ImplStringICompare( mpData->maStr+nIndex, pCharStr, nLen ) == 0); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 6575317bf6503cc9c92d40ef119924533586ed1f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:12:14 +0100 Subject: callcatcher: remove unused WriteUniStringLines --- tools/inc/tools/stream.hxx | 2 -- tools/source/stream/stream.cxx | 8 -------- 2 files changed, 10 deletions(-) diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index fc1a96c2285f..ed013eedfa11 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -446,8 +446,6 @@ public: { return WriteUnicodeOrByteText( rStr, GetStreamCharSet() ); } /// Write a line of Unicode and append line end (endlu()) sal_Bool WriteUniStringLine( const String& rStr ); - /// Write multiple lines of Unicode (with CovertLineEnd) and append line end (endlu()) - sal_Bool WriteUniStringLines( const String& rStr ); /// Write a Unicode character if eDestCharSet==RTL_TEXTENCODING_UNICODE, /// otherwise write as Bytecode converted to eDestCharSet. diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 0cd38bf90365..4186876fd4a0 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -949,14 +949,6 @@ sal_Bool SvStream::WriteLines( const ByteString& rStr ) return (sal_Bool)(nError == SVSTREAM_OK); } -sal_Bool SvStream::WriteUniStringLines( const String& rStr ) -{ - String aStr( rStr ); - aStr.ConvertLineEnd( eLineDelimiter ); - WriteUniStringLine( aStr ); - return nError == SVSTREAM_OK; -} - /************************************************************************* |* |* Stream::WriteUniOrByteChar() -- cgit v1.2.3 From a3b0ee88be3c6bff94ec6fe908f209c1dbb9748d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:17:35 +0100 Subject: strip out unused methods --- tools/inc/tools/stream.hxx | 2 - tools/source/stream/stream.cxx | 92 ------------------------------------------ 2 files changed, 94 deletions(-) diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index ed013eedfa11..71cae4e0e3f2 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -305,7 +305,6 @@ public: SvStream( SvLockBytes *pLockBytes); virtual ~SvStream(); - ErrCode SetLockBytes( SvLockBytesRef& rBytes ); SvLockBytes* GetLockBytes() const { return xLockBytes; } sal_uInt32 GetError() const { return ERRCODE_TOERROR(nError); } @@ -515,7 +514,6 @@ public: void RefreshBuffer(); SvStream& PutBack( char aCh ); - void EatWhite(); sal_Bool IsWritable() const { return bIsWritable; } StreamMode GetStreamMode() const { return eStreamMode; } diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 4186876fd4a0..242f9bb04dc1 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -373,13 +373,6 @@ sal_Size SvStream::GetData( void* pData, sal_Size nSize ) else return 0; } -ErrCode SvStream::SetLockBytes( SvLockBytesRef& rLB ) -{ - xLockBytes = rLB; - RefreshBuffer(); - return ERRCODE_NONE; -} - //======================================================================== sal_Size SvStream::PutData( const void* pData, sal_Size nSize ) @@ -1826,91 +1819,6 @@ void SvStream::Flush() FlushData(); } - -/************************************************************************* -|* -|* Stream::PutBack() -|* -*************************************************************************/ - -/* - 4 Faelle : - - 1. Datenzeiger steht mitten im Puffer (nBufActualPos >= 1) - 2. Datenzeiger auf Position 0, Puffer ist voll - 3. Datenzeiger auf Position 0, Puffer ist teilweise gefuellt - 4. Datenzeiger auf Position 0, Puffer ist leer -> Fehler! -*/ - -SvStream& SvStream::PutBack( char aCh ) -{ - // wenn kein Buffer oder Zurueckscrollen nicht moeglich -> Fehler - if( !pRWBuf || !nBufActualLen || ( !nBufActualPos && !nBufFilePos ) ) - { - // 4. Fall - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - - // Flush() (Phys. Flushen aber nicht notwendig, deshalb selbst schreiben) - if( bIsConsistent && bIsDirty ) - { - SeekPos( nBufFilePos ); - if( nCryptMask ) - CryptAndWriteBuffer( pRWBuf, nBufActualLen ); - else - PutData( pRWBuf, nBufActualLen ); - bIsDirty = sal_False; - } - bIsConsistent = sal_False; // Puffer enthaelt jetzt TRASH - if( nBufActualPos ) - { - // 1. Fall - nBufActualPos--; - pBufPos--; - *pBufPos = aCh; - nBufFree++; - } - else // Puffer muss verschoben werden - { - // Ist Puffer am Anschlag ? - if( nBufSize == nBufActualLen ) - { - // 2. Fall - memmove( pRWBuf+1, pRWBuf, nBufSize-1 ); - // nBufFree behaelt den Wert! - } - else - { - // 3. Fall -> Puffer vergroessern - memmove( pRWBuf+1, pRWBuf, (sal_uInt16)nBufActualLen ); - nBufActualLen++; - nBufFree++; - } - nBufFilePos--; - *pRWBuf = aCh; - } - eIOMode = STREAM_IO_DONTKNOW; - bIsEof = sal_False; - return *this; -} - -/************************************************************************* -|* -|* Stream::EatWhite() -|* -*************************************************************************/ - -void SvStream::EatWhite() -{ - char aCh; - Read(&aCh, sizeof(char) ); - while( !bIsEof && isspace((int)aCh) ) //( aCh == ' ' || aCh == '\t' ) ) - Read(&aCh, sizeof(char) ); - if( !bIsEof ) // konnte das letzte Char gelesen werden ? - SeekRel( -1L ); -} - /************************************************************************* |* |* Stream::RefreshBuffer() -- cgit v1.2.3 From f2da6ac0fab2f2a990437e272a14b0e4c25e1a27 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:31:10 +0100 Subject: callcatcher: drop ugly unused hack --- sot/inc/sot/storage.hxx | 3 -- sot/source/sdstor/storage.cxx | 123 ------------------------------------------ 2 files changed, 126 deletions(-) diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index e1ce95158b12..00348429894b 100644 --- a/sot/inc/sot/storage.hxx +++ b/sot/inc/sot/storage.hxx @@ -242,9 +242,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/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index ef398d081904..ae76765a5a3f 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -743,129 +743,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() |* -- cgit v1.2.3 From 24ea684eafde8f18d99e16dd591c89bc43f65cb4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:36:07 +0100 Subject: don't need these methods on some platforms --- tools/inc/tools/fsys.hxx | 3 +++ tools/source/fsys/dirent.cxx | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 9d8cc934699a..149c158ebdc1 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -251,9 +251,12 @@ private: TOOLS_DLLPRIVATE FSysError ImpParseName( const ByteString& rIntiName, FSysPathStyle eParser ); +#if defined(WNT) TOOLS_DLLPRIVATE FSysError ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eStyle ); +#else TOOLS_DLLPRIVATE FSysError ImpParseUnixName( const ByteString& rPfad, +#endif FSysPathStyle eStyle ); TOOLS_DLLPRIVATE const DirEntry* ImpGetTopPtr() const; TOOLS_DLLPRIVATE DirEntry* ImpGetTopPtr(); diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index a38d698b2f9b..5f1d74353169 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -331,6 +331,7 @@ ByteString ImplCutPath( const ByteString& rStr, sal_uInt16 nMax, char cAccDel ) return aCutPath; } +#if defined(WNT) /************************************************************************* |* |* DirEntry::ImpParseOs2Name() @@ -502,6 +503,7 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty aName = rPfad; return nErr; } +#endif /************************************************************************* |* @@ -1726,6 +1728,7 @@ const DirEntry &DirEntry::operator[]( sal_uInt16 nParentLevel ) const return *pRes; } +#if !defined(WNT) /************************************************************************* |* |* DirEntry::ImpParseUnixName() @@ -1841,6 +1844,7 @@ FSysError DirEntry::ImpParseUnixName( const ByteString& rPfad, FSysPathStyle eSt return FSYS_ERR_OK; } +#endif #define MAX_EXT_MAX 250 #define MAX_LEN_MAX 255 -- cgit v1.2.3 From 0b2ef1a08a330db47d924bbd940d950e3252f095 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:37:15 +0100 Subject: Dir::SetSort unused --- tools/inc/tools/fsys.hxx | 2 -- tools/source/fsys/tdir.cxx | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 149c158ebdc1..91406ec4f24d 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -453,8 +453,6 @@ public: FSysSort nSort, ... ); ~Dir(); - FSysError SetSort( FSysSort nSort, ... ); - void Reset(); sal_uInt16 Scan( sal_uInt16 nCount = 5 ); size_t Count( sal_Bool bUpdated = sal_True ) const; diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx index 6d16a5ed605a..4fb46f201f15 100644 --- a/tools/source/fsys/tdir.cxx +++ b/tools/source/fsys/tdir.cxx @@ -585,19 +585,6 @@ FSysError Dir::ImpSetSort( std::va_list pArgs, int nFirstSort ) return FSYS_ERR_OK; } -/************************************************************************* -|* -|* Dir::SetSort() -|* -*************************************************************************/ - -FSysError Dir::SetSort( FSysSort nSort, ... ) -{ - std::va_list pArgs; - va_start( pArgs, nSort ); - return ImpSetSort( pArgs, nSort ); -} - /************************************************************************* |* |* Dir::operator[]() -- cgit v1.2.3 From 3a9ef1a02ddab91c209093b4289ed68d9816e3c5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jul 2011 22:45:34 +0100 Subject: compiler can now detect additional unused function --- svtools/source/dialogs/mcvmath.cxx | 78 -------------------------------------- 1 file changed, 78 deletions(-) diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx index 4dcfbd519aa8..f34737b8a4f0 100644 --- a/svtools/source/dialogs/mcvmath.cxx +++ b/svtools/source/dialogs/mcvmath.cxx @@ -129,82 +129,4 @@ FixCpx ImpExPI( sal_uInt16 nPhi ) return aIter; } -/************************************************************************** -|* -|* ImpATanx2() -|* -|* Beschreibung ATANX2-Funktion fuer FixPoint-Berechnungen -|* -**************************************************************************/ - -// use for x*x+y*y==1 only - -static sal_uInt16 ImpATanx2( const Fix& rX, const Fix& rY ) -{ - sal_uInt16 phi0 = 0; // result angel higher part - sal_uInt16 phi = 0; // dito lower part - long x = rX.x; - long y = rY.x; - long z; - const char Sft=14-FIX_POST; - short i; - FixCpx aTry; - FixCpx aInc; - FixCpx aIter(1L); - sal_Bool Small = sal_False; - - if ( (x==0) && (y==0) ) - return 0; - - if ( y < 0) - { - // reduce 3. to 1. quadrant (0..90 Degree) - phi0 += 180L * 65536L / 360L; - // turn 180 degree - y *= -1; - x *= -1; - } - - if ( x < 0) - { - // 2. to 1. q. - phi0 += 90L * 65536L / 360L; - // turn 90 degree clockwise - z = y; - y = -x; - x = z; - } - - for ( i = 13; i >= 0; i-- ) - { - aInc.r.x = CosTab[i]>>Sft; // e**(i(phi1+phi2)) = - aInc.i.x = SinTab[i]>>Sft; // e**(i*phi1)) * e**(i*phi2)) - aTry = aIter*aInc; - - if ( Small ) - { - // is try ok - if ( aTry.r.x >= x ) - { - aIter = aTry; - phi += (1< 11 ) - Small=sal_True; - } - } - } - - return phi0+phi; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 426aecc30ee6ab987a69a31ffc40779f69b2d8f0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 01:11:53 +0100 Subject: callcatcher: unused IsKeyCodeValid --- vcl/inc/vcl/accel.hxx | 1 - vcl/source/window/accel.cxx | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx index a7bf623cb20a..cf21000ee08a 100644 --- a/vcl/inc/vcl/accel.hxx +++ b/vcl/inc/vcl/accel.hxx @@ -98,7 +98,6 @@ public: sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const; KeyCode GetKeyCode( sal_uInt16 nItemId ) const; sal_Bool IsIdValid( sal_uInt16 nItemId ) const; - sal_Bool IsKeyCodeValid( const KeyCode rKeyCode ) const; sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ); diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 525c8ad5a76a..ebf15497b229 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -560,16 +560,6 @@ sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - return (pEntry != NULL); -} - -// ----------------------------------------------------------------------- - sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { DBG_CHKTHIS( Accelerator, NULL ); -- cgit v1.2.3 From 0a01387f059357600cf3dbccdab65cdae517c709 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Mon, 11 Jul 2011 05:34:30 -0700 Subject: Replace List with std::vector< VCLXGraphics* > --- toolkit/source/awt/vclxgraphics.cxx | 16 ++++++++++++---- toolkit/source/helper/unowrapper.cxx | 6 +++--- vcl/inc/vcl/outdev.hxx | 23 +++++++++++++++-------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx index dc2c84702664..8f29a5e5e86f 100644 --- a/toolkit/source/awt/vclxgraphics.cxx +++ b/toolkit/source/awt/vclxgraphics.cxx @@ -73,9 +73,17 @@ VCLXGraphics::VCLXGraphics() VCLXGraphics::~VCLXGraphics() { - List* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; + VCLXGraphicsList_impl* pLst = mpOutputDevice ? mpOutputDevice->GetUnoGraphicsList() : NULL; if ( pLst ) - pLst->Remove( this ); + { + for( VCLXGraphicsList_impl::iterator it = pLst->begin(); it < pLst->end(); ++it ) + { + if( *it == this ) { + pLst->erase( it ); + break; + } + } + } delete mpClipRegion; } @@ -100,10 +108,10 @@ void VCLXGraphics::Init( OutputDevice* pOutDev ) mpClipRegion = NULL; // Register at OutputDevice - List* pLst = mpOutputDevice->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = mpOutputDevice->GetUnoGraphicsList(); if ( !pLst ) pLst = mpOutputDevice->CreateUnoGraphicsList(); - pLst->Insert( this, LIST_APPEND ); + pLst->push_back( this ); } void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags ) diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index b5abb11d632e..cc4992d250e0 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -206,12 +206,12 @@ void UnoWrapper::SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Ref void UnoWrapper::ReleaseAllGraphics( OutputDevice* pOutDev ) { - List* pLst = pOutDev->GetUnoGraphicsList(); + VCLXGraphicsList_impl* pLst = pOutDev->GetUnoGraphicsList(); if ( pLst ) { - for ( sal_uInt32 n = 0; n < pLst->Count(); n++ ) + for ( size_t n = 0; n < pLst->size(); n++ ) { - VCLXGraphics* pGrf = (VCLXGraphics*)pLst->GetObject( n ); + VCLXGraphics* pGrf = (*pLst)[ n ]; pGrf->SetOutputDevice( NULL ); } } diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx index b0d694c5e75e..78c7ad938d1a 100644 --- a/vcl/inc/vcl/outdev.hxx +++ b/vcl/inc/vcl/outdev.hxx @@ -282,6 +282,9 @@ class VirtualDevice; class Printer; class ImplFontSelectData; class ImplFontMetricData; +class VCLXGraphics; + +typedef ::std::vector< VCLXGraphics* > VCLXGraphicsList_impl; const char* ImplDbgCheckOutputDevice( const void* pObj ); @@ -305,17 +308,17 @@ private: mutable SalGraphics* mpGraphics; mutable OutputDevice* mpPrevGraphics; mutable OutputDevice* mpNextGraphics; - GDIMetaFile* mpMetaFile; + GDIMetaFile* mpMetaFile; mutable ImplFontEntry* mpFontEntry; mutable ImplFontCache* mpFontCache; mutable ImplDevFontList* mpFontList; mutable ImplGetDevFontList* mpGetDevFontList; mutable ImplGetDevSizeList* mpGetDevSizeList; - ImplObjStack* mpObjStack; - ImplOutDevData* mpOutDevData; - List* mpUnoGraphicsList; - vcl::PDFWriterImpl* mpPDFWriter; - vcl::ExtOutDevData* mpExtOutDevData; + ImplObjStack* mpObjStack; + ImplOutDevData* mpOutDevData; + VCLXGraphicsList_impl* mpUnoGraphicsList; + vcl::PDFWriterImpl* mpPDFWriter; + vcl::ExtOutDevData* mpExtOutDevData; // TEMP TEMP TEMP VirtualDevice* mpAlphaVDev; @@ -1141,8 +1144,12 @@ public: ::com::sun::star::rendering::XCanvas > GetCanvas() const; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > CreateUnoGraphics(); - List* GetUnoGraphicsList() const { return mpUnoGraphicsList; } - List* CreateUnoGraphicsList() { mpUnoGraphicsList = new List; return mpUnoGraphicsList; } + VCLXGraphicsList_impl* GetUnoGraphicsList() const { return mpUnoGraphicsList; } + VCLXGraphicsList_impl* CreateUnoGraphicsList() + { + mpUnoGraphicsList = new VCLXGraphicsList_impl(); + return mpUnoGraphicsList; + } static void BeginFontSubstitution(); static void EndFontSubstitution(); -- cgit v1.2.3 From 28dfd3a2e2c6a39626c55fce2303c83eea210e55 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:17:20 +0100 Subject: callcatcher: remove unused Application::GetReservedKeyCodeDescription --- vcl/inc/vcl/svapp.hxx | 1 - vcl/source/app/svapp.cxx | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index d78d42cf1d52..20eec8a9811e 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -379,7 +379,6 @@ public: static sal_uLong GetReservedKeyCodeCount(); static const KeyCode* GetReservedKeyCode( sal_uLong i ); - static String GetReservedKeyCodeDescription( sal_uLong i ); static void SetDefDialogParent( Window* pWindow ); static Window* GetDefDialogParent(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index fad5ad84ac7d..e6619cbfd20b 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -417,18 +417,6 @@ const KeyCode* Application::GetReservedKeyCode( sal_uLong i ) return &ImplReservedKeys::get()->first[i].mKeyCode; } -String Application::GetReservedKeyCodeDescription( sal_uLong i ) -{ - ResMgr* pResMgr = ImplGetResMgr(); - if( ! pResMgr ) - return String(); - ImplReservedKey *pImplReservedKeys = ImplReservedKeys::get()->first; - if( i >= GetReservedKeyCodeCount() || ! pImplReservedKeys[i].mnResId ) - return String(); - else - return String( ResId( pImplReservedKeys[i].mnResId, *pResMgr ) ); -} - // ----------------------------------------------------------------------- void Application::Execute() -- cgit v1.2.3 From 097b51c9cc3d358175fba3745fb70639cf0c08f9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:40:19 +0100 Subject: callcatcher: remove unused ByteString writeHeaderFieldBody variant --- tools/inc/tools/inetmime.hxx | 6 ------ tools/source/inet/inetmime.cxx | 13 ------------- 2 files changed, 19 deletions(-) diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index d5b56b090725..2c4c425f79e1 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -597,12 +597,6 @@ public: static void writeDateTime(INetMIMEOutputSink & rSink, const DateTime & rUTC); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, - HeaderFieldType eType, - const ByteString & rBody, - rtl_TextEncoding ePreferredEncoding, - bool bInitialSpace = true); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 78032e7d376e..83a3741a72cf 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -2229,19 +2229,6 @@ void INetMIME::writeDateTime(INetMIMEOutputSink & rSink, rSink << " +0000"; } -//============================================================================ -// static -void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, - HeaderFieldType eType, - const ByteString & rBody, - rtl_TextEncoding ePreferredEncoding, - bool bInitialSpace) -{ - writeHeaderFieldBody(rSink, eType, - UniString(rBody, RTL_TEXTENCODING_UTF8), - ePreferredEncoding, bInitialSpace); -} - //============================================================================ // static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, -- cgit v1.2.3 From 5d5fbc091c64d9b5fde5503547161a47502c953f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:41:53 +0100 Subject: callcatcher: remove unused MsLangId::convertIsoByteStringToLanguage --- i18npool/inc/i18npool/mslangid.hxx | 2 -- i18npool/source/isolang/isolang.cxx | 20 -------------------- 2 files changed, 22 deletions(-) diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx index b2a9e054482c..b3d353ca8f0a 100644 --- a/i18npool/inc/i18npool/mslangid.hxx +++ b/i18npool/inc/i18npool/mslangid.hxx @@ -184,8 +184,6 @@ 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 ); 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; -- cgit v1.2.3 From 9ebaee5987400331c4a8f65e44f2ef1b4c83932b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:44:07 +0100 Subject: callcatcher: remove unused SotStorage::OpenEncryptedSotStream --- sot/inc/sot/storage.hxx | 3 --- sot/source/sdstor/storage.cxx | 32 -------------------------------- 2 files changed, 35 deletions(-) diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx index 00348429894b..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 ); diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index ae76765a5a3f..50a30d89b45e 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -987,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 ) -- cgit v1.2.3 From a554c674d706f392ff9a073525ceec571072c60b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 13:55:44 +0100 Subject: callcatcher: remove unused UCBStorageStream ctor --- sot/inc/sot/stg.hxx | 1 - sot/source/sdstor/ucbstorage.cxx | 9 --------- 2 files changed, 10 deletions(-) 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/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 198a6572dec3..67b033c4415b 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 -- cgit v1.2.3 From 7ba61961cae3541fc32d3ac9492c7410869fb3e1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 14:40:24 +0100 Subject: callcatcher: remove unused ChangeDefName --- rsc/inc/rscdef.hxx | 2 -- rsc/inc/rscinst.hxx | 2 -- rsc/source/tools/rscdef.cxx | 24 ------------------------ 3 files changed, 28 deletions(-) diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index c5973e4a9bc8..bb9cb196d0c7 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -270,8 +270,6 @@ public: 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 ); 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/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index 86ad2828973c..9482a40b9f8c 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -1044,30 +1044,6 @@ sal_Bool RscFileTab::ChangeDef( const ByteString & rDefName, 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() -- cgit v1.2.3 From da090884ee84e25b3767da83d4f18dfd499cbbe6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 14:42:36 +0100 Subject: callcatcher: remove unused SfxItemPool::GetLoadingVersion --- svl/inc/svl/itempool.hxx | 1 - svl/source/items/poolio.cxx | 34 ---------------------------------- 2 files changed, 35 deletions(-) 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/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 - */ { @@ -1381,7 +1380,6 @@ sal_uInt16 SfxItemPool::GetNewWhich - */ { @@ -1470,7 +1468,6 @@ bool SfxItemPool::IsCurrentVersionLoading() const - */ { @@ -1503,7 +1500,6 @@ sal_uInt16 SfxItemPool::GetVersion() 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] - - - - - -*/ - -{ - return pImp->nLoadingVersion; -} - //------------------------------------------------------------------------- bool SfxItemPool::IsVer2_Impl() const -- cgit v1.2.3 From 468de84e52821728cb46035f252fac57df3b334e Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Fri, 8 Jul 2011 23:01:55 +0200 Subject: Cleanup some old X11 code, remove useless tests --- vcl/unx/generic/app/saldisp.cxx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 90d65efbd921..8156b86cab08 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -885,10 +885,7 @@ void SalDisplay::Init() sscanf( pProperties, "%li", &nProperties_ ); else { -#if defined DBG_UTIL || defined SUN || defined LINUX || defined FREEBSD || \ - defined NETBSD || defined OPENBSD || defined DRAGONFLY nProperties_ |= PROPERTY_FEATURE_Maximize; -#endif // Server Bugs & Properties if( GetServerVendor() == vendor_excursion ) { @@ -909,31 +906,6 @@ void SalDisplay::Init() if( otherwm == eWindowManager_ ) eWindowManager_ = mwm; } else - if( GetServerVendor() == vendor_xfree ) - { - nProperties_ |= PROPERTY_BUG_XCopyArea_GXxor; -#if defined LINUX || defined FREEBSD || defined NETBSD || defined OPENBSD || \ - defined DRAGONFLY - // otherwm and olwm are a kind of default, which are not detected - // carefully. if we are running linux (i.e. not netbsd) on an xfree - // display, fvwm is most probable the wm to choose, confusing with mwm - // doesn't harm. #57791# start maximized if possible - if( (otherwm == eWindowManager_) - || (olwm == eWindowManager_ )) - { - eWindowManager_ = fvwm; // ??? - nProperties_ |= PROPERTY_FEATURE_Maximize; - } -#else - if( otherwm == eWindowManager_ ) eWindowManager_ = winmgr; -#endif -#if defined SOLARIS && defined SPARC - nProperties_ |= PROPERTY_BUG_Bitmap_Bit_Order; - // solaris xlib seems to have problems with putting images - // in correct bit order to xfree 8 bit displays -#endif - } - else if( GetServerVendor() == vendor_sun ) { // nicht alle! (bekannt: nur Sparc II CG3, CG6?) -- cgit v1.2.3 From a0b2a7cc6be1de9f19842dfb60695e3ac1615577 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 11 Jul 2011 20:36:47 +0200 Subject: fix regression in SvGlobalName::operator < - it was comparing wrong parts and ommiting part of ID's, resulting in wrong results and thus ::std::map didn't work well with default less compare function of it's keys - fixes fdo#32709 --- tools/source/ref/globname.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 5272023ce43e..e7f30b9d50df 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -210,10 +210,10 @@ sal_Bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const else if( Data2_a == Data2_b ) { sal_uInt32 Data1_a; - memcpy(&Data1_a, pImp->szData+4, sizeof(sal_uInt32)); + memcpy(&Data1_a, pImp->szData, sizeof(sal_uInt32)); sal_uInt32 Data1_b; - memcpy(&Data1_b, rObj.pImp->szData+4, sizeof(sal_uInt32)); + memcpy(&Data1_b, rObj.pImp->szData, sizeof(sal_uInt32)); return Data1_a < Data1_b; } -- cgit v1.2.3 From 013fa91412f8687a6416dde97c5e963131a0014c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 11 Jul 2011 21:07:06 +0200 Subject: Remove unused RTFOutFuncs::Out_Fontname --- svtools/source/svrtf/rtfout.cxx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx index d17148bd291a..065fc6ba5572 100644 --- a/svtools/source/svrtf/rtfout.cxx +++ b/svtools/source/svrtf/rtfout.cxx @@ -180,17 +180,6 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr, return rStream; } -SvStream& RTFOutFuncs::Out_Fontname(SvStream& rStream, const String& rStr, - rtl_TextEncoding eDestEnc, sal_Bool bWriteHelpFile) -{ - //Fontnames in word have a quirk in that \uc and usage of ansi replacement - //chars after a \u don't work and in wordpad \u doesn't work, so we are - //left with forcing ansi characters only for fontnames - for (xub_StrLen n = 0; n < rStr.Len(); ++n) - Out_Char(rStream, rStr.GetChar(n), 0, eDestEnc, bWriteHelpFile); - return rStream; -} - SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen ) { sal_Char aNToABuf[] = "0000000000000000"; -- cgit v1.2.3 From 554981b2d3248bca522559f72cac06ff8dda9318 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:19:37 +0200 Subject: callcatcher: remove unused IMapObject::GetLogPoint --- svtools/inc/svtools/imapobj.hxx | 1 - svtools/source/misc/imap.cxx | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx index 88362d118ff6..a02b38f24b06 100644 --- a/svtools/inc/svtools/imapobj.hxx +++ b/svtools/inc/svtools/imapobj.hxx @@ -131,7 +131,6 @@ public: void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; } static Point GetPixelPoint( const Point& rLogPoint ); - static Point GetLogPoint( const Point& rPixelPoint ); sal_Bool IsEqual( const IMapObject& rEqObj ); diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index 9cfa72b76ade..caf84527c800 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -175,18 +175,6 @@ Point IMapObject::GetPixelPoint( const Point& rLogPoint ) } -/****************************************************************************** -|* -|* Konvertierung der logischen Koordianten in Pixel -|* -\******************************************************************************/ - -Point IMapObject::GetLogPoint( const Point& rPixelPoint ) -{ - return Application::GetDefaultDevice()->PixelToLogic( rPixelPoint, MapMode( MAP_100TH_MM ) ); -} - - /****************************************************************************** |* |* -- cgit v1.2.3 From c0ca459ed01dcca4531be11c366b8d66f20982a9 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:20:21 +0200 Subject: callcatcher: remove unused IMapObject::GetPixelPoint --- svtools/inc/svtools/imapobj.hxx | 2 -- svtools/source/misc/imap.cxx | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx index a02b38f24b06..f97850c061de 100644 --- a/svtools/inc/svtools/imapobj.hxx +++ b/svtools/inc/svtools/imapobj.hxx @@ -130,8 +130,6 @@ public: sal_Bool IsActive() const { return bActive; } void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; } - static Point GetPixelPoint( const Point& rLogPoint ); - sal_Bool IsEqual( const IMapObject& rEqObj ); // IMap-Events diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index caf84527c800..cf0615198109 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -163,18 +163,6 @@ void IMapObject::Read( SvStream& rIStm, const String& rBaseURL ) } -/****************************************************************************** -|* -|* Konvertierung der logischen Koordianten in Pixel -|* -\******************************************************************************/ - -Point IMapObject::GetPixelPoint( const Point& rLogPoint ) -{ - return Application::GetDefaultDevice()->LogicToPixel( rLogPoint, MapMode( MAP_100TH_MM ) ); -} - - /****************************************************************************** |* |* -- cgit v1.2.3 From 21e8f4d54d6042d7d472aa28aba958cc70705629 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:37:59 +0200 Subject: callcatcher: remove unused INetRFC822Message::Set* --- tools/inc/tools/inetmsg.hxx | 15 ------ tools/source/inet/inetmsg.cxx | 123 ------------------------------------------ 2 files changed, 138 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index 45b9241a976d..d988ad9758d2 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -295,7 +295,6 @@ public: /** Header fields. */ - void SetBCC (const UniString& rBCC); UniString GetBCC (void) const { return GetHeaderValue_Impl ( @@ -303,7 +302,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetCC (const UniString& rCC); UniString GetCC (void) const { return GetHeaderValue_Impl ( @@ -311,7 +309,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetComments (const UniString& rComments); UniString GetComments (void) const { return GetHeaderValue_Impl ( @@ -319,7 +316,6 @@ public: INetMIME::HEADER_FIELD_TEXT); } - void SetDate (const UniString& rDate); UniString GetDate (void) const { return GetHeaderValue_Impl ( @@ -327,7 +323,6 @@ public: INetMIME::HEADER_FIELD_STRUCTURED); } - void SetFrom (const UniString& rFrom); UniString GetFrom (void) const { return GetHeaderValue_Impl ( @@ -335,7 +330,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetInReplyTo (const UniString& rInReplyTo); UniString GetInReplyTo (void) const { return GetHeaderValue_Impl ( @@ -343,7 +337,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); // ??? MESSAGE_ID ??? } - void SetKeywords (const UniString& rKeywords); UniString GetKeywords (void) const { return GetHeaderValue_Impl ( @@ -351,7 +344,6 @@ public: INetMIME::HEADER_FIELD_PHRASE); } - void SetMessageID (const UniString& rMessageID); UniString GetMessageID (void) const { return GetHeaderValue_Impl ( @@ -359,7 +351,6 @@ public: INetMIME::HEADER_FIELD_MESSAGE_ID); } - void SetReferences (const UniString& rReferences); UniString GetReferences (void) const { return GetHeaderValue_Impl ( @@ -367,7 +358,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetReplyTo (const UniString& rReplyTo); UniString GetReplyTo (void) const { return GetHeaderValue_Impl ( @@ -375,7 +365,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetReturnPath (const UniString& rReturnPath); UniString GetReturnPath (void) const { return GetHeaderValue_Impl ( @@ -383,7 +372,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetReturnReceiptTo (const UniString& rReturnReceiptTo); UniString GetReturnReceiptTo (void) const { return GetHeaderValue_Impl ( @@ -391,7 +379,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetSender (const UniString& rSender); UniString GetSender (void) const { return GetHeaderValue_Impl ( @@ -399,7 +386,6 @@ public: INetMIME::HEADER_FIELD_ADDRESS); } - void SetSubject (const UniString& rSubject); UniString GetSubject (void) const { return GetHeaderValue_Impl ( @@ -407,7 +393,6 @@ public: INetMIME::HEADER_FIELD_TEXT); } - void SetTo (const UniString& rTo); UniString GetTo (void) const { return GetHeaderValue_Impl ( diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 72767a8c48f1..f7d83d9cf238 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -753,129 +753,6 @@ sal_uIntPtr INetRFC822Message::SetHeaderField ( return nNewIndex; } -/* - * Specific Set-Methods. - */ -void INetRFC822Message::SetBCC (const UniString& rBCC) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_BCC), rBCC, - m_nIndex[INETMSG_RFC822_BCC]); -} - -void INetRFC822Message::SetCC (const UniString& rCC) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_CC), rCC, - m_nIndex[INETMSG_RFC822_CC]); -} - -void INetRFC822Message::SetComments (const UniString& rComments) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - HDR(INETMSG_RFC822_COMMENTS), rComments, - m_nIndex[INETMSG_RFC822_COMMENTS]); -} - -void INetRFC822Message::SetDate (const UniString& rDate) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_STRUCTURED, - HDR(INETMSG_RFC822_DATE), rDate, - m_nIndex[INETMSG_RFC822_DATE]); -} - -void INetRFC822Message::SetFrom (const UniString& rFrom) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_FROM), rFrom, - m_nIndex[INETMSG_RFC822_FROM]); -} - -void INetRFC822Message::SetInReplyTo (const UniString& rInReplyTo) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, // ??? MESSAGE_ID ??? - HDR(INETMSG_RFC822_IN_REPLY_TO), rInReplyTo, - m_nIndex[INETMSG_RFC822_IN_REPLY_TO]); -} - -void INetRFC822Message::SetKeywords (const UniString& rKeywords) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_PHRASE, - HDR(INETMSG_RFC822_KEYWORDS), rKeywords, - m_nIndex[INETMSG_RFC822_KEYWORDS]); -} - -void INetRFC822Message::SetMessageID (const UniString& rMessageID) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_MESSAGE_ID, - HDR(INETMSG_RFC822_MESSAGE_ID), rMessageID, - m_nIndex[INETMSG_RFC822_MESSAGE_ID]); -} - -void INetRFC822Message::SetReferences (const UniString& rReferences) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_MESSAGE_ID, - HDR(INETMSG_RFC822_REFERENCES), rReferences, - m_nIndex[INETMSG_RFC822_REFERENCES]); -} - -void INetRFC822Message::SetReplyTo (const UniString& rReplyTo) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_REPLY_TO), rReplyTo, - m_nIndex[INETMSG_RFC822_REPLY_TO]); -} - -void INetRFC822Message::SetReturnPath (const UniString& rReturnPath) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_RETURN_PATH), rReturnPath, - m_nIndex[INETMSG_RFC822_RETURN_PATH]); -} - -void INetRFC822Message::SetReturnReceiptTo (const UniString& rValue) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_RETURN_RECEIPT_TO), rValue, - m_nIndex[INETMSG_RFC822_RETURN_RECEIPT_TO]); -} - -void INetRFC822Message::SetSender (const UniString& rSender) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_SENDER), rSender, - m_nIndex[INETMSG_RFC822_SENDER]); -} - -void INetRFC822Message::SetSubject (const UniString& rSubject) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - HDR(INETMSG_RFC822_SUBJECT), rSubject, - m_nIndex[INETMSG_RFC822_SUBJECT]); -} - -void INetRFC822Message::SetTo (const UniString& rTo) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_ADDRESS, - HDR(INETMSG_RFC822_TO), rTo, - m_nIndex[INETMSG_RFC822_TO]); -} - /* * operator<< */ -- cgit v1.2.3 From bbf795bf546f6510a8cf972d8f023b0cae178a72 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:40:26 +0200 Subject: callcatcher: remove unused INetRFC822Message::GenerateDateField --- tools/inc/tools/inetmsg.hxx | 2 -- tools/source/inet/inetmsg.cxx | 69 +------------------------------------------ 2 files changed, 1 insertion(+), 70 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index d988ad9758d2..cfdd78153e47 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -282,8 +282,6 @@ public: INetRFC822Message& operator= (const INetRFC822Message& rMsg); - static sal_Bool GenerateDateField ( - const DateTime& rDateTime, UniString& rDateField); static sal_Bool ParseDateField ( const UniString& rDateField, DateTime& rDateTime); diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index f7d83d9cf238..235d6fd4d20b 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -296,13 +296,8 @@ INetRFC822Message::~INetRFC822Message (void) } /* - * DateField and local helper functions. - * - * GenerateDateField. - * Generates a String from Date and Time objects in format: - * Wkd, 00 Mon 0000 00:00:00 [GMT] (rfc822, rfc1123) + * ParseDateField and local helper functions. * - * ParseDateField. * Parses a String in (implied) GMT format into class Date and Time objects. * Four formats are accepted: * @@ -321,68 +316,6 @@ static const sal_Char *months[12] = "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -static const sal_Char *wkdays[7] = -{ - "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" -}; - -/* - * GenerateDateField. - */ -sal_Bool INetRFC822Message::GenerateDateField ( - const DateTime& rDateTime, UniString& rDateFieldW) -{ - // Check arguments. - if (!rDateTime.IsValid() || - (rDateTime.GetSec() > 59) || - (rDateTime.GetMin() > 59) || - (rDateTime.GetHour() > 23) ) return sal_False; - - // Prepare output string. - rtl::OStringBuffer aDateField; - - // Insert Date. - aDateField.append(wkdays[(sal_uInt16)(rDateTime.GetDayOfWeek())]); - aDateField.append(RTL_CONSTASCII_STRINGPARAM(", ")); - - sal_uInt16 nNum = rDateTime.GetDay(); - if (nNum < 10) - aDateField.append('0'); - aDateField.append(static_cast(nNum)); - aDateField.append(' '); - - aDateField.append(months[(sal_uInt16)(rDateTime.GetMonth() - 1)]); - aDateField.append(' '); - - aDateField.append(static_cast(rDateTime.GetYear())); - aDateField.append(' '); - - // Insert Time. - nNum = rDateTime.GetHour(); - if (nNum < 10) - aDateField.append('0'); - aDateField.append(static_cast(nNum)); - aDateField.append(':'); - - nNum = rDateTime.GetMin(); - if (nNum < 10) - aDateField.append('0'); - aDateField.append(static_cast(nNum)); - aDateField.append(':'); - - nNum = rDateTime.GetSec(); - if (nNum < 10) - aDateField.append('0'); - aDateField.append(static_cast(nNum)); - aDateField.append(RTL_CONSTASCII_STRINGPARAM(" GMT")); - - // Done. - rDateFieldW = rtl::OStringToOUString(aDateField.makeStringAndClear(), - RTL_TEXTENCODING_ASCII_US); - - return sal_True; -} - /* * ParseDateField and local helper functions. */ -- cgit v1.2.3 From 07924e674e03ea7301c6f635a416120a37c6f4c6 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:42:48 +0200 Subject: callcatcher: remove unused INetURLHistory_Impl::heapsort --- svl/source/misc/inethist.cxx | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index eba1e4083d38..a0f6b8772a66 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -157,7 +157,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. */ @@ -274,25 +273,6 @@ void INetURLHistory_Impl::downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k) 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. */ -- cgit v1.2.3 From 7b8416199a530f602b99f71793e678dacdb6bd1e Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:44:31 +0200 Subject: callcatcher: remove unused INetURLObject::CutName --- tools/inc/tools/urlobj.hxx | 3 --- tools/source/fsys/urlobj.cxx | 8 -------- 2 files changed, 11 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index 67342db5d161..d92455e7cebc 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -1279,9 +1279,6 @@ public: = RTL_TEXTENCODING_UTF8) const { return GetLastName(eMechanism, eCharset); } - rtl::OUString CutName(DecodeMechanism eMechanism = DECODE_TO_IURI, - rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); - void SetExtension(rtl::OUString const & rTheExtension, EncodeMechanism eMechanism = WAS_ENCODED, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 6a855d7d85c8..faf22551dc4f 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -5592,14 +5592,6 @@ void INetURLObject::SetName(rtl::OUString const & rTheName, *this = aTemp; } -//============================================================================ -rtl::OUString INetURLObject::CutName(DecodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - rtl::OUString aTheName(getName(LAST_SEGMENT, true, eMechanism, eCharset)); - return removeSegment(LAST_SEGMENT, true) ? aTheName : rtl::OUString(); -} - //============================================================================ void INetURLObject::SetExtension(rtl::OUString const & rTheExtension, EncodeMechanism eMechanism, -- cgit v1.2.3 From 9a9d12d8b9c81352019ca153d6754c46022c5618 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:45:20 +0200 Subject: callcatcher: remove unused INetURLObject::HasMsgId --- tools/inc/tools/urlobj.hxx | 2 -- tools/source/fsys/urlobj.cxx | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index d92455e7cebc..de779c0fa394 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -1058,8 +1058,6 @@ public: //======================================================================== // POP3 and URLs: - bool HasMsgId() const; - rtl::OUString GetMsgId(DecodeMechanism eMechanism = DECODE_TO_IURI, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8) const; diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index faf22551dc4f..c8d1e8f10d2f 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -5136,19 +5136,6 @@ rtl::OUString INetURLObject::getFSysPath(FSysStyle eStyle, } } -//============================================================================ -bool INetURLObject::HasMsgId() const -{ - if (m_eScheme != INET_PROT_POP3) - return false; - sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPath.getBegin(); - sal_Unicode const * pEnd = p + m_aPath.getLength(); - for (; p < pEnd; ++p) - if (*p == '<') - return true; - return false; -} - //============================================================================ rtl::OUString INetURLObject::GetMsgId(DecodeMechanism eMechanism, rtl_TextEncoding eCharset) const -- cgit v1.2.3 From c54180baaab97c72d656771219d4111b19f1208e Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:47:22 +0200 Subject: callcatcher: remove unused INetURLObject::encodeHostPort --- tools/inc/tools/urlobj.hxx | 56 -------------------------------------------- tools/source/fsys/urlobj.cxx | 23 ------------------ 2 files changed, 79 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index de779c0fa394..ca694e66d5ce 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -624,49 +624,6 @@ public: void makePortCanonic(); - /** Encode the part of a URL. - - @ATT Obsolete, because at the moment the part of a URL may - not contain any escape sequences anyway, and because this method does - not inform the caller whether the given part is legal. - - @param rTheHostPort The part of a URL (for its - interpretation, see the general discussion for set-methods). - - @param eMechanism See the general discussion for set-methods. - - @param eCharset See the general discussion for set-methods. - - @return The part, encoded according to the given mechanism - and charset ('forbidden' characters replaced by escape sequences). - */ - static inline rtl::OUString encodeHostPort(ByteString const & rTheHostPort, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset - = RTL_TEXTENCODING_UTF8); - - /** Encode the part of a URL. - - @ATT Obsolete, because at the moment the part of a URL may - not contain any escape sequences anyway, and because this method does - not inform the caller whether the given part is legal. - - @param rTheHostPort The part of a URL (for its - interpretation, see the general discussion for set-methods). - - @param eMechanism See the general discussion for set-methods. - - @param eCharset See the general discussion for set-methods. - - @return The part, encoded according to the given mechanism - and charset ('forbidden' characters replaced by escape sequences). - */ - static inline rtl::OUString encodeHostPort(rtl::OUString const & rTheHostPort, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset - = RTL_TEXTENCODING_UTF8) - { return encodeHostPort(rTheHostPort, false, eMechanism, eCharset); } - //======================================================================== // Path: @@ -1423,10 +1380,6 @@ private: EncodeMechanism eMechanism, rtl_TextEncoding eCharset, bool bNetBiosName, rtl::OUStringBuffer* pCanonic); - static rtl::OUString encodeHostPort( - rtl::OUString const & rTheHostPort, bool bOctets, - EncodeMechanism eMechanism, rtl_TextEncoding eCharset); - bool setHost( rtl::OUString const & rTheHost, bool bOctets, EncodeMechanism eMechanism, rtl_TextEncoding eCharset); @@ -1817,15 +1770,6 @@ inline bool INetURLObject::SetUserAndPass(rtl::OUString const & rTheUser, setPassword(rThePassword, false, eMechanism, eCharset)); } -// static -inline rtl::OUString INetURLObject::encodeHostPort(ByteString const & - rTheHostPort, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - return encodeHostPort(extend(rTheHostPort), true, eMechanism, eCharset); -} - inline bool INetURLObject::insertName(rtl::OUString const & rTheName, bool bAppendFinalSlash, sal_Int32 nIndex, diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index c8d1e8f10d2f..da3fc0050d6f 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -2908,29 +2908,6 @@ bool INetURLObject::parseHostOrNetBiosName( return true; } -//============================================================================ -// static -rtl::OUString INetURLObject::encodeHostPort(rtl::OUString const & rTheHostPort, - bool bOctets, - EncodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - sal_Int32 nPort = rTheHostPort.getLength(); - if (nPort != 0) - { - sal_Int32 i = nPort - 1; - while (i != 0 && INetMIME::isDigit(rTheHostPort.getStr()[i])) - --i; - if (rTheHostPort.getStr()[i] == ':') - nPort = i; - } - rtl::OUString aResult(encodeText(rTheHostPort.copy(0, nPort), bOctets, - PART_HOST_EXTRA, '%', eMechanism, eCharset, - true)); - aResult += rTheHostPort.copy(nPort); - return aResult; -} - //============================================================================ bool INetURLObject::setHost(rtl::OUString const & rTheHost, bool bOctets, EncodeMechanism eMechanism, -- cgit v1.2.3 From 774c85c86cca143ca908bbe6cd57aa5495106512 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:48:31 +0200 Subject: callcatcher: remove unused INetURLObject::getFTPType --- tools/inc/tools/urlobj.hxx | 6 ------ tools/source/fsys/urlobj.cxx | 25 ------------------------- 2 files changed, 31 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index ca694e66d5ce..b4a10683beac 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -1430,12 +1430,6 @@ private: rtl::OUString const & rTheMark, bool bOctets, EncodeMechanism eMechanism, rtl_TextEncoding eCharset); - // FTP URLs: - - enum FTPType { FTP_TYPE_NONE, FTP_TYPE_A, FTP_TYPE_I, FTP_TYPE_D }; - - TOOLS_DLLPRIVATE FTPType getFTPType() const; - // FILE URLs: TOOLS_DLLPRIVATE bool hasDosVolume(FSysStyle eStyle) const; diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index da3fc0050d6f..7d4c1ad353a6 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -3682,31 +3682,6 @@ bool INetURLObject::setFragment(rtl::OUString const & rTheFragment, return true; } -//============================================================================ -INetURLObject::FTPType INetURLObject::getFTPType() const -{ - if (m_eScheme == INET_PROT_FTP - && m_aPath.getLength() >= RTL_CONSTASCII_LENGTH(";type=") + 1 - && rtl::OUString(m_aAbsURIRef).copy( - m_aPath.getEnd() - (RTL_CONSTASCII_LENGTH(";type=") + 1), - RTL_CONSTASCII_LENGTH(";type=")).equalsIgnoreAsciiCaseAscii(";type=")) - switch (m_aAbsURIRef.charAt(m_aPath.getEnd())) - { - case 'A': - case 'a': - return FTP_TYPE_A; - - case 'D': - case 'd': - return FTP_TYPE_D; - - case 'I': - case 'i': - return FTP_TYPE_I; - } - return FTP_TYPE_NONE; -} - //============================================================================ bool INetURLObject::hasDosVolume(FSysStyle eStyle) const { -- cgit v1.2.3 From b468c1c0aefbc512d1d98641babfbc1d17691c86 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:49:07 +0200 Subject: callcatcher: remove unused INetURLObject::getIMAPUID --- tools/inc/tools/urlobj.hxx | 4 ---- tools/source/fsys/urlobj.cxx | 27 --------------------------- 2 files changed, 31 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index b4a10683beac..e8d93a5abadf 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -1434,10 +1434,6 @@ private: TOOLS_DLLPRIVATE bool hasDosVolume(FSysStyle eStyle) const; - // IMAP URLs: - - TOOLS_DLLPRIVATE sal_uInt32 getIMAPUID() const; - // Coding: static inline rtl::OUString extend(ByteString const & rOctets) diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 7d4c1ad353a6..20917846e2bb 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -3694,33 +3694,6 @@ bool INetURLObject::hasDosVolume(FSysStyle eStyle) const && (m_aPath.getLength() == 3 || p[3] == '/'); } -//============================================================================ -sal_uInt32 INetURLObject::getIMAPUID() const -{ - if (m_eScheme == INET_PROT_IMAP - && m_aPath.getLength() >= RTL_CONSTASCII_LENGTH("/;uid=") + 1) - { - sal_Unicode const * pBegin = m_aAbsURIRef.getStr() - + m_aPath.getBegin() - + RTL_CONSTASCII_LENGTH("/;uid="); - sal_Unicode const * pEnd = pBegin + m_aPath.getLength(); - sal_Unicode const * p = pEnd; - while (p > pBegin && INetMIME::isDigit(p[-1])) - --p; - if (p < pEnd && *--p != '0' - && rtl::OUString(m_aAbsURIRef).copy( - p - RTL_CONSTASCII_LENGTH("/;uid=") - m_aAbsURIRef.getStr(), - RTL_CONSTASCII_LENGTH("/;uid=")).equalsIgnoreAsciiCaseAscii("/;uid=") - ) - { - sal_uInt32 nUID; - if (INetMIME::scanUnsigned(p, pEnd, false, nUID)) - return nUID; - } - } - return 0; -} - //============================================================================ // static rtl::OUString INetURLObject::encodeText(sal_Unicode const * pBegin, -- cgit v1.2.3 From 77c7a7fab5984539cab438831e04d56d4fc65849 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:52:02 +0200 Subject: callcatcher: remove unused INetURLObject::makeAuthCanonic --- tools/inc/tools/urlobj.hxx | 2 -- tools/source/fsys/urlobj.cxx | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index e8d93a5abadf..b164869ea220 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -573,8 +573,6 @@ public: rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8) { return setUser(rTheUser, false, eMechanism, eCharset); } - void makeAuthCanonic(); - inline bool SetPass(ByteString const & rThePassword, EncodeMechanism eMechanism = WAS_ENCODED, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 20917846e2bb..0765490527a2 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4293,22 +4293,6 @@ bool INetURLObject::hasPassword() const return m_aAuth.isPresent() && getSchemeInfo().m_bPassword; } -//============================================================================ -void INetURLObject::makeAuthCanonic() -{ - if (m_eScheme == INET_PROT_IMAP && m_aAuth.getLength() == 1 - && m_aAbsURIRef.charAt(m_aAuth.getBegin()) == '*') - { - lcl_Erase(m_aAbsURIRef, m_aAuth.getBegin() - - RTL_CONSTASCII_LENGTH(";AUTH="), - RTL_CONSTASCII_LENGTH(";AUTH=*")); - sal_Int32 nDelta = m_aAuth.clear() - RTL_CONSTASCII_LENGTH(";AUTH="); - m_aPath += nDelta; - m_aQuery += nDelta; - m_aFragment += nDelta; - } -} - //============================================================================ rtl::OUString INetURLObject::GetHostPort(DecodeMechanism eMechanism, rtl_TextEncoding eCharset) -- cgit v1.2.3 From 229e44242af8934f4ef41b3b86650c304a9d5a1f Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 15:52:32 +0200 Subject: callcatcher: remove unused INetURLObject::makePortCanonic --- tools/inc/tools/urlobj.hxx | 2 -- tools/source/fsys/urlobj.cxx | 27 --------------------------- 2 files changed, 29 deletions(-) diff --git a/tools/inc/tools/urlobj.hxx b/tools/inc/tools/urlobj.hxx index b164869ea220..f8caeee0d11a 100644 --- a/tools/inc/tools/urlobj.hxx +++ b/tools/inc/tools/urlobj.hxx @@ -620,8 +620,6 @@ public: bool SetPort(sal_uInt32 nThePort); - void makePortCanonic(); - //======================================================================== // Path: diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 0765490527a2..bf3cf2e95a4d 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -4349,33 +4349,6 @@ bool INetURLObject::SetPort(sal_uInt32 nThePort) return false; } -//============================================================================ -void INetURLObject::makePortCanonic() -{ - if (m_aPort.isPresent()) - { - sal_Unicode const * p = m_aAbsURIRef.getStr() + m_aPort.getBegin(); - sal_Unicode const * pEnd = p + m_aPort.getLength(); - sal_uInt32 nThePort; - if (INetMIME::scanUnsigned(p, pEnd, true, nThePort) && p == pEnd) - { - sal_Int32 nDelta; - if (nThePort != 0 && nThePort == getSchemeInfo().m_nDefaultPort) - { - lcl_Erase(m_aAbsURIRef, m_aPort.getBegin() - 1, - m_aPort.getLength() + 1); - nDelta = m_aPort.clear() - 1; - } - else - nDelta = m_aPort.set(m_aAbsURIRef, - rtl::OUString::valueOf(sal_Int64(nThePort))); - m_aPath += nDelta; - m_aQuery += nDelta; - m_aFragment += nDelta; - } - } -} - //============================================================================ sal_Int32 INetURLObject::getSegmentCount(bool bIgnoreFinalSlash) const { -- cgit v1.2.3 From d0587241ebf9fefa0834b903e69bcb4acc1c2a94 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 16:46:32 +0200 Subject: callcatcher: remove unused Image::GetColorTransformArrays --- vcl/inc/vcl/image.hxx | 1 - vcl/source/gdi/image.cxx | 30 ------------------------------ 2 files changed, 31 deletions(-) diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx index d536d6bd03d7..7b64582f4a2e 100644 --- a/vcl/inc/vcl/image.hxx +++ b/vcl/inc/vcl/image.hxx @@ -87,7 +87,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > GetXGraphic() const; Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const; - static void GetColorTransformArrays( ImageColorTransform eColorTransform, Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount ); void Invert(); diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 18f927e5b0ff..2e8459725907 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -285,36 +285,6 @@ void Image::Invert() // ----------------------------------------------------------------------- -void Image::GetColorTransformArrays( ImageColorTransform eColorTransform, - Color*& rpSrcColor, Color*& rpDstColor, sal_uLong& rColorCount ) -{ - if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform ) - { - rpSrcColor = new Color[ 4 ]; - rpDstColor = new Color[ 4 ]; - rColorCount = 4; - - rpSrcColor[ 0 ] = Color( COL_BLACK ); - rpDstColor[ 0 ] = Color( COL_WHITE ); - - rpSrcColor[ 1 ] = Color( COL_WHITE ); - rpDstColor[ 1 ] = Color( COL_BLACK ); - - rpSrcColor[ 2 ] = Color( COL_BLUE ); - rpDstColor[ 2 ] = Color( COL_WHITE ); - - rpSrcColor[ 3 ] = Color( COL_LIGHTBLUE ); - rpDstColor[ 3 ] = Color( COL_WHITE ); - } - else - { - rpSrcColor = rpDstColor = NULL; - rColorCount = 0; - } -} - -// ----------------------------------------------------------------------- - Image& Image::operator=( const Image& rImage ) { DBG_CHKTHIS( Image, NULL ); -- cgit v1.2.3 From e5bcbc7fb2903504d967a8a1f0218de2acb11170 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Mon, 11 Jul 2011 16:47:00 +0200 Subject: callcatcher: remove unused Image::Invert --- vcl/inc/vcl/image.hxx | 2 -- vcl/source/gdi/image.cxx | 9 --------- 2 files changed, 11 deletions(-) diff --git a/vcl/inc/vcl/image.hxx b/vcl/inc/vcl/image.hxx index 7b64582f4a2e..301af44bead9 100644 --- a/vcl/inc/vcl/image.hxx +++ b/vcl/inc/vcl/image.hxx @@ -88,8 +88,6 @@ public: Image GetColorTransformedImage( ImageColorTransform eColorTransform ) const; - void Invert(); - sal_Bool operator!() const { return( !mpImplData ? true : false ); } Image& operator=( const Image& rImage ); sal_Bool operator==( const Image& rImage ) const; diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 2e8459725907..f587bc29d2e9 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -276,15 +276,6 @@ uno::Reference< graphic::XGraphic > Image::GetXGraphic() const // ----------------------------------------------------------------------- -void Image::Invert() -{ - BitmapEx aInvertedBmp( GetBitmapEx() ); - aInvertedBmp.Invert(); - *this = aInvertedBmp; -} - -// ----------------------------------------------------------------------- - Image& Image::operator=( const Image& rImage ) { DBG_CHKTHIS( Image, NULL ); -- cgit v1.2.3 From c2b29549ce9a4ac49587fcac03d8f41fc2cf914a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 21:10:48 +0100 Subject: callcatcher: remove Directory ByteString ctor --- l10ntools/inc/l10ntools/directory.hxx | 1 - l10ntools/source/directory.cxx | 6 ------ 2 files changed, 7 deletions(-) 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/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() ); -- cgit v1.2.3 From a0864219a12fa09e46e4193003913ac2945fff76 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 21:12:51 +0100 Subject: callcatcher: remove unused Merge ByteString --- l10ntools/source/localize.cxx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index a0c3775b9ee7..8b9f473e300f 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -221,7 +221,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 ); }; @@ -796,24 +795,6 @@ sal_Bool SourceTreeLocalizer::ExecuteMerge( ) } -/*****************************************************************************/ -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; -- cgit v1.2.3 From 6974f514d3b8cf4b422a70f21fdb57d283ab3774 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 21:15:10 +0100 Subject: callcatcher: remove unused RscFileInst ByteString ctor --- rsc/inc/rscpar.hxx | 2 -- rsc/source/parser/rscpar.cxx | 17 ----------------- 2 files changed, 19 deletions(-) diff --git a/rsc/inc/rscpar.hxx b/rsc/inc/rscpar.hxx index 77b037d841f5..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; } 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() -- cgit v1.2.3 From cc3d6508286ef9daa5bf6a028e0e3b81c2ccc98d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jul 2011 21:17:43 +0100 Subject: callcatcher: remove unused MergeDataFile::WriteError ByteString --- l10ntools/inc/export.hxx | 2 -- l10ntools/source/merge.cxx | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index addfd7a88f7f..bf3308b85215 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -515,8 +515,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/source/merge.cxx b/l10ntools/source/merge.cxx index 35a61211bdbb..584a84bbbf56 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -269,18 +269,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 MergeDataFile::GetLanguages(){ return std::vector(aLanguageSet.begin(),aLanguageSet.end()); } -- cgit v1.2.3 From ae5b6a6e5e73517eb40d4f8d7d2c17d1bfba810f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 01:30:16 +0100 Subject: callcatcher: unused code --- rsc/inc/rscclass.hxx | 9 --- rsc/inc/rscdb.hxx | 4 -- rsc/inc/rscdef.hxx | 11 --- rsc/inc/rsckey.hxx | 2 - rsc/inc/rscrsc.hxx | 10 +-- rsc/source/misc/rscdbl.cxx | 9 --- rsc/source/parser/rscdb.cxx | 50 -------------- rsc/source/parser/rsckey.cxx | 10 --- rsc/source/res/rscclass.cxx | 27 -------- rsc/source/rsc/rsc.cxx | 45 ------------ rsc/source/tools/rscdef.cxx | 159 ------------------------------------------- 11 files changed, 3 insertions(+), 333 deletions(-) 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..830c25fb72b6 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -337,8 +337,6 @@ public: } 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 +351,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 bb9cb196d0c7..8a884c0e5dfd 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -103,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; @@ -166,9 +164,7 @@ 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 ) @@ -265,15 +261,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 & ); - // 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/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/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 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/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx index da2106366f9f..8de91ae9dbbd 100644 --- a/rsc/source/misc/rscdbl.cxx +++ b/rsc/source/misc/rscdbl.cxx @@ -37,11 +37,6 @@ #include #include "rsclst.hxx" -/************************************************************************* -|* -|* RscTypCont::FillNameIdList() -|* -*************************************************************************/ REResourceList * InsertList( Atom nClassName, const RscId& rId, REResourceList * pList ) { REResourceList * pSubList; @@ -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/rscdb.cxx b/rsc/source/parser/rscdb.cxx index a71b4a51eea2..5bfa6ea6e49d 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -322,47 +322,6 @@ 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 +928,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 +975,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/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 @@ -1122,33 +1122,6 @@ ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, return aError; } -/************************************************************************* -|* -|* 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() diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 6fbc6976aedc..6dbf71c3983c 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -106,18 +106,6 @@ void RscCmdLine::Init() m_aOutputFiles.push_back( OutputFile() ); } -/************************************************************************* -|* -|* RscCmdLine::RscCmdLine() -|* -|* Beschreibung Kommandozeile interpretierten -|* -*************************************************************************/ -RscCmdLine::RscCmdLine() -{ - Init(); -} - /************************************************************************* |* |* RscCmdLine::RscCmdLine() @@ -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() diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index 9482a40b9f8c..eab8bbb63ae7 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; } /************************************************************************* |* @@ -183,23 +182,6 @@ ByteString RscId::GetName() const return aStr.makeStringAndClear(); } -/************************************************************************* -|* -|* RscId::GetMacro() -|* -*************************************************************************/ -ByteString RscId::GetMacro() const -{ - rtl::OStringBuffer aStr; - - if ( aExp.IsDefinition() ) - aStr.append(aExp.aExp.pDef->GetMacro()); - else - aExp.AppendMacro(aStr); - - return aStr.makeStringAndClear(); -} - /****************** R s c D e f i n e ************************************/ /************************************************************************* |* @@ -376,18 +358,6 @@ sal_Bool RscDefineList::Remove( RscDefine * pDef ) { 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; @@ -398,29 +368,6 @@ sal_Bool RscDefineList::Remove() { return sal_True; } -/************************************************************************* -|* -|* 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() @@ -961,89 +908,6 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const ByteString & rDefName, return( pDef ); } -/************************************************************************* -|* -|* 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::DeleteFileContext() @@ -1064,29 +928,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() -- cgit v1.2.3 From 4cb993343f58112dbe15cb188ba643a6c4e5bf7c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 08:54:16 +0100 Subject: 4 minutes 27 seconds -> 11 seconds --- basegfx/source/polygon/b2dpolypolygon.cxx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) 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) -- cgit v1.2.3 From 72eff9e69217a5877e1fd1d5b5555f258556dd53 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 12 Jul 2011 13:35:43 +0200 Subject: fix set color regression in cairo canvas - the cairo_set_source_rgba should be called with non-alpha-pre-multiplied color values - fixes fdo#33591 and fdo#35681 --- canvas/source/cairo/cairo_canvashelper.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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, -- cgit v1.2.3 From 22f299b12e1c874a43b38f7efdda0d1b952d09a0 Mon Sep 17 00:00:00 2001 From: Matus Kukan Date: Sun, 3 Jul 2011 17:43:02 +0200 Subject: Remove component_getImplementationEnvironment methods --- canvas/source/cairo/exports.dxp | 1 - canvas/source/directx/exports.dxp | 1 - canvas/source/factory/cf_service.cxx | 6 ------ canvas/source/null/exports.dxp | 1 - canvas/source/simplecanvas/exports.dxp | 3 +-- canvas/source/vcl/exports.dxp | 3 +-- comphelper/inc/comphelper/componentmodule.hxx | 5 ----- comphelper/inc/comphelper/servicedecl.hxx | 6 ------ cppcanvas/source/uno/exports.dxp | 1 - cppcanvas/source/uno/exports.map | 1 - dtrans/source/cnttype/exports.dxp | 1 - dtrans/source/cnttype/mctfentry.cxx | 15 --------------- dtrans/source/generic/dtrans.cxx | 8 -------- dtrans/source/generic/exports.dxp | 1 - dtrans/source/win32/clipb/exports.dxp | 2 -- dtrans/source/win32/clipb/wcbentry.cxx | 15 --------------- dtrans/source/win32/dnd/dndentry.cxx | 10 ---------- dtrans/source/win32/dnd/exports.dxp | 1 - dtrans/source/win32/ftransl/exports.dxp | 1 - dtrans/source/win32/ftransl/ftranslentry.cxx | 15 --------------- dtrans/util/exports.dxp | 1 - i18npool/source/registerservices/registerservices.cxx | 5 ----- i18npool/source/search/textsearch.cxx | 6 ------ sax/source/expatwrap/sax_expat.cxx | 6 ------ sax/source/fastparser/facreg.cxx | 6 ------ sax/test/sax/exports.dxp | 3 +-- sax/test/sax/testsax.cxx | 8 -------- sot/source/unoolestorage/register.cxx | 5 ----- svl/qa/complex/ConfigItems/helper/ConfigItemTest.cxx | 7 ------- svl/source/fsstor/fsfactory.cxx | 6 ------ svl/source/passwordcontainer/passwordcontainer.cxx | 6 ------ svl/source/uno/registerservices.cxx | 6 ------ svtools/source/hatchwindow/hatchwindowfactory.cxx | 6 ------ .../source/productregistration/productregistration.cxx | 6 ------ svtools/source/uno/miscservices.cxx | 6 ------ toolkit/source/helper/registerservices.cxx | 5 ----- ucbhelper/workben/myucp/myucp_services.cxx | 7 ------- unotools/source/ucbhelper/xtempfile.cxx | 8 -------- vcl/source/components/factory.cxx | 7 ------- 39 files changed, 3 insertions(+), 204 deletions(-) diff --git a/canvas/source/cairo/exports.dxp b/canvas/source/cairo/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/cairo/exports.dxp +++ b/canvas/source/cairo/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/canvas/source/directx/exports.dxp b/canvas/source/directx/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/directx/exports.dxp +++ b/canvas/source/directx/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory 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/canvas/source/null/exports.dxp b/canvas/source/null/exports.dxp index f0e1c69934bc..70033078921a 100644 --- a/canvas/source/null/exports.dxp +++ b/canvas/source/null/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment component_getFactory diff --git a/canvas/source/simplecanvas/exports.dxp b/canvas/source/simplecanvas/exports.dxp index 0cb5620a1603..70033078921a 100644 --- a/canvas/source/simplecanvas/exports.dxp +++ b/canvas/source/simplecanvas/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment -component_getFactory \ No newline at end of file +component_getFactory diff --git a/canvas/source/vcl/exports.dxp b/canvas/source/vcl/exports.dxp index 0cb5620a1603..70033078921a 100644 --- a/canvas/source/vcl/exports.dxp +++ b/canvas/source/vcl/exports.dxp @@ -1,2 +1 @@ -component_getImplementationEnvironment -component_getFactory \ No newline at end of file +component_getFactory diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 4bc917ef13d3..198d6c37bb20 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -355,11 +355,6 @@ namespace comphelper //= 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 ) \ { \ 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/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/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/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/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 @@ -63,16 +63,6 @@ sal_Bool SAL_CALL component_canUnload( TimeValue *pTime ) return g_moduleCount.canUnload( &g_moduleCount , 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/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/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/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/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/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/sot/source/unoolestorage/register.cxx b/sot/source/unoolestorage/register.cxx index 30f417b29625..2738a8054af3 100644 --- a/sot/source/unoolestorage/register.cxx +++ b/sot/source/unoolestorage/register.cxx @@ -41,11 +41,6 @@ using namespace ::com::sun::star; extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL sot_component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = 0; 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 @@ -221,13 +221,6 @@ static ::cppu::ImplementationEntry const lRegEntries[] = { 0, 0, 0, 0, 0, 0 } }; -//============================================================================= -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, diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index db6fc301a0d0..61a8f7f15048 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -235,12 +235,6 @@ uno::Sequence< ::rtl::OUString > SAL_CALL FSStorageFactory::getSupportedServiceN extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL fsstorage_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL fsstorage_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index d584a1c77725..86c72fb3619b 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -1538,12 +1538,6 @@ MasterPasswordRequest_Impl::MasterPasswordRequest_Impl( PasswordRequestMode Mode extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL passwordcontainer_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL passwordcontainer_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svl/source/uno/registerservices.cxx b/svl/source/uno/registerservices.cxx index 3fa8b0e7ebef..d001c73da633 100644 --- a/svl/source/uno/registerservices.cxx +++ b/svl/source/uno/registerservices.cxx @@ -55,12 +55,6 @@ DECLARE_CREATEINSTANCE( PathService ) extern "C" { -SVL_DLLPUBLIC void SAL_CALL svl_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SVL_DLLPUBLIC void* SAL_CALL svl_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * /* _pRegistryKey*/) { diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index 13f78b3e353b..93401d8f8f43 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -109,12 +109,6 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OHatchWindowFactory::getSupportedServi extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL hatchwindowfactory_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL hatchwindowfactory_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx index ebedda0ad071..a3312c107a52 100644 --- a/svtools/source/productregistration/productregistration.cxx +++ b/svtools/source/productregistration/productregistration.cxx @@ -453,12 +453,6 @@ namespace svt extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL productregistration_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL productregistration_component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * /* pRegistryKey */) { diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx index 1b20ef518683..e49672bbac52 100644 --- a/svtools/source/uno/miscservices.cxx +++ b/svtools/source/uno/miscservices.cxx @@ -96,12 +96,6 @@ DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL ) extern "C" { -SAL_DLLPUBLIC_EXPORT void SAL_CALL svt_component_getImplementationEnvironment ( - const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey) { diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx index 6e11e72970be..3a532b83de14 100644 --- a/toolkit/source/helper/registerservices.cxx +++ b/toolkit/source/helper/registerservices.cxx @@ -236,11 +236,6 @@ extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, extern "C" { -TOOLKIT_DLLPUBLIC void SAL_CALL tk_component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey ) { void* pRet = NULL; diff --git a/ucbhelper/workben/myucp/myucp_services.cxx b/ucbhelper/workben/myucp/myucp_services.cxx index 6551ca755a12..c455addd1a22 100644 --- a/ucbhelper/workben/myucp/myucp_services.cxx +++ b/ucbhelper/workben/myucp/myucp_services.cxx @@ -80,13 +80,6 @@ sal_Bool writeInfo( void * pRegistryKey, } -//========================================================================= -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_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index d73981670d5d..bf4a88112929 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -484,14 +484,6 @@ throw ( ::css::uno::RuntimeException ) return ::cppu::createSingleComponentFactory( XTempFile_createInstance, getImplementationName_Static(), getSupportedServiceNames_Static() ); } -// C functions to implement this as a component - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL utl_component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - /** * This function is called to get service factories for an implementation. * @param pImplName name of implementation diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx index de76b6e84c58..9701e83e886a 100644 --- a/vcl/source/components/factory.cxx +++ b/vcl/source/components/factory.cxx @@ -83,13 +83,6 @@ namespace rsvg extern "C" { - VCL_DLLPUBLIC void SAL_CALL vcl_component_getImplementationEnvironment( - const sal_Char** ppEnvTypeName, - uno_Environment** /*ppEnv*/ ) - { - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; - } - VCL_DLLPUBLIC void* SAL_CALL vcl_component_getFactory( const sal_Char* pImplementationName, void* pXUnoSMgr, -- cgit v1.2.3 From a206e2afb0c4edcaacce9d42b3b15350ec8c25dc Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 12 Jul 2011 13:22:10 +0100 Subject: initial cut at damage tracking support --- basebmp/inc/basebmp/bitmapdevice.hxx | 13 +++- basebmp/source/bitmapdevice.cxx | 138 +++++++++++++++++++++++++++-------- 2 files changed, 117 insertions(+), 34 deletions(-) diff --git a/basebmp/inc/basebmp/bitmapdevice.hxx b/basebmp/inc/basebmp/bitmapdevice.hxx index e026f3165fbb..5a5436432169 100644 --- a/basebmp/inc/basebmp/bitmapdevice.hxx +++ b/basebmp/inc/basebmp/bitmapdevice.hxx @@ -60,6 +60,11 @@ typedef boost::shared_ptr< const std::vector > 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. @@ -108,6 +113,8 @@ public: */ RawMemorySharedArray getBuffer() const; + BitmapDeviceDamageTracker *getDamageTracker() const; + /** Get pointer to palette The returned pointer is const on purpose, since the @@ -541,7 +548,8 @@ protected: sal_Int32 nScanlineStride, sal_uInt8* pFirstScanline, const RawMemorySharedArray& rMem, - const PaletteMemorySharedVector& rPalette ); + const PaletteMemorySharedVector& rPalette, + BitmapDeviceDamageTracker* pDamage = NULL ); virtual ~BitmapDevice(); @@ -641,7 +649,8 @@ private: */ 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 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(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( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::ONE_BIT_LSB_GREY: return createRenderer( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::ONE_BIT_MSB_PAL: return createRenderer( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); case Format::ONE_BIT_LSB_PAL: return createRenderer( 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( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::FOUR_BIT_LSB_GREY: return createRenderer( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::FOUR_BIT_MSB_PAL: return createRenderer( aBounds, nScanlineFormat, nScanlineStride, pFirstScanline, pMem, pPal, - bitsPerPixel[nScanlineFormat] ); + bitsPerPixel[nScanlineFormat], pDamage ); case Format::FOUR_BIT_LSB_PAL: return createRenderer( 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( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::EIGHT_BIT_PAL: return createRenderer( 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( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::SIXTEEN_BIT_MSB_TC_MASK: return createRenderer( 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( 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( aBounds, nScanlineFormat, nScanlineStride, - pFirstScanline, pMem, pPal ); + pFirstScanline, pMem, pPal, pDamage ); case Format::THIRTYTWO_BIT_TC_MASK_ARGB: return createRenderer( 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() ); } //---------------------------------------------------------------------------------- -- cgit v1.2.3 From 51764de67355e629a3cfdaabd4cbb486586931f1 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Tue, 12 Jul 2011 20:06:36 -0700 Subject: Replace List with std::vector< IMapObject* > I also removed some unused methods. --- svtools/inc/svtools/imap.hxx | 28 +++++++------ svtools/source/misc/imap.cxx | 91 ++++++++++++++++++++----------------------- svtools/source/misc/imap2.cxx | 26 ++++++------- 3 files changed, 71 insertions(+), 74 deletions(-) diff --git a/svtools/inc/svtools/imap.hxx b/svtools/inc/svtools/imap.hxx index 7e0124f70d0c..1d89ca30a49a 100644 --- a/svtools/inc/svtools/imap.hxx +++ b/svtools/inc/svtools/imap.hxx @@ -32,6 +32,7 @@ #include "svtools/svtdllapi.h" #include #include +#include class Point; class Rectangle; @@ -45,22 +46,26 @@ class IMapObject; |* \******************************************************************************/ +typedef ::std::vector< IMapObject* > IMapObjectList_impl; + class SVT_DLLPUBLIC ImageMap { - List maList; +private: + + IMapObjectList_impl maList; String aName; protected: // Binaer laden/speichern void ImpWriteImageMap( SvStream& rOStm, const String& ) const ; - void ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& ); + void ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& ); // Im-/Export void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const; void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const; - sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL ); - sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL ); + sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL ); + sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL ); void ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL ); Point ImpReadCERNCoords( const char** ppStr ); @@ -71,7 +76,7 @@ protected: String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL ); Point ImpReadNCSACoords( const char** ppStr ); - sal_uLong ImpDetectFormat( SvStream& rIStm ); + sal_uLong ImpDetectFormat( SvStream& rIStm ); public: @@ -98,11 +103,10 @@ public: // Zugriff auf einzelne IMapObjekte; die Objekte // duerfen von aussen _nicht_ zerstoert werden - IMapObject* GetFirstIMapObject() { return (IMapObject*) maList.First(); } - IMapObject* GetNextIMapObject() { return (IMapObject*) maList.Next(); } - IMapObject* GetLastIMapObject() { return (IMapObject*) maList.Last(); } - IMapObject* GetPrevIMapObject() { return (IMapObject*) maList.Prev(); } - IMapObject* GetIMapObject( sal_uInt16 nPos ) const { return (IMapObject*) maList.GetObject( nPos ); } + IMapObject* GetIMapObject( size_t nPos ) const + { + return ( nPos < maList.size() ) ? maList[ nPos ] : NULL; + } // Gibt das Objekt zurueck, das zuerst getroffen wurde oder NULL; // Groessen- und Positionsangaben sind in 1/100mm; @@ -116,13 +120,13 @@ public: sal_uLong nFlags = 0 ); // Gibt die Gesamtanzahl der IMap-Objekte zurueck - sal_uInt16 GetIMapObjectCount() const { return (sal_uInt16) maList.Count(); } + size_t GetIMapObjectCount() const { return maList.size(); } // Loescht alle internen Objekte void ClearImageMap(); // liefert die aktuelle Versionsnummer - sal_uInt16 GetVersion() const; + sal_uInt16 GetVersion() const; // liefert / setzt den Namen der ImageMap const String& GetName() const { return aName; } diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx index cf0615198109..39bb9f83bd87 100644 --- a/svtools/source/misc/imap.cxx +++ b/svtools/source/misc/imap.cxx @@ -719,8 +719,8 @@ sal_Bool IMapPolygonObject::IsEqual( const IMapPolygonObject& rEqObj ) |* \******************************************************************************/ -ImageMap::ImageMap( const String& rName ) : - aName ( rName ) +ImageMap::ImageMap( const String& rName ) +: aName( rName ) { } @@ -735,24 +735,24 @@ ImageMap::ImageMap( const ImageMap& rImageMap ) { DBG_CTOR( ImageMap, NULL ); - sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); + size_t nCount = rImageMap.GetIMapObjectCount(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); switch( pCopyObj->GetType() ) { case( IMAP_OBJ_RECTANGLE ): - maList.Insert( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ) ); break; case( IMAP_OBJ_CIRCLE ): - maList.Insert( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ) ); break; case( IMAP_OBJ_POLYGON ): - maList.Insert( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ) ); break; default: @@ -786,15 +786,9 @@ ImageMap::~ImageMap() void ImageMap::ClearImageMap() { - IMapObject* pObj = (IMapObject*) maList.First(); - - while ( pObj ) - { - delete pObj; - pObj = (IMapObject*) maList.Next(); - } - - maList.Clear(); + for( size_t i = 0, n = maList.size(); i < n; ++i ) + delete maList[ i ]; + maList.clear(); aName = String(); } @@ -808,26 +802,26 @@ void ImageMap::ClearImageMap() ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) { - sal_uInt16 nCount = rImageMap.GetIMapObjectCount(); + size_t nCount = rImageMap.GetIMapObjectCount(); ClearImageMap(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { IMapObject* pCopyObj = rImageMap.GetIMapObject( i ); switch( pCopyObj->GetType() ) { case( IMAP_OBJ_RECTANGLE ): - maList.Insert( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapRectangleObject( *(IMapRectangleObject*) pCopyObj ) ); break; case( IMAP_OBJ_CIRCLE ): - maList.Insert( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapCircleObject( *(IMapCircleObject*) pCopyObj ) ); break; case( IMAP_OBJ_POLYGON ): - maList.Insert( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ), LIST_APPEND ); + maList.push_back( new IMapPolygonObject( *(IMapPolygonObject*) pCopyObj ) ); break; default: @@ -849,17 +843,17 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap ) sal_Bool ImageMap::operator==( const ImageMap& rImageMap ) { - const sal_uInt16 nCount = (sal_uInt16) maList.Count(); - const sal_uInt16 nEqCount = rImageMap.GetIMapObjectCount(); - sal_Bool bRet = sal_False; + const size_t nCount = maList.size(); + const size_t nEqCount = rImageMap.GetIMapObjectCount(); + sal_Bool bRet = sal_False; if ( nCount == nEqCount ) { sal_Bool bDifferent = ( aName != rImageMap.aName ); - for ( sal_uInt16 i = 0; ( i < nCount ) && !bDifferent; i++ ) + for ( size_t i = 0; ( i < nCount ) && !bDifferent; i++ ) { - IMapObject* pObj = (IMapObject*) maList.GetObject( i ); + IMapObject* pObj = maList[ i ]; IMapObject* pEqObj = rImageMap.GetIMapObject( i ); if ( pObj->GetType() == pEqObj->GetType() ) @@ -938,15 +932,15 @@ void ImageMap::InsertIMapObject( const IMapObject& rIMapObject ) switch( rIMapObject.GetType() ) { case( IMAP_OBJ_RECTANGLE ): - maList.Insert( new IMapRectangleObject( (IMapRectangleObject&) rIMapObject ), LIST_APPEND ); + maList.push_back( new IMapRectangleObject( (IMapRectangleObject&) rIMapObject ) ); break; case( IMAP_OBJ_CIRCLE ): - maList.Insert( new IMapCircleObject( (IMapCircleObject&) rIMapObject ), LIST_APPEND ); + maList.push_back( new IMapCircleObject( (IMapCircleObject&) rIMapObject ) ); break; case( IMAP_OBJ_POLYGON ): - maList.Insert( new IMapPolygonObject( (IMapPolygonObject&) rIMapObject ), LIST_APPEND ); + maList.push_back( new IMapPolygonObject( (IMapPolygonObject&) rIMapObject ) ); break; default: @@ -981,13 +975,12 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, } // Alle Objekte durchlaufen und HitTest ausfuehren - IMapObject* pObj = (IMapObject*) maList.First(); - while ( pObj ) - { - if ( pObj->IsHit( aRelPoint ) ) + IMapObject* pObj = NULL; + for( size_t i = 0, n = maList.size(); i < n; ++i ) { + if ( maList[ i ]->IsHit( aRelPoint ) ) { + pObj = maList[ i ]; break; - - pObj = (IMapObject*) maList.Next(); + } } return( pObj ? ( pObj->IsActive() ? pObj : NULL ) : NULL ); @@ -1003,10 +996,10 @@ IMapObject* ImageMap::GetHitIMapObject( const Size& rTotalSize, Rectangle ImageMap::GetBoundRect() const { Rectangle aBoundRect; - sal_uLong nCount = maList.Count(); + size_t nCount = maList.size(); - for ( sal_uLong i = 0; i < nCount; i++ ) - aBoundRect.Union( ( (IMapObject*) maList.GetObject( i ) )->GetBoundRect() ); + for ( size_t i = 0; i < nCount; i++ ) + aBoundRect.Union( maList[ i ]->GetBoundRect() ); return aBoundRect; } @@ -1020,11 +1013,11 @@ Rectangle ImageMap::GetBoundRect() const void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) { - sal_uInt16 nCount = (sal_uInt16) maList.Count(); + size_t nCount = maList.size(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { - IMapObject* pObj = GetIMapObject( i ); + IMapObject* pObj = maList[ i ]; switch( pObj->GetType() ) { @@ -1056,11 +1049,11 @@ void ImageMap::Scale( const Fraction& rFracX, const Fraction& rFracY ) void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - sal_uInt16 nCount = (sal_uInt16) maList.Count(); + size_t nCount = maList.size(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { - pObj = (IMapObject*) maList.GetObject( i ); + pObj = maList[ i ]; pObj->Write( rOStm, rBaseURL ); } } @@ -1072,10 +1065,10 @@ void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const |* \******************************************************************************/ -void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String& rBaseURL ) +void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& rBaseURL ) { // neue Objekte einlesen - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { sal_uInt16 nType; @@ -1088,7 +1081,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String { IMapRectangleObject* pObj = new IMapRectangleObject; pObj->Read( rIStm, rBaseURL ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } break; @@ -1096,7 +1089,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String { IMapCircleObject* pObj = new IMapCircleObject; pObj->Read( rIStm, rBaseURL ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } break; @@ -1104,7 +1097,7 @@ void ImageMap::ImpReadImageMap( SvStream& rIStm, sal_uInt16 nCount, const String { IMapPolygonObject* pObj = new IMapPolygonObject; pObj->Read( rIStm, rBaseURL ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } break; diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index b9231a50c2d3..359615a1b2c2 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -169,11 +169,11 @@ void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - sal_uInt16 nCount = (sal_uInt16) maList.Count(); + size_t nCount = maList.size(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { - pObj = GetIMapObject( i ); + pObj = maList[ i ]; switch( pObj->GetType() ) { @@ -198,13 +198,13 @@ void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const { IMapObject* pObj; - sal_uInt16 nCount = (sal_uInt16) maList.Count(); + size_t nCount = maList.size(); - for ( sal_uInt16 i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { - pObj = GetIMapObject( i ); + pObj = maList[ i ]; - switch( pObj->GetType() ) + switch( pObj->GetType() ) { case( IMAP_OBJ_RECTANGLE ): ( (IMapRectangleObject*) pObj )->WriteNCSA( rOStm, rBaseURL ); @@ -290,7 +290,7 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL const Rectangle aRect( aTopLeft, aBottomRight ); IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } else if ( ( aToken == "circle" ) || ( aToken == "circ" ) ) { @@ -299,7 +299,7 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL const String aURL( ImpReadCERNURL( &pStr, rBaseURL ) ); IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) ) { @@ -313,7 +313,7 @@ void ImageMap::ImpReadCERNLine( const ByteString& rLine, const String& rBaseURL aURL = ImpReadCERNURL( &pStr, rBaseURL ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } } } @@ -433,7 +433,7 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL const Rectangle aRect( aTopLeft, aBottomRight ); IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } else if ( aToken == "circle" ) { @@ -444,7 +444,7 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL (double) aDX.Y() * aDX.Y() ); IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } else if ( aToken == "poly" ) { @@ -456,7 +456,7 @@ void ImageMap::ImpReadNCSALine( const ByteString& rLine, const String& rBaseURL aPoly[ i ] = ImpReadNCSACoords( &pStr ); IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() ); - maList.Insert( pObj, LIST_APPEND ); + maList.push_back( pObj ); } } } -- cgit v1.2.3 From ca349219a95d94d01fb3e4a807e56fea6c019f4f Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:03:54 +0200 Subject: callcatcher: remove unused B3dTransformationSet transformations --- tools/inc/tools/b3dtrans.hxx | 17 ------ tools/source/generic/b3dtrans.cxx | 122 -------------------------------------- 2 files changed, 139 deletions(-) diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx index 2c136870d72b..2a5f959dab86 100644 --- a/tools/inc/tools/b3dtrans.hxx +++ b/tools/inc/tools/b3dtrans.hxx @@ -214,23 +214,6 @@ public: // Direkter Zugriff auf verschiedene Transformationen const basegfx::B3DPoint WorldToEyeCoor(const basegfx::B3DPoint& rVec); const basegfx::B3DPoint EyeToWorldCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint EyeToViewCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ViewToEyeCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint WorldToViewCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ViewToWorldCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint DeviceToViewCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ViewToDeviceCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ObjectToWorldCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint WorldToObjectCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ObjectToViewCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ViewToObjectCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint ObjectToEyeCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint EyeToObjectCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint DeviceToEyeCoor(const basegfx::B3DPoint& rVec); - const basegfx::B3DPoint EyeToDeviceCoor(const basegfx::B3DPoint& rVec); - - const basegfx::B3DPoint InvTransObjectToEye(const basegfx::B3DPoint& rVec); - const basegfx::B2DPoint TransTextureCoor(const basegfx::B2DPoint& rVec); static void Frustum( basegfx::B3DHomMatrix& rTarget, diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index 4af4b3edcb85..a60ae5c0ed9c 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -670,128 +670,6 @@ const basegfx::B3DPoint B3dTransformationSet::EyeToWorldCoor(const basegfx::B3DP return aVec; } -const basegfx::B3DPoint B3dTransformationSet::EyeToViewCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetProjection(); - aVec *= GetScale(); - aVec += GetTranslate(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ViewToEyeCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec -= GetTranslate(); - aVec = aVec / GetScale(); - aVec *= GetInvProjection(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::WorldToViewCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetMatFromWorldToView(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ViewToWorldCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvMatFromWorldToView(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::DeviceToViewCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetScale(); - aVec += GetTranslate(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ViewToDeviceCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec -= GetTranslate(); - aVec = aVec / GetScale(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ObjectToWorldCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetObjectTrans(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::WorldToObjectCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvObjectTrans(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ObjectToViewCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetObjectTrans(); - aVec *= GetMatFromWorldToView(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ViewToObjectCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvMatFromWorldToView(); - aVec *= GetInvObjectTrans(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::ObjectToEyeCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetObjectTrans(); - aVec *= GetOrientation(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::EyeToObjectCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvOrientation(); - aVec *= GetInvObjectTrans(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::DeviceToEyeCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvProjection(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::EyeToDeviceCoor(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetProjection(); - return aVec; -} - -const basegfx::B3DPoint B3dTransformationSet::InvTransObjectToEye(const basegfx::B3DPoint& rVec) -{ - basegfx::B3DPoint aVec(rVec); - aVec *= GetInvTransObjectToEye(); - return aVec; -} - -const basegfx::B2DPoint B3dTransformationSet::TransTextureCoor(const basegfx::B2DPoint& rVec) -{ - basegfx::B2DPoint aVec(rVec); - aVec *= GetTexture(); - return aVec; -} - /************************************************************************* |* |* Konstruktor B3dViewport -- cgit v1.2.3 From bb97b1e4b80595c22ea424bc45d763380f71273c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:11:54 +0200 Subject: callcatcher: remove unused B3dTransformationSet various Get/Set methods --- tools/inc/tools/b3dtrans.hxx | 11 ----- tools/source/generic/b3dtrans.cxx | 86 --------------------------------------- 2 files changed, 97 deletions(-) diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx index 2a5f959dab86..84d6758801ae 100644 --- a/tools/inc/tools/b3dtrans.hxx +++ b/tools/inc/tools/b3dtrans.hxx @@ -147,7 +147,6 @@ public: void Reset(); // ObjectTrans - void SetObjectTrans(const basegfx::B3DHomMatrix& rObj); const basegfx::B3DHomMatrix& GetObjectTrans() { return maObjectTrans; } const basegfx::B3DHomMatrix& GetInvObjectTrans() { return maInvObjectTrans; } @@ -156,7 +155,6 @@ public: basegfx::B3DPoint aVRP = basegfx::B3DPoint(0.0,0.0,1.0), basegfx::B3DVector aVPN = basegfx::B3DVector(0.0,0.0,1.0), basegfx::B3DVector aVUP = basegfx::B3DVector(0.0,1.0,0.0)); - void SetOrientation(basegfx::B3DHomMatrix& mOrient); const basegfx::B3DHomMatrix& GetOrientation() { return maOrientation; } const basegfx::B3DHomMatrix& GetInvOrientation() { return maInvOrientation; } @@ -166,20 +164,15 @@ public: const basegfx::B3DHomMatrix& GetInvProjection(); // Texture - void SetTexture(const basegfx::B2DHomMatrix& rTxt); const basegfx::B2DHomMatrix& GetTexture() { return maTexture; } // Seitenverhaeltnis und Modus zu dessen Aufrechterhaltung double GetRatio() { return mfRatio; } void SetRatio(double fNew=1.0); Base3DRatio GetRatioMode() { return meRatio; } - void SetRatioMode(Base3DRatio eNew=Base3DRatioGrow); // Parameter der ViewportTransformation void SetDeviceRectangle(double fL=-1.0, double fR=1.0, double fB=-1.0, double fT=1.0, sal_Bool bBroadCastChange=sal_True); - void SetDeviceVolume(const basegfx::B3DRange& rVol, sal_Bool bBroadCastChange=sal_True); - void GetDeviceRectangle(double &fL, double &fR, double& fB, double& fT); - basegfx::B3DRange GetDeviceVolume(); double GetDeviceRectangleWidth() const { return mfRightBound - mfLeftBound; } double GetDeviceRectangleHeight() const { return mfTopBound - mfBottomBound; } void SetFrontClippingPlane(double fF=0.0); @@ -193,9 +186,6 @@ public: const Rectangle& GetViewportRectangle() { return maViewportRectangle; } void CalcViewport(); - // Spezielle Matritzen anfordern - basegfx::B3DHomMatrix GetMatFromObjectToView(); - // Transponierte Inverse fuer Vectortransformationen const basegfx::B3DHomMatrix& GetInvTransObjectToEye(); @@ -207,7 +197,6 @@ public: const basegfx::B3DHomMatrix& GetInvMatFromWorldToView(); // Bounds des Viewports lesen - const Rectangle& GetLogicalViewportBounds(); const basegfx::B3DVector& GetScale(); const basegfx::B3DVector& GetTranslate(); diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index a60ae5c0ed9c..23b064e57c72 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -182,16 +182,6 @@ void B3dTransformationSet::Reset() |* \************************************************************************/ -void B3dTransformationSet::SetObjectTrans(const basegfx::B3DHomMatrix& rObj) -{ - maObjectTrans = rObj; - - mbObjectToDeviceValid = sal_False; - mbInvTransObjectToEyeValid = sal_False; - - PostSetObjectTrans(); -} - void B3dTransformationSet::PostSetObjectTrans() { // Zuweisen und Inverse bestimmen @@ -217,17 +207,6 @@ void B3dTransformationSet::SetOrientation( basegfx::B3DPoint aVRP, basegfx::B3DV PostSetOrientation(); } -void B3dTransformationSet::SetOrientation(basegfx::B3DHomMatrix& mOrient) -{ - maOrientation = mOrient; - - mbInvTransObjectToEyeValid = sal_False; - mbObjectToDeviceValid = sal_False; - mbWorldToViewValid = sal_False; - - PostSetOrientation(); -} - void B3dTransformationSet::PostSetOrientation() { // Zuweisen und Inverse bestimmen @@ -278,12 +257,6 @@ void B3dTransformationSet::PostSetProjection() |* \************************************************************************/ -void B3dTransformationSet::SetTexture(const basegfx::B2DHomMatrix& rTxt) -{ - maTexture = rTxt; - PostSetTexture(); -} - void B3dTransformationSet::PostSetTexture() { } @@ -425,17 +398,6 @@ void B3dTransformationSet::SetRatio(double fNew) } } -void B3dTransformationSet::SetRatioMode(Base3DRatio eNew) -{ - if(meRatio != eNew) - { - meRatio = eNew; - mbProjectionValid = sal_False; - mbObjectToDeviceValid = sal_False; - mbWorldToViewValid = sal_False; - } -} - void B3dTransformationSet::SetDeviceRectangle(double fL, double fR, double fB, double fT, sal_Bool bBroadCastChange) { @@ -456,39 +418,10 @@ void B3dTransformationSet::SetDeviceRectangle(double fL, double fR, double fB, d } } -void B3dTransformationSet::SetDeviceVolume(const basegfx::B3DRange& rVol, sal_Bool bBroadCastChange) -{ - SetDeviceRectangle(rVol.getMinX(), rVol.getMaxX(), rVol.getMinY(), rVol.getMaxY(), bBroadCastChange); - SetFrontClippingPlane(rVol.getMinZ()); - SetBackClippingPlane(rVol.getMaxZ()); -} - void B3dTransformationSet::DeviceRectangleChange() { } -void B3dTransformationSet::GetDeviceRectangle(double &fL, double &fR, double& fB, double& fT) -{ - fL = mfLeftBound; - fR = mfRightBound; - fB = mfBottomBound; - fT = mfTopBound; - - mbProjectionValid = sal_False; - mbObjectToDeviceValid = sal_False; - mbWorldToViewValid = sal_False; -} - -basegfx::B3DRange B3dTransformationSet::GetDeviceVolume() -{ - basegfx::B3DRange aRet; - - aRet.expand(basegfx::B3DTuple(mfLeftBound, mfBottomBound, mfNearBound)); - aRet.expand(basegfx::B3DTuple(mfRightBound, mfTopBound, mfFarBound)); - - return aRet; -} - void B3dTransformationSet::SetFrontClippingPlane(double fF) { if(mfNearBound != fF) @@ -539,13 +472,6 @@ void B3dTransformationSet::PostSetViewport() { } -const Rectangle& B3dTransformationSet::GetLogicalViewportBounds() -{ - if(!mbProjectionValid) - CalcViewport(); - return maSetBound; -} - const basegfx::B3DVector& B3dTransformationSet::GetScale() { if(!mbProjectionValid) @@ -609,18 +535,6 @@ const basegfx::B3DHomMatrix& B3dTransformationSet::GetInvTransObjectToEye() return maInvTransObjectToEye; } -basegfx::B3DHomMatrix B3dTransformationSet::GetMatFromObjectToView() -{ - basegfx::B3DHomMatrix aFromObjectToView = GetObjectToDevice(); - - const basegfx::B3DVector& rScale(GetScale()); - aFromObjectToView.scale(rScale.getX(), rScale.getY(), rScale.getZ()); - const basegfx::B3DVector& rTranslate(GetTranslate()); - aFromObjectToView.translate(rTranslate.getX(), rTranslate.getY(), rTranslate.getZ()); - - return aFromObjectToView; -} - void B3dTransformationSet::CalcMatFromWorldToView() { maMatFromWorldToView = maOrientation; -- cgit v1.2.3 From 88e42a981484c9a1b782dadb7830a1f9cd58c5e2 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:13:12 +0200 Subject: callcatcher: remove unused B3dViewport::Set* --- tools/inc/tools/b3dtrans.hxx | 2 -- tools/source/generic/b3dtrans.cxx | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx index 84d6758801ae..4bc988ace8ce 100644 --- a/tools/inc/tools/b3dtrans.hxx +++ b/tools/inc/tools/b3dtrans.hxx @@ -254,8 +254,6 @@ public: B3dViewport(); virtual ~B3dViewport(); - void SetVRP(const basegfx::B3DPoint& rNewVRP); - void SetVPN(const basegfx::B3DVector& rNewVPN); void SetVUV(const basegfx::B3DVector& rNewVUV); void SetViewportValues( const basegfx::B3DPoint& rNewVRP, diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index 23b064e57c72..2d62f2871d46 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -603,18 +603,6 @@ B3dViewport::~B3dViewport() { } -void B3dViewport::SetVRP(const basegfx::B3DPoint& rNewVRP) -{ - aVRP = rNewVRP; - CalcOrientation(); -} - -void B3dViewport::SetVPN(const basegfx::B3DVector& rNewVPN) -{ - aVPN = rNewVPN; - CalcOrientation(); -} - void B3dViewport::SetVUV(const basegfx::B3DVector& rNewVUV) { aVUV = rNewVUV; -- cgit v1.2.3 From 58eaf5fff0a8ba2d1874c3588706b7dd12deebac Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:15:16 +0200 Subject: callcatcher: remove unused B3dCamera::Set* --- tools/inc/tools/b3dtrans.hxx | 6 ---- tools/source/generic/b3dtrans.cxx | 75 --------------------------------------- 2 files changed, 81 deletions(-) diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx index 4bc988ace8ce..bcf690d0fae7 100644 --- a/tools/inc/tools/b3dtrans.hxx +++ b/tools/inc/tools/b3dtrans.hxx @@ -294,22 +294,16 @@ public: virtual ~B3dCamera(); // Positionen - void SetPosition(const basegfx::B3DPoint& rNewPos); const basegfx::B3DPoint& GetPosition() const { return aPosition; } - void SetLookAt(const basegfx::B3DVector& rNewLookAt); const basegfx::B3DVector& GetLookAt() const { return aLookAt; } - void SetPositionAndLookAt(const basegfx::B3DPoint& rNewPos, const basegfx::B3DVector& rNewLookAt); // Brennweite in mm - void SetFocalLength(double fLen); double GetFocalLength() const { return fFocalLength; } // Neigung links/rechts - void SetBankAngle(double fAngle); double GetBankAngle() const { return fBankAngle; } // FocalLength Flag - void SetUseFocalLength(sal_Bool bNew); sal_Bool GetUseFocalLength() const { return (sal_Bool)bUseFocalLength; } protected: diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index 2d62f2871d46..9c1c5c9a10b7 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -649,81 +649,6 @@ B3dCamera::~B3dCamera() { } -void B3dCamera::SetPosition(const basegfx::B3DPoint& rNewPos) -{ - if(rNewPos != aPosition) - { - // Zuweisen - aCorrectedPosition = aPosition = rNewPos; - - // Neuberechnung - CalcNewViewportValues(); - } -} - -void B3dCamera::SetLookAt(const basegfx::B3DVector& rNewLookAt) -{ - if(rNewLookAt != aLookAt) - { - // Zuweisen - aLookAt = rNewLookAt; - - // Neuberechnung - CalcNewViewportValues(); - } -} - -void B3dCamera::SetPositionAndLookAt(const basegfx::B3DPoint& rNewPos, const basegfx::B3DVector& rNewLookAt) -{ - if(rNewPos != aPosition || rNewLookAt != aLookAt) - { - // Zuweisen - aPosition = rNewPos; - aLookAt = rNewLookAt; - - // Neuberechnung - CalcNewViewportValues(); - } -} - -void B3dCamera::SetFocalLength(double fLen) -{ - if(fLen != fFocalLength) - { - // Zuweisen - if(fLen < 5.0) - fLen = 5.0; - fFocalLength = fLen; - - // Neuberechnung - CalcNewViewportValues(); - } -} - -void B3dCamera::SetBankAngle(double fAngle) -{ - if(fAngle != fBankAngle) - { - // Zuweisen - fBankAngle = fAngle; - - // Neuberechnung - CalcNewViewportValues(); - } -} - -void B3dCamera::SetUseFocalLength(sal_Bool bNew) -{ - if(bNew != (sal_Bool)bUseFocalLength) - { - // Zuweisen - bUseFocalLength = bNew; - - // Neuberechnung - CalcNewViewportValues(); - } -} - void B3dCamera::DeviceRectangleChange() { // call parent -- cgit v1.2.3 From 32096886c88a7bb97e8c6fd30cce2fff2a598d17 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:23:04 +0200 Subject: callcatcher: remove unused TimeBox::Foo --- vcl/inc/vcl/field.hxx | 7 ---- vcl/source/control/field2.cxx | 74 ------------------------------------------- 2 files changed, 81 deletions(-) diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index 9271df88ba86..639f33afae4e 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -866,7 +866,6 @@ class VCL_DLLPUBLIC TimeBox : public ComboBox, public TimeFormatter { public: TimeBox( Window* pParent, WinBits nWinStyle ); - TimeBox( Window* pParent, const ResId& rResId ); ~TimeBox(); virtual long PreNotify( NotifyEvent& rNEvt ); @@ -876,12 +875,6 @@ public: virtual void Modify(); virtual void ReformatAll(); - - void InsertTime( const Time& rTime, sal_uInt16 nPos = COMBOBOX_APPEND ); - void RemoveTime( const Time& rTime ); - using TimeFormatter::GetTime; - Time GetTime( sal_uInt16 nPos ) const; - sal_uInt16 GetTimePos( const Time& rTime ) const; }; #endif // _SV_FIELD_HXX diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 74241bef0f1b..63e4cd80f199 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -3323,26 +3323,6 @@ TimeBox::TimeBox( Window* pParent, WinBits nWinStyle ) : // ----------------------------------------------------------------------- -TimeBox::TimeBox( Window* pParent, const ResId& rResId ) : - ComboBox( WINDOW_TIMEBOX ) -{ - rResId.SetRT( RSC_TIMEBOX ); - WinBits nStyle = ImplInitRes( rResId ); - ComboBox::ImplInit( pParent, nStyle ); - SetField( this ); - SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, sal_False, sal_False ) ); - ComboBox::ImplLoadRes( rResId ); - ResMgr* pMgr = rResId.GetResMgr(); - if( pMgr ) - TimeFormatter::ImplLoadRes( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) ); - Reformat(); - - if ( !(nStyle & WB_HIDE) ) - Show(); -} - -// ----------------------------------------------------------------------- - TimeBox::~TimeBox() { } @@ -3414,58 +3394,4 @@ void TimeBox::ReformatAll() SetUpdateMode( sal_True ); } -// ----------------------------------------------------------------------- - -void TimeBox::InsertTime( const Time& rTime, sal_uInt16 nPos ) -{ - Time aTime = rTime; - if ( aTime > GetMax() ) - aTime = GetMax(); - else if ( aTime < GetMin() ) - aTime = GetMin(); - - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || GetFormat() == TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - ComboBox::InsertEntry( ImplGetLocaleDataWrapper().getTime( aTime, bSec, b100Sec ), nPos ); -} - -// ----------------------------------------------------------------------- - -void TimeBox::RemoveTime( const Time& rTime ) -{ - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - ComboBox::RemoveEntry( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) ); -} - -// ----------------------------------------------------------------------- - -Time TimeBox::GetTime( sal_uInt16 nPos ) const -{ - Time aTime( 0, 0, 0 ); - ImplTimeGetValue( ComboBox::GetEntry( nPos ), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ); - return aTime; -} - -// ----------------------------------------------------------------------- - -sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const -{ - sal_Bool bSec = sal_False; - sal_Bool b100Sec = sal_False; - if ( GetFormat() == TIMEF_SEC ) - bSec = sal_True; - if ( GetFormat() == TIMEF_100TH_SEC || TIMEF_SEC_CS ) - bSec = b100Sec = sal_True; - return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From fa8eff8cb7c8c11b2a210009d97636d4af29050e Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 12 Jul 2011 23:24:44 +0200 Subject: callcatcher: remove unused TimeFormatter::Foo --- vcl/inc/vcl/field.hxx | 2 -- vcl/source/control/field2.cxx | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/vcl/inc/vcl/field.hxx b/vcl/inc/vcl/field.hxx index 639f33afae4e..4af5e1a6128b 100644 --- a/vcl/inc/vcl/field.hxx +++ b/vcl/inc/vcl/field.hxx @@ -475,8 +475,6 @@ public: void SetTime( const Time& rNewTime ); void SetUserTime( const Time& rNewTime ); Time GetTime() const; - Time GetRealTime() const; - sal_Bool IsTimeModified() const; void SetEmptyTime() { FormatterBase::SetEmptyFieldValue(); } sal_Bool IsEmptyTime() const { return FormatterBase::IsEmptyFieldValue(); } Time GetCorrectedTime() const { return maCorrectedTime; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 63e4cd80f199..4929a8bfa01a 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -3050,35 +3050,6 @@ Time TimeFormatter::GetTime() const // ----------------------------------------------------------------------- -Time TimeFormatter::GetRealTime() const -{ - Time aTime( 0, 0, 0 ); - - if ( GetField() ) - { - sal_Bool bAllowMailformed = ImplAllowMalformedInput(); - if ( !ImplTimeGetValue( GetField()->GetText(), aTime, GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMailformed ) ) - if ( bAllowMailformed ) - aTime = GetInvalidTime(); - } - - return aTime; -} - -// ----------------------------------------------------------------------- - -sal_Bool TimeFormatter::IsTimeModified() const -{ - if ( ImplGetEmptyFieldValue() ) - return !IsEmptyTime(); - else if ( GetTime() != maFieldTime ) - return sal_True; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void TimeFormatter::Reformat() { if ( !GetField() ) -- cgit v1.2.3 From 188fee6957bf700c923e29d19fa79fa828b28045 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 16:51:52 +0100 Subject: WaE: unused arguments --- sax/test/testcomponent.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx index 6d7ff0f03c86..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); -- cgit v1.2.3 From dd69ff6ea20bf43b08b8de951c750853a62d3335 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 20:57:00 +0100 Subject: callcatcher: downheap only used by removed heapsort, also remove it --- svl/source/misc/inethist.cxx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index a0f6b8772a66..c52c03cf6cef 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -156,8 +156,6 @@ class INetURLHistory_Impl */ void initialize (void); - void downheap (hash_entry a[], sal_uInt16 n, sal_uInt16 k); - /** capacity. */ sal_uInt16 capacity (void) const @@ -256,23 +254,6 @@ void INetURLHistory_Impl::initialize (void) backlink (m_aHead.m_nNext, i); } -/* - * 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; -} - /* * find. */ -- cgit v1.2.3 From 61ad99a50c1e327d81bc61f7b681cf144facf2c9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 21:08:21 +0100 Subject: callcatcher: strip rsc down by more unused methods --- rsc/inc/rscdb.hxx | 1 - rsc/inc/rscdef.hxx | 6 ---- rsc/source/parser/rscdb.cxx | 9 ------ rsc/source/tools/rscdef.cxx | 77 --------------------------------------------- 4 files changed, 93 deletions(-) diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx index 830c25fb72b6..012c340bc42e 100644 --- a/rsc/inc/rscdb.hxx +++ b/rsc/inc/rscdb.hxx @@ -336,7 +336,6 @@ public: aBaseLst.push_back( pType ); } RscTop * SearchType( Atom nTypId ); - RscTop * Search( Atom typ ); // loescht alle Resourceobjekte diese Datei void Delete( sal_uLong lFileKey ); RscTop * GetRoot() { return( pRoot ); }; diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index 8a884c0e5dfd..6d335d5544b0 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -140,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: @@ -164,7 +162,6 @@ private: sal_Int32 lDefId, size_t lPos ); RscDefine * New( sal_uLong lFileKey, const ByteString & rDefName, RscExpression * pExpression, size_t lPos ); - sal_Bool Remove( RscDefine * pDef ); sal_Bool Remove(); size_t GetPos( RscDefine* item ) { for ( size_t i = 0, n = maList.size(); i < n; ++i ) @@ -217,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; }; @@ -233,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 ); @@ -248,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, diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx index 5bfa6ea6e49d..1c7e544e18eb 100644 --- a/rsc/source/parser/rscdb.cxx +++ b/rsc/source/parser/rscdb.cxx @@ -313,15 +313,6 @@ RscTop * RscTypCont::SearchType( Atom nId ) return NULL; } -/************************************************************************* -|* -|* RscTypCont :: Search -|* -*************************************************************************/ -RscTop * RscTypCont :: Search( Atom nRT ){ - return( (RscTop *)pRoot->Search( nRT ) ); -} - /************************************************************************* |* |* RscTypCont :: PutSysName() diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index eab8bbb63ae7..8f8754d1b205 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -244,26 +244,6 @@ void RscDefine::DefineToNumber() SetName(rtl::OString::valueOf(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; -} - /************************************************************************* |* |* RscDefine::Evaluate() @@ -341,23 +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() { if ( maList.empty() ) return sal_False; @@ -610,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 **********************************/ /************************************************************************* |* @@ -705,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 **********************************/ /************************************************************************* |* @@ -764,23 +704,6 @@ RscDefine * RscFileTab::FindDef( const char * pName ){ return aDefTree.Search( 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() -- cgit v1.2.3 From 0eeba1cdf66c124cf600a8611555e897aa268327 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 21:09:13 +0100 Subject: callcatcher: strip l10ntools down by more unused methods --- l10ntools/source/localize.cxx | 96 ------------------------------------------- 1 file changed, 96 deletions(-) diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 8b9f473e300f..5af7bfcb5c18 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -204,7 +204,6 @@ private: const ByteString &rCollectMode ); void WorkOnDirectory( const ByteString &rDirectory ); - sal_Bool ExecuteMerge(); sal_Bool MergeSingleFile( const ByteString &rPrj, const ByteString &rFile, @@ -699,101 +698,6 @@ sal_Bool SourceTreeLocalizer::MergeSingleFile( } 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(aErr)); - } - } - return bReturn; - -} } using namespace transex3; -- cgit v1.2.3 From f12d9262d3bdd4c5764166ac22267fb8ba8490e0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 21:14:33 +0100 Subject: callcatcher: remove beautiful, but unused methods --- i18npool/inc/i18npool/mslangid.hxx | 34 +--------------------------------- i18npool/source/isolang/mslangid.cxx | 31 ------------------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx index b3d353ca8f0a..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 getRealLanguageWithoutConfig() - 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 - // ----------------------------- @@ -187,29 +178,6 @@ public: 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 getRealLanguage() - 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/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 ) { -- cgit v1.2.3 From 832fa247b71184f23eb6f3f88d7347af135c225a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 21:16:08 +0100 Subject: callcatcher: unused methods --- svtools/source/contnr/fileview.cxx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 6a511bdb4e4b..e8f6f9cc5b60 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -496,15 +496,12 @@ class NameTranslator_Impl : public ::svt::IContentTitleTranslation private: NameTranslationList* mpActFolder; public: - NameTranslator_Impl( void ); NameTranslator_Impl( const INetURLObject& rActualFolder ); virtual ~NameTranslator_Impl(); // IContentTitleTranslation virtual sal_Bool GetTranslation( const OUString& rOriginalName, OUString& rTranslatedName ) const; - void UpdateTranslationTable(); // reads the translation file again - void SetActualFolder( const INetURLObject& rActualFolder ); const String* GetTransTableFileName() const; // returns the name for the file, which contains the translation strings @@ -1810,11 +1807,6 @@ void SvtFileView::StateChanged( StateChangedType nStateChange ) // class NameTranslator_Impl // ----------------------------------------------------------------------- -NameTranslator_Impl::NameTranslator_Impl( void ) : - mpActFolder( NULL ) -{ -} - NameTranslator_Impl::NameTranslator_Impl( const INetURLObject& rActualFolder ) { mpActFolder = new NameTranslationList( rActualFolder ); @@ -1826,12 +1818,6 @@ NameTranslator_Impl::~NameTranslator_Impl() delete mpActFolder; } -void NameTranslator_Impl::UpdateTranslationTable() -{ - if( mpActFolder ) - mpActFolder->Update(); -} - void NameTranslator_Impl::SetActualFolder( const INetURLObject& rActualFolder ) { HashedEntry aActFolder( rActualFolder ); -- cgit v1.2.3 From bc19d8491f320b4f5e728a2a8f0d0a7cbe65a849 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jul 2011 21:21:23 +0100 Subject: callcatcher: ByteString::CompareIgnoreCaseToAscii unused, shrink api --- tools/inc/tools/string.hxx | 2 -- tools/source/string/strimp.cxx | 30 ------------------------------ tools/source/string/tustring.cxx | 30 ++++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index 46760c07f003..9435d4fb9bd9 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -286,8 +286,6 @@ public: xub_StrLen nLen = STRING_LEN ) const; StringCompare CompareTo( const sal_Char* pCharStr, xub_StrLen nLen = STRING_LEN ) const; - StringCompare CompareIgnoreCaseToAscii( const ByteString& rStr, - xub_StrLen nLen = STRING_LEN ) const; StringCompare CompareIgnoreCaseToAscii( const sal_Char* pCharStr, xub_StrLen nLen = STRING_LEN ) const; sal_Bool Equals( const ByteString& rStr ) const; diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 452905c415e1..2f79410a9c19 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -1209,36 +1209,6 @@ StringCompare STRING::CompareTo( const STRCODE* pCharStr, xub_StrLen nLen ) cons // ----------------------------------------------------------------------- -StringCompare STRING::CompareIgnoreCaseToAscii( const STRING& rStr, - xub_StrLen nLen ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - - // Auf Gleichheit der Pointer testen - if ( mpData == rStr.mpData ) - return COMPARE_EQUAL; - - // Maximale Laenge ermitteln - if ( mpData->mnLen < nLen ) - nLen = static_cast< xub_StrLen >(mpData->mnLen+1); - if ( rStr.mpData->mnLen < nLen ) - nLen = static_cast< xub_StrLen >(rStr.mpData->mnLen+1); - - // String vergleichen - sal_Int32 nCompare = ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, nLen ); - - // Rueckgabewert anpassen - if ( nCompare == 0 ) - return COMPARE_EQUAL; - else if ( nCompare < 0 ) - return COMPARE_LESS; - else - return COMPARE_GREATER; -} - -// ----------------------------------------------------------------------- - StringCompare STRING::CompareIgnoreCaseToAscii( const STRCODE* pCharStr, xub_StrLen nLen ) const { diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index fe0feb51b85b..9ef026f6cce8 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -471,4 +471,34 @@ sal_Bool STRING::EqualsIgnoreCaseAscii( const STRCODE* pCharStr, xub_StrLen nInd return (ImplStringICompare( mpData->maStr+nIndex, pCharStr, nLen ) == 0); } +// ----------------------------------------------------------------------- + +StringCompare STRING::CompareIgnoreCaseToAscii( const STRING& rStr, + xub_StrLen nLen ) const +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); + + // Auf Gleichheit der Pointer testen + if ( mpData == rStr.mpData ) + return COMPARE_EQUAL; + + // Maximale Laenge ermitteln + if ( mpData->mnLen < nLen ) + nLen = static_cast< xub_StrLen >(mpData->mnLen+1); + if ( rStr.mpData->mnLen < nLen ) + nLen = static_cast< xub_StrLen >(rStr.mpData->mnLen+1); + + // String vergleichen + sal_Int32 nCompare = ImplStringICompareWithoutZero( mpData->maStr, rStr.mpData->maStr, nLen ); + + // Rueckgabewert anpassen + if ( nCompare == 0 ) + return COMPARE_EQUAL; + else if ( nCompare < 0 ) + return COMPARE_LESS; + else + return COMPARE_GREATER; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 3b7a12766361a1425566ea909e0003ec8c8ea73d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 00:49:10 +0100 Subject: init against short reads --- sot/source/sdstor/ucbstorage.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 67b033c4415b..dfc5024889a3 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -3266,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 @@ -3277,6 +3277,7 @@ sal_Bool UCBStorage::IsStorageFile( SvStream* pFile ) bRet = ( nBytes == 0x08074b50 ); if ( bRet ) { + nBytes = 0; *pFile >> nBytes; bRet = ( nBytes == 0x04034b50 ); } -- cgit v1.2.3 From f14997ab1432d831ee495307b5615120fbf151b5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 13:23:16 +0100 Subject: misplaced endif --- tools/inc/tools/fsys.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 91406ec4f24d..034b20c5ee57 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -256,8 +256,8 @@ private: FSysPathStyle eStyle ); #else TOOLS_DLLPRIVATE FSysError ImpParseUnixName( const ByteString& rPfad, -#endif FSysPathStyle eStyle ); +#endif TOOLS_DLLPRIVATE const DirEntry* ImpGetTopPtr() const; TOOLS_DLLPRIVATE DirEntry* ImpGetTopPtr(); -- cgit v1.2.3 From 51054e7a8b14aa285b19b124184393d86064ad7e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 14:06:19 +0100 Subject: bah, hidden windows-only uses of these --- tools/inc/tools/fsys.hxx | 4 +++- tools/source/fsys/dirent.cxx | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index 034b20c5ee57..fbcafefacd6b 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -342,7 +342,9 @@ public: #ifdef UNX return rWith.aName.CompareTo( aName ); #else - return rWith.aName.CompareIgnoreCaseToAscii( aName ); + rtl::OString aThis(rtl::OString(aName).toAsciiLowerCase()); + rtl::OString aWith(rtl::OString(rWith.aName).toAsciiLowerCase()); + return static_cast(aWith.compareTo(aThis)); #endif } diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 5f1d74353169..0e8f37ef623d 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -403,9 +403,15 @@ FSysError DirEntry::ImpParseOs2Name( const ByteString& rPfad, FSysPathStyle eSty else { // liegt ein anderes Drive auf dem Stack? - if ( aStack.Count() && - COMPARE_EQUAL != aStack.Bottom()->aName.CompareIgnoreCaseToAscii(aName) ) - aStack.Clear(); + if ( aStack.Count() ) + { + rtl::OString aThis(aStack.Bottom()->aName); + aThis = aThis.toAsciiLowerCase(); + rtl::OString aOther(aName); + aOther = aOther.toAsciiLowerCase(); + if (aThis.compareTo(aOther) != 0) + aStack.Clear(); + } // liegt jetzt nichts mehr auf dem Stack? if ( !aStack.Count() ) -- cgit v1.2.3 From 66803f4a1fd5e4987cfa9abe32972fdb6515c5ec Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 13 Jul 2011 06:58:16 -0700 Subject: Replace List with std::vector< Window* > I also removed the unused Dummy class members. --- svtools/inc/svtools/taskbar.hxx | 41 +++++++++++++++++----------- svtools/source/control/taskmisc.cxx | 53 +++++++++++++++---------------------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/svtools/inc/svtools/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx index 4fb126e5eefe..36b625eca650 100644 --- a/svtools/inc/svtools/taskbar.hxx +++ b/svtools/inc/svtools/taskbar.hxx @@ -440,30 +440,39 @@ class ImplWindowArrangeList; // - class WindowArrange - // ----------------------- +typedef ::std::vector< Window* > WindowList_impl; + class SVT_DLLPUBLIC WindowArrange { private: - List* mpWinList; - void* mpDummy; - sal_uLong mnDummy; + WindowList_impl maWinList; #ifdef _TASKBAR_CXX - SVT_DLLPRIVATE void ImplTile( const Rectangle& rRect ); - SVT_DLLPRIVATE void ImplHorz( const Rectangle& rRect ); - SVT_DLLPRIVATE void ImplVert( const Rectangle& rRect ); - SVT_DLLPRIVATE void ImplCascade( const Rectangle& rRect ); + SVT_DLLPRIVATE void ImplTile( const Rectangle& rRect ); + SVT_DLLPRIVATE void ImplHorz( const Rectangle& rRect ); + SVT_DLLPRIVATE void ImplVert( const Rectangle& rRect ); + SVT_DLLPRIVATE void ImplCascade( const Rectangle& rRect ); #endif public: - WindowArrange(); - ~WindowArrange(); - - void AddWindow( Window* pWindow, sal_uLong nPos = LIST_APPEND ) - { mpWinList->Insert( (void*)pWindow, nPos ); } - void RemoveAllWindows() - { mpWinList->Clear(); } - - void Arrange( sal_uInt16 nType, const Rectangle& rRect ); + WindowArrange(); + ~WindowArrange(); + + void AddWindow( Window* pWindow, size_t nPos = size_t(-1) ) + { + if ( nPos < maWinList.size() ) { + maWinList.insert( maWinList.begin() + nPos, pWindow ); + } else { + maWinList.push_back( pWindow ); + } + } + + void RemoveAllWindows() + { + maWinList.clear(); + } + + void Arrange( sal_uInt16 nType, const Rectangle& rRect ); }; #endif // _TASKBAR_HXX diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx index 1476cacb76fb..246d107fc1d1 100644 --- a/svtools/source/control/taskmisc.cxx +++ b/svtools/source/control/taskmisc.cxx @@ -61,14 +61,13 @@ void TaskButtonBar::RequestHelp( const HelpEvent& rHEvt ) WindowArrange::WindowArrange() { - mpWinList = new List; } // ----------------------------------------------------------------------- WindowArrange::~WindowArrange() { - delete mpWinList; + maWinList.clear(); } // ----------------------------------------------------------------------- @@ -103,22 +102,21 @@ static void ImplPosSizeWindow( Window* pWindow, void WindowArrange::ImplTile( const Rectangle& rRect ) { - sal_uInt16 nCount = (sal_uInt16)mpWinList->Count(); + size_t nCount = maWinList.size(); if ( nCount < 3 ) { ImplVert( rRect ); return; } - sal_uInt16 i; - sal_uInt16 j; - sal_uInt16 nCols; - sal_uInt16 nRows; - sal_uInt16 nActRows; - sal_uInt16 nOffset; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nCols; + sal_uInt16 nRows; + sal_uInt16 nActRows; + sal_uInt16 nOffset; long nOverWidth; long nOverHeight; - Window* pWindow; long nX = rRect.Left(); long nY = rRect.Top(); long nWidth = rRect.GetWidth(); @@ -144,7 +142,7 @@ void WindowArrange::ImplTile( const Rectangle& rRect ) nWidth = 1; nOverWidth = nRectWidth-(nWidth*nCols); - pWindow = (Window*)mpWinList->First(); + WindowList_impl::iterator it = maWinList.begin(); for ( i = 0; i < nCols; i++ ) { if ( i < nOffset ) @@ -172,18 +170,17 @@ void WindowArrange::ImplTile( const Rectangle& rRect ) nTempHeight++; nOverHeight--; } - ImplPosSizeWindow( pWindow, nX, nY, nTempWidth, nTempHeight ); + ImplPosSizeWindow( *it, nX, nY, nTempWidth, nTempHeight ); nY += nTempHeight; - pWindow = (Window*)mpWinList->Next(); - if ( !pWindow ) + if ( ++it == maWinList.end() ) break; } nX += nWidth; nY = nRectY; - if ( !pWindow ) + if ( it == maWinList.end() ) break; } } @@ -192,7 +189,7 @@ void WindowArrange::ImplTile( const Rectangle& rRect ) void WindowArrange::ImplHorz( const Rectangle& rRect ) { - long nCount = (long)mpWinList->Count(); + size_t nCount = maWinList.size(); long nX = rRect.Left(); long nY = rRect.Top(); long nWidth = rRect.GetWidth(); @@ -206,9 +203,9 @@ void WindowArrange::ImplHorz( const Rectangle& rRect ) if ( nHeight < 1 ) nHeight = 1; nOver = nRectHeight - (nCount*nHeight); - pWindow = (Window*)mpWinList->First(); - while ( pWindow ) + for( size_t index = 0; index < nCount; ++index ) { + pWindow = maWinList[ index ]; nTempHeight = nHeight; if ( nOver > 0 ) { @@ -217,8 +214,6 @@ void WindowArrange::ImplHorz( const Rectangle& rRect ) } ImplPosSizeWindow( pWindow, nX, nY, nWidth, nTempHeight ); nY += nTempHeight; - - pWindow = (Window*)mpWinList->Next(); } } @@ -226,7 +221,7 @@ void WindowArrange::ImplHorz( const Rectangle& rRect ) void WindowArrange::ImplVert( const Rectangle& rRect ) { - long nCount = (long)mpWinList->Count(); + size_t nCount = maWinList.size(); long nX = rRect.Left(); long nY = rRect.Top(); long nWidth = rRect.GetWidth(); @@ -240,9 +235,9 @@ void WindowArrange::ImplVert( const Rectangle& rRect ) if ( nWidth < 1 ) nWidth = 1; nOver = nRectWidth - (nCount*nWidth); - pWindow = (Window*)mpWinList->First(); - while ( pWindow ) + for( size_t index = 0; index < nCount; ++index ) { + pWindow = maWinList[ index ]; nTempWidth = nWidth; if ( nOver > 0 ) { @@ -251,8 +246,6 @@ void WindowArrange::ImplVert( const Rectangle& rRect ) } ImplPosSizeWindow( pWindow, nX, nY, nTempWidth, nHeight ); nX += nTempWidth; - - pWindow = (Window*)mpWinList->Next(); } } @@ -285,7 +278,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) Window* pTempWindow; // Border-Fenster suchen um den Versatz zu ermitteln - pTempWindow = (Window*)mpWinList->First(); + pTempWindow = maWinList.front(); pTempWindow->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); while ( !nTopBorder ) { @@ -313,9 +306,9 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) nStartOverHeight = nRectHeight-(nHeight+(nCascadeWins*nOff)); i = 0; - pWindow = (Window*)mpWinList->First(); - while ( pWindow ) + for( size_t index = 0, count = maWinList.size(); index < count; ++index ) { + pWindow = maWinList[ index ]; if ( !i ) { nOverWidth = nStartOverWidth; @@ -346,8 +339,6 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) i++; else i = 0; - - pWindow = (Window*)mpWinList->Next(); } } @@ -355,7 +346,7 @@ void WindowArrange::ImplCascade( const Rectangle& rRect ) void WindowArrange::Arrange( sal_uInt16 nType, const Rectangle& rRect ) { - if ( !mpWinList->Count() ) + if ( maWinList.empty() ) return; switch ( nType ) -- cgit v1.2.3 From ce0ecd94dc4066024d8f8a0c4f7b681e1765cced Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 13 Jul 2011 07:26:24 -0700 Subject: Whitespace cleanup --- svtools/inc/svtools/grfmgr.hxx | 418 +++++++++++++++++++++++++++-------------- 1 file changed, 277 insertions(+), 141 deletions(-) diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index 0395a9d5afe5..d48d82851851 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -105,14 +105,14 @@ private: long mnTopCrop; long mnRightCrop; long mnBottomCrop; - sal_uInt16 mnRotate10; + sal_uInt16 mnRotate10; short mnContPercent; short mnLumPercent; short mnRPercent; short mnGPercent; short mnBPercent; - sal_Bool mbInvert; - sal_uInt8 mcTransparency; + sal_Bool mbInvert; + sal_uInt8 mcTransparency; GraphicDrawMode meDrawMode; void* mpDummy; @@ -122,14 +122,14 @@ public: GraphicAttr(); ~GraphicAttr(); - sal_Bool operator==( const GraphicAttr& rAttr ) const; - sal_Bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); } + sal_Bool operator==( const GraphicAttr& rAttr ) const; + sal_Bool operator!=( const GraphicAttr& rAttr ) const { return !( *this == rAttr ); } void SetDrawMode( GraphicDrawMode eDrawMode ) { meDrawMode = eDrawMode; } GraphicDrawMode GetDrawMode() const { return meDrawMode; } void SetMirrorFlags( sal_uLong nMirrFlags ) { mnMirrFlags = nMirrFlags; } - sal_uLong GetMirrorFlags() const { return mnMirrFlags; } + sal_uLong GetMirrorFlags() const { return mnMirrFlags; } void SetCrop( long nLeft_100TH_MM, long nTop_100TH_MM, long nRight_100TH_MM, long nBottom_100TH_MM ) { @@ -142,7 +142,7 @@ public: long GetBottomCrop() const { return mnBottomCrop; } void SetRotation( sal_uInt16 nRotate10 ) { mnRotate10 = nRotate10; } - sal_uInt16 GetRotation() const { return mnRotate10; } + sal_uInt16 GetRotation() const { return mnRotate10; } void SetLuminance( short nLuminancePercent ) { mnLumPercent = nLuminancePercent; } short GetLuminance() const { return mnLumPercent; } @@ -163,21 +163,21 @@ public: double GetGamma() const { return mfGamma; } void SetInvert( sal_Bool bInvert ) { mbInvert = bInvert; } - sal_Bool IsInvert() const { return mbInvert; } + sal_Bool IsInvert() const { return mbInvert; } void SetTransparency( sal_uInt8 cTransparency ) { mcTransparency = cTransparency; } - sal_uInt8 GetTransparency() const { return mcTransparency; } + sal_uInt8 GetTransparency() const { return mcTransparency; } - sal_Bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); } - sal_Bool IsMirrored() const { return( mnMirrFlags != 0UL ); } - sal_Bool IsCropped() const + sal_Bool IsSpecialDrawMode() const { return( meDrawMode != GRAPHICDRAWMODE_STANDARD ); } + sal_Bool IsMirrored() const { return( mnMirrFlags != 0UL ); } + sal_Bool IsCropped() const { return( mnLeftCrop != 0 || mnTopCrop != 0 || mnRightCrop != 0 || mnBottomCrop != 0 ); } - sal_Bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); } - sal_Bool IsTransparent() const { return( mcTransparency > 0 ); } - sal_Bool IsAdjusted() const + sal_Bool IsRotated() const { return( ( mnRotate10 % 3600 ) != 0 ); } + sal_Bool IsTransparent() const { return( mcTransparency > 0 ); } + sal_Bool IsAdjusted() const { return( mnLumPercent != 0 || mnContPercent != 0 || mnRPercent != 0 || mnGPercent != 0 || mnBPercent != 0 || mfGamma != 1.0 || mbInvert ); @@ -203,7 +203,7 @@ private: GraphicAttr maAttr; Size maPrefSize; MapMode maPrefMapMode; - sal_uLong mnSizeBytes; + sal_uLong mnSizeBytes; GraphicType meType; GraphicManager* mpMgr; String* mpLink; @@ -211,7 +211,7 @@ private: String* mpUserData; Timer* mpSwapOutTimer; GrfSimpleCacheObj* mpSimpleCache; - sal_uLong mnAnimationLoopCount; + sal_uLong mnAnimationLoopCount; void* mpDummy1; void* mpDummy2; sal_Bool mbAutoSwapped : 1; @@ -227,13 +227,21 @@ private: void SVT_DLLPRIVATE ImplConstruct(); void SVT_DLLPRIVATE ImplAssignGraphicData(); - void SVT_DLLPRIVATE ImplSetGraphicManager( const GraphicManager* pMgr, - const ByteString* pID = NULL, - const GraphicObject* pCopyObj = NULL ); + void SVT_DLLPRIVATE ImplSetGraphicManager( + const GraphicManager* pMgr, + const ByteString* pID = NULL, + const GraphicObject* pCopyObj = NULL + ); void SVT_DLLPRIVATE ImplAutoSwapIn(); - sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; } - sal_Bool SVT_DLLPRIVATE ImplGetCropParams( OutputDevice* pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr, - PolyPolygon& rClipPolyPoly, sal_Bool& bRectClipRegion ) const; + sal_Bool SVT_DLLPRIVATE ImplIsAutoSwapped() const { return mbAutoSwapped; } + sal_Bool SVT_DLLPRIVATE ImplGetCropParams( + OutputDevice* pOut, + Point& rPt, + Size& rSz, + const GraphicAttr* pAttr, + PolyPolygon& rClipPolyPoly, + sal_Bool& bRectClipRegion + ) const; /** Render a given number of tiles in an optimized way @@ -276,33 +284,60 @@ private: @return true, if everything was successfully rendered. */ - bool SVT_DLLPRIVATE ImplRenderTempTile( VirtualDevice& rVDev, int nExponent, - int nNumTilesX, int nNumTilesY, - const Size& rTileSizePixel, - const GraphicAttr* pAttr, sal_uLong nFlags ); + bool SVT_DLLPRIVATE ImplRenderTempTile( + VirtualDevice& rVDev, + int nExponent, + int nNumTilesX, + int nNumTilesY, + const Size& rTileSizePixel, + const GraphicAttr* pAttr, + sal_uLong nFlags + ); /// internally called by ImplRenderTempTile() - bool SVT_DLLPRIVATE ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent, int nMSBFactor, - int nNumOrigTilesX, int nNumOrigTilesY, - int nRemainderTilesX, int nRemainderTilesY, - const Size& rTileSizePixel, const GraphicAttr* pAttr, - sal_uLong nFlags, ImplTileInfo& rTileInfo ); - - bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSizePixel, - const Size& rOffset, const GraphicAttr* pAttr, sal_uLong nFlags, int nTileCacheSize1D ); - - bool SVT_DLLPRIVATE ImplDrawTiled( OutputDevice& rOut, const Point& rPos, - int nNumTilesX, int nNumTilesY, - const Size& rTileSize, - const GraphicAttr* pAttr, sal_uLong nFlags ); - - void SVT_DLLPRIVATE ImplTransformBitmap( BitmapEx& rBmpEx, - const GraphicAttr& rAttr, - const Size& rCropLeftTop, - const Size& rCropRightBottom, - const Rectangle& rCropRect, - const Size& rDstSize, - sal_Bool bEnlarge ) const; + bool SVT_DLLPRIVATE ImplRenderTileRecursive( + VirtualDevice& rVDev, + int nExponent, + int nMSBFactor, + int nNumOrigTilesX, + int nNumOrigTilesY, + int nRemainderTilesX, + int nRemainderTilesY, + const Size& rTileSizePixel, + const GraphicAttr* pAttr, + sal_uLong nFlags, + ImplTileInfo& rTileInfo + ); + + bool SVT_DLLPRIVATE ImplDrawTiled( + OutputDevice* pOut, + const Rectangle& rArea, + const Size& rSizePixel, + const Size& rOffset, + const GraphicAttr* pAttr, + sal_uLong nFlags, + int nTileCacheSize1D + ); + + bool SVT_DLLPRIVATE ImplDrawTiled( + OutputDevice& rOut, + const Point& rPos, + int nNumTilesX, + int nNumTilesY, + const Size& rTileSize, + const GraphicAttr* pAttr, + sal_uLong nFlags + ); + + void SVT_DLLPRIVATE ImplTransformBitmap( + BitmapEx& rBmpEx, + const GraphicAttr& rAttr, + const Size& rCropLeftTop, + const Size& rCropRightBottom, + const Rectangle& rCropRect, + const Size& rDstSize, + sal_Bool bEnlarge + ) const; DECL_LINK( ImplAutoSwapOutHdl, void* ); @@ -312,7 +347,7 @@ protected: virtual SvStream* GetSwapStream() const; // !!! to be removed - virtual sal_uLong GetReleaseFromCache() const; + virtual sal_uLong GetReleaseFromCache() const; virtual void Load( SvStream& ); virtual void Save( SvStream& ); @@ -330,14 +365,14 @@ public: ~GraphicObject(); GraphicObject& operator=( const GraphicObject& rCacheObj ); - sal_Bool operator==( const GraphicObject& rCacheObj ) const; - sal_Bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); } + sal_Bool operator==( const GraphicObject& rCacheObj ) const; + sal_Bool operator!=( const GraphicObject& rCacheObj ) const { return !( *this == rCacheObj ); } - sal_Bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); } + sal_Bool HasSwapStreamHdl() const { return( mpSwapStreamHdl != NULL && mpSwapStreamHdl->IsSet() ); } void SetSwapStreamHdl(); void SetSwapStreamHdl( const Link& rHdl, const sal_uLong nSwapOutTimeout = 0UL ); Link GetSwapStreamHdl() const; - sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); } + sal_uLong GetSwapOutTimeout() const { return( mpSwapOutTimer ? mpSwapOutTimer->GetTimeout() : 0 ); } void FireSwapInRequest(); void FireSwapOutRequest(); @@ -345,8 +380,13 @@ public: void SetGraphicManager( const GraphicManager& rMgr ); GraphicManager& GetGraphicManager() const { return *mpMgr; } - sal_Bool IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD) const; + sal_Bool IsCached( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const GraphicAttr* pAttr = NULL, + sal_uLong nFlags = GRFMGR_DRAW_STANDARD + ) const; void ReleaseFromCache(); const Graphic& GetGraphic() const; @@ -378,18 +418,22 @@ public: @return the readily transformed Graphic */ - Graphic GetTransformedGraphic( const Size& rDestSize, const MapMode& rDestMap, const GraphicAttr& rAttr ) const; + Graphic GetTransformedGraphic( + const Size& rDestSize, + const MapMode& rDestMap, + const GraphicAttr& rAttr + ) const; Graphic GetTransformedGraphic( const GraphicAttr* pAttr = NULL ) const; // TODO: Change to Impl void SetAttr( const GraphicAttr& rAttr ); const GraphicAttr& GetAttr() const { return maAttr; } - sal_Bool HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); } + sal_Bool HasLink() const { return( mpLink != NULL && mpLink->Len() > 0 ); } void SetLink(); void SetLink( const String& rLink ); String GetLink() const; - sal_Bool HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); } + sal_Bool HasUserData() const { return( mpUserData != NULL && mpUserData->Len() > 0 ); } void SetUserData(); void SetUserData( const String& rUserData ); String GetUserData() const; @@ -412,24 +456,32 @@ public: Link GetAnimationNotifyHdl() const { return maGraphic.GetAnimationNotifyHdl(); } void SetAnimationNotifyHdl( const Link& rLink ); - sal_Bool SwapOut(); - sal_Bool SwapOut( SvStream* pOStm ); - sal_Bool SwapIn(); - sal_Bool SwapIn( SvStream* pIStm ); + sal_Bool SwapOut(); + sal_Bool SwapOut( SvStream* pOStm ); + sal_Bool SwapIn(); + sal_Bool SwapIn( SvStream* pIStm ); - sal_Bool IsInSwapIn() const { return mbIsInSwapIn; } - sal_Bool IsInSwapOut() const { return mbIsInSwapOut; } - sal_Bool IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); } - sal_Bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); } + sal_Bool IsInSwapIn() const { return mbIsInSwapIn; } + sal_Bool IsInSwapOut() const { return mbIsInSwapOut; } + sal_Bool IsInSwap() const { return( mbIsInSwapOut || mbIsInSwapOut ); } + sal_Bool IsSwappedOut() const { return( mbAutoSwapped || maGraphic.IsSwapOut() ); } void SetSwapState(); - sal_Bool Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD ); - - sal_Bool DrawWithPDFHandling( OutputDevice& rOutDev, - const Point& rPt, const Size& rSz, - const GraphicAttr* pGrfAttr = NULL, - const sal_uLong nFlags = GRFMGR_DRAW_STANDARD ); + sal_Bool Draw( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const GraphicAttr* pAttr = NULL, + sal_uLong nFlags = GRFMGR_DRAW_STANDARD + ); + + sal_Bool DrawWithPDFHandling( + OutputDevice& rOutDev, + const Point& rPt, + const Size& rSz, + const GraphicAttr* pGrfAttr = NULL, + const sal_uLong nFlags = GRFMGR_DRAW_STANDARD + ); /** Draw the graphic repeatedly into the given output rectangle @@ -464,20 +516,32 @@ public: @return sal_True, if drawing completed successfully */ - sal_Bool DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize, - const Size& rOffset, const GraphicAttr* pAttr = NULL, - sal_uLong nFlags = GRFMGR_DRAW_STANDARD, int nTileCacheSize1D=128 ); - - sal_Bool StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz, long nExtraData = 0L, - const GraphicAttr* pAttr = NULL, sal_uLong nFlags = GRFMGR_DRAW_STANDARD, - OutputDevice* pFirstFrameOutDev = NULL ); + sal_Bool DrawTiled( + OutputDevice* pOut, + const Rectangle& rArea, + const Size& rSize, + const Size& rOffset, + const GraphicAttr* pAttr = NULL, + sal_uLong nFlags = GRFMGR_DRAW_STANDARD, + int nTileCacheSize1D=128 + ); + + sal_Bool StartAnimation( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + long nExtraData = 0L, + const GraphicAttr* pAttr = NULL, + sal_uLong nFlags = GRFMGR_DRAW_STANDARD, + OutputDevice* pFirstFrameOutDev = NULL + ); void StopAnimation( OutputDevice* pOut = NULL, long nExtraData = 0L ); friend SvStream& operator<<( SvStream& rOStm, const GraphicObject& rGraphicObj ); friend SvStream& operator>>( SvStream& rIStm, GraphicObject& rGraphicObj ); - static GraphicObject CreateGraphicObjectFromURL( const ::rtl::OUString &rURL ); + static GraphicObject CreateGraphicObjectFromURL( const ::rtl::OUString &rURL ); }; // ------------------ @@ -491,84 +555,156 @@ class SVT_DLLPUBLIC GraphicManager private: - List maObjList; - GraphicCache* mpCache; - - GraphicManager( const GraphicManager& ) {} - GraphicManager& operator=( const GraphicManager& ) { return *this; } - - sal_Bool SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt, - const Size& rSz, GraphicObject& rObj, - const GraphicAttr& rAttr, - const sal_uLong nFlags, sal_Bool& rCached ); - - sal_Bool SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const BitmapEx& rBmpEx, const GraphicAttr& rAttr, - const sal_uLong nFlags, BitmapEx* pBmpEx = NULL ); - sal_Bool SVT_DLLPRIVATE ImplCreateOutput( OutputDevice* pOut, - const Point& rPt, const Size& rSz, - const GDIMetaFile& rMtf, const GraphicAttr& rAttr, - const sal_uLong nFlags, GDIMetaFile& rOutMtf, BitmapEx& rOutBmpEx ); - - sal_Bool SVT_DLLPRIVATE ImplCreateScaled( const BitmapEx& rBmpEx, - long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, - long nStartX, long nEndX, long nStartY, long nEndY, - BitmapEx& rOutBmpEx ); - - sal_Bool SVT_DLLPRIVATE ImplCreateRotatedScaled( const BitmapEx& rBmpEx, - sal_uInt16 nRot10, const Size& rOutSzPix, const Size& rUntSzPix, - long* pMapIX, long* pMapFX, long* pMapIY, long* pMapFY, - long nStartX, long nEndX, long nStartY, long nEndY, - BitmapEx& rOutBmpEx ); - - static void SVT_DLLPRIVATE ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ); - static void SVT_DLLPRIVATE ImplAdjust( GDIMetaFile& rMtf, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ); - static void SVT_DLLPRIVATE ImplAdjust( Animation& rAnimation, const GraphicAttr& rAttr, sal_uLong nAdjustmentFlags ); - - static void SVT_DLLPRIVATE ImplDraw( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GDIMetaFile& rMtf, const GraphicAttr& rAttr ); + List maObjList; + GraphicCache* mpCache; + + GraphicManager( const GraphicManager& ) {} + GraphicManager& operator=( const GraphicManager& ) { return *this; } + + sal_Bool SVT_DLLPRIVATE ImplDraw( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + GraphicObject& rObj, + const GraphicAttr& rAttr, + const sal_uLong nFlags, + sal_Bool& rCached + ); + + sal_Bool SVT_DLLPRIVATE ImplCreateOutput( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const BitmapEx& rBmpEx, + const GraphicAttr& rAttr, + const sal_uLong nFlags, + BitmapEx* pBmpEx = NULL + ); + sal_Bool SVT_DLLPRIVATE ImplCreateOutput( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const GDIMetaFile& rMtf, + const GraphicAttr& rAttr, + const sal_uLong nFlags, + GDIMetaFile& rOutMtf, + BitmapEx& rOutBmpEx + ); + + sal_Bool SVT_DLLPRIVATE ImplCreateScaled( + const BitmapEx& rBmpEx, + long* pMapIX, + long* pMapFX, + long* pMapIY, + long* pMapFY, + long nStartX, + long nEndX, + long nStartY, + long nEndY, + BitmapEx& rOutBmpEx + ); + + sal_Bool SVT_DLLPRIVATE ImplCreateRotatedScaled( + const BitmapEx& rBmpEx, + sal_uInt16 nRot10, + const Size& rOutSzPix, + const Size& rUntSzPix, + long* pMapIX, + long* pMapFX, + long* pMapIY, + long* pMapFY, + long nStartX, + long nEndX, + long nStartY, + long nEndY, + BitmapEx& rOutBmpEx + ); + + static void SVT_DLLPRIVATE ImplAdjust( + BitmapEx& rBmpEx, + const GraphicAttr& rAttr, + sal_uLong nAdjustmentFlags + ); + static void SVT_DLLPRIVATE ImplAdjust( + GDIMetaFile& rMtf, + const GraphicAttr& rAttr, + sal_uLong nAdjustmentFlags + ); + static void SVT_DLLPRIVATE ImplAdjust( + Animation& rAnimation, + const GraphicAttr& rAttr, + sal_uLong nAdjustmentFlags + ); + + static void SVT_DLLPRIVATE ImplDraw( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const GDIMetaFile& rMtf, + const GraphicAttr& rAttr + ); // Only used by GraphicObject's Ctor's and Dtor's - void SVT_DLLPRIVATE ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute, - const ByteString* pID = NULL, - const GraphicObject* pCopyObj = NULL ); - void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj ); - inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); } + void SVT_DLLPRIVATE ImplRegisterObj( + const GraphicObject& rObj, + Graphic& rSubstitute, + const ByteString* pID = NULL, + const GraphicObject* pCopyObj = NULL + ); + void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj ); + inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); } // Only used in swap case by GraphicObject - void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj ); - sal_Bool SVT_DLLPRIVATE ImplFillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); - void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ); + void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj ); + sal_Bool SVT_DLLPRIVATE ImplFillSwappedGraphicObject( + const GraphicObject& rObj, + Graphic& rSubstitute + ); + void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedIn( const GraphicObject& rObj ); - ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; + ByteString SVT_DLLPRIVATE ImplGetUniqueID( const GraphicObject& rObj ) const; public: - GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL ); - ~GraphicManager(); + GraphicManager( sal_uLong nCacheSize = 10000000UL, sal_uLong nMaxObjCacheSize = 2400000UL ); + ~GraphicManager(); - void SetMaxCacheSize( sal_uLong nNewCacheSize ); + void SetMaxCacheSize( sal_uLong nNewCacheSize ); sal_uLong GetMaxCacheSize() const; - void SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, sal_Bool bDestroyGreaterCached = sal_False ); + void SetMaxObjCacheSize( + sal_uLong nNewMaxObjSize, + sal_Bool bDestroyGreaterCached = sal_False + ); sal_uLong GetMaxObjCacheSize() const; sal_uLong GetUsedCacheSize() const; sal_uLong GetFreeCacheSize() const; - void SetCacheTimeout( sal_uLong nTimeoutSeconds ); + void SetCacheTimeout( sal_uLong nTimeoutSeconds ); sal_uLong GetCacheTimeout() const; - void ClearCache(); - - void ReleaseFromCache( const GraphicObject& rObj ); - - sal_Bool IsInCache( OutputDevice* pOut, const Point& rPt, const Size& rSz, - const GraphicObject& rObj, const GraphicAttr& rAttr ) const; - - sal_Bool DrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz, - GraphicObject& rObj, const GraphicAttr& rAttr, - const sal_uLong nFlags, sal_Bool& rCached ); + void ClearCache(); + + void ReleaseFromCache( const GraphicObject& rObj ); + + sal_Bool IsInCache( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + const GraphicObject& rObj, + const GraphicAttr& rAttr + ) const; + + sal_Bool DrawObj( + OutputDevice* pOut, + const Point& rPt, + const Size& rSz, + GraphicObject& rObj, + const GraphicAttr& rAttr, + const sal_uLong nFlags, + sal_Bool& rCached + ); }; #endif // _GRFMGR_HXX -- cgit v1.2.3 From 44fb00ef676e12d1be3cc552c35efde6ea1fca71 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 13 Jul 2011 20:42:27 +0300 Subject: Bin dead MacOSX X11 code --- vcl/source/app/svmainhook.cxx | 78 +------------------------------------------ 1 file changed, 1 insertion(+), 77 deletions(-) diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx index dd446125a7aa..47c3854a2987 100644 --- a/vcl/source/app/svmainhook.cxx +++ b/vcl/source/app/svmainhook.cxx @@ -31,89 +31,13 @@ #include #ifndef MACOSX +// MacOSX implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx sal_Bool ImplSVMainHook( int * ) { return sal_False; // indicate that ImplSVMainHook is not implemented } -#else -// MACOSX cocoa implementation of ImplSVMainHook is in aqua/source/app/salinst.cxx -#ifndef QUARTZ // MACOSX (X11) needs the CFRunLoop() -#include -#include -#include -#include -#include - -extern sal_Bool ImplSVMain(); - -// ============================================================================ - - -static void SourceContextCallBack( void *pInfo ) -{ -} - -struct ThreadContext -{ - int* pRet; - CFRunLoopRef* pRunLoopRef; -}; - -static void RunSVMain(void *pData) -{ - ThreadContext* tcx = reinterpret_cast(pData); - - // busy waiting (ok in this case) until the run loop is - // running - while (!CFRunLoopIsWaiting(*tcx->pRunLoopRef)) - usleep(100); - - *tcx->pRet = ImplSVMain(); - - // Force exit since some JVMs won't shutdown when only exit() is invoked - _exit( 0 ); -} - -sal_Bool ImplSVMainHook( int *pnInit ) -{ - // Mac OS X requires that any Cocoa code have a CFRunLoop started in the - // primordial thread. Since all of the AWT classes in Java 1.4 and higher - // are written in Cocoa, we need to start the CFRunLoop here and run - // ImplSVMain() in a secondary thread. - // See http://developer.apple.com/samplecode/simpleJavaLauncher/listing3.html - // for further details and an example - - CFRunLoopRef runLoopRef = CFRunLoopGetCurrent(); - ThreadContext tcx; - tcx.pRet = pnInit; // the return value - tcx.pRunLoopRef = &runLoopRef; - oslThread hThreadID = osl_createThread(RunSVMain, &tcx); - - // Start the CFRunLoop - CFRunLoopSourceContext aSourceContext; - aSourceContext.version = 0; - aSourceContext.info = NULL; - aSourceContext.retain = NULL; - aSourceContext.release = NULL; - aSourceContext.copyDescription = NULL; - aSourceContext.equal = NULL; - aSourceContext.hash = NULL; - aSourceContext.schedule = NULL; - aSourceContext.cancel = NULL; - aSourceContext.perform = &SourceContextCallBack; - CFRunLoopSourceRef aSourceRef = CFRunLoopSourceCreate(NULL, 0, &aSourceContext); - CFRunLoopAddSource(runLoopRef, aSourceRef, kCFRunLoopCommonModes); - CFRunLoopRun(); - - osl_joinWithThread( hThreadID ); - osl_destroyThread( hThreadID ); - - return sal_True; // indicate that ImplSVMainHook is implemented -} - -#endif // MACOSX #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ecf04369ec7b2d08f2553cc3207aa2640972c766 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 13 Jul 2011 21:09:43 +0300 Subject: Add a comment about the VCL_NSApplication magic --- vcl/aqua/source/app/vclnsapp.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcl/aqua/source/app/vclnsapp.mm b/vcl/aqua/source/app/vclnsapp.mm index 5206c17dd2d7..e103a6b3e387 100644 --- a/vcl/aqua/source/app/vclnsapp.mm +++ b/vcl/aqua/source/app/vclnsapp.mm @@ -58,6 +58,10 @@ } @end +// If you wonder how this VCL_NSApplication stuff works, one thing you +// might have missed is that the NSPrincipalClass property in +// desktop/macosx/Info.plist has the value VCL_NSApplication. + @implementation VCL_NSApplication -(void)sendEvent:(NSEvent*)pEvent { -- cgit v1.2.3 From 3e7cc992732fa58271db42ce3c82dc6a07c33223 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 13 Jul 2011 19:59:10 -0700 Subject: Replace List with std::vector< GraphicObject* > --- svtools/inc/svtools/grfmgr.hxx | 8 +++++--- svtools/source/graphic/grfmgr2.cxx | 14 ++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx index d48d82851851..f7560058c458 100644 --- a/svtools/inc/svtools/grfmgr.hxx +++ b/svtools/inc/svtools/grfmgr.hxx @@ -548,6 +548,8 @@ public: // - GraphicManager - // ------------------ +typedef ::std::vector< GraphicObject* > GraphicObjectList_impl; + class SVT_DLLPUBLIC GraphicManager { friend class GraphicObject; @@ -555,8 +557,8 @@ class SVT_DLLPUBLIC GraphicManager private: - List maObjList; - GraphicCache* mpCache; + GraphicObjectList_impl maObjList; + GraphicCache* mpCache; GraphicManager( const GraphicManager& ) {} GraphicManager& operator=( const GraphicManager& ) { return *this; } @@ -652,7 +654,7 @@ private: const GraphicObject* pCopyObj = NULL ); void SVT_DLLPRIVATE ImplUnregisterObj( const GraphicObject& rObj ); - inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return( maObjList.Count() > 0UL ); } + inline sal_Bool SVT_DLLPRIVATE ImplHasObjects() const { return !maObjList.empty(); } // Only used in swap case by GraphicObject void SVT_DLLPRIVATE ImplGraphicObjectWasSwappedOut( const GraphicObject& rObj ); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index fbd00913607b..b5d7b2bcda15 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -122,8 +122,8 @@ GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize GraphicManager::~GraphicManager() { - for( void* pObj = maObjList.First(); pObj; pObj = maObjList.Next() ) - ( (GraphicObject*) pObj )->GraphicManagerDestroyed(); + for( size_t i = 0, n = maObjList.size(); i < n; ++i ) + maObjList[ i ]->GraphicManagerDestroyed(); delete mpCache; } @@ -271,7 +271,7 @@ sal_Bool GraphicManager::DrawObj( OutputDevice* pOut, const Point& rPt, const Si void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubstitute, const ByteString* pID, const GraphicObject* pCopyObj ) { - maObjList.Insert( (void*) &rObj, LIST_APPEND ); + maObjList.push_back( (GraphicObject*)&rObj ); mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj ); } @@ -280,7 +280,13 @@ void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& rSubst void GraphicManager::ImplUnregisterObj( const GraphicObject& rObj ) { mpCache->ReleaseGraphicObject( rObj ); - maObjList.Remove( (void*) &rObj ); + for( GraphicObjectList_impl::iterator it = maObjList.begin(); it < maObjList.end(); ++it ) + { + if ( *it == &rObj ) { + maObjList.erase( it ); + break; + } + } } // ----------------------------------------------------------------------------- -- cgit v1.2.3 From 114508f9d89a361c47d1fbdeef1bc786a08fb11c Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 13 Jul 2011 21:13:00 -0700 Subject: Replace List with std::vector< GraphicObject* > I also replaced sal_Bool with bool. It's a private class so this is safe; only salBool GraphicCache::FillSwappedGraphicObject() leaks to bool to the world. --- svtools/source/graphic/grfcache.cxx | 87 +++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 47de44d7695c..4251c1ba7fe2 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -162,15 +162,16 @@ class GraphicCacheEntry { private: - List maGraphicObjectList; + GraphicObjectList_impl maGraphicObjectList; + GraphicID maID; GfxLink maGfxLink; BitmapEx* mpBmpEx; GDIMetaFile* mpMtf; Animation* mpAnimation; - sal_Bool mbSwappedAll; + bool mbSwappedAll; - sal_Bool ImplInit( const GraphicObject& rObj ); + bool ImplInit( const GraphicObject& rObj ); void ImplFillSubstitute( Graphic& rSubstitute ); public: @@ -181,13 +182,13 @@ public: const GraphicID& GetID() const { return maID; } void AddGraphicObjectReference( const GraphicObject& rObj, Graphic& rSubstitute ); - sal_Bool ReleaseGraphicObjectReference( const GraphicObject& rObj ); - sal_uLong GetGraphicObjectReferenceCount() { return maGraphicObjectList.Count(); } - sal_Bool HasGraphicObjectReference( const GraphicObject& rObj ); + bool ReleaseGraphicObjectReference( const GraphicObject& rObj ); + size_t GetGraphicObjectReferenceCount() { return maGraphicObjectList.size(); } + bool HasGraphicObjectReference( const GraphicObject& rObj ); void TryToSwapIn(); void GraphicObjectWasSwappedOut( const GraphicObject& rObj ); - sal_Bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); + bool FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ); void GraphicObjectWasSwappedIn( const GraphicObject& rObj ); }; @@ -200,14 +201,17 @@ GraphicCacheEntry::GraphicCacheEntry( const GraphicObject& rObj ) : mpAnimation ( NULL ), mbSwappedAll ( !ImplInit( rObj ) ) { - maGraphicObjectList.Insert( (void*) &rObj, LIST_APPEND ); + maGraphicObjectList.push_back( (GraphicObject*)&rObj ); } // ----------------------------------------------------------------------------- GraphicCacheEntry::~GraphicCacheEntry() { - DBG_ASSERT( !maGraphicObjectList.Count(), "GraphicCacheEntry::~GraphicCacheEntry(): Not all GraphicObjects are removed from this entry" ); + DBG_ASSERT( + maGraphicObjectList.empty(), + "GraphicCacheEntry::~GraphicCacheEntry(): Not all GraphicObjects are removed from this entry" + ); delete mpBmpEx; delete mpMtf; @@ -216,9 +220,9 @@ GraphicCacheEntry::~GraphicCacheEntry() // ----------------------------------------------------------------------------- -sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) +bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) { - sal_Bool bRet; + bool bRet = false; if( !rObj.IsSwappedOut() ) { @@ -260,10 +264,8 @@ sal_Bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) else maGfxLink = GfxLink(); - bRet = sal_True; + bRet = true; } - else - bRet = sal_False; return bRet; } @@ -277,9 +279,9 @@ void GraphicCacheEntry::ImplFillSubstitute( Graphic& rSubstitute ) const MapMode aPrefMapMode( rSubstitute.GetPrefMapMode() ); const Link aAnimationNotifyHdl( rSubstitute.GetAnimationNotifyHdl() ); const String aDocFileName( rSubstitute.GetDocFileName() ); - const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos(); + const sal_uLong nDocFilePos = rSubstitute.GetDocFilePos(); const GraphicType eOldType = rSubstitute.GetType(); - const sal_Bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); + const bool bDefaultType = ( rSubstitute.GetType() == GRAPHIC_DEFAULT ); if( rSubstitute.IsLink() && ( GFX_LINK_TYPE_NONE == maGfxLink.GetType() ) ) maGfxLink = rSubstitute.GetLink(); @@ -316,21 +318,24 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr mbSwappedAll = !ImplInit( rObj ); ImplFillSubstitute( rSubstitute ); - maGraphicObjectList.Insert( (void*) &rObj, LIST_APPEND ); + maGraphicObjectList.push_back( (GraphicObject*) &rObj ); } // ----------------------------------------------------------------------------- -sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) +bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) { - sal_Bool bRet = sal_False; - - for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) - { - if( &rObj == (GraphicObject*) pObj ) + bool bRet = false; + + for( + GraphicObjectList_impl::iterator it = maGraphicObjectList.begin(); + ( it < maGraphicObjectList.end() ) && !bRet; + ++it + ) { + if( &rObj == *it ) { - maGraphicObjectList.Remove( pObj ); - bRet = sal_True; + maGraphicObjectList.erase( it ); + bRet = true; } } @@ -339,13 +344,13 @@ sal_Bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& // ----------------------------------------------------------------------------- -sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) +bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj ) { - sal_Bool bRet = sal_False; + bool bRet = false; - for( void* pObj = maGraphicObjectList.First(); !bRet && pObj; pObj = maGraphicObjectList.Next() ) - if( &rObj == (GraphicObject*) pObj ) - bRet = sal_True; + for( size_t i = 0, n = maGraphicObjectList.size(); ( i < n ) && !bRet; ++i ) + if( &rObj == maGraphicObjectList[ i ] ) + bRet = true; return bRet; } @@ -354,19 +359,19 @@ sal_Bool GraphicCacheEntry::HasGraphicObjectReference( const GraphicObject& rObj void GraphicCacheEntry::TryToSwapIn() { - if( mbSwappedAll && maGraphicObjectList.Count() ) - ( (GraphicObject*) maGraphicObjectList.First() )->FireSwapInRequest(); + if( mbSwappedAll && !maGraphicObjectList.empty() ) + maGraphicObjectList.front()->FireSwapInRequest(); } // ----------------------------------------------------------------------------- void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*/ ) { - mbSwappedAll = sal_True; + mbSwappedAll = true; - for( void* pObj = maGraphicObjectList.First(); mbSwappedAll && pObj; pObj = maGraphicObjectList.Next() ) - if( !( (GraphicObject*) pObj )->IsSwappedOut() ) - mbSwappedAll = sal_False; + for( size_t i = 0, n = maGraphicObjectList.size(); ( i < n ) && mbSwappedAll; ++i ) + if( !maGraphicObjectList[ i ]->IsSwappedOut() ) + mbSwappedAll = false; if( mbSwappedAll ) { @@ -378,17 +383,15 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj* // ----------------------------------------------------------------------------- -sal_Bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) +bool GraphicCacheEntry::FillSwappedGraphicObject( const GraphicObject& rObj, Graphic& rSubstitute ) { - sal_Bool bRet; + bool bRet = false; if( !mbSwappedAll && rObj.IsSwappedOut() ) { ImplFillSubstitute( rSubstitute ); - bRet = sal_True; + bRet = true; } - else - bRet = sal_False; return bRet; } @@ -676,7 +679,7 @@ void GraphicCache::ReleaseGraphicObject( const GraphicObject& rObj ) { // Release cached object GraphicCacheEntry* pEntry = (GraphicCacheEntry*) maGraphicCache.First(); - sal_Bool bRemoved = sal_False; + bool bRemoved = false; while( !bRemoved && pEntry ) { -- cgit v1.2.3 From 0083b35e75455ac69eedd4650211ff28a3311a60 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:14:09 +0200 Subject: callcatcher: remove unused basegfx::B3DHomMatrix::Foo --- basegfx/inc/basegfx/matrix/b3dhommatrix.hxx | 13 ------- basegfx/source/matrix/b3dhommatrix.cxx | 54 ----------------------------- 2 files changed, 67 deletions(-) diff --git a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx index f3face91ee21..27a94d374256 100644 --- a/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx +++ b/basegfx/inc/basegfx/matrix/b3dhommatrix.hxx @@ -52,9 +52,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); @@ -66,20 +63,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(); @@ -94,8 +83,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/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(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); -- cgit v1.2.3 From b695e520883657f492184235cc6fabc59c935b29 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:19:27 +0200 Subject: callcatcher: remove unused basegfx::B3DHomPoint::implHomogenize --- basegfx/inc/basegfx/point/b3dhompoint.hxx | 408 ------------------------------ basegfx/prj/d.lst | 1 - basegfx/source/point/b3dhompoint.cxx | 47 ---- basegfx/source/point/makefile.mk | 1 - basegfx/test/basegfx3d.cxx | 28 -- 5 files changed, 485 deletions(-) delete mode 100644 basegfx/inc/basegfx/point/b3dhompoint.hxx delete mode 100644 basegfx/source/point/b3dhompoint.cxx diff --git a/basegfx/inc/basegfx/point/b3dhompoint.hxx b/basegfx/inc/basegfx/point/b3dhompoint.hxx deleted file mode 100644 index 763997620bd0..000000000000 --- a/basegfx/inc/basegfx/point/b3dhompoint.hxx +++ /dev/null @@ -1,408 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _BGFX_POINT_B3DHOMPOINT_HXX -#define _BGFX_POINT_B3DHOMPOINT_HXX - -#include - -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 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/prj/d.lst b/basegfx/prj/d.lst index a654a17c1249..4c710155cbf0 100644 --- a/basegfx/prj/d.lst +++ b/basegfx/prj/d.lst @@ -20,7 +20,6 @@ mkdir: %_DEST%\inc\basegfx\point ..\inc\basegfx\point\b2ipoint.hxx %_DEST%\inc\basegfx\point\b2ipoint.hxx ..\inc\basegfx\point\b3ipoint.hxx %_DEST%\inc\basegfx\point\b3ipoint.hxx ..\inc\basegfx\point\b2dhompoint.hxx %_DEST%\inc\basegfx\point\b2dhompoint.hxx -..\inc\basegfx\point\b3dhompoint.hxx %_DEST%\inc\basegfx\point\b3dhompoint.hxx mkdir: %_DEST%\inc\basegfx\range ..\inc\basegfx\range\rangeexpander.hxx %_DEST%\inc\basegfx\range\rangeexpander.hxx diff --git a/basegfx/source/point/b3dhompoint.cxx b/basegfx/source/point/b3dhompoint.cxx deleted file mode 100644 index 3a6c33a50262..000000000000 --- a/basegfx/source/point/b3dhompoint.cxx +++ /dev/null @@ -1,47 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_basegfx.hxx" -#include - -namespace basegfx -{ - void B3DHomPoint::implHomogenize() - { - const double fFactor(1.0 / mfW); - maTuple.setX(maTuple.getX() * fFactor); - maTuple.setY(maTuple.getY() * fFactor); - maTuple.setZ(maTuple.getZ() * fFactor); - mfW = 1.0; - } -} // end of namespace basegfx - -// eof - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/basegfx/source/point/makefile.mk b/basegfx/source/point/makefile.mk index 1c03ab1bf42e..09c3457dab1c 100644 --- a/basegfx/source/point/makefile.mk +++ b/basegfx/source/point/makefile.mk @@ -39,7 +39,6 @@ SLOFILES= \ $(SLO)$/b2dpoint.obj \ $(SLO)$/b2dhompoint.obj \ $(SLO)$/b3dpoint.obj \ - $(SLO)$/b3dhompoint.obj \ $(SLO)$/b2ipoint.obj \ $(SLO)$/b3ipoint.obj 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); -- cgit v1.2.3 From f0f8be40da13833cc518711251fcd990ea91e032 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:57:44 +0200 Subject: callcatcher: remove unused SystemWindow::Foo --- vcl/inc/vcl/syswin.hxx | 4 ---- vcl/source/window/syswin.cxx | 49 -------------------------------------------- 2 files changed, 53 deletions(-) diff --git a/vcl/inc/vcl/syswin.hxx b/vcl/inc/vcl/syswin.hxx index c8062e3dc352..19cce93d44dd 100644 --- a/vcl/inc/vcl/syswin.hxx +++ b/vcl/inc/vcl/syswin.hxx @@ -204,10 +204,6 @@ public: // for systems like MacOSX which can display the URL a document is loaded from // separately from the window title void SetRepresentedURL( const rtl::OUString& ); - const rtl::OUString& GetRepresentedURL() const; - - void SetZLevel( sal_uInt8 nLevel ); - sal_uInt8 GetZLevel() const; void EnableSaveBackground( sal_Bool bSave = sal_True ); sal_Bool IsSaveBackgroundEnabled() const; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 51258f73e77f..77cfb7044740 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -244,36 +244,6 @@ void SystemWindow::Resizing( Size& ) // ----------------------------------------------------------------------- -void SystemWindow::SetZLevel( sal_uInt8 nLevel ) -{ - Window* pWindow = this; - while ( pWindow->mpWindowImpl->mpBorderWindow ) - pWindow = pWindow->mpWindowImpl->mpBorderWindow; - if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame ) - { - sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; - pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel; - // Wenn der neue Level groesser als der alte ist, schieben - // wir das Fenster nach hinten - if ( !IsReallyVisible() && (nLevel > nOldLevel) && pWindow->mpWindowImpl->mpNext ) - { - // Fenster aus der Liste entfernen - if ( pWindow->mpWindowImpl->mpPrev ) - pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow->mpWindowImpl->mpNext; - else - pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap = pWindow->mpWindowImpl->mpNext; - pWindow->mpWindowImpl->mpNext->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpPrev; - pWindow->mpWindowImpl->mpNext = NULL; - // und Fenster wieder in die Liste am Ende eintragen - pWindow->mpWindowImpl->mpPrev = pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap; - pWindow->mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = pWindow; - pWindow->mpWindowImpl->mpPrev->mpWindowImpl->mpNext = pWindow; - } - } -} - -// ----------------------------------------------------------------------- - void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL ) { bool bChanged = (i_rURL != mpImplData->maRepresentedURL); @@ -288,12 +258,6 @@ void SystemWindow::SetRepresentedURL( const rtl::OUString& i_rURL ) pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL ); } } -// ----------------------------------------------------------------------- - -const rtl::OUString& SystemWindow::GetRepresentedURL() const -{ - return mpImplData->maRepresentedURL; -} // ----------------------------------------------------------------------- @@ -317,19 +281,6 @@ void SystemWindow::SetIcon( sal_uInt16 nIcon ) // ----------------------------------------------------------------------- -sal_uInt8 SystemWindow::GetZLevel() const -{ - const Window* pWindow = this; - while ( pWindow->mpWindowImpl->mpBorderWindow ) - pWindow = pWindow->mpWindowImpl->mpBorderWindow; - if ( pWindow->mpWindowImpl->mpOverlapData ) - return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void SystemWindow::EnableSaveBackground( sal_Bool bSave ) { if( ImplGetSVData()->maWinData.mbNoSaveBackground ) -- cgit v1.2.3 From e41f1df72991619a9a4b5f0015397d36c2353ee7 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 12:59:11 +0200 Subject: callcatcher: remove unused SystemChildWindow::IsEraseBackgroundEnabled --- vcl/inc/vcl/syschild.hxx | 1 - vcl/source/window/syschild.cxx | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx index 275e41312f17..3a55d0b45a2c 100644 --- a/vcl/inc/vcl/syschild.hxx +++ b/vcl/inc/vcl/syschild.hxx @@ -63,7 +63,6 @@ public: // per default systemchildwindows erase their background for better plugin support // however, this might not always be required void EnableEraseBackground( sal_Bool bEnable = sal_True ); - sal_Bool IsEraseBackgroundEnabled(); void SetForwardKey( sal_Bool bEnable ); // return the platform specific handle/id of this window; // in case the flag bUseJava is set, a java compatible overlay window diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 341d7f3bfff8..f72decce183e 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -198,16 +198,6 @@ void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable ) // ----------------------------------------------------------------------- -sal_Bool SystemChildWindow::IsEraseBackgroundEnabled() -{ - if ( mpWindowImpl->mpSysObj ) - return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled(); - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void SystemChildWindow::ImplTestJavaException( void* pEnv ) { #ifdef SOLAR_JAVA -- cgit v1.2.3 From 91ef8382196e2664678bfb96513261eb0303d375 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:07:19 +0200 Subject: callcatcher: remove unused TabBar::Foo --- svtools/inc/svtools/tabbar.hxx | 12 --- svtools/source/control/tabbar.cxx | 167 -------------------------------------- 2 files changed, 179 deletions(-) diff --git a/svtools/inc/svtools/tabbar.hxx b/svtools/inc/svtools/tabbar.hxx index a8bdabdb6432..1478b0e690dd 100644 --- a/svtools/inc/svtools/tabbar.hxx +++ b/svtools/inc/svtools/tabbar.hxx @@ -450,7 +450,6 @@ public: void Clear(); - void EnablePage( sal_uInt16 nPageId, sal_Bool bEnable = sal_True ); sal_Bool IsPageEnabled( sal_uInt16 nPageId ) const; void SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits = 0 ); @@ -472,10 +471,6 @@ public: void MakeVisible( sal_uInt16 nPageId ); void SelectPage( sal_uInt16 nPageId, sal_Bool bSelect = sal_True ); - void SelectPageRange( sal_Bool bSelect = sal_False, - sal_uInt16 nStartPos = 0, - sal_uInt16 nEndPos = TabBar::APPEND ); - sal_uInt16 GetSelectPage( sal_uInt16 nSelIndex = 0 ) const; sal_uInt16 GetSelectPageCount() const; sal_Bool IsPageSelected( sal_uInt16 nPageId ) const; @@ -519,24 +514,17 @@ public: void EndSwitchPage(); sal_Bool IsInSwitching() { return mbInSwitching; } - void SetSelectColor(); - void SetSelectColor( const Color& rColor ); const Color& GetSelectColor() const { return maSelColor; } sal_Bool IsSelectColor() const { return mbSelColor; } - void SetSelectTextColor(); - void SetSelectTextColor( const Color& rColor ); const Color& GetSelectTextColor() const { return maSelTextColor; } sal_Bool IsSelectTextColor() const { return mbSelTextColor; } void SetPageText( sal_uInt16 nPageId, const XubString& rText ); XubString GetPageText( sal_uInt16 nPageId ) const; - void SetHelpText( sal_uInt16 nPageId, const XubString& rText ); XubString GetHelpText( sal_uInt16 nPageId ) const; - void SetHelpId( sal_uInt16 nPageId, const rtl::OString& nHelpId ); rtl::OString GetHelpId( sal_uInt16 nPageId ) const; long GetSplitSize() const { return mnSplitSize; } - long GetMinSize() const; void SetHelpText( const XubString& rText ) { Window::SetHelpText( rText ); } diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index bc0ee75a845b..49309fd4f001 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1978,29 +1978,6 @@ void TabBar::Clear() // ----------------------------------------------------------------------- -void TabBar::EnablePage( sal_uInt16 nPageId, sal_Bool bEnable ) -{ - sal_uInt16 nPos = GetPagePos( nPageId ); - - if ( nPos != PAGE_NOT_FOUND ) - { - ImplTabBarItem* pItem = (*mpItemList)[ nPos ]; - - if ( pItem->mbEnable != bEnable ) - { - pItem->mbEnable = bEnable; - - // Leiste neu ausgeben - if ( IsReallyVisible() && IsUpdateMode() ) - Invalidate( pItem->maRect ); - - CallEventListeners( bEnable ? VCLEVENT_TABBAR_PAGEENABLED : VCLEVENT_TABBAR_PAGEDISABLED, reinterpret_cast(sal::static_int_cast(nPageId)) ); - } - } -} - -// ----------------------------------------------------------------------- - sal_Bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); @@ -2302,48 +2279,6 @@ void TabBar::SelectPage( sal_uInt16 nPageId, sal_Bool bSelect ) // ----------------------------------------------------------------------- -void TabBar::SelectPageRange( sal_Bool bSelect, sal_uInt16 nStartPos, sal_uInt16 nEndPos ) -{ - Rectangle aPaintRect; - sal_uInt16 nPos = nStartPos; - ImplTabBarItem* pItem = seek( nPos ); - while ( pItem && (nPos <= nEndPos) ) - { - if ( (pItem->mbSelect != bSelect) && (pItem->mnId != mnCurPageId) ) - { - pItem->mbSelect = bSelect; - aPaintRect.Union( pItem->maRect ); - } - - nPos++; - pItem = next(); - } - - // Leiste neu ausgeben - if ( IsReallyVisible() && IsUpdateMode() && !aPaintRect.IsEmpty() ) - Invalidate( aPaintRect ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 TabBar::GetSelectPage( sal_uInt16 nSelIndex ) const -{ - sal_uInt16 nSelected = 0; - for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) - { - ImplTabBarItem* pItem = (*mpItemList)[ i ]; - if ( pItem->mbSelect ) - nSelected++; - - if ( nSelected == nSelIndex ) - return pItem->mnId; - } - - return 0; -} - -// ----------------------------------------------------------------------- - sal_uInt16 TabBar::GetSelectPageCount() const { sal_uInt16 nSelected = 0; @@ -2519,78 +2454,6 @@ void TabBar::SetMaxPageWidth( long nMaxWidth ) // ----------------------------------------------------------------------- -void TabBar::SetSelectColor() -{ - if ( mbSelColor ) - { - maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = sal_False; - Invalidate(); - } -} - -// ----------------------------------------------------------------------- - -void TabBar::SetSelectColor( const Color& rColor ) -{ - if ( rColor.GetTransparency() ) - { - if ( mbSelColor ) - { - maSelColor = Color( COL_TRANSPARENT ); - mbSelColor = sal_False; - Invalidate(); - } - } - else - { - if ( maSelColor != rColor ) - { - maSelColor = rColor; - mbSelColor = sal_True; - Invalidate(); - } - } -} - -// ----------------------------------------------------------------------- - -void TabBar::SetSelectTextColor() -{ - if ( mbSelTextColor ) - { - maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = sal_False; - Invalidate(); - } -} - -// ----------------------------------------------------------------------- - -void TabBar::SetSelectTextColor( const Color& rColor ) -{ - if ( rColor.GetTransparency() ) - { - if ( mbSelTextColor ) - { - maSelTextColor = Color( COL_TRANSPARENT ); - mbSelTextColor = sal_False; - Invalidate(); - } - } - else - { - if ( maSelTextColor != rColor ) - { - maSelTextColor = rColor; - mbSelTextColor = sal_True; - Invalidate(); - } - } -} - -// ----------------------------------------------------------------------- - void TabBar::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { sal_uInt16 nPos = GetPagePos( nPageId ); @@ -2620,15 +2483,6 @@ XubString TabBar::GetPageText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpText( sal_uInt16 nPageId, const XubString& rText ) -{ - sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != PAGE_NOT_FOUND ) - (*mpItemList)[ nPos ]->maHelpText = rText; -} - -// ----------------------------------------------------------------------- - XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); @@ -2650,15 +2504,6 @@ XubString TabBar::GetHelpText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -void TabBar::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ) -{ - sal_uInt16 nPos = GetPagePos( nPageId ); - if ( nPos != PAGE_NOT_FOUND ) - (*mpItemList)[ nPos ]->maHelpId = rHelpId; -} - -// ----------------------------------------------------------------------- - rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const { sal_uInt16 nPos = GetPagePos( nPageId ); @@ -2670,18 +2515,6 @@ rtl::OString TabBar::GetHelpId( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -long TabBar::GetMinSize() const -{ - long nMinSize = TABBAR_MINSIZE + TABBAR_OFFSET_X; - if ( mnWinStyle & WB_MINSCROLL ) - nMinSize += mpPrevBtn->GetSizePixel().Width()*2; - else if ( mnWinStyle & WB_SCROLL ) - nMinSize += mpFirstBtn->GetSizePixel().Width()*4; - return nMinSize; -} - -// ----------------------------------------------------------------------- - sal_Bool TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion ) { if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) ) -- cgit v1.2.3 From b6d0d593b65d0b1b8f4611d0eea27a88af68bedf Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:09:51 +0200 Subject: callcatcher: remove unused TabControl::Foo --- vcl/inc/vcl/tabctrl.hxx | 3 --- vcl/source/control/tabctrl.cxx | 30 ------------------------------ 2 files changed, 33 deletions(-) diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index c6525138f73b..380fb2e70883 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -158,7 +158,6 @@ public: void SetTabPage( sal_uInt16 nPageId, TabPage* pPage ); TabPage* GetTabPage( sal_uInt16 nPageId ) const; - sal_uInt16 GetTabPageResId( sal_uInt16 nPageId ) const; void SetPageText( sal_uInt16 nPageId, const XubString& rText ); XubString GetPageText( sal_uInt16 nPageId ) const; @@ -166,11 +165,9 @@ public: void SetHelpText( sal_uInt16 nPageId, const XubString& rText ); const XubString& GetHelpText( sal_uInt16 nPageId ) const; - void SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ); rtl::OString GetHelpId( sal_uInt16 nPageId ) const; void SetPageImage( sal_uInt16 nPageId, const Image& rImage ); - const Image* GetPageImage( sal_uInt16 nPageId ) const; void SetHelpText( const XubString& rText ) { Control::SetHelpText( rText ); } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 765907721ed6..7bdd0d3af0bf 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1981,18 +1981,6 @@ TabPage* TabControl::GetTabPage( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -sal_uInt16 TabControl::GetTabPageResId( sal_uInt16 nPageId ) const -{ - ImplTabItem* pItem = ImplGetItem( nPageId ); - - if ( pItem ) - return pItem->mnTabPageResId; - else - return 0; -} - -// ----------------------------------------------------------------------- - void TabControl::SetPageText( sal_uInt16 nPageId, const XubString& rText ) { ImplTabItem* pItem = ImplGetItem( nPageId ); @@ -2059,16 +2047,6 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const // ----------------------------------------------------------------------- -void TabControl::SetHelpId( sal_uInt16 nPageId, const rtl::OString& rHelpId ) -{ - ImplTabItem* pItem = ImplGetItem( nPageId ); - - if ( pItem ) - pItem->maHelpId = rHelpId; -} - -// ----------------------------------------------------------------------- - rtl::OString TabControl::GetHelpId( sal_uInt16 nPageId ) const { rtl::OString aRet; @@ -2097,14 +2075,6 @@ void TabControl::SetPageImage( sal_uInt16 i_nPageId, const Image& i_rImage ) // ----------------------------------------------------------------------- -const Image* TabControl::GetPageImage( sal_uInt16 i_nPageId ) const -{ - const ImplTabItem* pItem = ImplGetItem( i_nPageId ); - return pItem ? &pItem->maTabImage : NULL; -} - -// ----------------------------------------------------------------------- - Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) const { Rectangle aRet; -- cgit v1.2.3 From a5b3ededeeb952f12b478ea5035655bb8eeeb1fe Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:11:49 +0200 Subject: callcatcher: remove unused Table::GetUniqueKey --- tools/inc/tools/table.hxx | 2 -- tools/source/memtools/table.cxx | 39 --------------------------------------- 2 files changed, 41 deletions(-) diff --git a/tools/inc/tools/table.hxx b/tools/inc/tools/table.hxx index bfb91fbe7dc6..ec0c82cf663b 100644 --- a/tools/inc/tools/table.hxx +++ b/tools/inc/tools/table.hxx @@ -65,7 +65,6 @@ public: { return Container::GetObject( (nPos*2)+1 ); } sal_uIntPtr GetObjectKey( sal_uIntPtr nPos ) const { return (sal_uIntPtr)Container::GetObject( nPos*2 ); } - sal_uIntPtr GetUniqueKey( sal_uIntPtr nStartKey = 1 ) const; sal_uIntPtr SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos = NULL ) const; void* Seek( sal_uIntPtr nKey ); @@ -102,7 +101,6 @@ public: \ using Table::Count; \ using Table::GetCurKey; \ using Table::GetObjectKey; \ - using Table::GetUniqueKey; \ using Table::SearchKey; \ using Table::IsKeyValid; \ \ diff --git a/tools/source/memtools/table.cxx b/tools/source/memtools/table.cxx index 75119ba6f142..e9c2239b1c82 100644 --- a/tools/source/memtools/table.cxx +++ b/tools/source/memtools/table.cxx @@ -257,45 +257,6 @@ sal_Bool Table::IsKeyValid( sal_uIntPtr nKey ) const // ----------------------------------------------------------------------- -sal_uIntPtr Table::GetUniqueKey( sal_uIntPtr nStartKey ) const -{ - DBG_ASSERT( (nStartKey > 1) && (nStartKey < 0xFFFFFFFF), - "Table::GetUniqueKey() - nStartKey == 0 or nStartKey >= 0xFFFFFFFF" ); - - if ( !nCount ) - return nStartKey; - - sal_uIntPtr nLastKey = (sal_uIntPtr)Container::GetObject( (nCount*2)-2 ); - if ( nLastKey < nStartKey ) - return nStartKey; - else - { - if ( nLastKey < 0xFFFFFFFE ) - return nLastKey+1; - else - { - sal_uIntPtr nPos; - sal_uIntPtr nTempPos = ImplGetIndex( nStartKey, &nPos ); - if ( nTempPos != TABLE_ENTRY_NOTFOUND ) - nPos = nTempPos; - nLastKey = (sal_uIntPtr)Container::GetObject( nPos ); - if ( nStartKey < nLastKey ) - return nStartKey; - while ( nLastKey < 0xFFFFFFFE ) - { - nPos += 2; - nLastKey++; - if ( nLastKey != (sal_uIntPtr)Container::GetObject( nPos ) ) - return nLastKey; - } - } - } - - return 0; -} - -// ----------------------------------------------------------------------- - sal_uIntPtr Table::SearchKey( sal_uIntPtr nKey, sal_uIntPtr* pPos ) const { *pPos = 0; -- cgit v1.2.3 From 55de765205359cb0c268a6b2c027e9839102ca04 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:15:48 +0200 Subject: callcatcher: remove unused TaskBar::Foo --- svtools/inc/svtools/taskbar.hxx | 5 --- svtools/source/control/taskbar.cxx | 64 -------------------------------------- 2 files changed, 69 deletions(-) diff --git a/svtools/inc/svtools/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx index 36b625eca650..dc6e15a530d4 100644 --- a/svtools/inc/svtools/taskbar.hxx +++ b/svtools/inc/svtools/taskbar.hxx @@ -403,14 +403,9 @@ public: void Format(); - void SetLines( sal_uInt16 nLines ); sal_uInt16 GetLines() const { return mnLines; } - void EnableAutoHide( sal_Bool bAutoHide = sal_True ); sal_Bool IsAutoHideEnabled() const { return mbAutoHide; } - void ShowStatusText( const String& rText ); - void HideStatusText(); - void SetStatusSize( long nNewSize ) { mnStatusWidth=nNewSize; Resize(); } long GetStatusSize() const { return mnStatusWidth; } diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx index 8d3a6abce18f..a41730c3318b 100644 --- a/svtools/source/control/taskbar.cxx +++ b/svtools/source/control/taskbar.cxx @@ -464,70 +464,6 @@ void TaskBar::Format() // ----------------------------------------------------------------------- -void TaskBar::SetLines( sal_uInt16 nLines ) -{ - mnLines = nLines; -} - -// ----------------------------------------------------------------------- - -void TaskBar::EnableAutoHide( sal_Bool bAutoHide ) -{ - mbAutoHide = bAutoHide; - - if ( mbAutoHide ) - { - ImplNewHeight( TASKBAR_AUTOHIDE_HEIGHT ); - } - else - { - ImplNewHeight( CalcWindowSizePixel().Height() ); - } -} - -// ----------------------------------------------------------------------- - -void TaskBar::ShowStatusText( const String& rText ) -{ - if ( mpStatusBar ) - { - if ( !mbStatusText ) - { - mbStatusText = sal_True; - if ( mpStatusBar->AreItemsVisible() ) - { - mbShowItems = sal_True; - mpStatusBar->HideItems(); - } - else - mbShowItems = sal_True; - maOldText = mpStatusBar->GetText(); - Resize(); - mpStatusBar->SetText( rText ); - Update(); - mpStatusBar->Update(); - } - else - mpStatusBar->SetText( rText ); - } -} - -// ----------------------------------------------------------------------- - -void TaskBar::HideStatusText() -{ - if ( mbStatusText && mpStatusBar ) - { - mbStatusText = sal_False; - mpStatusBar->SetText( maOldText ); - Resize(); - if ( mbShowItems ) - mpStatusBar->ShowItems(); - } -} - -// ----------------------------------------------------------------------- - Size TaskBar::CalcWindowSizePixel() const { TaskButtonBar* pTempButtonBar = GetButtonBar(); -- cgit v1.2.3 From edf835031f1adad05dfc22153a52779a943a9f0a Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:17:14 +0200 Subject: callcatcher: remove unused TaskPaneList::FindNextPane --- vcl/inc/vcl/taskpanelist.hxx | 1 - vcl/source/window/taskpanelist.cxx | 35 ----------------------------------- 2 files changed, 36 deletions(-) diff --git a/vcl/inc/vcl/taskpanelist.hxx b/vcl/inc/vcl/taskpanelist.hxx index 102f755554f2..9042169e9898 100644 --- a/vcl/inc/vcl/taskpanelist.hxx +++ b/vcl/inc/vcl/taskpanelist.hxx @@ -37,7 +37,6 @@ class VCL_DLLPUBLIC TaskPaneList { ::std::vector mTaskPanes; - Window *FindNextPane( Window *pWindow, sal_Bool bForward = sal_True ); Window *FindNextFloat( Window *pWindow, sal_Bool bForward = sal_True ); Window *FindNextSplitter( Window *pWindow, sal_Bool bForward = sal_True ); diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index 24c8ded6e4b4..bfb3be82b70f 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -262,41 +262,6 @@ sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) // -------------------------------------------------- -// returns next valid pane -Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward ) -{ - if( bForward ) - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); - else - ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSortBackward() ); - - ::std::vector< Window* >::iterator p = mTaskPanes.begin(); - while( p != mTaskPanes.end() ) - { - if( *p == pWindow ) - { - unsigned n = mTaskPanes.size(); - while( --n ) - { - if( ++p == mTaskPanes.end() ) - p = mTaskPanes.begin(); - if( (*p)->IsReallyVisible() && !(*p)->IsDialog() && !(*p)->ImplIsSplitter() ) - { - pWindow = *p; - break; - } - } - break; - } - else - ++p; - } - - return pWindow; -} - -// -------------------------------------------------- - // returns next splitter Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward ) { -- cgit v1.2.3 From 8d7b1fba417503130f197c007b24e7c4d8f20329 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:20:25 +0200 Subject: callcatcher: remove unused TaskStatusBar::Foo --- svtools/inc/svtools/taskbar.hxx | 11 +---- svtools/source/control/taskstat.cxx | 86 ------------------------------------- 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/svtools/inc/svtools/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx index dc6e15a530d4..97c69b451e92 100644 --- a/svtools/inc/svtools/taskbar.hxx +++ b/svtools/inc/svtools/taskbar.hxx @@ -88,9 +88,7 @@ TaskStatusBar kann auch ein Notify-Object gesetzt werden, wenn man benachrichtigt werden will, wenn die Uhrzeit oder die TaskStatusBar angeklickt wird. Wenn der Notify fuer die Uhrzeit kommt, ist die Id TASKSTATUSBAR_CLOCKID, wenn er fuer die TaskStatusBar kommt, ist -die Id 0. Mit SetFieldFlags() kann am TaskStatusBar auch die Flags -hinterher umgesetzt werden, um zum Beispiel die Uhrzeit ein- und -auszuschalten. +die Id 0. TaskBar @@ -331,16 +329,9 @@ public: sal_uInt16 nFlags = TASKSTATUSFIELD_CLOCK ); void RemoveStatusField() { maTimer.Stop(); RemoveItem( TASKSTATUSBAR_STATUSFIELDID ); } - void SetFieldFlags( sal_uInt16 nFlags ); sal_uInt16 GetFieldFlags() const { return mnFieldFlags; } void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; } ITaskStatusNotify* GetNotifyObject() const { return mpNotify; } - - void AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem, - sal_uInt16 nPos = 0xFFFF ); - void ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem ); - void RemoveStatusFieldItem( sal_uInt16 nItemId ); - sal_Bool GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const; }; // ----------- diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index b94aae25a88f..56c3071462fd 100644 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -563,90 +563,4 @@ void TaskStatusBar::InsertStatusField( long, sal_uInt16, ImplUpdateField( sal_False ); } -// ----------------------------------------------------------------------- - -void TaskStatusBar::SetFieldFlags( sal_uInt16 nFlags ) -{ - if ( mnFieldFlags != nFlags ) - { - mnFieldFlags = nFlags; - ImplUpdateField( sal_False ); - } -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::AddStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem, - sal_uInt16 nPos ) -{ - DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" ); - DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" ); - - if ( !mpFieldItemList ) - mpFieldItemList = new ImplTaskSBItemList; - - ImplTaskSBFldItem* pItem = new ImplTaskSBFldItem; - pItem->maItem = rItem; - pItem->mnId = nItemId; - pItem->mnOffX = 0; - if ( nPos < mpFieldItemList->size() ) { - ImplTaskSBItemList::iterator it = mpFieldItemList->begin(); - ::std::advance( it, nPos ); - mpFieldItemList->insert( it, pItem ); - } else { - mpFieldItemList->push_back( pItem ); - } - - ImplUpdateField( sal_True ); -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::ModifyStatusFieldItem( sal_uInt16 nItemId, const TaskStatusFieldItem& rItem ) -{ - ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); - if ( pItem ) - { - sal_Bool bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) || - (pItem->maItem.GetFlags() != rItem.GetFlags()); - pItem->maItem = rItem; - if ( bUpdate ) - ImplUpdateField( sal_True ); - } -} - -// ----------------------------------------------------------------------- - -void TaskStatusBar::RemoveStatusFieldItem( sal_uInt16 nItemId ) -{ - ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); - if ( pItem ) - { - for ( ImplTaskSBItemList::iterator it = mpFieldItemList->begin(); - it < mpFieldItemList->end(); - ++it - ) { - if ( *it == pItem ) { - delete *it; - mpFieldItemList->erase( it ); - break; - } - } - } -} - -// ----------------------------------------------------------------------- - -sal_Bool TaskStatusBar::GetStatusFieldItem( sal_uInt16 nItemId, TaskStatusFieldItem& rItem ) const -{ - ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId ); - if ( pItem ) - { - rItem = pItem->maItem; - return sal_True; - } - - return sal_False; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 36b7696fbc4339a94185b3a33c62f1f49df25129 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:22:37 +0200 Subject: callcatcher: remove unused TaskStatusFieldItem::TaskStatusFieldItem --- svtools/inc/svtools/taskbar.hxx | 5 ----- svtools/source/control/taskstat.cxx | 15 --------------- 2 files changed, 20 deletions(-) diff --git a/svtools/inc/svtools/taskbar.hxx b/svtools/inc/svtools/taskbar.hxx index 97c69b451e92..c29fe770f757 100644 --- a/svtools/inc/svtools/taskbar.hxx +++ b/svtools/inc/svtools/taskbar.hxx @@ -251,11 +251,6 @@ private: public: TaskStatusFieldItem(); TaskStatusFieldItem( const TaskStatusFieldItem& rItem ); - TaskStatusFieldItem( ITaskStatusNotify* pNotify, - const Image& rImage, - const XubString& rQuickHelpText, - const XubString& rHelpText, - sal_uInt16 nFlags ); ~TaskStatusFieldItem(); void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; } diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx index 56c3071462fd..08f2a25b4b2f 100644 --- a/svtools/source/control/taskstat.cxx +++ b/svtools/source/control/taskstat.cxx @@ -110,21 +110,6 @@ TaskStatusFieldItem::TaskStatusFieldItem( const TaskStatusFieldItem& rItem ) : // ----------------------------------------------------------------------- -TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify, - const Image& rImage, - const XubString& rQuickHelpText, - const XubString& rHelpText, - sal_uInt16 nFlags ) : - mpNotify( pNotify ), - maImage( rImage ), - maQuickHelpText( rQuickHelpText ), - maHelpText( rHelpText ), - mnFlags( nFlags ) -{ -} - -// ----------------------------------------------------------------------- - TaskStatusFieldItem::~TaskStatusFieldItem() { } -- cgit v1.2.3 From fd0d90b50233732abf15da59afe5fbf823e8341c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:26:54 +0200 Subject: callcatcher: remove unused TempFile::SetTempNameBaseDirectory from unotools --- unotools/inc/unotools/tempfile.hxx | 11 --------- unotools/source/ucbhelper/tempfile.cxx | 41 ---------------------------------- 2 files changed, 52 deletions(-) diff --git a/unotools/inc/unotools/tempfile.hxx b/unotools/inc/unotools/tempfile.hxx index 2030b1ab0791..b30f2eb4f7bd 100644 --- a/unotools/inc/unotools/tempfile.hxx +++ b/unotools/inc/unotools/tempfile.hxx @@ -143,17 +143,6 @@ public: conversion functions of osl. */ static String CreateTempName( const String* pParent=NULL ); - - /** - The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the - SetTempNameBaseDirectory method. - This subfolder will be used if a TempFile or TempName is created without a parent name or a parent name - that does not belong to the local file system. - The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it. - The return value of both methods is the complete "physical" name of the tempname base folder. - It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all. - */ - static String SetTempNameBaseDirectory( const String &rBaseName ); }; } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 33a3ca6fb8f4..49d8bfaf4efd 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -443,47 +443,6 @@ void TempFile::CloseStream() } } -String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) -{ - if( !rBaseName.Len() ) - return String(); - - rtl::OUString aUnqPath( rBaseName ); - - // remove trailing slash - if ( rBaseName.GetChar( rBaseName.Len() - 1 ) == sal_Unicode( '/' ) ) - aUnqPath = rBaseName.Copy( 0, rBaseName.Len() - 1 ); - - // try to create the directory - sal_Bool bRet = sal_False; - osl::FileBase::RC err = osl::Directory::create( aUnqPath ); - if ( err != FileBase::E_None && err != FileBase::E_EXIST ) - // perhaps parent(s) don't exist - bRet = ensuredir( aUnqPath ); - else - bRet = sal_True; - - // failure to create base directory means returning an empty string - rtl::OUString aTmp; - if ( bRet ) - { - // append own internal directory - bRet = sal_True; - ::rtl::OUString &rTempNameBase_Impl = TempNameBase_Impl::get(); - rTempNameBase_Impl = rBaseName; - rTempNameBase_Impl += String( '/' ); - - TempFile aBase( NULL, sal_True ); - if ( aBase.IsValid() ) - // use it in case of success - rTempNameBase_Impl = aBase.pImp->aName; - - // return system path of used directory - FileBase::getSystemPathFromFileURL( rTempNameBase_Impl, aTmp ); - } - - return aTmp; -} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From e19c00ed76f5d46c3b88d2721b9ac84fcaaed97c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:30:48 +0200 Subject: callcatcher: remove unused TextAttrib stuff --- svtools/inc/svtools/txtattr.hxx | 4 ---- svtools/source/edit/txtattr.cxx | 21 --------------------- 2 files changed, 25 deletions(-) diff --git a/svtools/inc/svtools/txtattr.hxx b/svtools/inc/svtools/txtattr.hxx index 982e9c20be5a..2b6028965475 100644 --- a/svtools/inc/svtools/txtattr.hxx +++ b/svtools/inc/svtools/txtattr.hxx @@ -61,8 +61,6 @@ public: sal_uInt16 Which() const { return mnWhich; } - virtual void SetFont( Font& rFont ) const = 0; - virtual TextAttrib* Clone() const = 0; virtual int operator==( const TextAttrib& rAttr ) const = 0; int operator!=( const TextAttrib& rAttr ) const { return !(*this == rAttr ); } @@ -114,8 +112,6 @@ private: Color maColor; public: - TextAttribHyperLink( const XubString& rURL ); - TextAttribHyperLink( const XubString& rURL, const XubString& rDescription ); TextAttribHyperLink( const TextAttribHyperLink& rAttr ); ~TextAttribHyperLink(); diff --git a/svtools/source/edit/txtattr.cxx b/svtools/source/edit/txtattr.cxx index 022a40ae848f..e932cbee585a 100644 --- a/svtools/source/edit/txtattr.cxx +++ b/svtools/source/edit/txtattr.cxx @@ -39,15 +39,6 @@ TextAttrib::~TextAttrib() { } -void TextAttrib::SetFont( Font& ) const -{ -} - -TextAttrib* TextAttrib::Clone() const -{ - return NULL; -} - int TextAttrib::operator==( const TextAttrib& rAttr ) const { return mnWhich == rAttr.mnWhich; @@ -115,18 +106,6 @@ int TextAttribFontWeight::operator==( const TextAttrib& rAttr ) const } -TextAttribHyperLink::TextAttribHyperLink( const XubString& rURL ) - : TextAttrib( TEXTATTR_HYPERLINK ), maURL( rURL ) -{ - maColor = COL_BLUE; -} - -TextAttribHyperLink::TextAttribHyperLink( const XubString& rURL, const XubString& rDescription ) - : TextAttrib( TEXTATTR_HYPERLINK ), maURL( rURL ), maDescription( rDescription ) -{ - maColor = COL_BLUE; -} - TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr ) : TextAttrib( rAttr ), maURL( rAttr.maURL ), maDescription( rAttr.maDescription ) { -- cgit v1.2.3 From a434c5236f4e50f2569043a75295f422e45051c9 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:37:20 +0200 Subject: Remove EDITDEBUG --- svtools/source/edit/textdoc.cxx | 16 ---------------- svtools/source/edit/texteng.cxx | 14 -------------- 2 files changed, 30 deletions(-) diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index fa7536035288..fa37e13f58c7 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -307,10 +307,6 @@ void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew ) if ( bResort ) maCharAttribs.ResortAttribs(); - -#ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( (TextCharAttribs*)&maCharAttribs ), "Expand: Start-Liste verdreht" ); -#endif } void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) @@ -374,10 +370,6 @@ void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted ) if ( bResort ) maCharAttribs.ResortAttribs(); - -#ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( (TextCharAttribs)&maCharAttribs ), "Collaps: Start-Liste verdreht" ); -#endif } void TextNode::InsertText( sal_uInt16 nPos, const String& rText ) @@ -460,10 +452,6 @@ void TextNode::Append( const TextNode& rNode ) maText += rNode.GetText(); -#ifdef EDITDEBUG - DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); -#endif - const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count(); for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { @@ -499,10 +487,6 @@ void TextNode::Append( const TextNode& rNode ) maCharAttribs.InsertAttrib( pNewAttrib ); } } - -#ifdef EDITDEBUG - DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute NACH AppendAttribs kaputt" ); -#endif } // ------------------------------------------------------------------------- diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 15412276e587..841093908fb8 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -1953,9 +1953,6 @@ void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos ) } DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions?!" ); -#ifdef EDITDEBUG - DBG_ASSERT( pTEParaPortion->DbgCheckTextPortions(), "Portions kaputt?" ); -#endif } void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars ) @@ -2048,10 +2045,6 @@ void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short } DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "RecalcTextPortions: Keine mehr da!" ); } - -#ifdef EDITDEBUG - DBG_ASSERT( pTEParaPortion->DbgCheckTextPortions(), "Portions kaputt?" ); -#endif } void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection ) @@ -2242,13 +2235,6 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan pOutDev->Erase( aTabArea ); } } -#ifdef EDITDEBUG - Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) ); - Color aOldColor = pOutDev->GetFillColor(); - pOutDev->SetFillColor( (y%2) ? COL_RED : COL_GREEN ); - pOutDev->DrawRect( aTabArea ); - pOutDev->SetFillColor( aOldColor ); -#endif } break; default: OSL_FAIL( "ImpPaint: Unknown Portion-Type !" ); -- cgit v1.2.3 From ad50fa236bccb0c201156d0a5ee55d7d31ee036d Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:45:29 +0200 Subject: callcatcher: remove TextCharAttribList::DbgCheckAttribs --- svtools/source/edit/textdoc.cxx | 17 ----------------- svtools/source/edit/textdoc.hxx | 4 ---- 2 files changed, 21 deletions(-) diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index fa37e13f58c7..615ac1258f4d 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -216,23 +216,6 @@ void TextCharAttribList::DeleteEmptyAttribs() mbHasEmptyAttribs = sal_False; } -#ifdef DBG_UTIL -sal_Bool TextCharAttribList::DbgCheckAttribs() -{ - sal_Bool bOK = sal_True; - for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ ) - { - TextCharAttrib* pAttr = GetObject( nAttr ); - if ( pAttr->GetStart() > pAttr->GetEnd() ) - { - bOK = sal_False; - OSL_FAIL( "Attr verdreht" ); - } - } - return bOK; -} -#endif - // ------------------------------------------------------------------------- // (+) class TextNode // ------------------------------------------------------------------------- diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx index c52190ca4d63..41a134da4899 100644 --- a/svtools/source/edit/textdoc.hxx +++ b/svtools/source/edit/textdoc.hxx @@ -69,10 +69,6 @@ public: TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); sal_Bool HasAttrib( sal_uInt16 nWhich ) const; sal_Bool HasBoundingAttrib( sal_uInt16 nBound ); - -#ifdef DBG_UTIL - sal_Bool DbgCheckAttribs(); -#endif }; -- cgit v1.2.3 From 1ccbcfddd1e2493401be86328e2030cabccc3ad0 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:47:15 +0200 Subject: callcatcher: remove TextEngine::Foo --- svtools/inc/svtools/texteng.hxx | 3 --- svtools/source/edit/texteng.cxx | 43 ----------------------------------------- 2 files changed, 46 deletions(-) diff --git a/svtools/inc/svtools/texteng.hxx b/svtools/inc/svtools/texteng.hxx index ba2c440f6d98..ea81c4806206 100644 --- a/svtools/inc/svtools/texteng.hxx +++ b/svtools/inc/svtools/texteng.hxx @@ -245,13 +245,11 @@ public: void SetFont( const Font& rFont ); const Font& GetFont() const { return maFont; } - void SetDefTab( sal_uInt16 nDefTab ); sal_uInt16 GetDefTab() const; void SetLeftMargin( sal_uInt16 n ); sal_uInt16 GetLeftMargin() const; - void SetUpdateMode( sal_Bool bUpdate ); sal_Bool GetUpdateMode() const { return mbUpdate; } sal_uInt16 GetViewCount() const; @@ -325,7 +323,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > GetBreakIterator(); static sal_Bool DoesKeyChangeText( const KeyEvent& rKeyEvent ); - static sal_Bool DoesKeyMoveCursor( const KeyEvent& rKeyEvent ); static sal_Bool IsSimpleCharInput( const KeyEvent& rKeyEvent ); }; diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 841093908fb8..2b041f23be8a 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -253,12 +253,6 @@ void TextEngine::SetFont( const Font& rFont ) } } -void TextEngine::SetDefTab( sal_uInt16 nDefTab ) -{ - mnDefTab = nDefTab; - // evtl neu setzen? -} - void TextEngine::SetMaxTextLen( sal_uLong nLen ) { mnMaxTextLen = nLen; @@ -345,43 +339,6 @@ sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const return mpDoc->GetNodes().GetObject( nPara )->GetText().Len(); } -void TextEngine::SetUpdateMode( sal_Bool bUpdate ) -{ - if ( bUpdate != mbUpdate ) - { - mbUpdate = bUpdate; - if ( mbUpdate ) - { - FormatAndUpdate( GetActiveView() ); - if ( GetActiveView() ) - GetActiveView()->ShowCursor(); - } - } -} - -sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent ) -{ - sal_Bool bDoesMove = sal_False; - - switch ( rKeyEvent.GetKeyCode().GetCode() ) - { - case KEY_UP: - case KEY_DOWN: - case KEY_LEFT: - case KEY_RIGHT: - case KEY_HOME: - case KEY_END: - case KEY_PAGEUP: - case KEY_PAGEDOWN: - { - if ( !rKeyEvent.GetKeyCode().IsMod2() ) - bDoesMove = sal_True; - } - break; - } - return bDoesMove; -} - sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) { sal_Bool bDoesChange = sal_False; -- cgit v1.2.3 From a5d227a076fddd2b1a427baaaf3ec92e3fa40943 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 13:56:26 +0200 Subject: callcatcher: remove TextUndoSetAttribs --- svtools/source/edit/textundo.cxx | 41 ---------------------------------------- 1 file changed, 41 deletions(-) diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx index 660c272397f5..56aea0d2c0fa 100644 --- a/svtools/source/edit/textundo.cxx +++ b/svtools/source/edit/textundo.cxx @@ -43,7 +43,6 @@ TYPEINIT1( TextUndoConnectParas, TextUndo ); TYPEINIT1( TextUndoSplitPara, TextUndo ); TYPEINIT1( TextUndoInsertChars, TextUndo ); TYPEINIT1( TextUndoRemoveChars, TextUndo ); -TYPEINIT1( TextUndoSetAttribs, TextUndo ); TextUndoManager::TextUndoManager( TextEngine* p ) @@ -296,44 +295,4 @@ void TextUndoRemoveChars::Redo() SetSelection( aPaM ); } - -TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel ) - : TextUndo( pTextEngine ), maSelection( rSel ) -{ - maSelection.Justify(); -// aNewAttribs.Set( rNewItems ); -// mbSetIsRemove = sal_False; -// mnRemoveWhich = 0; -// mnSpecial = 0; -} - -TextUndoSetAttribs::~TextUndoSetAttribs() -{ - // ............... -} - -void TextUndoSetAttribs::Undo() -{ - for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ ) - { -// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ]; -// GetTextEngine()->RemoveCharAttribs( nPara ); -// TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara ); -// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) -// { -// GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); -// } - } - SetSelection( maSelection ); -} - -void TextUndoSetAttribs::Redo() -{ -// if ( !bSetIsRemove ) -// GetTextEngine()->SetAttribs( aSel, aNewAttribs, nSpecial ); -// else -// GetTextEngine()->RemoveCharAttribs( aSel, bRemoveParaAttribs, nRemoveWhich ); - SetSelection( maSelection ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From e8d4b4ffa0cb615e712e4a33879ab96901c8c321 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:01:10 +0200 Subject: callcatcher: remove TextView::Foo --- svtools/inc/svtools/textview.hxx | 10 ---------- svtools/source/edit/textview.cxx | 36 ------------------------------------ 2 files changed, 46 deletions(-) diff --git a/svtools/inc/svtools/textview.hxx b/svtools/inc/svtools/textview.hxx index de8da807a3dd..ebf7a4f6f2eb 100644 --- a/svtools/inc/svtools/textview.hxx +++ b/svtools/inc/svtools/textview.hxx @@ -156,7 +156,6 @@ public: void Redo(); sal_Bool Read( SvStream& rInput ); - sal_Bool Write( SvStream& rOutput ); void SetStartDocPos( const Point& rPos ); const Point& GetStartDocPos() const; @@ -168,7 +167,6 @@ public: sal_Bool IsInsertMode() const; void SetAutoIndentMode( sal_Bool bAutoIndent ); - sal_Bool IsAutoIndentMode() const; void SetReadOnly( sal_Bool bReadOnly ); sal_Bool IsReadOnly() const; @@ -180,10 +178,6 @@ public: sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); void SetPaintSelection( sal_Bool bPaint); - sal_Bool IsPaintSelection() const; - - void SetHighlightSelection( sal_Bool bSelectByHighlight ); - sal_Bool IsHighlightSelection() const; void EraseVirtualDevice(); @@ -204,10 +198,6 @@ public: TextPaM CursorStartOfDoc(); TextPaM CursorEndOfDoc(); - // Old, remove! - TextPaM CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode = sal_False ); - TextPaM CursorRight( const TextPaM& rPaM, sal_Bool bWordMode = sal_False ); - /** Drag and Drop, deleting and selection regards all text that has an attribute TEXTATTR_PROTECTED set as one entitity. Drag and dropped text is automatically diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx index f2b370a9a923..1ee50008aeaf 100644 --- a/svtools/source/edit/textview.cxx +++ b/svtools/source/edit/textview.cxx @@ -1427,22 +1427,6 @@ void TextView::InsertText( const XubString& rStr, sal_Bool bSelect ) } */ -// OLD -TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode ) -{ - return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - - // Remove (sal_uInt16) typecasts in this file when removing this method! -} - -// OLD -TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode ) -{ - return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); - - // Remove (sal_uInt16) typecasts in this file when removing this method! -} - TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { TextPaM aPaM( rPaM ); @@ -2006,15 +1990,6 @@ void TextView::SetPaintSelection( sal_Bool bPaint ) } } -void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight ) -{ - if ( bSelectByHighlight != mpImpl->mbHighlightSelection ) - { - // Falls umschalten zwischendurch moeglich... - mpImpl->mbHighlightSelection = bSelectByHighlight; - } -} - sal_Bool TextView::Read( SvStream& rInput ) { sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection ); @@ -2022,11 +1997,6 @@ sal_Bool TextView::Read( SvStream& rInput ) return bDone; } -sal_Bool TextView::Write( SvStream& rOutput ) -{ - return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection ); -} - bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const { bool bTruncated = false; @@ -2439,18 +2409,12 @@ const Point& TextView::GetStartDocPos() const { return mpImpl->maStartDocPos; } void TextView::SetAutoIndentMode( sal_Bool bAutoIndent ) { mpImpl->mbAutoIndent = bAutoIndent; } -sal_Bool TextView::IsAutoIndentMode() const -{ return mpImpl->mbAutoIndent; } sal_Bool TextView::IsReadOnly() const { return mpImpl->mbReadOnly; } void TextView::SetAutoScroll( sal_Bool bAutoScroll ) { mpImpl->mbAutoScroll = bAutoScroll; } sal_Bool TextView::IsAutoScroll() const { return mpImpl->mbAutoScroll; } -sal_Bool TextView::IsPaintSelection() const -{ return mpImpl->mbPaintSelection; } -sal_Bool TextView::IsHighlightSelection() const -{ return mpImpl->mbHighlightSelection; } sal_Bool TextView::HasSelection() const { return mpImpl->maSelection.HasRange(); } sal_Bool TextView::IsInsertMode() const -- cgit v1.2.3 From 28ee3e903dfed99d66b0dd190ccef91306d0c8c1 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:20:14 +0200 Subject: callcatcher: ToolBox cleanup --- vcl/inc/vcl/toolbox.hxx | 29 ------- vcl/source/window/toolbox.cxx | 132 ------------------------------ vcl/source/window/toolbox2.cxx | 182 ----------------------------------------- 3 files changed, 343 deletions(-) diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 5badbc2d13bd..4542a51984b7 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -274,7 +274,6 @@ private: SAL_DLLPRIVATE sal_Bool ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle = sal_False ); SAL_DLLPRIVATE sal_uInt16 ImplGetItemLine( ImplToolItem* pCurrentItem ); SAL_DLLPRIVATE ImplToolItem* ImplGetFirstValidItem( sal_uInt16 nLine ); - SAL_DLLPRIVATE ImplToolItem* ImplGetLastValidItem( sal_uInt16 nLine ); SAL_DLLPRIVATE sal_Bool ImplOpenItem( KeyCode aKeyCode ); SAL_DLLPRIVATE sal_Bool ImplActivateItem( KeyCode aKeyCode ); SAL_DLLPRIVATE void ImplShowFocus(); @@ -332,9 +331,6 @@ public: static SAL_DLLPRIVATE void ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform, sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False, long nSize = 6 ); - static SAL_DLLPRIVATE void SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, - sal_Bool bLeft = sal_False, sal_Bool bTop = sal_False, - long nSize = 6 ); static SAL_DLLPRIVATE void ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight ); static SAL_DLLPRIVATE sal_uInt16 ImplCountLineBreaks( const ToolBox *pThis ); SAL_DLLPRIVATE ImplToolBoxPrivateData* ImplGetToolBoxPrivateData() const { return mpData; } @@ -401,12 +397,9 @@ public: sal_uInt16 nPixSize = 0 ); void InsertBreak( sal_uInt16 nPos = TOOLBOX_APPEND ); void RemoveItem( sal_uInt16 nPos ); - void MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND ); void CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, sal_uInt16 nNewPos = TOOLBOX_APPEND ); - void CopyItems( const ToolBox& rToolBox ); void Clear(); - void RecalcItems(); const ImageList& GetImageList() const { return maImageList; } void SetImageList( const ImageList& rImageList ); @@ -429,7 +422,6 @@ public: // Used to enable/disable scrolling one page at a time for toolbar void SetPageScroll( sal_Bool b ); - sal_Bool GetPageScroll(); void SetNextToolBox( const XubString& rStr ); const XubString& GetNextToolBox() const { return maNextToolBoxStr; } @@ -442,14 +434,12 @@ public: sal_uInt16 GetItemId( const Point& rPos ) const; Rectangle GetItemRect( sal_uInt16 nItemId ) const; Rectangle GetItemPosRect( sal_uInt16 nPos ) const; - Rectangle GetItemDropDownRect( sal_uInt16 nItemId ) const; Rectangle GetItemPosDropDownRect( sal_uInt16 nPos ) const; // retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown) Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const; Rectangle GetScrollRect() const; - Rectangle GetMenubuttonRect() const; sal_uInt16 GetCurItemId() const { return mnCurItemId; } sal_uInt16 GetDownItemId() const { return mnDownItemId; } sal_uInt16 GetClicks() const { return mnMouseClicks; } @@ -464,11 +454,7 @@ public: void SetItemImage( sal_uInt16 nItemId, const Image& rImage ); Image GetItemImage( sal_uInt16 nItemId ) const; void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ); - long GetItemImageAngle( sal_uInt16 nItemId ) const; void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror ); - sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const; - void SetItemHighImage( sal_uInt16 nItemId, const Image& rImage ); - Image GetItemHighImage( sal_uInt16 nItemId ) const; void SetItemText( sal_uInt16 nItemId, const XubString& rText ); const XubString& GetItemText( sal_uInt16 nItemId ) const; void SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow ); @@ -479,7 +465,6 @@ public: void EndSelection(); void SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease = sal_True ); - sal_Bool IsItemDown( sal_uInt16 nItemId ) const; void SetItemState( sal_uInt16 nItemId, TriState eState ); TriState GetItemState( sal_uInt16 nItemId ) const; @@ -552,14 +537,8 @@ public: void EnableCustomize( sal_Bool bEnable = sal_True ); sal_Bool IsCustomize() { return mbCustomize; } - void StartCustomize( const Rectangle& rRect, void* pData = NULL ); - void SetCustomizeMode( sal_Bool ); sal_Bool IsInCustomizeMode() const { return mbCustomizeMode; } - static void StartCustomizeMode(); - static void EndCustomizeMode(); - static sal_Bool IsCustomizeMode(); - void SetHelpText( const XubString& rText ) { DockingWindow::SetHelpText( rText ); } const XubString& GetHelpText() const @@ -600,7 +579,6 @@ public: PopupMenu* GetMenu() const; void UpdateCustomMenu(); void SetMenuButtonHdl( const Link& rLink ); - const Link& GetMenuButtonHdl() const; // open custommenu void ExecuteCustomMenu(); @@ -625,13 +603,6 @@ public: // -1 is returned if no character is at that point // if an index is found the corresponding item id is filled in (else 0) long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const; - // returns the number of portions in the result of GetDisplayText() - long GetTextCount() const; - // returns the interval [start,end] of text portion nText - // returns [-1,-1] for an invalid text number - Pair GetTextStartEnd( long nText ) const; - // returns the item id for text portion nText or 0 if nText is invalid - sal_uInt16 GetDisplayItemId( long nText ) const; const Size& GetDefaultImageSize() const; void ChangeHighlight( sal_uInt16 nPos ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 8ffe04c4208a..e43f1c1fc8bd 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -195,8 +195,6 @@ public: DECL_LINK( SelectHdl, Accelerator* ); void StartCustomizeMode(); - void EndCustomizeMode(); - sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -3178,60 +3176,6 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlac } } -void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, - sal_Bool bLeft, sal_Bool bTop, long nSize ) -{ - WindowAlign eAlign = pBox->meAlign; - long nHalfSize; - if ( bLeft ) - eAlign = WINDOWALIGN_RIGHT; - else if ( bTop ) - eAlign = WINDOWALIGN_BOTTOM; - - nHalfSize = nSize/2; - - Point p[6]; - - switch ( eAlign ) - { - case WINDOWALIGN_LEFT: - p[0].X() = nX-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+nSize+1; - p[2].X() = nX+1; p[2].Y() = nY+nSize+1; - p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nHalfSize-1; - p[5].X() = nX+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_TOP: - p[0].X() = nX-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+1; - p[2].X() = nX+nHalfSize-1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nHalfSize+1; p[3].Y() = nY+nHalfSize+1; - p[4].X() = nX+nSize+1; p[4].Y() = nY+1; - p[5].X() = nX+nSize+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_RIGHT: - p[0].X() = nX+nHalfSize-1; p[0].Y() = nY-1; - p[1].X() = nX-1; p[1].Y() = nY+nHalfSize-1; - p[2].X() = nX-1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nHalfSize-1; p[3].Y() = nY+nSize+1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY+nSize+1; - p[5].X() = nX+nHalfSize+1; p[5].Y() = nY-1; - break; - case WINDOWALIGN_BOTTOM: - p[0].X() = nX-1; p[0].Y() = nY+nHalfSize-1; - p[1].X() = nX-1; p[1].Y() = nY+nHalfSize+1; - p[2].X() = nX+nSize+1; p[2].Y() = nY+nHalfSize+1; - p[3].X() = nX+nSize+1; p[3].Y() = nY+nHalfSize-1; - p[4].X() = nX+nHalfSize+1; p[4].Y() = nY-1; - p[5].X() = nX+nHalfSize-1; p[5].Y() = nY-1; - break; - } - Polygon aPoly(6,p); - Region aRgn( aPoly ); - pBox->SetClipRegion( aRgn ); -} - // ----------------------------------------------------------------------- void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight ) @@ -3868,14 +3812,6 @@ void ToolBox::ImplStartCustomizeMode() } } -void ToolBox::SetCustomizeMode( sal_Bool bSet ) -{ - if ( bSet ) - ImplStartCustomizeMode(); - else - ImplEndCustomizeMode(); -} - // ----------------------------------------------------------------------- void ToolBox::ImplEndCustomizeMode() @@ -5545,33 +5481,6 @@ void ToolBox::EnableCustomize( sal_Bool bEnable ) // ----------------------------------------------------------------------- -void ToolBox::StartCustomize( const Rectangle& rRect, void* pData ) -{ - DBG_ASSERT( mbCustomize, - "ToolBox::StartCustomize(): ToolBox must be customized" ); - - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - Point aMousePos = GetPointerPosPixel(); - Point aPos = ScreenToOutputPixel( rRect.TopLeft() ); - Rectangle aRect( aPos.X(), aPos.Y(), - aPos.X()+rRect.GetWidth()+SMALLBUTTON_HSIZE, - aPos.Y()+rRect.GetHeight()+SMALLBUTTON_VSIZE ); - aMousePos = ScreenToOutputPixel( aPos ); - Pointer aPtr; - SetPointer( aPtr ); - pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData ); -} - -// ----------------------------------------------------------------------- - -void ToolBox::StartCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - pMgr->StartCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::EndCustomizeMode() { ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); @@ -5580,14 +5489,6 @@ void ToolBox::EndCustomizeMode() // ----------------------------------------------------------------------- -sal_Bool ToolBox::IsCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - return pMgr->IsCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::GetFocus() { DockingWindow::GetFocus(); @@ -5985,39 +5886,6 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine ) return (it == mpData->m_aItems.end()) ? NULL : &(*it); } -// returns the last displayable item in the given line -ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine ) -{ - if( !nLine || nLine > mnCurLines ) - return NULL; - - nLine--; - ImplToolItem *pFound = NULL; - std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); - while( it != mpData->m_aItems.end() ) - { - // find correct line - if ( it->mbBreak ) - nLine--; - if( !nLine ) - { - // find last useful item - while( it != mpData->m_aItems.end() && ((it->meType == TOOLBOXITEM_BUTTON) && - /*it->mbEnabled &&*/ it->mbVisible && !ImplIsFixedControl( &(*it) )) ) - { - pFound = &(*it); - ++it; - if( it == mpData->m_aItems.end() || it->mbBreak ) - return pFound; // end of line: return last useful item - } - return pFound; - } - ++it; - } - - return pFound; -} - // ----------------------------------------------------------------------- sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList ) diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 348ecec00104..3e32f5d02bf2 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -828,41 +828,6 @@ void ToolBox::RemoveItem( sal_uInt16 nPos ) // ----------------------------------------------------------------------- -void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) -{ - sal_uInt16 nPos = GetItemPos( nItemId ); - - if ( nPos == nNewPos ) - return; - - if ( nPos < nNewPos ) - nNewPos--; - - // Existiert Item - if ( nPos != TOOLBOX_ITEM_NOTFOUND ) - { - // ToolBox-Item in der Liste verschieben - ImplToolItem aItem = mpData->m_aItems[nPos]; - mpData->m_aItems.erase( mpData->m_aItems.begin()+nPos ); - mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aItem ); - mpData->ImplClearLayoutData(); - - // ToolBox neu ausgeben - ImplInvalidate( sal_False ); - - // Notify - if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway - ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) ); - else - { - sal_uInt16 nNewPos2 = sal::static_int_cast(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); - ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); - } - } -} - -// ----------------------------------------------------------------------- - void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, sal_uInt16 nNewPos ) { @@ -893,29 +858,6 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, // ----------------------------------------------------------------------- -void ToolBox::CopyItems( const ToolBox& rToolBox ) -{ - mpData->ImplClearLayoutData(); - mpData->m_aItems = rToolBox.mpData->m_aItems; - // Absichern gegen das Loeschen im Select-Handler - mnCurItemId = 0; - mnHighItemId = 0; - - for( std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); - it != mpData->m_aItems.end(); ++it ) - { - it->mpWindow = NULL; - it->mbShowWindow = sal_False; - } - - ImplInvalidate( sal_True, sal_True ); - - // Notify - ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED ); -} - -// ----------------------------------------------------------------------- - void ToolBox::Clear() { mpData->m_aItems.clear(); @@ -1043,11 +985,6 @@ void ToolBox::SetPageScroll( sal_Bool b ) mpData->mbPageScroll = b; } -sal_Bool ToolBox::GetPageScroll() -{ - return mpData->mbPageScroll; -} - // ----------------------------------------------------------------------- void ToolBox::SetNextToolBox( const XubString& rStr ) @@ -1224,16 +1161,6 @@ Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const return Rectangle(); } -// ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const -{ - if ( mbCalc || mbFormat ) - ((ToolBox*)this)->ImplFormat(); - - sal_uInt16 nPos = GetItemPos( nItemId ); - return GetItemPosDropDownRect( nPos ); -} - // ----------------------------------------------------------------------- Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const @@ -1249,11 +1176,6 @@ Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const // ----------------------------------------------------------------------- -Rectangle ToolBox::GetMenubuttonRect() const -{ - return mpData->maMenubuttonItem.maRect; -} - sal_Bool ToolBox::ImplHasExternalMenubutton() { // check if the borderwindow (i.e. the decoration) provides the menu button @@ -1459,55 +1381,6 @@ Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->mnImageAngle; - else - return 0; -} - -// ----------------------------------------------------------------------- - -sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->mbMirrorMode; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage ) -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - if ( pItem ) - { - DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) || - ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" ); - pItem->maHighImage = rImage; - } -} - -// ----------------------------------------------------------------------- - -Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const -{ - ImplToolItem* pItem = ImplGetItem( nItemId ); - - if ( pItem ) - return pItem->maHighImage; - else - return Image(); -} - -// ----------------------------------------------------------------------- - void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1668,18 +1541,6 @@ void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease // ----------------------------------------------------------------------- -sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const -{ - sal_uInt16 nPos = GetItemPos( nItemId ); - - if ( nPos != TOOLBOX_ITEM_NOTFOUND ) - return (nPos == mnCurPos); - else - return sal_False; -} - -// ----------------------------------------------------------------------- - void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1969,13 +1830,6 @@ void ToolBox::SetOutStyle( sal_uInt16 nNewStyle ) // ----------------------------------------------------------------------- -void ToolBox::RecalcItems() -{ - ImplInvalidate( sal_True ); -} - -// ----------------------------------------------------------------------- - // disable key input if all items are disabled void ToolBox::ImplUpdateInputEnable() @@ -2064,37 +1918,6 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const return nIndex; } -// ----------------------------------------------------------------------- - -long ToolBox::GetTextCount() const -{ - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineCount() : 0; -} - -// ----------------------------------------------------------------------- - -Pair ToolBox::GetTextStartEnd( long nText ) const -{ - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - return mpData->m_pLayoutData ? mpData->m_pLayoutData->GetLineStartEnd( nText ) : Pair( -1, -1 ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const -{ - sal_uInt16 nItemId = 0; - if( ! mpData->m_pLayoutData ) - ImplFillLayoutData(); - if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() ) - nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText]; - return nItemId; -} - - // ----------------------------------------------------------------------- void ToolBox::SetDropdownClickHdl( const Link& rLink ) @@ -2154,11 +1977,6 @@ void ToolBox::SetMenuButtonHdl( const Link& rLink ) mpData->maMenuButtonHdl = rLink; } -const Link& ToolBox::GetMenuButtonHdl() const -{ - return mpData->maMenuButtonHdl; -} - // ----------------------------------------------------------------------- sal_Bool ToolBox::ImplHasClippedItems() -- cgit v1.2.3 From 851cb7e311f79772a4d6623220e7442468b19163 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:21:43 +0200 Subject: callcatcher: remove TransferDataContainer::ClearData --- svtools/inc/svtools/transfer.hxx | 2 -- svtools/source/misc/transfer2.cxx | 9 --------- 2 files changed, 11 deletions(-) diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx index 397dccfc0fe6..26e84d0c3b12 100644 --- a/svtools/inc/svtools/transfer.hxx +++ b/svtools/inc/svtools/transfer.hxx @@ -565,8 +565,6 @@ public: TransferDataContainer(); ~TransferDataContainer(); - void ClearData(); - void CopyINetBookmark( const INetBookmark& rBkmk ); void CopyINetImage( const INetImage& rINtImg ); void CopyImageMap( const ImageMap& rImgMap ); diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index 5e4fa8e56077..fe8921061f8f 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -475,15 +475,6 @@ sal_Bool TransferDataContainer::GetData( const // ----------------------------------------------------------------------------- -void TransferDataContainer::ClearData() -{ - delete pImpl; - pImpl = new TransferDataContainer_Impl; - ClearFormats(); -} - -// ----------------------------------------------------------------------------- - void TransferDataContainer::CopyINetBookmark( const INetBookmark& rBkmk ) { if( !pImpl->pBookmk ) -- cgit v1.2.3 From 7ca22e561b9eb83dbc28427086dea06489c83290 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:24:29 +0200 Subject: callcatcher: remove TransferableDataHelper::GetInterface --- svtools/inc/svtools/transfer.hxx | 1 - svtools/source/misc/transfer.cxx | 9 --------- 2 files changed, 10 deletions(-) diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx index 26e84d0c3b12..0267824ff36e 100644 --- a/svtools/inc/svtools/transfer.hxx +++ b/svtools/inc/svtools/transfer.hxx @@ -398,7 +398,6 @@ public: sal_Bool GetInputStream( SotFormatStringId nFormat, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream ); sal_Bool GetInputStream( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference < com::sun::star::io::XInputStream >& xStream ); - sal_Bool GetInterface( SotFormatStringId nFormat, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf ); sal_Bool GetInterface( const ::com::sun::star::datatransfer::DataFlavor& rFlavor, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf ); public: diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 2c93a1045e89..22f0c3fe0ff3 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -2214,15 +2214,6 @@ sal_Bool TransferableDataHelper::GetInputStream( const DataFlavor& rFlavor, Refe // ----------------------------------------------------------------------------- - -sal_Bool TransferableDataHelper::GetInterface( SotFormatStringId nFormat, Reference< XInterface >& rIf ) -{ - DataFlavor aFlavor; - return( SotExchange::GetFormatDataFlavor( nFormat, aFlavor ) && GetInterface( aFlavor, rIf ) ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableDataHelper::GetInterface( const DataFlavor& rFlavor, Reference< XInterface >& rIf ) { const Any aAny( GetAny( rFlavor ) ); -- cgit v1.2.3 From 571eedc0cfa067029d59c78fd19cf06683b9d771 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:25:48 +0200 Subject: callcatcher: remove TransferableHelper::Foo --- svtools/inc/svtools/transfer.hxx | 3 --- svtools/source/misc/transfer.cxx | 25 ------------------------- 2 files changed, 28 deletions(-) diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx index 0267824ff36e..3b0d961a3623 100644 --- a/svtools/inc/svtools/transfer.hxx +++ b/svtools/inc/svtools/transfer.hxx @@ -267,10 +267,7 @@ protected: sal_Bool SetTransferableObjectDescriptor( const TransferableObjectDescriptor& rDesc, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); sal_Bool SetINetBookmark( const INetBookmark& rBmk, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); sal_Bool SetINetImage( const INetImage& rINtImg, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - sal_Bool SetFileList( const FileList& rFileList, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); sal_Bool SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); - sal_Bool SetInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf, - const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); protected: diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 22f0c3fe0ff3..cbb5eedb3bb3 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -975,22 +975,6 @@ sal_Bool TransferableHelper::SetINetImage( const INetImage& rINtImg, // ----------------------------------------------------------------------------- -sal_Bool TransferableHelper::SetFileList( const FileList& rFileList, - const ::com::sun::star::datatransfer::DataFlavor& ) -{ - SvMemoryStream aMemStm( 4096, 4096 ); - - aMemStm.SetVersion( SOFFICE_FILEFORMAT_50 ); - aMemStm << rFileList; - - maAny <<= Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aMemStm.GetData() ), - aMemStm.Seek( STREAM_SEEK_TO_END ) ); - - return( maAny.hasValue() ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableHelper::SetObject( void* pUserObject, sal_uInt32 nUserObjectId, const DataFlavor& rFlavor ) { SotStorageStreamRef xStm( new SotStorageStream( String() ) ); @@ -1022,15 +1006,6 @@ sal_Bool TransferableHelper::SetObject( void* pUserObject, sal_uInt32 nUserObjec // ----------------------------------------------------------------------------- -sal_Bool TransferableHelper::SetInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rIf, - const ::com::sun::star::datatransfer::DataFlavor& ) -{ - maAny <<= rIf; - return( maAny.hasValue() ); -} - -// ----------------------------------------------------------------------------- - sal_Bool TransferableHelper::WriteObject( SotStorageStreamRef&, void*, sal_uInt32, const DataFlavor& ) { OSL_FAIL( "TransferableHelper::WriteObject( ... ) not implemented" ); -- cgit v1.2.3 From e6309e7bf5419b6b040cc2e94670c8db4fe66037 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 14:27:16 +0200 Subject: callcatcher: remove Type1Emitter::Type1Emitter --- vcl/source/fontsubset/cff.cxx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index eed5a9e1ac07..b6516fcc624b 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1868,7 +1868,6 @@ const char* CffSubsetterContext::getGlyphName( int nGlyphIndex) class Type1Emitter { public: - explicit Type1Emitter( const char* pOutFileName, bool bPfbSubset = true); explicit Type1Emitter( FILE* pOutFile, bool bPfbSubset = true); /*virtual*/ ~Type1Emitter( void); void setSubsetName( const char* ); @@ -1895,20 +1894,6 @@ public: // -------------------------------------------------------------------- -Type1Emitter::Type1Emitter( const char* pPfbFileName, bool bPfbSubset) -: mpFileOut( NULL) -, mbCloseOutfile( true) -, mnEECryptR( 55665) // default eexec seed, TODO: mnEECryptSeed -, mpPtr( maBuffer) -, mbPfbSubset( bPfbSubset) -, mnHexLineCol( 0) -{ - mpFileOut = fopen( pPfbFileName, "wb"); - maSubsetName[0] = '\0'; -} - -// -------------------------------------------------------------------- - Type1Emitter::Type1Emitter( FILE* pOutFile, bool bPfbSubset) : mpFileOut( pOutFile) , mbCloseOutfile( false) -- cgit v1.2.3 From 264ef46bed7263fd01a32804fcbd3ccda78b0725 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 21:13:08 +0200 Subject: callcatcher: bring ImplTBDragMgr members back and remove EndCustomizeMode --- vcl/source/window/toolbox.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index e43f1c1fc8bd..0304033d03f9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -195,6 +195,8 @@ public: DECL_LINK( SelectHdl, Accelerator* ); void StartCustomizeMode(); + void EndCustomizeMode(); + sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -5481,14 +5483,6 @@ void ToolBox::EnableCustomize( sal_Bool bEnable ) // ----------------------------------------------------------------------- -void ToolBox::EndCustomizeMode() -{ - ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); - pMgr->EndCustomizeMode(); -} - -// ----------------------------------------------------------------------- - void ToolBox::GetFocus() { DockingWindow::GetFocus(); -- cgit v1.2.3 From 10f28d5c9a072bf108a79f3b05ad8247ca0dcea5 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 21:46:17 +0200 Subject: callcatcher: build fixes - remove the correct SetUpdateMode() - Clone() always returns NULL - SetFont() doesn't do anything --- svtools/inc/svtools/texteng.hxx | 2 +- svtools/source/edit/textdoc.cxx | 4 ++-- svtools/source/edit/texteng.cxx | 29 +++++++++++++++-------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/svtools/inc/svtools/texteng.hxx b/svtools/inc/svtools/texteng.hxx index ea81c4806206..e9f0b6c51b06 100644 --- a/svtools/inc/svtools/texteng.hxx +++ b/svtools/inc/svtools/texteng.hxx @@ -196,7 +196,6 @@ protected: void FormatAndUpdate( TextView* pCurView = 0 ); sal_Bool IsFormatting() const { return mbIsFormatting; } void UpdateViews( TextView* pCurView = 0 ); - void SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate ); void ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange = 0, TextSelection const* pSelection = 0 ); @@ -250,6 +249,7 @@ public: void SetLeftMargin( sal_uInt16 n ); sal_uInt16 GetLeftMargin() const; + void SetUpdateMode( sal_Bool bUpdate ); sal_Bool GetUpdateMode() const { return mbUpdate; } sal_uInt16 GetViewCount() const; diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index 615ac1258f4d..4fad052dd498 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -54,14 +54,14 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) { - mpAttr = rAttr.Clone(); + mpAttr = NULL; mnStart = nStart, mnEnd = nEnd; } TextCharAttrib::TextCharAttrib( const TextCharAttrib& rTextCharAttrib ) { - mpAttr = rTextCharAttrib.GetAttr().Clone(); + mpAttr = NULL; mnStart = rTextCharAttrib.mnStart; mnEnd = rTextCharAttrib.mnEnd; } diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx index 2b041f23be8a..9decddde44f9 100644 --- a/svtools/source/edit/texteng.cxx +++ b/svtools/source/edit/texteng.cxx @@ -339,6 +339,20 @@ sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const return mpDoc->GetNodes().GetObject( nPara )->GetText().Len(); } +void TextEngine::SetUpdateMode( sal_Bool bUpdate ) +{ + if ( bUpdate != mbUpdate ) + { + mbUpdate = bUpdate; + if ( mbUpdate ) + { + FormatAndUpdate( GetActiveView() ); + if ( GetActiveView() ) + GetActiveView()->ShowCursor(); + } + } +} + sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) { sal_Bool bDoesChange = sal_False; @@ -1466,11 +1480,7 @@ void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, Outp if ( ( ( pAttrib->GetStart() < nPos ) && ( pAttrib->GetEnd() >= nPos ) ) || !pNode->GetText().Len() ) { - if ( pAttrib->Which() != TEXTATTR_FONTCOLOR ) - { - pAttrib->GetAttr().SetFont( rFont ); - } - else + if ( pAttrib->Which() == TEXTATTR_FONTCOLOR ) { if ( pOutDev ) pOutDev->SetTextColor( ((TextAttribFontColor&)pAttrib->GetAttr()).GetColor() ); @@ -1510,15 +1520,6 @@ void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, Outp } } -void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate ) -{ - sal_Bool bChanged = ( GetUpdateMode() != bUp ); - - mbUpdate = bUp; - if ( mbUpdate && ( bChanged || bForceUpdate ) ) - FormatAndUpdate( pCurView ); -} - void TextEngine::FormatAndUpdate( TextView* pCurView ) { if ( mbDowning ) -- cgit v1.2.3 From 30bfcd14c3c42bde7c02328e258169deb5d634c2 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:05:08 +0200 Subject: callcatcher: remove Wallpaper::Foo --- vcl/inc/vcl/wall.hxx | 3 --- vcl/source/gdi/wall.cxx | 42 ------------------------------------------ 2 files changed, 45 deletions(-) diff --git a/vcl/inc/vcl/wall.hxx b/vcl/inc/vcl/wall.hxx index 66a2a11038ed..f85d58c1200f 100644 --- a/vcl/inc/vcl/wall.hxx +++ b/vcl/inc/vcl/wall.hxx @@ -112,17 +112,14 @@ public: WallpaperStyle GetStyle() const; void SetBitmap( const BitmapEx& rBitmap ); - void SetBitmap(); BitmapEx GetBitmap() const; sal_Bool IsBitmap() const; void SetGradient( const Gradient& rGradient ); - void SetGradient(); Gradient GetGradient() const; sal_Bool IsGradient() const; void SetRect( const Rectangle& rRect ); - void SetRect(); Rectangle GetRect() const; sal_Bool IsRect() const; diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index a24d3b0cbd66..5529d9c06232 100644 --- a/vcl/source/gdi/wall.cxx +++ b/vcl/source/gdi/wall.cxx @@ -366,20 +366,6 @@ void Wallpaper::SetBitmap( const BitmapEx& rBitmap ) // ----------------------------------------------------------------------- -void Wallpaper::SetBitmap() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpBitmap ) - { - ImplMakeUnique(); - delete mpImplWallpaper->mpBitmap; - mpImplWallpaper->mpBitmap = NULL; - } -} - -// ----------------------------------------------------------------------- - BitmapEx Wallpaper::GetBitmap() const { DBG_CHKTHIS( Wallpaper, NULL ); @@ -422,20 +408,6 @@ void Wallpaper::SetGradient( const Gradient& rGradient ) // ----------------------------------------------------------------------- -void Wallpaper::SetGradient() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpGradient ) - { - ImplMakeUnique(); - delete mpImplWallpaper->mpGradient; - mpImplWallpaper->mpGradient = NULL; - } -} - -// ----------------------------------------------------------------------- - Gradient Wallpaper::GetGradient() const { DBG_CHKTHIS( Wallpaper, NULL ); @@ -504,20 +476,6 @@ void Wallpaper::SetRect( const Rectangle& rRect ) // ----------------------------------------------------------------------- -void Wallpaper::SetRect() -{ - DBG_CHKTHIS( Wallpaper, NULL ); - - if ( mpImplWallpaper->mpRect ) - { - ImplMakeUnique( sal_False ); - delete mpImplWallpaper->mpRect; - mpImplWallpaper->mpRect = NULL; - } -} - -// ----------------------------------------------------------------------- - Rectangle Wallpaper::GetRect() const { DBG_CHKTHIS( Wallpaper, NULL ); -- cgit v1.2.3 From c57d50dc6309a444c1ca2ef4dc75b71ea924c8ac Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:13:25 +0200 Subject: callcatcher: remove Printer::Foo --- vcl/inc/vcl/print.hxx | 5 ----- vcl/source/gdi/print.cxx | 56 ----------------------------------------------- vcl/source/gdi/print2.cxx | 43 ------------------------------------ 3 files changed, 104 deletions(-) diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 182258aeb3c1..3d266160b3e2 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -272,7 +272,6 @@ private: static SAL_DLLPRIVATE sal_uLong ImplSalPrinterErrorCodeToVCL( sal_uLong nError ); private: - SAL_DLLPRIVATE void ImplEndPrint(); SAL_DLLPRIVATE sal_Bool EndJob(); SAL_DLLPRIVATE Printer( const Printer& rPrinter ); SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter ); @@ -281,7 +280,6 @@ public: SAL_DLLPRIVATE void ImplEndPage(); public: void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient ); - void DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient ); protected: @@ -290,7 +288,6 @@ protected: public: Printer(); - Printer( const Window* pWindow ); Printer( const JobSetup& rJobSetup ); Printer( const QueueInfo& rQueueInfo ); Printer( const XubString& rPrinterName ); @@ -329,7 +326,6 @@ public: sal_Bool SetOrientation( Orientation eOrient ); Orientation GetOrientation() const; - DuplexMode GetDuplexMode() const; sal_Bool SetDuplexMode( DuplexMode ); // returns the angle that a landscape page will be turned counterclockwise // wrt to portrait. The return value may be only valid for @@ -363,7 +359,6 @@ public: sal_Bool IsPrinting() const { return mbPrinting; } - sal_Bool AbortJob(); const XubString& GetCurJobName() const { return maJobName; } sal_uInt16 GetCurPage() const { return mnCurPage; } sal_Bool IsJobActive() const { return mbJobActive; } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 4c9461fbcb97..ef3c68ec5355 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -667,14 +667,6 @@ Printer::Printer() // ----------------------------------------------------------------------- -Printer::Printer( const Window* pWindow ) -{ - ImplInitData(); - ImplInitDisplay( pWindow ); -} - -// ----------------------------------------------------------------------- - Printer::Printer( const JobSetup& rJobSetup ) : maJobSetup( rJobSetup ) { @@ -1336,13 +1328,6 @@ const PaperInfo& Printer::GetPaperInfo( int nPaper ) const // ----------------------------------------------------------------------- -DuplexMode Printer::GetDuplexMode() const -{ - return maJobSetup.ImplGetConstData()->meDuplexMode; -} - -// ----------------------------------------------------------------------- - sal_Bool Printer::SetDuplexMode( DuplexMode eDuplex ) { if ( mbInPrintPage ) @@ -1455,15 +1440,6 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError ) // ----------------------------------------------------------------------- -void Printer::ImplEndPrint() -{ - mbPrinting = sal_False; - mnCurPrintPage = 0; - maJobName.Erase(); -} - -// ----------------------------------------------------------------------- - IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter ) { SalPrinter* pPrinter = (SalPrinter*)pSalPrinter; @@ -1510,38 +1486,6 @@ sal_Bool Printer::EndJob() // ----------------------------------------------------------------------- -sal_Bool Printer::AbortJob() -{ - // Wenn wir einen Queue-Printer haben, kann man diesen noch mit - // AbortJob() abbrechen, solange dieser noch am Drucken ist - if ( !IsJobActive() && !IsPrinting() ) - return sal_False; - - mbJobActive = sal_False; - mbInPrintPage = sal_False; - mpJobGraphics = NULL; - - if ( mpPrinter ) - { - mbPrinting = sal_False; - mnCurPage = 0; - mnCurPrintPage = 0; - maJobName.Erase(); - - ImplReleaseGraphics(); - mbDevOutput = sal_False; - mpPrinter->AbortJob(); - Application::PostUserEvent( LINK( this, Printer, ImplDestroyPrinterAsync ), mpPrinter ); - mpPrinter = NULL; - - return sal_True; - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Printer::ImplStartPage() { if ( !IsJobActive() ) diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index add5071ef2dd..bfb28b5b6996 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1579,47 +1579,4 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const pOut->DrawGradient( rRect, rGradient ); } -// ----------------------------------------------------------------------------- - -void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient ) -{ - const PrinterOptions& rPrinterOptions = GetPrinterOptions(); - - if( rPrinterOptions.IsReduceGradients() ) - { - if( PRINTER_GRADIENT_STRIPES == rPrinterOptions.GetReducedGradientMode() ) - { - if( !rGradient.GetSteps() || ( rGradient.GetSteps() > rPrinterOptions.GetReducedGradientStepCount() ) ) - { - Gradient aNewGradient( rGradient ); - - aNewGradient.SetSteps( rPrinterOptions.GetReducedGradientStepCount() ); - pOut->DrawGradient( rPolyPoly, aNewGradient ); - } - else - pOut->DrawGradient( rPolyPoly, rGradient ); - } - else - { - const Color& rStartColor = rGradient.GetStartColor(); - const Color& rEndColor = rGradient.GetEndColor(); - const long nR = ( ( (long) rStartColor.GetRed() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetRed() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const long nG = ( ( (long) rStartColor.GetGreen() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetGreen() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const long nB = ( ( (long) rStartColor.GetBlue() * rGradient.GetStartIntensity() ) / 100L + - ( (long) rEndColor.GetBlue() * rGradient.GetEndIntensity() ) / 100L ) >> 1; - const Color aColor( (sal_uInt8) nR, (sal_uInt8) nG, (sal_uInt8) nB ); - - pOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR ); - pOut->SetLineColor( aColor ); - pOut->SetFillColor( aColor ); - pOut->DrawPolyPolygon( rPolyPoly ); - pOut->Pop(); - } - } - else - pOut->DrawGradient( rPolyPoly, rGradient ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 2b4d711e0f716f727b4e7b10d4ba21fa7b8e8412 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:14:43 +0200 Subject: callcatcher: remove PrinterSetupDialog::GetOptionsHdl --- svtools/inc/svtools/prnsetup.hxx | 1 - svtools/source/dialogs/prnsetup.cxx | 5 ----- 2 files changed, 6 deletions(-) diff --git a/svtools/inc/svtools/prnsetup.hxx b/svtools/inc/svtools/prnsetup.hxx index a7155032a238..4fc096c5a85e 100644 --- a/svtools/inc/svtools/prnsetup.hxx +++ b/svtools/inc/svtools/prnsetup.hxx @@ -90,7 +90,6 @@ public: virtual short Execute(); void SetOptionsHdl( const Link& rLink ); - const Link& GetOptionsHdl() const; }; // -------------------------------------- diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 728d0e6ea5c7..1c39b8e6f70d 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -281,11 +281,6 @@ void PrinterSetupDialog::SetOptionsHdl( const Link& rLink ) maBtnOptions.Show( rLink.IsSet() ); } -const Link& PrinterSetupDialog::GetOptionsHdl() const -{ - return maBtnOptions.GetClickHdl(); -} - void PrinterSetupDialog::ImplSetInfo() { const QueueInfo* pInfo = Printer::GetQueueInfo(maLbName.GetSelectEntry(), true); -- cgit v1.2.3 From 3dc7859eb7801ffd801d214654385c6133a41452 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:18:19 +0200 Subject: callcatcher: remove INetContentTypes::Foo --- svl/inc/svl/inettype.hxx | 7 ------- svl/source/misc/inettype.cxx | 38 -------------------------------------- 2 files changed, 45 deletions(-) diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx index 54dbda7b75d4..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,9 +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 diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 762f53061dcf..d576ae83cf7b 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); @@ -766,24 +764,6 @@ UniString Registration::GetPresentation(INetContentType eTypeID) return pEntry ? pEntry->m_aPresentation : UniString(); } -//============================================================================ -// 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 & @@ -854,12 +834,6 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName, // //============================================================================ -//static -void INetContentTypes::Uninitialize() -{ - Registration::deinitialize(); -} - //============================================================================ //static INetContentType INetContentTypes::RegisterContentType(UniString const & @@ -1135,18 +1109,6 @@ bool INetContentTypes::GetExtensionFromURL(UniString const & rURL, return false; } -//============================================================================ -//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(UniString const & rMediaType, -- cgit v1.2.3 From 1b4f6e746d0dcdea0603d962336a3dd173d279bd Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:20:57 +0200 Subject: callcatcher: cleanup INetIStream --- tools/inc/tools/inetstrm.hxx | 3 --- tools/source/inet/inetstrm.cxx | 42 ------------------------------------------ 2 files changed, 45 deletions(-) diff --git a/tools/inc/tools/inetstrm.hxx b/tools/inc/tools/inetstrm.hxx index aa662555c14e..4d82c8de9791 100644 --- a/tools/inc/tools/inetstrm.hxx +++ b/tools/inc/tools/inetstrm.hxx @@ -68,9 +68,6 @@ public: virtual ~INetIStream (void); int Read (sal_Char *pData, sal_uIntPtr nSize); - - static void Decode64 (SvStream& rIn, SvStream& rOut); - static void Encode64 (SvStream& rIn, SvStream& rOut); }; /* diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index ff90411c8cee..7a04ea24af20 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -173,48 +173,6 @@ int INetIStream::Read (sal_Char *pData, sal_uIntPtr nSize) return GetData (pData, nSize); } -/* - * Decode64. - */ -void INetIStream::Decode64 (SvStream& rIn, SvStream& rOut) -{ - INetMessage aMsg; - aMsg.SetDocumentLB(new SvAsyncLockBytes(&rOut, sal_False)); - - INetMessageDecode64Stream_Impl aStream (8192); - aStream.SetTargetMessage (&aMsg); - - sal_Char* pBuf = new sal_Char[8192]; - - int nRead = 0; - while ((nRead = rIn.Read (pBuf, 8192)) > 0) - aStream.Write( pBuf, nRead ); - aStream.Write ("\r\n", 2); - - delete[] pBuf; -} - -/* - * Encode64. - */ -void INetIStream::Encode64 (SvStream& rIn, SvStream& rOut) -{ - INetMessage aMsg; - aMsg.SetDocumentLB ( - new SvLockBytes (&rIn, sal_False)); - - INetMessageEncode64Stream_Impl aStream (8192); - aStream.SetSourceMessage (&aMsg); - - sal_Char* pBuf = new sal_Char[8192]; - - int nRead = 0; - while ((nRead = aStream.Read (pBuf, 8192)) > 0) - rOut.Write( pBuf, nRead ); - - delete[] pBuf; -} - /*========================================================================= * * INetOStream Implementation. -- cgit v1.2.3 From 9a5c6464357a3b820409241960dbed95ac25a7df Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:32:17 +0200 Subject: callcatcher: cleanup INetMIMEMessage --- tools/inc/tools/inetmsg.hxx | 3 - tools/source/inet/inetmsg.cxx | 201 ------------------------------------------ 2 files changed, 204 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index cfdd78153e47..60e0a8f0cb0d 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -500,7 +500,6 @@ public: return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]); } - void SetContentID (const UniString& rID); UniString GetContentID (void) const { return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_ID]); @@ -547,8 +546,6 @@ public: INetMessageContainerType eType = INETMSG_MULTIPART_MIXED); sal_Bool AttachChild ( INetMIMEMessage& rChildMsg, sal_Bool bOwner = sal_True); - sal_Bool DetachChild ( - sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const; /** Stream operators. */ diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 235d6fd4d20b..8a390b3f060b 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -1035,14 +1035,6 @@ void INetMIMEMessage::SetContentDisposition (const String& rDisposition) m_nIndex[INETMSG_MIME_CONTENT_DISPOSITION]); } -void INetMIMEMessage::SetContentID (const String& rID) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - MIMEHDR(INETMSG_MIME_CONTENT_ID), rID, - m_nIndex[INETMSG_MIME_CONTENT_ID]); -} - void INetMIMEMessage::SetContentType (const String& rType) { SetHeaderField_Impl ( @@ -1181,199 +1173,6 @@ sal_Bool INetMIMEMessage::AttachChild ( return sal_False; } -/* - * DetachChild. - */ -sal_Bool INetMIMEMessage::DetachChild ( - sal_uIntPtr nIndex, INetMIMEMessage& rChildMsg) const -{ - if (IsContainer()) - { - // Check document stream. - if (GetDocumentLB() == NULL) return sal_False; - SvStream *pDocStrm = new SvStream (GetDocumentLB()); - - // Initialize message buffer. - char pMsgBuffer[1024]; - char *pMsgRead, *pMsgWrite; - pMsgRead = pMsgWrite = pMsgBuffer; - - // Initialize message parser stream. - INetMIMEMessageStream *pMsgStrm = NULL; - - // Check for "multipart/uvw" or "message/xyz". - if (IsMultipart()) - { - // Multipart message body. Initialize multipart delimiters. - ByteString aDelim ("--"); - aDelim += GetMultipartBoundary(); - ByteString aClose = aDelim; - aClose += "--"; - - // Initialize line buffer. - SvMemoryStream aLineBuf; - - // Initialize control variables. - INetMessageStreamState eState = INETMSG_EOL_SCR; - int nCurIndex = -1; - - // Go! - while (nCurIndex < (int)(nIndex + 1)) - { - if ((pMsgRead - pMsgWrite) > 0) - { - // Bytes still in buffer. - if (eState == INETMSG_EOL_FCR) - { - // Check for 2nd line break character. - if ((*pMsgWrite == '\r') || (*pMsgWrite == '\n')) - aLineBuf << *pMsgWrite++; - - // Check current index. - if (nCurIndex == (int)nIndex) - { - // Found requested part. - if (pMsgStrm == NULL) - { - // Create message parser stream. - pMsgStrm = new INetMIMEMessageStream; - pMsgStrm->SetTargetMessage (&rChildMsg); - } - - // Put message down-stream. - int status = pMsgStrm->Write ( - (const sal_Char *) aLineBuf.GetData(), aLineBuf.Tell()); - if (status != INETSTREAM_STATUS_OK) - { - // Cleanup. - delete pDocStrm; - delete pMsgStrm; - - // Finish. - return (!(status == INETSTREAM_STATUS_OK)); - } - } - - // Reset to . - aLineBuf.Seek (STREAM_SEEK_TO_BEGIN); - eState = INETMSG_EOL_SCR; - } - else if ((*pMsgWrite == '\r') || (*pMsgWrite == '\n')) - { - /* - * Found any line break character. - * Compare buffered line with part/close delimiter. - * Increment current part index upon match. - */ - sal_uInt16 nLen = (sal_uInt16)(aLineBuf.Tell() & 0xffff); - if (nLen == aDelim.Len()) - { - if (aDelim.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen) - == COMPARE_EQUAL) nCurIndex++; - } - else if (nLen == aClose.Len()) - { - if (aClose.CompareTo ((const sal_Char *) aLineBuf.GetData(), nLen) - == COMPARE_EQUAL) nCurIndex++; - } - aLineBuf << *pMsgWrite++; - eState = INETMSG_EOL_FCR; - } - else - { - // Insert into line buffer. - aLineBuf << *pMsgWrite; - } - } - else - { - // Buffer empty. Reset to . - pMsgRead = pMsgWrite = pMsgBuffer; - - // Read document stream. - sal_uIntPtr nRead = pDocStrm->Read ( - pMsgBuffer, sizeof (pMsgBuffer)); - if (nRead > 0) - { - // Set read pointer. - pMsgRead += nRead; - } - else - { - // Premature end. - if (pMsgStrm) - { - // Assume end of requested part. - nCurIndex++; - } - else - { - // Requested part not found. - delete pDocStrm; - return sal_False; - } - } - } - } // while (nCurIndex < (nIndex + 1)) - } - else - { - // Encapsulated message body. Create message parser stream. - pMsgStrm = new INetMIMEMessageStream; - pMsgStrm->SetTargetMessage (&rChildMsg); - - // Initialize control variables. - INetMessageStreamState eState = INETMSG_EOL_BEGIN; - - // Go. - while (eState == INETMSG_EOL_BEGIN) - { - if ((pMsgRead - pMsgWrite) > 0) - { - // Bytes still in buffer. Put message down-stream. - int status = pMsgStrm->Write ( - pMsgBuffer, (pMsgRead - pMsgWrite)); - if (status != INETSTREAM_STATUS_OK) - { - // Cleanup. - delete pDocStrm; - delete pMsgStrm; - - // Finish. - return (!(status == INETSTREAM_STATUS_ERROR)); - } - pMsgWrite = pMsgBuffer + (pMsgRead - pMsgWrite); - } - else - { - // Buffer empty. Reset to . - pMsgRead = pMsgWrite = pMsgBuffer; - - // Read document stream. - sal_uIntPtr nRead = pDocStrm->Read ( - pMsgBuffer, sizeof (pMsgBuffer)); - if (nRead > 0) - { - // Set read pointer. - pMsgRead += nRead; - } - else - { - // Mark we're done. - eState = INETMSG_EOL_DONE; - } - } - } // while (eState == INETMSG_EOL_BEGIN) - } - - // Done. - if (pDocStrm) delete pDocStrm; - if (pMsgStrm) delete pMsgStrm; - return sal_True; - } - return sal_False; -} - /* * operator<< */ -- cgit v1.2.3 From 734485db6a9612879eec051d6a857aa5563f2235 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:34:42 +0200 Subject: callcatcher: remove INetMessage::SetHeaderField --- tools/inc/tools/inetmsg.hxx | 6 ------ tools/source/inet/inetmsg.cxx | 14 -------------- 2 files changed, 20 deletions(-) diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index 60e0a8f0cb0d..cf96dc98d5be 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -209,12 +209,6 @@ public: } } - sal_uIntPtr SetHeaderField ( - const UniString& rName, - const UniString& rValue, - sal_uIntPtr nIndex = ((sal_uIntPtr)-1) - ); - virtual sal_uIntPtr SetHeaderField ( const INetMessageHeader &rField, sal_uIntPtr nIndex = ((sal_uIntPtr)-1) diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 8a390b3f060b..aa6a00313352 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -121,20 +121,6 @@ void INetMessage::SetHeaderField_Impl ( INetMessageHeader (rName, aSink.takeBuffer()), rnIndex); } -/* - * SetHeaderField. - */ -sal_uIntPtr INetMessage::SetHeaderField ( - const UniString& rName, const UniString& rValue, sal_uIntPtr nIndex) -{ - sal_uIntPtr nResult = nIndex; - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - ByteString (rName, RTL_TEXTENCODING_ASCII_US), rValue, - nResult); - return nResult; -} - /* * SetHeaderField. */ -- cgit v1.2.3 From b272991c334e008537d5aa1b782e1f4a3dab6da8 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 22:48:22 +0200 Subject: callcatcher: cleanup INetMIME --- tools/inc/tools/inetmime.hxx | 54 --------- tools/source/inet/inetmime.cxx | 256 ----------------------------------------- 2 files changed, 310 deletions(-) diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 2c4c425f79e1..a9407126a93f 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -377,8 +377,6 @@ public: @return The Base 64 digit corresponding to nWeight (US-ASCII 'A'-- 'Z', 'a'--'z', '0'--'9', '+' or '/'). */ - static sal_uInt32 getBase64Digit(int nWeight); - static inline bool isHighSurrogate(sal_uInt32 nUTF16); static inline bool isLowSurrogate(sal_uInt32 nUTF16); @@ -386,28 +384,6 @@ public: static inline sal_uInt32 toUTF32(sal_Unicode cHighSurrogate, sal_Unicode cLowSurrogate); - /** Check two US-ASCII strings for equality, ignoring case. - - @param pBegin1 Points to the start of the first string, must not be - null. - - @param pEnd1 Points past the end of the first string, must be >= - pBegin1. - - @param pBegin2 Points to the start of the second string, must not be - null. - - @param pEnd2 Points past the end of the second string, must be >= - pBegin2. - - @return True if the two strings are equal, ignoring the case of US- - ASCII alphabetic characters (US-ASCII 'A'--'Z' and 'a'--'z'). - */ - static bool equalIgnoreCase(const sal_Char * pBegin1, - const sal_Char * pEnd1, - const sal_Char * pBegin2, - const sal_Char * pEnd2); - /** Check two US-ASCII strings for equality, ignoring case. @param pBegin1 Points to the start of the first string, must not be @@ -472,9 +448,6 @@ public: static bool startsWithLinearWhiteSpace(const sal_Char * pBegin, const sal_Char * pEnd); - static const sal_Char * skipLinearWhiteSpace(const sal_Char * pBegin, - const sal_Char * pEnd); - static const sal_Unicode * skipLinearWhiteSpace(const sal_Unicode * pBegin, const sal_Unicode * pEnd); @@ -503,12 +476,6 @@ public: static const sal_Unicode * skipQuotedString(const sal_Unicode * pBegin, const sal_Unicode * pEnd); - static const sal_Char * scanAtom(const sal_Char * pBegin, - const sal_Char * pEnd); - - static const sal_Unicode * scanAtom(const sal_Unicode * pBegin, - const sal_Unicode * pEnd); - static bool scanUnsigned(const sal_Char *& rBegin, const sal_Char * pEnd, bool bLeadingZeroes, sal_uInt32 & rValue); @@ -516,21 +483,6 @@ public: const sal_Unicode * pEnd, bool bLeadingZeroes, sal_uInt32 & rValue); - static bool scanUnsignedHex(const sal_Char *& rBegin, - const sal_Char * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue); - - static bool scanUnsignedHex(const sal_Unicode *& rBegin, - const sal_Unicode * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue); - - static const sal_Char * scanQuotedBlock(const sal_Char * pBegin, - const sal_Char * pEnd, - sal_uInt32 nOpening, - sal_uInt32 nClosing, - sal_Size & rLength, - bool & rModify); - static const sal_Unicode * scanQuotedBlock(const sal_Unicode * pBegin, const sal_Unicode * pEnd, sal_uInt32 nOpening, @@ -559,9 +511,6 @@ public: static rtl_TextEncoding getCharsetEncoding(const sal_Char * pBegin, const sal_Char * pEnd); - static rtl_TextEncoding getCharsetEncoding(const sal_Unicode * pBegin, - const sal_Unicode * pEnd); - static inline bool isMIMECharsetEncoding(rtl_TextEncoding eEncoding); static INetMIMECharsetList_Impl * @@ -594,9 +543,6 @@ public: static void writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, int nMinDigits = 1); - static void writeDateTime(INetMIMEOutputSink & rSink, - const DateTime & rUTC); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 83a3741a72cf..1db41b4d73ba 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -515,40 +515,6 @@ sal_uInt32 INetMIME::getHexDigit(int nWeight) return aDigits[nWeight]; } -//============================================================================ -// static -sal_uInt32 INetMIME::getBase64Digit(int nWeight) -{ - DBG_ASSERT(nWeight >= 0 && nWeight < 64, - "INetMIME::getBase64Digit(): Bad weight"); - - static const sal_Char aDigits[64] - = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; - return aDigits[nWeight]; -} - -//============================================================================ -// static -bool INetMIME::equalIgnoreCase(const sal_Char * pBegin1, - const sal_Char * pEnd1, - const sal_Char * pBegin2, - const sal_Char * pEnd2) -{ - DBG_ASSERT(pBegin1 && pBegin1 <= pEnd1 && pBegin2 && pBegin2 <= pEnd2, - "INetMIME::equalIgnoreCase(): Bad sequences"); - - if (pEnd1 - pBegin1 != pEnd2 - pBegin2) - return false; - while (pBegin1 != pEnd1) - if (toUpperCase(*pBegin1++) != toUpperCase(*pBegin2++)) - return false; - return true; -} - //============================================================================ // static bool INetMIME::equalIgnoreCase(const sal_Char * pBegin1, @@ -581,35 +547,6 @@ bool INetMIME::equalIgnoreCase(const sal_Unicode * pBegin1, return pBegin1 == pEnd1; } -//============================================================================ -// static -const sal_Char * INetMIME::skipLinearWhiteSpace(const sal_Char * pBegin, - const sal_Char * pEnd) -{ - DBG_ASSERT(pBegin && pBegin <= pEnd, - "INetMIME::skipLinearWhiteSpace(): Bad sequence"); - - while (pBegin != pEnd) - switch (*pBegin) - { - case '\t': - case ' ': - ++pBegin; - break; - - case 0x0D: // CR - if (startsWithLineFolding(pBegin, pEnd)) - pBegin += 3; - else - return pBegin; - break; - - default: - return pBegin; - } - return pBegin; -} - //============================================================================ // static const sal_Unicode * INetMIME::skipLinearWhiteSpace(const sal_Unicode * pBegin, @@ -840,26 +777,6 @@ const sal_Unicode * INetMIME::skipQuotedString(const sal_Unicode * pBegin, return pBegin; } -//============================================================================ -// static -const sal_Char * INetMIME::scanAtom(const sal_Char * pBegin, - const sal_Char * pEnd) -{ - while (pBegin != pEnd && isAtomChar(*pBegin)) - ++pBegin; - return pBegin; -} - -//============================================================================ -// static -const sal_Unicode * INetMIME::scanAtom(const sal_Unicode * pBegin, - const sal_Unicode * pEnd) -{ - while (pBegin != pEnd && isAtomChar(*pBegin)) - ++pBegin; - return pBegin; -} - //============================================================================ // static bool INetMIME::scanUnsigned(const sal_Char *& rBegin, const sal_Char * pEnd, @@ -907,127 +824,6 @@ bool INetMIME::scanUnsigned(const sal_Unicode *& rBegin, return true; } -//============================================================================ -// static -bool INetMIME::scanUnsignedHex(const sal_Char *& rBegin, - const sal_Char * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue) -{ - sal_uInt64 nTheValue = 0; - const sal_Char * p = rBegin; - for ( p = rBegin; p != pEnd; ++p) - { - int nWeight = getHexWeight(*p); - if (nWeight < 0) - break; - nTheValue = nTheValue << 4 | nWeight; - if (nTheValue > std::numeric_limits< sal_uInt32 >::max()) - return false; - } - if (nTheValue == 0 && (p == rBegin || (!bLeadingZeroes && p - rBegin != 1))) - return false; - rBegin = p; - rValue = sal_uInt32(nTheValue); - return true; -} - -//============================================================================ -// static -bool INetMIME::scanUnsignedHex(const sal_Unicode *& rBegin, - const sal_Unicode * pEnd, bool bLeadingZeroes, - sal_uInt32 & rValue) -{ - sal_uInt64 nTheValue = 0; - const sal_Unicode * p = rBegin; - for ( ; p != pEnd; ++p) - { - int nWeight = getHexWeight(*p); - if (nWeight < 0) - break; - nTheValue = nTheValue << 4 | nWeight; - if (nTheValue > std::numeric_limits< sal_uInt32 >::max()) - return false; - } - if (nTheValue == 0 && (p == rBegin || (!bLeadingZeroes && p - rBegin != 1))) - return false; - rBegin = p; - rValue = sal_uInt32(nTheValue); - return true; -} - -//============================================================================ -// static -const sal_Char * INetMIME::scanQuotedBlock(const sal_Char * pBegin, - const sal_Char * pEnd, - sal_uInt32 nOpening, - sal_uInt32 nClosing, - sal_Size & rLength, - bool & rModify) -{ - DBG_ASSERT(pBegin && pBegin <= pEnd, - "INetMIME::scanQuotedBlock(): Bad sequence"); - - if (pBegin != pEnd && static_cast< unsigned char >(*pBegin) == nOpening) - { - ++rLength; - ++pBegin; - while (pBegin != pEnd) - if (static_cast< unsigned char >(*pBegin) == nClosing) - { - ++rLength; - return ++pBegin; - } - else - { - sal_uInt32 c = *pBegin++; - switch (c) - { - case 0x0D: // CR - if (pBegin != pEnd && *pBegin == 0x0A) // LF - if (pEnd - pBegin >= 2 && isWhiteSpace(pBegin[1])) - { - ++rLength; - rModify = true; - pBegin += 2; - } - else - { - rLength += 3; - rModify = true; - ++pBegin; - } - else - ++rLength; - break; - - case '\\': - ++rLength; - if (pBegin != pEnd) - { - if (startsWithLineBreak(pBegin, pEnd) - && (pEnd - pBegin < 3 - || !isWhiteSpace(pBegin[2]))) - { - rLength += 3; - rModify = true; - pBegin += 2; - } - else - ++pBegin; - } - break; - - default: - ++rLength; - if (!isUSASCII(c)) - rModify = true; - break; - } - } - } - return pBegin; -} - //============================================================================ // static const sal_Unicode * INetMIME::scanQuotedBlock(const sal_Unicode * pBegin, @@ -1765,14 +1561,6 @@ rtl_TextEncoding INetMIME::getCharsetEncoding(sal_Char const * pBegin, return getCharsetEncoding_Impl(pBegin, pEnd); } -//============================================================================ -// static -rtl_TextEncoding INetMIME::getCharsetEncoding(sal_Unicode const * pBegin, - sal_Unicode const * pEnd) -{ - return getCharsetEncoding_Impl(pBegin, pEnd); -} - //============================================================================ // static INetMIMECharsetList_Impl * @@ -2185,50 +1973,6 @@ void INetMIME::writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, rSink << *--p; } -//============================================================================ -// static -void INetMIME::writeDateTime(INetMIMEOutputSink & rSink, - const DateTime & rUTC) -{ - static const sal_Char aDay[7][3] - = { { 'M', 'o', 'n' }, - { 'T', 'u', 'e' }, - { 'W', 'e', 'd' }, - { 'T', 'h', 'u' }, - { 'F', 'r', 'i' }, - { 'S', 'a', 't' }, - { 'S', 'u', 'n' } }; - const sal_Char * pTheDay = aDay[rUTC.GetDayOfWeek()]; - rSink.write(pTheDay, pTheDay + 3); - rSink << ", "; - writeUnsigned(rSink, rUTC.GetDay()); - rSink << ' '; - static const sal_Char aMonth[12][3] - = { { 'J', 'a', 'n' }, - { 'F', 'e', 'b' }, - { 'M', 'a', 'r' }, - { 'A', 'p', 'r' }, - { 'M', 'a', 'y' }, - { 'J', 'u', 'n' }, - { 'J', 'u', 'l' }, - { 'A', 'u', 'g' }, - { 'S', 'e', 'p' }, - { 'O', 'c', 't' }, - { 'N', 'o', 'v' }, - { 'D', 'e', 'c' } }; - const sal_Char * pTheMonth = aMonth[rUTC.GetMonth() - 1]; - rSink.write(pTheMonth, pTheMonth + 3); - rSink << ' '; - writeUnsigned(rSink, rUTC.GetYear()); - rSink << ' '; - writeUnsigned(rSink, rUTC.GetHour(), 2); - rSink << ':'; - writeUnsigned(rSink, rUTC.GetMin(), 2); - rSink << ':'; - writeUnsigned(rSink, rUTC.GetSec(), 2); - rSink << " +0000"; -} - //============================================================================ // static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, -- cgit v1.2.3 From 03ce32c4feae1c4db4f307007ca19822eccc0a4f Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 13 Jul 2011 23:00:29 +0200 Subject: callcatcher: actually remove INetContentTypes::GetExtension --- svl/source/misc/inettype.cxx | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index d576ae83cf7b..a00f2e453afb 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -942,25 +942,6 @@ UniString INetContentTypes::GetPresentation(INetContentType eTypeID, return SvtSimpleResId(nResID, aLocale); } -//============================================================================ -//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 & -- cgit v1.2.3 From 24d333676a54f48ed0c989fb54b42a9af899127f Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 14 Jul 2011 01:05:54 +0200 Subject: Revert "callcatcher: remove unused TempFile::SetTempNameBaseDirectory from unotools" This reverts commit 817875a7126b403ab029ca1fa06c9d3297bd24b2. --- unotools/inc/unotools/tempfile.hxx | 11 +++++++++ unotools/source/ucbhelper/tempfile.cxx | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/unotools/inc/unotools/tempfile.hxx b/unotools/inc/unotools/tempfile.hxx index b30f2eb4f7bd..2030b1ab0791 100644 --- a/unotools/inc/unotools/tempfile.hxx +++ b/unotools/inc/unotools/tempfile.hxx @@ -143,6 +143,17 @@ public: conversion functions of osl. */ static String CreateTempName( const String* pParent=NULL ); + + /** + The TempNameBaseDirectory is a subfolder in the folder that is passed as a "physical" file name in the + SetTempNameBaseDirectory method. + This subfolder will be used if a TempFile or TempName is created without a parent name or a parent name + that does not belong to the local file system. + The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it. + The return value of both methods is the complete "physical" name of the tempname base folder. + It is not a URL because alle URLs must be "UCB compatible", so there may be no suitable URL at all. + */ + static String SetTempNameBaseDirectory( const String &rBaseName ); }; } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 49d8bfaf4efd..33a3ca6fb8f4 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -443,6 +443,47 @@ void TempFile::CloseStream() } } +String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) +{ + if( !rBaseName.Len() ) + return String(); + + rtl::OUString aUnqPath( rBaseName ); + + // remove trailing slash + if ( rBaseName.GetChar( rBaseName.Len() - 1 ) == sal_Unicode( '/' ) ) + aUnqPath = rBaseName.Copy( 0, rBaseName.Len() - 1 ); + + // try to create the directory + sal_Bool bRet = sal_False; + osl::FileBase::RC err = osl::Directory::create( aUnqPath ); + if ( err != FileBase::E_None && err != FileBase::E_EXIST ) + // perhaps parent(s) don't exist + bRet = ensuredir( aUnqPath ); + else + bRet = sal_True; + + // failure to create base directory means returning an empty string + rtl::OUString aTmp; + if ( bRet ) + { + // append own internal directory + bRet = sal_True; + ::rtl::OUString &rTempNameBase_Impl = TempNameBase_Impl::get(); + rTempNameBase_Impl = rBaseName; + rTempNameBase_Impl += String( '/' ); + + TempFile aBase( NULL, sal_True ); + if ( aBase.IsValid() ) + // use it in case of success + rTempNameBase_Impl = aBase.pImp->aName; + + // return system path of used directory + FileBase::getSystemPathFromFileURL( rTempNameBase_Impl, aTmp ); + } + + return aTmp; +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 85713e8a910a0f70180dad9439f7fba2759c7980 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 14 Jul 2011 01:07:39 +0200 Subject: callcatcher: actually remove the correct SetTempNameBaseDirectory --- tools/inc/tools/tempfile.hxx | 7 ------- tools/source/fsys/tempfile.cxx | 22 ---------------------- 2 files changed, 29 deletions(-) diff --git a/tools/inc/tools/tempfile.hxx b/tools/inc/tools/tempfile.hxx index d81914e1f0e7..4ca220462898 100644 --- a/tools/inc/tools/tempfile.hxx +++ b/tools/inc/tools/tempfile.hxx @@ -65,13 +65,6 @@ public: // Only create a name for a temporary file that would be valid at that moment. static String CreateTempName( const String* pParent=NULL ); - - // The TempNameBase is a folder in the default ( system ) tempfile folder. - // This subfolder will be used if a TempFile or TempName is created without a parent name. - // The caller of the SetTempNameBase is responsible for deleting this folder and all temporary files in it. - // The argument must be a simple name, not a complete URL. - // The return value of both methods is the complete URL of the tempname base folder. - static String SetTempNameBaseDirectory( const String &rBaseName ); }; #endif diff --git a/tools/source/fsys/tempfile.cxx b/tools/source/fsys/tempfile.cxx index b859fa9ab1e3..b6a4b1e2b70e 100644 --- a/tools/source/fsys/tempfile.cxx +++ b/tools/source/fsys/tempfile.cxx @@ -267,26 +267,4 @@ String TempFile::GetName() const return aTmp; } -String TempFile::SetTempNameBaseDirectory( const String &rBaseName ) -{ - String aName( rBaseName ); - - ::rtl::OUString& rTempNameBase_Impl = TempNameBase_Impl::get(); - - FileBase::RC err= Directory::create( aName ); - if ( err == FileBase::E_None || err == FileBase::E_EXIST ) - { - rTempNameBase_Impl = aName; - rTempNameBase_Impl += String( '/' ); - - TempFile aBase( NULL, sal_True ); - if ( aBase.IsValid() ) - rTempNameBase_Impl = aBase.pImp->aName; - } - - rtl::OUString aTmp; - aTmp = rTempNameBase_Impl; - return aTmp; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 364b742f3674bf5c90067ba473794042d890e325 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 14 Jul 2011 09:53:11 +0200 Subject: WaE: unused parameter --- svtools/source/edit/textdoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index 4fad052dd498..b31395dd43fa 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -52,7 +52,7 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- // (+) class TextCharAttrib // ------------------------------------------------------------------------- -TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& /* rAttr */, sal_uInt16 nStart, sal_uInt16 nEnd ) { mpAttr = NULL; mnStart = nStart, -- cgit v1.2.3 From b1e607a2ee4be0bf305c20fb5ba60bad3f0ed316 Mon Sep 17 00:00:00 2001 From: Nigel Hawkins Date: Thu, 14 Jul 2011 09:49:14 +0100 Subject: Fix "unused attribute" build error. This reverts parts of 82ea128f190dbe8d707cb140a5a2bb2b48bef58d e1309004099d1a1c0a9bc1ba6de9e5054629da3c which were a bit over-zealous at removing "unused" stuff. LGPLv3+/MPL --- svtools/inc/svtools/txtattr.hxx | 4 +++- svtools/source/edit/textdoc.cxx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/svtools/inc/svtools/txtattr.hxx b/svtools/inc/svtools/txtattr.hxx index 2b6028965475..bf4c8e38b007 100644 --- a/svtools/inc/svtools/txtattr.hxx +++ b/svtools/inc/svtools/txtattr.hxx @@ -59,7 +59,9 @@ public: virtual ~TextAttrib(); - sal_uInt16 Which() const { return mnWhich; } + sal_uInt16 Which() const { return mnWhich; } + virtual void SetFont( Font& rFont ) const = 0; + virtual TextAttrib* Clone() const = 0; virtual int operator==( const TextAttrib& rAttr ) const = 0; int operator!=( const TextAttrib& rAttr ) const diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index b31395dd43fa..95a26d2c1ebc 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -54,14 +54,14 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- TextCharAttrib::TextCharAttrib( const TextAttrib& /* rAttr */, sal_uInt16 nStart, sal_uInt16 nEnd ) { - mpAttr = NULL; + mpAttr = rAttr.Clone(); mnStart = nStart, mnEnd = nEnd; } TextCharAttrib::TextCharAttrib( const TextCharAttrib& rTextCharAttrib ) { - mpAttr = NULL; + mpAttr = rTextCharAttrib.GetAttr().Clone(); mnStart = rTextCharAttrib.mnStart; mnEnd = rTextCharAttrib.mnEnd; } -- cgit v1.2.3 From 42c4b54fe57a40cf3e49c27d7887c4e706f06451 Mon Sep 17 00:00:00 2001 From: Nigel Hawkins Date: Thu, 14 Jul 2011 10:03:12 +0100 Subject: Revert "WaE: unused parameter" This reverts commit 070016df3becc51d467fbf2e70312106d7392c89. Thomas and I both submitted different fixes at about the same time. --- svtools/source/edit/textdoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx index 95a26d2c1ebc..615ac1258f4d 100644 --- a/svtools/source/edit/textdoc.cxx +++ b/svtools/source/edit/textdoc.cxx @@ -52,7 +52,7 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) // ------------------------------------------------------------------------- // (+) class TextCharAttrib // ------------------------------------------------------------------------- -TextCharAttrib::TextCharAttrib( const TextAttrib& /* rAttr */, sal_uInt16 nStart, sal_uInt16 nEnd ) +TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ) { mpAttr = rAttr.Clone(); mnStart = nStart, -- cgit v1.2.3 From 0206aafdb9b9076b58b46eaeaecccbff832a8182 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 20:55:00 +0100 Subject: callcatcher: drop unused help methods --- vcl/inc/vcl/help.hxx | 2 -- vcl/source/app/help.cxx | 28 ---------------------------- 2 files changed, 30 deletions(-) diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx index ce7d1baf4fd6..54cdea8ccb25 100644 --- a/vcl/inc/vcl/help.hxx +++ b/vcl/inc/vcl/help.hxx @@ -86,14 +86,12 @@ public: static void EnableContextHelp(); static void DisableContextHelp(); static sal_Bool IsContextHelpEnabled(); - static sal_Bool StartContextHelp(); static void EnableExtHelp(); static void DisableExtHelp(); static sal_Bool IsExtHelpEnabled(); static sal_Bool StartExtHelp(); static sal_Bool EndExtHelp(); - static sal_Bool IsExtHelpActive(); static void EnableBalloonHelp(); static void DisableBalloonHelp(); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 75bab1a29694..3db6bcc841bf 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -112,27 +112,6 @@ sal_Bool Help::IsContextHelpEnabled() // ----------------------------------------------------------------------- -sal_Bool Help::StartContextHelp() -{ - ImplSVData* pSVData = ImplGetSVData(); - - if ( pSVData->maHelpData.mbContextHelp ) - { - Window* pWindow = pSVData->maWinData.mpFocusWin; - if ( pWindow ) - { - Point aMousePos = pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() ); - HelpEvent aHelpEvent( aMousePos, HELPMODE_CONTEXT ); - pWindow->RequestHelp( aHelpEvent ); - return sal_True; - } - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Help::EnableExtHelp() { ImplGetSVData()->maHelpData.mbExtHelp = sal_True; @@ -191,13 +170,6 @@ sal_Bool Help::EndExtHelp() // ----------------------------------------------------------------------- -sal_Bool Help::IsExtHelpActive() -{ - return ImplGetSVData()->maHelpData.mbExtHelpMode; -} - -// ----------------------------------------------------------------------- - void Help::EnableBalloonHelp() { ImplGetSVData()->maHelpData.mbBalloonHelp = sal_True; -- cgit v1.2.3 From 3e6685165995d25ea6028d569c68714a02ee9ca3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:05:35 +0100 Subject: set Dump methods to ultra-verbose debug-mode --- l10ntools/inc/helpmerge.hxx | 12 ++++++------ l10ntools/source/helpmerge.cxx | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index e2ec54daa637..40ca25dac877 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 ); diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 5a0ffa193edd..b576e1fb8781 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; -- cgit v1.2.3 From df7dab517b499779593825a648da319a0c058ccb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:07:19 +0100 Subject: callcatcher: ditch unused method --- l10ntools/inc/helpmerge.hxx | 1 - l10ntools/source/helpmerge.cxx | 72 ------------------------------------------ 2 files changed, 73 deletions(-) diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx index 40ca25dac877..25536244e357 100644 --- a/l10ntools/inc/helpmerge.hxx +++ b/l10ntools/inc/helpmerge.hxx @@ -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/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index b576e1fb8781..ccb45e47105f 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -633,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: */ -- cgit v1.2.3 From e71342f90b1b76f1d29c51eb0786212f6013f62b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:10:35 +0100 Subject: callcatcher: unused methods --- svl/source/misc/inettype.cxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index a00f2e453afb..6234bc0dbe02 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -828,13 +828,6 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName, } -//============================================================================ -// -// INetContentTypes -// -//============================================================================ - -//============================================================================ //static INetContentType INetContentTypes::RegisterContentType(UniString const & rTypeName, -- cgit v1.2.3 From ee3cb54ee4e1d6a38bad8319a784fd2bed69bf4c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:13:29 +0100 Subject: callcatcher: unused methods --- tools/inc/tools/inetmime.hxx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index a9407126a93f..059c34a9515a 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -370,13 +370,6 @@ public: */ static sal_uInt32 getHexDigit(int nWeight); - /** Get a Base 64 digit encoded as US-ASCII. - - @param nWeight Must be in the range 0--63, inclusive. - - @return The Base 64 digit corresponding to nWeight (US-ASCII 'A'-- - 'Z', 'a'--'z', '0'--'9', '+' or '/'). - */ static inline bool isHighSurrogate(sal_uInt32 nUTF16); static inline bool isLowSurrogate(sal_uInt32 nUTF16); -- cgit v1.2.3 From 785b4c2f48de177974bf05d215ba6fe350598952 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:15:45 +0100 Subject: callcatcher: remove unused ifdef branch --- svtools/source/contnr/imivctl.hxx | 1 - svtools/source/contnr/imivctl2.cxx | 49 -------------------------------------- 2 files changed, 50 deletions(-) diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 517f0f6b66f1..06d905f7a757 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -609,7 +609,6 @@ public: GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ); GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True ); - void OccupyGrids( const Rectangle&, sal_Bool bOccupy = sal_True ); void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True ); void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True ) { diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 93e2990d6658..d21ff9139a49 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -728,60 +728,11 @@ GridId IcnGridMap_Impl::GetUnoccupiedGrid( sal_Bool bOccupyFound ) // ein Eintrag belegt nur das unter seinem Zentrum liegende GridRect // diese Variante ist bedeutend schneller als die Belegung ueber das // Bounding-Rect, kann aber zu kleinen Ueberlappungen fuehren -#define OCCUPY_CENTER - void IcnGridMap_Impl::OccupyGrids( const SvxIconChoiceCtrlEntry* pEntry, sal_Bool bOccupy ) { if( !_pGridMap || !_pView->IsBoundingRectValid( pEntry->aRect )) return; -#ifndef OCCUPY_CENTER - OccupyGrids( pEntry->aRect, bOccupy ); -#else OccupyGrid( GetGrid( pEntry->aRect.Center()), bOccupy ); -#endif - -} - -void IcnGridMap_Impl::OccupyGrids( const Rectangle& rRect, sal_Bool bUsed ) -{ - if( !_pGridMap ) - return; - - if( bUsed ) - { - if( _aLastOccupiedGrid == rRect ) - return; - _aLastOccupiedGrid = rRect; - } - else - _aLastOccupiedGrid.SetEmpty(); - - sal_Bool bTopLeftClipped, bBottomRightClipped; - GridId nIdTL = GetGrid( rRect.TopLeft(), &bTopLeftClipped ); - GridId nIdBR = GetGrid( rRect.BottomRight(), &bBottomRightClipped ); - - if( bTopLeftClipped && bBottomRightClipped ) - return; - - sal_uInt16 nX1,nX2,nY1,nY2; - GetGridCoord( nIdTL, nX1, nY1 ); - GetGridCoord( nIdBR, nX2, nY2 ); - sal_uInt16 nTemp; - if( nX1 > nX2 ) - { - nTemp = nX1; - nX1 = nX2; - nX2 = nTemp; - } - if( nY1 > nY2 ) - { - nTemp = nY1; - nY1 = nY2; - nY2 = nTemp; - } - for( ; nX1 <= nX2; nX1++ ) - for( ; nY1 <= nY2; nY1++ ) - OccupyGrid( GetGrid( nX1, nY1 ) ); } void IcnGridMap_Impl::Clear() -- cgit v1.2.3 From 9b5d883faeed10440175009e3b8bf1728381d0e3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 13 Jul 2011 21:51:01 +0100 Subject: add missing mode-lines --- vcl/inc/saltimer.hxx | 3 +++ vcl/inc/svsys.h | 3 +++ vcl/inc/unx/Xproto.h | 3 +++ vcl/inc/unx/x11_cursors/salcursors.h | 3 +++ vcl/inc/vcl/displayconnectiondispatch.hxx | 3 +++ vcl/inc/vcl/quickselectionengine.hxx | 3 +++ vcl/inc/vcl/rendergraphic.hxx | 3 +++ vcl/inc/vcl/rendergraphicrasterizer.hxx | 3 +++ vcl/inc/vcl/throbber.hxx | 2 ++ vcl/source/components/rasterizer_rsvg.cxx | 3 +++ vcl/source/components/stringmirror.cxx | 3 +++ vcl/source/control/quickselectionengine.cxx | 3 +++ vcl/source/control/throbber.cxx | 3 +++ vcl/source/gdi/pdfwriter_impl2.cxx | 3 +++ vcl/source/gdi/rendergraphic.cxx | 3 +++ vcl/source/gdi/rendergraphicrasterizer.cxx | 3 +++ vcl/source/gdi/svgread.cxx | 3 +++ vcl/source/window/window4.cxx | 2 ++ vcl/source/window/wpropset.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkaction.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkbridge.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkfactory.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkimage.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atklistener.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkregistry.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkselection.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktable.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktext.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkutil.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkvalue.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkwindow.cxx | 3 +++ vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtkdata.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtkinst.cxx | 3 +++ vcl/unx/gtk3/app/gtk3gtksys.cxx | 3 +++ vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 2 ++ vcl/unx/gtk3/window/gtk3gtkframe.cxx | 3 +++ vcl/unx/gtk3/window/gtk3gtkobject.cxx | 3 +++ 42 files changed, 123 insertions(+) diff --git a/vcl/inc/saltimer.hxx b/vcl/inc/saltimer.hxx index 38dd20e69ff3..11a90dc24bf1 100644 --- a/vcl/inc/saltimer.hxx +++ b/vcl/inc/saltimer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,5 @@ public: }; #endif // _SV_SALTIMER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svsys.h b/vcl/inc/svsys.h index ce65f4ab95fb..0976282bc898 100644 --- a/vcl/inc/svsys.h +++ b/vcl/inc/svsys.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -44,3 +45,5 @@ #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/Xproto.h b/vcl/inc/unx/Xproto.h index 804b3ffa98cc..b6db98dbfe15 100644 --- a/vcl/inc/unx/Xproto.h +++ b/vcl/inc/unx/Xproto.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ #include #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/x11_cursors/salcursors.h b/vcl/inc/unx/x11_cursors/salcursors.h index e0d34e122336..6af2c111fb57 100644 --- a/vcl/inc/unx/x11_cursors/salcursors.h +++ b/vcl/inc/unx/x11_cursors/salcursors.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -160,3 +161,5 @@ #include "unx/x11_cursors/tblselsw_mask.h" #include "unx/x11_cursors/paintbrush_curs.h" #include "unx/x11_cursors/paintbrush_mask.h" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/displayconnectiondispatch.hxx b/vcl/inc/vcl/displayconnectiondispatch.hxx index fea1d0b7cba9..0804c9111153 100644 --- a/vcl/inc/vcl/displayconnectiondispatch.hxx +++ b/vcl/inc/vcl/displayconnectiondispatch.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -50,3 +51,5 @@ protected: } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/quickselectionengine.hxx b/vcl/inc/vcl/quickselectionengine.hxx index f70736428010..d3dc157d2c6c 100644 --- a/vcl/inc/vcl/quickselectionengine.hxx +++ b/vcl/inc/vcl/quickselectionengine.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -93,3 +94,5 @@ namespace vcl //........................................................................ #endif // VCL_QUICKSELECTIONENGINE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/rendergraphic.hxx b/vcl/inc/vcl/rendergraphic.hxx index 0a0f475decd6..bee2abf4f6f1 100644 --- a/vcl/inc/vcl/rendergraphic.hxx +++ b/vcl/inc/vcl/rendergraphic.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,3 +123,5 @@ namespace vcl } #endif // _SV_RENDERHRAPHIC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/rendergraphicrasterizer.hxx b/vcl/inc/vcl/rendergraphicrasterizer.hxx index f2166b03ffb3..0f564a635beb 100644 --- a/vcl/inc/vcl/rendergraphicrasterizer.hxx +++ b/vcl/inc/vcl/rendergraphicrasterizer.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,3 +110,5 @@ namespace vcl } #endif // _SV_RENDERGRAPHICRASTERIZER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/throbber.hxx b/vcl/inc/vcl/throbber.hxx index ce45631d2fda..4cbd6dcdbce2 100644 --- a/vcl/inc/vcl/throbber.hxx +++ b/vcl/inc/vcl/throbber.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,4 @@ private: #endif // VCL_THROBBER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/components/rasterizer_rsvg.cxx b/vcl/source/components/rasterizer_rsvg.cxx index b68aaa1fda8c..ef0d5f82e937 100644 --- a/vcl/source/components/rasterizer_rsvg.cxx +++ b/vcl/source/components/rasterizer_rsvg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -542,3 +543,5 @@ uno::Reference< uno::XInterface > SAL_CALL Rasterizer_createInstance( const uno: } // namespace rsvg } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/components/stringmirror.cxx b/vcl/source/components/stringmirror.cxx index 78806914a7c4..70bf44b568d0 100644 --- a/vcl/source/components/stringmirror.cxx +++ b/vcl/source/components/stringmirror.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -121,3 +122,5 @@ Sequence< OUString > SAL_CALL StringMirror::getSupportedServiceNames() throw (Ru } } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx index 2d32393bf79a..ee479d27ab20 100644 --- a/vcl/source/control/quickselectionengine.cxx +++ b/vcl/source/control/quickselectionengine.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -181,3 +182,5 @@ namespace vcl //........................................................................ } // namespace vcl //........................................................................ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx index a55fdb3eb379..4aa456c1ddcf 100644 --- a/vcl/source/control/throbber.cxx +++ b/vcl/source/control/throbber.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -323,3 +324,5 @@ IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index c1fd5a8c6ca5..0569de5e3464 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2050,3 +2051,5 @@ void PDFWriterImpl::writeG4Stream( BitmapReadAccess* i_pBitmap ) rtl_freeMemory( pFirstRefLine ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx index 10b6064cc57c..79771163fa2d 100644 --- a/vcl/source/gdi/rendergraphic.cxx +++ b/vcl/source/gdi/rendergraphic.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -238,3 +239,5 @@ void RenderGraphic::ImplGetDefaults() const } } // VCL + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/rendergraphicrasterizer.cxx b/vcl/source/gdi/rendergraphicrasterizer.cxx index 29c9863335b3..4c70d866245b 100644 --- a/vcl/source/gdi/rendergraphicrasterizer.cxx +++ b/vcl/source/gdi/rendergraphicrasterizer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -398,3 +399,5 @@ void RenderGraphicRasterizer::ImplUpdateCache( const RenderGraphicRasterizer& rR } } // VCL + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/svgread.cxx b/vcl/source/gdi/svgread.cxx index 554cfa804b1b..0573f924e277 100644 --- a/vcl/source/gdi/svgread.cxx +++ b/vcl/source/gdi/svgread.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -129,3 +130,5 @@ namespace vcl } } // namespace vcl + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx index 775249c450ee..b4abcf229502 100644 --- a/vcl/source/window/window4.cxx +++ b/vcl/source/window/window4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -223,3 +224,4 @@ uno::Sequence< beans::PropertyValue > Window::getProperties() const return aProps; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx index 10e3e8fa5e2f..ceca8f8784d6 100644 --- a/vcl/source/window/wpropset.cxx +++ b/vcl/source/window/wpropset.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -345,3 +346,5 @@ IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkaction.cxx b/vcl/unx/gtk3/a11y/gtk3atkaction.cxx index 71a92c8e918b..80593f6af67c 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkaction.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkaction.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkaction.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx index 34d094ff9d20..f7babdb8d95f 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkbridge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkbridge.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx b/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx index cd33fcf91e9d..8c300b125d79 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkcomponent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkcomponent.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx b/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx index 6ba2164d2842..ae91ac31c63e 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkeditabletext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkeditabletext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx b/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx index 3fd107f960c9..2a3c0dc8d76a 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkfactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkfactory.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx index 29458829989c..f6b8cb651ffb 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkhypertext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkhypertext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkimage.cxx b/vcl/unx/gtk3/a11y/gtk3atkimage.cxx index e8404b199b0f..8167f6e8ecc9 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkimage.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkimage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkimage.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atklistener.cxx b/vcl/unx/gtk3/a11y/gtk3atklistener.cxx index a43aeab9abcb..76ad3ba5c6ea 100644 --- a/vcl/unx/gtk3/a11y/gtk3atklistener.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atklistener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atklistener.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx b/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx index 95c372a8c74e..3ad55519a892 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkregistry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkregistry.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkselection.cxx b/vcl/unx/gtk3/a11y/gtk3atkselection.cxx index 860e125d38cb..b233bbee9ef5 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkselection.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkselection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkselection.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktable.cxx b/vcl/unx/gtk3/a11y/gtk3atktable.cxx index 39dc5fc75407..bc0f473a773c 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktable.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktable.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktext.cxx b/vcl/unx/gtk3/a11y/gtk3atktext.cxx index 3239c6630114..f6f69af3b4be 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktext.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktext.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx index 61eeb47211d1..85ecf50da8bd 100644 --- a/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atktextattributes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atktextattributes.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx index 44b41f63e575..183a33c3ac27 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkutil.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkutil.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx b/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx index 8398e0f5f57f..346d7672d6d2 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkvalue.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkvalue.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx b/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx index 3b11cf0f0780..c93b0ff4a8de 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkwindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkwindow.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx index 9a6c2e9c5d22..fbcecd3495f8 100644 --- a/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx +++ b/vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/a11y/atkwrapper.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtkdata.cxx b/vcl/unx/gtk3/app/gtk3gtkdata.cxx index a6d7a0e2abc2..01d5c59104ca 100644 --- a/vcl/unx/gtk3/app/gtk3gtkdata.cxx +++ b/vcl/unx/gtk3/app/gtk3gtkdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtkdata.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtkinst.cxx b/vcl/unx/gtk3/app/gtk3gtkinst.cxx index ad2d59ac54a5..7d10b89e62a6 100644 --- a/vcl/unx/gtk3/app/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/app/gtk3gtkinst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtkinst.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/app/gtk3gtksys.cxx b/vcl/unx/gtk3/app/gtk3gtksys.cxx index ee769b30e71a..8b103fa28e61 100644 --- a/vcl/unx/gtk3/app/gtk3gtksys.cxx +++ b/vcl/unx/gtk3/app/gtk3gtksys.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/app/gtksys.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx index d6a181a77f30..aa68cc26e002 100644 --- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -28,3 +29,4 @@ #include "../../headless/svpdi.hxx" #include "../../headless/svpdi.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/window/gtk3gtkframe.cxx b/vcl/unx/gtk3/window/gtk3gtkframe.cxx index a1d950ec5a15..47cbf2f41893 100644 --- a/vcl/unx/gtk3/window/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/window/gtk3gtkframe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/window/gtkframe.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/gtk3/window/gtk3gtkobject.cxx b/vcl/unx/gtk3/window/gtk3gtkobject.cxx index ab1628018e06..e91c849d8dff 100644 --- a/vcl/unx/gtk3/window/gtk3gtkobject.cxx +++ b/vcl/unx/gtk3/window/gtk3gtkobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * Version: MPL 1.1 / GPLv3+ / LGPLv3+ * @@ -26,3 +27,5 @@ */ #include "../../gtk/window/gtkobject.cxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 0d5420e58da79b845f84587344fc29c4e105e5b6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:19:24 +0300 Subject: Use the gdiplus headers from Wine when cross-compiling to Windows --- vcl/Library_vcl.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 70bdad3fecd9..2925acf1cb24 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -42,12 +42,17 @@ endif $(eval $(call gb_Library_add_package_headers,vcl,vcl_inc)) $(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash)) +ifeq ($(OS)$(COM),WNTGCC) +GDIPLUSINCLUDE=-I$(OUTDIR)/inc/external/gdiplus +endif + $(eval $(call gb_Library_set_include,vcl,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/vcl/inc) \ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc \ + $(GDIPLUSINCLUDE) \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) ifeq ($(GUIBASE),unx) -- cgit v1.2.3 From e4e34084c711f75cae159c072e241289d34c3068 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:20:47 +0300 Subject: Use OLDNAMESLIB --- vcl/Library_vcl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 2925acf1cb24..b6d7ba691431 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -545,7 +545,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ mpr \ msimg32 \ msvcrt \ - oldnames \ + $(OLDNAMESLIB) \ ole32 \ shell32 \ user32 \ -- cgit v1.2.3 From 87f3d120efc0ded699f89607b48a3c2f9c56d4e0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:25:16 +0300 Subject: Use the flat GdiPlus API as needed because of the incomplete headers from Wine --- vcl/win/source/gdi/salgdi_gdiplus.cxx | 104 +++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 47 deletions(-) diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index 3c55685f0aba..fd828d6c0878 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -50,9 +50,9 @@ #pragma warning(push, 1) #endif -#include -#include -#include +#include +#include +#include #if defined _MSC_VER #pragma warning(pop) @@ -62,7 +62,7 @@ // ----------------------------------------------------------------------- -void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GpPath *pPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { sal_uInt32 nCount(rPolygon.count()); @@ -71,44 +71,42 @@ void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, con const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); const bool bControls(rPolygon.areControlPointsUsed()); basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); - Gdiplus::PointF aFCurr(Gdiplus::REAL(aCurr.getX()), Gdiplus::REAL(aCurr.getY())); for(sal_uInt32 a(0); a < nEdgeCount; a++) { const sal_uInt32 nNextIndex((a + 1) % nCount); const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); - const Gdiplus::PointF aFNext(Gdiplus::REAL(aNext.getX()), Gdiplus::REAL(aNext.getY())); if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) { const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); - rPath.AddBezier( - aFCurr, - Gdiplus::PointF(Gdiplus::REAL(aCa.getX()), Gdiplus::REAL(aCa.getY())), - Gdiplus::PointF(Gdiplus::REAL(aCb.getX()), Gdiplus::REAL(aCb.getY())), - aFNext); + Gdiplus::DllExports::GdipAddPathBezier(pPath, + aCurr.getX(), aCurr.getY(), + aCa.getX(), aCa.getY(), + aCb.getX(), aCb.getY(), + aNext.getX(), aNext.getY()); } else { - rPath.AddLine(aFCurr, aFNext); + Gdiplus::DllExports::GdipAddPathLine(pPath, aCurr.getX(), aCurr.getY(), aNext.getX(), aNext.getY()); } if(a + 1 < nEdgeCount) { - aFCurr = aFNext; + aCurr = aNext; if(bNoLineJoin) { - rPath.StartFigure(); + Gdiplus::DllExports::GdipStartPathFigure(pPath); } } } } } -void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GpPath *pPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { sal_uInt32 nCount(rPolygon.count()); @@ -117,37 +115,36 @@ void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); const bool bControls(rPolygon.areControlPointsUsed()); basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); - Gdiplus::Point aICurr(INT(aCurr.getX()), INT(aCurr.getY())); for(sal_uInt32 a(0); a < nEdgeCount; a++) { const sal_uInt32 nNextIndex((a + 1) % nCount); const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); - const Gdiplus::Point aINext(INT(aNext.getX()), INT(aNext.getY())); if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) { const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); - rPath.AddBezier( - aICurr, - Gdiplus::Point(INT(aCa.getX()), INT(aCa.getY())), - Gdiplus::Point(INT(aCb.getX()), INT(aCb.getY())), - aINext); + Gdiplus::DllExports::GdipAddPathBezier( + pPath, + aCurr.getX(), aCurr.getY(), + aCa.getX(), aCa.getY(), + aCb.getX(), aCb.getY(), + aNext.getX(), aNext.getY()); } else { - rPath.AddLine(aICurr, aINext); + Gdiplus::DllExports::GdipAddPathLine(pPath, aCurr.getX(), aCurr.getY(), aNext.getX(), aNext.getY()); } if(a + 1 < nEdgeCount) { - aICurr = aINext; + aCurr = aNext; if(bNoLineJoin) { - rPath.StartFigure(); + Gdiplus::DllExports::GdipStartPathFigure(pPath); } } } @@ -160,33 +157,39 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly if(mbBrush && nCount && (fTransparency >= 0.0 && fTransparency < 1.0)) { - Gdiplus::Graphics aGraphics(mhDC); + Gdiplus::GpGraphics *pGraphics = NULL; + Gdiplus::DllExports::GdipCreateFromHDC(mhDC, &pGraphics); const sal_uInt8 aTrans((sal_uInt8)255 - (sal_uInt8)basegfx::fround(fTransparency * 255.0)); Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maFillColor), SALCOLOR_GREEN(maFillColor), SALCOLOR_BLUE(maFillColor)); - Gdiplus::SolidBrush aTestBrush(aTestColor); - Gdiplus::GraphicsPath aPath; + Gdiplus::GpSolidFill *pTestBrush; + Gdiplus::DllExports::GdipCreateSolidFill(aTestColor.GetValue(), &pTestBrush); + Gdiplus::GpPath *pPath = NULL; + Gdiplus::DllExports::GdipCreatePath(Gdiplus::FillModeAlternate, &pPath); for(sal_uInt32 a(0); a < nCount; a++) { if(0 != a) { - aPath.StartFigure(); // #i101491# not needed for first run + Gdiplus::DllExports::GdipStartPathFigure(pPath); // #i101491# not needed for first run } - impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolyPolygon.getB2DPolygon(a), false); - aPath.CloseFigure(); + impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolyPolygon.getB2DPolygon(a), false); + Gdiplus::DllExports::GdipClosePathFigure(pPath); } if(getAntiAliasB2DDraw()) { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeAntiAlias); } else { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeNone); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeNone); } - aGraphics.FillPath(&aTestBrush, &aPath); + Gdiplus::DllExports::GdipFillPath(pGraphics, pTestBrush, pPath); + + Gdiplus::DllExports::GdipDeletePath(pPath); + Gdiplus::DllExports::GdipDeleteGraphics(pGraphics); } return true; @@ -198,11 +201,14 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f if(mbPen && nCount) { - Gdiplus::Graphics aGraphics(mhDC); + Gdiplus::GpGraphics *pGraphics = NULL; + Gdiplus::DllExports::GdipCreateFromHDC(mhDC, &pGraphics); const sal_uInt8 aTrans = (sal_uInt8)basegfx::fround( 255 * (1.0 - fTransparency) ); Gdiplus::Color aTestColor(aTrans, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); - Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); - Gdiplus::GraphicsPath aPath; + Gdiplus::GpPen *pTestPen = NULL; + Gdiplus::DllExports::GdipCreatePen1(aTestColor.GetValue(), Gdiplus::REAL(rLineWidths.getX()), Gdiplus::UnitWorld, &pTestPen); + Gdiplus::GpPath *pPath; + Gdiplus::DllExports::GdipCreatePath(Gdiplus::FillModeAlternate, &pPath); bool bNoLineJoin(false); switch(eLineJoin) @@ -217,49 +223,53 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f } case basegfx::B2DLINEJOIN_BEVEL : { - aTestPen.SetLineJoin(Gdiplus::LineJoinBevel); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinBevel); break; } case basegfx::B2DLINEJOIN_MIDDLE : case basegfx::B2DLINEJOIN_MITER : { const Gdiplus::REAL aMiterLimit(15.0); - aTestPen.SetMiterLimit(aMiterLimit); - aTestPen.SetLineJoin(Gdiplus::LineJoinMiter); + Gdiplus::DllExports::GdipSetPenMiterLimit(pTestPen, aMiterLimit); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinMiter); break; } case basegfx::B2DLINEJOIN_ROUND : { - aTestPen.SetLineJoin(Gdiplus::LineJoinRound); + Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinRound); break; } } if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 1.5)) { - impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, bNoLineJoin); + impAddB2DPolygonToGDIPlusGraphicsPathInteger(pPath, rPolygon, bNoLineJoin); } else { - impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolygon, bNoLineJoin); + impAddB2DPolygonToGDIPlusGraphicsPathReal(pPath, rPolygon, bNoLineJoin); } if(rPolygon.isClosed() && !bNoLineJoin) { // #i101491# needed to create the correct line joins - aPath.CloseFigure(); + Gdiplus::DllExports::GdipClosePathFigure(pPath); } if(getAntiAliasB2DDraw()) { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeAntiAlias); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeAntiAlias); } else { - aGraphics.SetSmoothingMode(Gdiplus::SmoothingModeNone); + Gdiplus::DllExports::GdipSetSmoothingMode(pGraphics, Gdiplus::SmoothingModeNone); } - aGraphics.DrawPath(&aTestPen, &aPath); + Gdiplus::DllExports::GdipDrawPath(pGraphics, pTestPen, pPath); + + Gdiplus::DllExports::GdipDeletePath(pPath); + Gdiplus::DllExports::GdipDeletePen(pTestPen); + Gdiplus::DllExports::GdipDeleteGraphics(pGraphics); } return true; -- cgit v1.2.3 From 1f7e587c283f27ad08aaca19d3b9550da4b23941 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 18:25:51 +0300 Subject: Fixes for Windows cross-compilation Header names are all lower-case. Use our own sehandler.hxx instead of assuming that stuff being in a patches excpt.h. --- vcl/win/source/app/salinst.cxx | 15 ++++++++------- vcl/win/source/app/saltimer.cxx | 7 ++++--- vcl/win/source/gdi/salprn.cxx | 8 ++++---- vcl/win/source/window/salframe.cxx | 7 ++++--- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index b06d3cc672d6..5e8930f4155f 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -34,9 +34,6 @@ #include #include #endif -#ifdef __MINGW32__ -#include -#endif #include #include @@ -72,15 +69,19 @@ #pragma warning( disable: 4917 ) #endif -#include -#include -#include -#include +#include +#include +#include +#include #if defined _MSC_VER #pragma warning(pop) #endif +#ifdef __MINGW32__ +#include +#endif + // ======================================================================= void SalAbort( const XubString& rErrorText ) diff --git a/vcl/win/source/app/saltimer.cxx b/vcl/win/source/app/saltimer.cxx index 60c917475a94..5aab67d88cdd 100644 --- a/vcl/win/source/app/saltimer.cxx +++ b/vcl/win/source/app/saltimer.cxx @@ -29,13 +29,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" #include -#ifdef __MINGW32__ -#include -#endif #include #include #include +#ifdef __MINGW32__ +#include +#endif + // ======================================================================= // Maximale Periode diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index ae8d93382985..7fdd77394cc2 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -39,10 +39,6 @@ #include -#ifdef __MINGW32__ -#include -#endif - #include #include #include @@ -64,6 +60,10 @@ #include +#ifdef __MINGW32__ +#include +#endif + #ifdef __MINGW32__ #define CATCH_DRIVER_EX_BEGIN \ jmp_buf jmpbuf; \ diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 2ccef60923b1..81a6a4778753 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -48,9 +48,6 @@ #include #include -#ifdef __MINGW32__ -#include -#endif #include #include @@ -100,6 +97,10 @@ using ::std::max; #include +#ifdef __MINGW32__ +#include +#endif + using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -- cgit v1.2.3 From 80e824f344fdf74a69533859fbb6e60eadd7bdef Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:02:30 +0300 Subject: Use all-lowercase header names --- vcl/win/source/gdi/winlayout.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index ec4917f4201a..23f672389057 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -57,8 +57,8 @@ #define USE_UNISCRIBE #ifdef USE_UNISCRIBE -#include -#include +#include +#include #include #endif // USE_UNISCRIBE -- cgit v1.2.3 From ec1c756eb00aec9e4c9dfe14e0efe335cb048b61 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:03:48 +0300 Subject: Relocated the headers we need from Wine --- vcl/Library_vcl.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index b6d7ba691431..977facc72a1f 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -43,7 +43,7 @@ $(eval $(call gb_Library_add_package_headers,vcl,vcl_inc)) $(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash)) ifeq ($(OS)$(COM),WNTGCC) -GDIPLUSINCLUDE=-I$(OUTDIR)/inc/external/gdiplus +WINEINCLUDE=-I$(OUTDIR)/inc/external/wine endif $(eval $(call gb_Library_set_include,vcl,\ @@ -52,7 +52,7 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(realpath $(SRCDIR)/vcl/inc/pch) \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc \ - $(GDIPLUSINCLUDE) \ + $(WINEINCLUDE) \ -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) ifeq ($(GUIBASE),unx) -- cgit v1.2.3 From c4accd1fd7bf27a210db4f05e10932fd933c8e6b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:07:07 +0300 Subject: Fix WNTGCC compilation error --- vcl/win/source/gdi/winlayout.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 23f672389057..6eb423f72cf6 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2807,7 +2807,7 @@ private: grutils::GrFeatureParser * mpFeatures; mutable GraphiteLayoutWinImpl maImpl; public: - GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE); + GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplWinFontEntry& rWFE) throw(); // used by upper layers virtual bool LayoutText( ImplLayoutArgs& ); // first step of layout -- cgit v1.2.3 From f564296d7b8dd85fba153a5c5ed9f3ef6b16827c Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 21:31:28 +0300 Subject: The MinGW winuser.h doesn't have WM_MOUSEHWHEEL yet --- vcl/win/source/window/salframe.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 81a6a4778753..80051f321eac 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -114,6 +114,9 @@ using namespace ::com::sun::star::beans; #ifndef SPI_SETWHEELSCROLLCHARS # define SPI_SETWHEELSCROLLCHARS 0x006D #endif +#ifndef WM_MOUSEHWHEEL +# define WM_MOUSEHWHEEL 0x020E +#endif #if OSL_DEBUG_LEVEL > 1 void MyOutputDebugString( char *s) { OutputDebugString( s ); } -- cgit v1.2.3 From d08bf1ca63e51c950ed0bc84b6f1d5232ae97f38 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 15:25:51 +0300 Subject: Don't build these executables when cross-compiling They are not included in the SDK either. --- svtools/Module_svtools.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/svtools/Module_svtools.mk b/svtools/Module_svtools.mk index ac2fff8623a3..7adeaf80a64c 100644 --- a/svtools/Module_svtools.mk +++ b/svtools/Module_svtools.mk @@ -30,15 +30,20 @@ $(eval $(call gb_Module_Module,svtools)) $(eval $(call gb_Module_add_targets,svtools,\ AllLangResTarget_productregistration \ AllLangResTarget_svt \ - Executable_bmp \ - Executable_bmpsum \ - Executable_g2g \ Library_hatchwindowfactory \ Library_productregistration \ Library_svt \ Package_inc \ )) +ifneq ($(CROSS_COMPILING),YES) +$(eval $(call gb_Module_add_targets,svtools,\ + Executable_bmp \ + Executable_bmpsum \ + Executable_g2g \ +)) +endif + $(eval $(call gb_Module_add_check_targets,svtools,\ CppunitTest_svtools_filters_test \ )) -- cgit v1.2.3 From 5a7834cd3e6e73ec9c19f3ff057aacba59e3f9a3 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 11:02:21 +0300 Subject: iOS hacking Add some trivialish first attempts at iOS-specific headers and some source files that surely are quite bogus and does nothing sane, but must start with something. Mostly based on the MacOSX ("aqua") code. --- vcl/Library_vcl.mk | 33 +- vcl/StaticLibrary_vclmain.mk | 8 + vcl/inc/ios/iosvcltypes.h | 37 ++ vcl/inc/ios/salbmp.h | 117 ++++++ vcl/inc/ios/salcolorutils.hxx | 46 +++ vcl/inc/ios/saldata.hxx | 126 ++++++ vcl/inc/ios/salframe.h | 208 ++++++++++ vcl/inc/ios/salframeview.h | 144 +++++++ vcl/inc/ios/salgdi.h | 401 +++++++++++++++++++ vcl/inc/ios/salinst.h | 199 ++++++++++ vcl/inc/ios/salmathutils.hxx | 90 +++++ vcl/inc/ios/salmenu.h | 122 ++++++ vcl/inc/ios/salnstimer.h | 43 ++ vcl/inc/ios/salobj.h | 86 ++++ vcl/inc/ios/salprn.h | 173 ++++++++ vcl/inc/ios/salsys.h | 56 +++ vcl/inc/ios/saltimer.h | 54 +++ vcl/inc/ios/saluimenu.h | 62 +++ vcl/inc/ios/salvd.h | 79 ++++ vcl/inc/ios/vcluiapp.h | 53 +++ vcl/inc/vcl/bitmap.hxx | 2 +- vcl/inc/vcl/sysdata.hxx | 23 +- vcl/ios/source/app/saldata.cxx | 128 ++++++ vcl/ios/source/app/salinst.cxx | 828 +++++++++++++++++++++++++++++++++++++++ vcl/ios/source/app/salnstimer.mm | 59 +++ vcl/ios/source/app/salsys.cxx | 253 ++++++++++++ vcl/ios/source/app/saltimer.cxx | 104 +++++ vcl/ios/source/app/vcluiapp.mm | 101 +++++ vcl/source/salmain/salmain.cxx | 2 +- vcl/source/window/syschild.cxx | 3 + vcl/source/window/window.cxx | 10 + 31 files changed, 3644 insertions(+), 6 deletions(-) create mode 100644 vcl/inc/ios/iosvcltypes.h create mode 100644 vcl/inc/ios/salbmp.h create mode 100644 vcl/inc/ios/salcolorutils.hxx create mode 100644 vcl/inc/ios/saldata.hxx create mode 100644 vcl/inc/ios/salframe.h create mode 100644 vcl/inc/ios/salframeview.h create mode 100644 vcl/inc/ios/salgdi.h create mode 100644 vcl/inc/ios/salinst.h create mode 100644 vcl/inc/ios/salmathutils.hxx create mode 100644 vcl/inc/ios/salmenu.h create mode 100644 vcl/inc/ios/salnstimer.h create mode 100644 vcl/inc/ios/salobj.h create mode 100644 vcl/inc/ios/salprn.h create mode 100644 vcl/inc/ios/salsys.h create mode 100644 vcl/inc/ios/saltimer.h create mode 100644 vcl/inc/ios/saluimenu.h create mode 100644 vcl/inc/ios/salvd.h create mode 100644 vcl/inc/ios/vcluiapp.h create mode 100644 vcl/ios/source/app/saldata.cxx create mode 100644 vcl/ios/source/app/salinst.cxx create mode 100644 vcl/ios/source/app/salnstimer.mm create mode 100644 vcl/ios/source/app/salsys.cxx create mode 100644 vcl/ios/source/app/saltimer.cxx create mode 100644 vcl/ios/source/app/vcluiapp.mm diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 977facc72a1f..42e57144d5f4 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -236,7 +236,23 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ )) $(eval $(call gb_Library_add_nativeres,vcl,src)) +endif +ifeq ($(GUIBASE),cocoatouch) +$(eval $(call gb_Library_set_cxxflags,vcl,\ + $$(CXXFLAGS) \ + $$(OBJCXXFLAGS) \ +)) +$(eval $(call gb_Library_add_objcxxobjects,vcl,\ + vcl/ios/source/app/salnstimer \ + vcl/ios/source/app/vcluiapp \ +)) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/ios/source/app/saldata \ + vcl/ios/source/app/salinst \ + vcl/ios/source/app/salsys \ + vcl/ios/source/app/saltimer \ +)) endif $(eval $(call gb_Library_add_cobjects,vcl,\ @@ -372,7 +388,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/helper/strhelper \ vcl/source/helper/threadex \ vcl/source/helper/xconnection \ - vcl/source/salmain/salmain \ vcl/source/window/abstdlg \ vcl/source/window/accel \ vcl/source/window/accmgr \ @@ -421,7 +436,11 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/wpropset \ vcl/source/window/wrkwin \ )) - +ifneq ($(OS),IOS) +$(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/source/salmain/salmain \ +)) +endif ## handle Graphite ifneq ($(ENABLE_GRAPHITE),) $(eval $(call gb_Library_set_defs,vcl,\ @@ -554,4 +573,14 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ winspool \ )) endif + +ifeq ($(GUIBASE),cocoatouch) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ + -framework UIKit \ + -framework CoreFoundation \ +)) +endif + + # vim: set noet sw=4 ts=4: diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index 79b3ddd3ad5f..4c313f88b082 100644 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -27,6 +27,13 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,vclmain)) +ifeq ($(OS),IOS) +$(eval $(call gb_StaticLibrary_set_cxxflags,vclmain,\ + $$(CXXFLAGS) \ + -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 \ +)) +endif + $(eval $(call gb_StaticLibrary_set_include,vclmain,\ $$(INCLUDE) \ -I$(realpath $(SRCDIR)/vcl/inc) \ @@ -36,6 +43,7 @@ $(eval $(call gb_StaticLibrary_set_include,vclmain,\ )) $(eval $(call gb_StaticLibrary_add_api,vclmain,\ + offapi \ udkapi \ )) diff --git a/vcl/inc/ios/iosvcltypes.h b/vcl/inc/ios/iosvcltypes.h new file mode 100644 index 000000000000..820547b6a013 --- /dev/null +++ b/vcl/inc/ios/iosvcltypes.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 Tor Lillqvist + * 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 _IOSVCLTYPES_H +#define _IOSVCLTYPES_H + +#include "premac.h" +#import +#include "postmac.h" + +#endif _IOSVCLTYPES_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salbmp.h b/vcl/inc/ios/salbmp.h new file mode 100644 index 000000000000..0c3e1468b154 --- /dev/null +++ b/vcl/inc/ios/salbmp.h @@ -0,0 +1,117 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +#ifndef _SV_SALBMP_H +#define _SV_SALBMP_H + +#include "tools/gen.hxx" + +#include "basebmp/bitmapdevice.hxx" + +#include "vcl/salbtype.hxx" + +#include "ios/salgdi.h" + +#include "saldata.hxx" +#include "salinst.hxx" +#include "salvd.hxx" +#include "salbmp.hxx" + +#include "salcolorutils.hxx" + + +// -------------- +// - SalBitmap - +// -------------- + +struct BitmapBuffer; +class BitmapColor; +class BitmapPalette; +class IosSalVirtualDevice; +class IosSalGraphics; + +class IosSalBitmap : public SalBitmap +{ +public: + CGContextRef mxGraphicContext; + mutable CGImageRef mxCachedImage; + BitmapPalette maPalette; + basebmp::RawMemorySharedArray maUserBuffer; + basebmp::RawMemorySharedArray maContextBuffer; + sal_uInt16 mnBits; + int mnWidth; + int mnHeight; + sal_uInt32 mnBytesPerRow; + +public: + IosSalBitmap(); + virtual ~IosSalBitmap(); + +public: + + // SalBitmap methods + bool Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ); + bool Create( const SalBitmap& rSalBmp ); + bool Create( const SalBitmap& rSalBmp, SalGraphics* pGraphics ); + bool Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount ); + virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask = false ); + + void Destroy(); + + Size GetSize() const; + sal_uInt16 GetBitCount() const; + + BitmapBuffer *AcquireBuffer( bool bReadOnly ); + void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + + bool GetSystemData( BitmapSystemData& rData ); + +private: + // quartz helper + bool CreateContext(); + void DestroyContext(); + bool AllocateUserData(); + + void ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight, + sal_uInt16 nDestBits, sal_uInt32 nDestBytesPerRow, const BitmapPalette& rDestPalette, sal_uInt8* pDestData, + sal_uInt16 nSrcBits, sal_uInt32 nSrcBytesPerRow, const BitmapPalette& rSrcPalette, sal_uInt8* pSrcData ); + +public: + bool Create( CGLayerRef xLayer, int nBitCount, int nX, int nY, int nWidth, int nHeight, bool bMirrorVert = true ); + +public: + CGImageRef CreateWithMask( const IosSalBitmap& rMask, int nX, int nY, int nWidth, int nHeight ) const; + CGImageRef CreateColorMask( int nX, int nY, int nWidth, int nHeight, SalColor nMaskColor ) const; + CGImageRef CreateCroppedImage( int nX, int nY, int nWidth, int nHeight ) const; +}; + +#endif // _SV_SALBMP_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salcolorutils.hxx b/vcl/inc/ios/salcolorutils.hxx new file mode 100644 index 000000000000..d6db5f839e04 --- /dev/null +++ b/vcl/inc/ios/salcolorutils.hxx @@ -0,0 +1,46 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALCOLORUTILS_HXX +#define _SV_SALCOLORUTILS_HXX + +#include "vcl/salbtype.hxx" +#include "vcl/salgtype.hxx" +#include "salmathutils.hxx" + +// ------------------------------------------------------------------ + +SalColor GetSalColor( const float* pQuartzColor ); + +void SetSalColor( const SalColor& rColor, float* pQuartzColor ); + +// ------------------------------------------------------------------ + +#endif // _SV_SALCOLORUTILS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saldata.hxx b/vcl/inc/ios/saldata.hxx new file mode 100644 index 000000000000..764264e42462 --- /dev/null +++ b/vcl/inc/ios/saldata.hxx @@ -0,0 +1,126 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALDATA_HXX +#define _SV_SALDATA_HXX + +#include "premac.h" +#include +#include "postmac.h" + +#include "com/sun/star/uno/Reference.hxx" + +#include "vcl/ptrstyle.hxx" + +#include "svdata.hxx" +#include "salwtype.hxx" + +#include +#include +#include +#include + +#include +#include + +class IosSalInstance; +class SalObject; +class SalFrame; +class SalVirtualDevice; +class SalPrinter; +class SystemFontList; + +// ------------------ +// - Some constants - +// ------------------ + +#define SAL_CLIPRECT_COUNT 16 + +#define VER_TIGER 0x1040 +#define VER_LEOPARD 0x1050 + +// ----------- +// - SalData - +// ----------- + +class IosSalFrame; +struct FrameHash : public boost::hash +{ + size_t operator()(const IosSalFrame* frame) const + { return boost::hash::operator()( reinterpret_cast(frame) ); } +}; + +struct SalData +{ + + SALTIMERPROC mpTimerProc; // timer callback proc + IosSalInstance *mpFirstInstance; // pointer of first instance + std::list maFrames; // pointer of first frame + boost::unordered_set maFrameCheck; // for fast check of frame existance + SalObject *mpFirstObject; // pointer of first object window + SalVirtualDevice *mpFirstVD; // first VirDev + SalPrinter *mpFirstPrinter; // first printing printer + SystemFontList *mpFontList; + + CGColorSpaceRef mxRGBSpace; + CGColorSpaceRef mxGraySpace; + CGColorSpaceRef mxP50Space; + CGPatternRef mxP50Pattern; + + std::vector< UIMenuItem* > maFallbackMenu; + + static oslThreadKey s_aAutoReleaseKey; + + SInt32 mnSystemVersion; // Store System Version + + long mnDPIX; // #i100617# read DPI only once per office life + long mnDPIY; // #i100617# read DPI only once per office life + + com::sun::star::uno::Reference< com::sun::star::uno::XInterface > + mxClipboard; + + SalData(); + ~SalData(); + + static void ensureThreadAutoreleasePool(); + static void drainThreadAutoreleasePool(); +}; + +inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; } +inline SalData *GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; } +inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; } + +// --- Prototypes --- + +sal_Bool ImplSalYieldMutexTryToAcquire(); +void ImplSalYieldMutexAcquire(); +void ImplSalYieldMutexRelease(); + +#endif // _SV_SALDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h new file mode 100644 index 000000000000..14761fe36ebd --- /dev/null +++ b/vcl/inc/ios/salframe.h @@ -0,0 +1,208 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALFRAME_H +#define _SV_SALFRAME_H + +#include "vcl/sysdata.hxx" + +#include "ios/salmenu.h" +#include "ios/saldata.hxx" +#include "ios/iosvcltypes.h" + +#include "salframe.hxx" + +#include +#include +#include + +#include + +class IosSalGraphics; +class IosSalFrame; +class IosSalTimer; +class IosSalInstance; +class IosSalMenu; +class IosBlinker; + +typedef struct SalFrame::SalPointerState SalPointerState; + +// ---------------- +// - IosSalFrame - +// ---------------- + +class IosSalFrame : public SalFrame +{ +public: + UIWindow* mpWindow; + UIView* mpView; + CGRect maScreenRect; // for mirroring purposes + IosSalGraphics* mpGraphics; + IosSalFrame* mpParent; + SystemEnvData maSysData; + int mnMinWidth; // min. client width in pixels + int mnMinHeight; // min. client height in pixels + int mnMaxWidth; // max. client width in pixels + int mnMaxHeight; // max. client height in pixels + CGRect maFullScreenRect; // old window size when in FullScreen + bool mbGraphics:1; // is Graphics used? + bool mbShown:1; + bool mbInitShow:1; + bool mbPresentation:1; + + sal_uLong mnStyle; + unsigned int mnStyleMask; // our style mask from UIWindow creation + + sal_uLong mnLastEventTime; + unsigned int mnLastModifierFlags; + IosSalMenu* mpMenu; + + SalExtStyle mnExtStyle; // currently document frames are marked this way + + PointerStyle mePointerStyle; // currently active pointer style + + CGMutablePathRef mrClippingPath; // used for "shaping" + std::vector< CGRect > maClippingRects; + + std::list maBlinkers; + + Rectangle maInvalidRect; + + sal_uLong mnICOptions; + + boost::shared_ptr< Timer > mpActivityTimer; // Timer to prevent system sleep during presentation +public: + /** Constructor + + Creates a system window and connects this frame with it. + + @throws std::runtime_error in case window creation fails + */ + IosSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ); + + virtual ~IosSalFrame(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual sal_Bool PostEvent( void* pData ); + virtual void SetTitle( const XubString& rTitle ); + virtual void SetIcon( sal_uInt16 nIcon ); + virtual void SetRepresentedURL( const rtl::OUString& ); + virtual void SetMenu( SalMenu* pSalMenu ); + virtual void DrawMenuBar(); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate = sal_False ); + virtual void Enable( sal_Bool bEnable ); + virtual void SetMinClientSize( long nWidth, long nHeight ); + virtual void SetMaxClientSize( long nWidth, long nHeight ); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ); + virtual void GetClientSize( long& rWidth, long& rHeight ); + virtual void GetWorkArea( Rectangle& rRect ); + virtual SalFrame* GetParent() const; + virtual void SetWindowState( const SalFrameState* pState ); + virtual sal_Bool GetWindowState( SalFrameState* pState ); + virtual void ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay ); + virtual void StartPresentation( sal_Bool bStart ); + virtual void SetAlwaysOnTop( sal_Bool bOnTop ); + virtual void ToTop( sal_uInt16 nFlags ); + virtual void SetPointer( PointerStyle ePointerStyle ); + virtual void CaptureMouse( sal_Bool bMouse ); + virtual void SetPointerPos( long nX, long nY ); + virtual void Flush( void ); + virtual void Flush( const Rectangle& ); + virtual void Sync(); + virtual void SetInputContext( SalInputContext* pContext ); + virtual void EndExtTextInput( sal_uInt16 nFlags ); + virtual String GetKeyName( sal_uInt16 nKeyCode ); + virtual String GetSymbolKeyName( const XubString& rFontName, sal_uInt16 nKeyCode ); + virtual sal_Bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, KeyCode& rKeyCode ); + virtual LanguageType GetInputLanguage(); + virtual SalBitmap* SnapShot(); + virtual void UpdateSettings( AllSettings& rSettings ); + virtual void Beep( SoundType eSoundType ); + virtual const SystemEnvData* GetSystemData() const; + virtual SalPointerState GetPointerState(); + virtual SalIndicatorState GetIndicatorState(); + virtual void SimulateKeyPress( sal_uInt16 nKeyCode ); + virtual void SetParent( SalFrame* pNewParent ); + virtual bool SetPluginParent( SystemParentData* pNewParent ); + virtual void SetExtendedFrameStyle( SalExtStyle ); + virtual void SetBackgroundBitmap( SalBitmap* ); + virtual void SetScreenNumber(unsigned int); + virtual void SetApplicationID( const rtl::OUString &rApplicationID ); + + // shaped system windows + // set clip region to none (-> rectangular windows, normal state) + virtual void ResetClipRegion(); + // start setting the clipregion consisting of nRects rectangles + virtual void BeginSetClipRegion( sal_uLong nRects ); + // add a rectangle to the clip region + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + // done setting up the clipregion + virtual void EndSetClipRegion(); + + virtual void SetClientSize( long nWidth, long nHeight ); + + void UpdateFrameGeometry(); + + // trigger painting of the window + void SendPaintEvent( const Rectangle* pRect = NULL ); + + static bool isAlive( const IosSalFrame* pFrame ) + { return GetSalData()->maFrameCheck.find( pFrame ) != GetSalData()->maFrameCheck.end(); } + + static IosSalFrame* GetCaptureFrame() { return s_pCaptureFrame; } + + UIWindow* getWindow() const { return mpWindow; } + UIView* getView() const { return mpView; } + unsigned int getStyleMask() const { return mnStyleMask; } + + void getResolution( long& o_rDPIX, long& o_rDPIY ); + + CGMutablePathRef getClipPath() const { return mrClippingPath; } + + // called by VCL_UIApplication to indicate screen settings have changed + void screenParametersChanged(); + + private: // methods + /** do things on initial show (like centering on parent or on screen) + */ + void initShow(); + + void initWindowAndView(); + + private: // data + static IosSalFrame* s_pCaptureFrame; + + // make IosSalFrame non copyable + IosSalFrame( const IosSalFrame& ); + IosSalFrame& operator=(const IosSalFrame&); +}; + +#endif // _SV_SALFRAME_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salframeview.h b/vcl/inc/ios/salframeview.h new file mode 100644 index 000000000000..e631209c7b7f --- /dev/null +++ b/vcl/inc/ios/salframeview.h @@ -0,0 +1,144 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _VCL_SALFRAMEVIEW_H +#define _VCL_SALFRAMEVIEW_H + +@interface SalFrameWindow : UIWindow +{ + IosSalFrame* mpFrame; + id mDraggingDestinationHandler; +} +-(id)initWithSalFrame: (IosSalFrame*)pFrame; +-(BOOL)canBecomeKeyWindow; +-(void)displayIfNeeded; +-(void)becomeKeyWindow; +-(void)resignKeyWindow; +-(IosSalFrame*)getSalFrame; +@end + +@interface SalFrameView : UIView +{ + IosSalFrame* mpFrame; + + // for UITextInput + UIEvent* mpLastEvent; + BOOL mbNeedSpecialKeyHandle; + BOOL mbInKeyInput; + BOOL mbKeyHandled; + NSRange mMarkedRange; + NSRange mSelectedRange; + id mDraggingDestinationHandler; + UIEvent* mpLastSuperEvent; + + NSTimeInterval mfLastMagnifyTime; + float mfMagnifyDeltaSum; +} +-(id)initWithSalFrame: (IosSalFrame*)pFrame; +-(IosSalFrame*)getSalFrame; +-(BOOL)acceptsFirstResponder; +-(BOOL)isOpaque; +-(void)drawRect: (CGRect)aRect; +-(void)magnifyWithEvent: (UIEvent*)pEvent; +-(void)rotateWithEvent: (UIEvent*)pEvent; +-(void)swipeWithEvent: (UIEvent*)pEvent; +-(void)keyDown: (UIEvent*)pEvent; +-(void)flagsChanged: (UIEvent*)pEvent; +-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar; +-(BOOL)sendKeyInputAndReleaseToFrame: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; +-(BOOL)sendKeyToFrameDirect: (sal_uInt16)nKeyCode character: (sal_Unicode)aChar modifiers: (unsigned int)nMod; +-(BOOL)sendSingleCharacter:(UIEvent*)pEvent; +-(BOOL)handleKeyDownException:(UIEvent*)pEvent; +-(void)clearLastEvent; +/* + text action methods +*/ +-(void)insertText:(id)aString; +-(void)insertTab: (id)aSender; +-(void)insertBacktab: (id)aSender; +-(void)moveLeft: (id)aSender; +-(void)moveLeftAndModifySelection: (id)aSender; +-(void)moveBackwardAndModifySelection: (id)aSender; +-(void)moveRight: (id)aSender; +-(void)moveRightAndModifySelection: (id)aSender; +-(void)moveForwardAndModifySelection: (id)aSender; +-(void)moveUp: (id)aSender; +-(void)moveDown: (id)aSender; +-(void)moveWordBackward: (id)aSender; +-(void)moveWordBackwardAndModifySelection: (id)aSender; +-(void)moveWordLeftAndModifySelection: (id)aSender; +-(void)moveWordForward: (id)aSender; +-(void)moveWordForwardAndModifySelection: (id)aSender; +-(void)moveWordRightAndModifySelection: (id)aSender; +-(void)moveToEndOfLine: (id)aSender; +-(void)moveToRightEndOfLine: (id)aSender; +-(void)moveToLeftEndOfLine: (id)aSender; +-(void)moveToEndOfLineAndModifySelection: (id)aSender; +-(void)moveToRightEndOfLineAndModifySelection: (id)aSender; +-(void)moveToLeftEndOfLineAndModifySelection: (id)aSender; +-(void)moveToBeginningOfLine: (id)aSender; +-(void)moveToBeginningOfLineAndModifySelection: (id)aSender; +-(void)moveToEndOfParagraph: (id)aSender; +-(void)moveToEndOfParagraphAndModifySelection: (id)aSender; +-(void)moveToBeginningOfParagraph: (id)aSender; +-(void)moveToBeginningOfParagraphAndModifySelection: (id)aSender; +-(void)moveParagraphForward: (id)aSender; +-(void)moveParagraphForwardAndModifySelection: (id)aSender; +-(void)moveParagraphBackward: (id)aSender; +-(void)moveParagraphBackwardAndModifySelection: (id)aSender; +-(void)moveToEndOfDocument: (id)aSender; +-(void)scrollToEndOfDocument: (id)aSender; +-(void)moveToEndOfDocumentAndModifySelection: (id)aSender; +-(void)moveToBeginningOfDocument: (id)aSender; +-(void)scrollToBeginningOfDocument: (id)aSender; +-(void)moveToBeginningOfDocumentAndModifySelection: (id)aSender; +-(void)insertNewline: (id)aSender; +-(void)deleteBackward: (id)aSender; +-(void)deleteForward: (id)aSender; +-(void)cancelOperation: (id)aSender; +-(void)deleteBackwardByDecomposingPreviousCharacter: (id)aSender; +-(void)deleteWordBackward: (id)aSender; +-(void)deleteWordForward: (id)aSender; +-(void)deleteToBeginningOfLine: (id)aSender; +-(void)deleteToEndOfLine: (id)aSender; +-(void)deleteToBeginningOfParagraph: (id)aSender; +-(void)deleteToEndOfParagraph: (id)aSender; +-(void)insertLineBreak: (id)aSender; +-(void)insertParagraphSeparator: (id)aSender; +-(void)selectWord: (id)aSender; +-(void)selectLine: (id)aSender; +-(void)selectParagraph: (id)aSender; +-(void)selectAll: (id)aSender; +-(void)noop: (id)aSender; +-(id)parentAttribute; +-(UIView *)viewElementForParent; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h new file mode 100644 index 000000000000..51ef49219e9a --- /dev/null +++ b/vcl/inc/ios/salgdi.h @@ -0,0 +1,401 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALGDI_H +#define _SV_SALGDI_H + +#include "basegfx/polygon/b2dpolypolygon.hxx" + +#include "ios/iosvcltypes.h" +#include + +#include "outfont.hxx" +#include "salgdi.hxx" + +#include + +class IosSalFrame; +class IosSalBitmap; +class ImplDevFontAttributes; + +class CGRect; + +// mac specific physically available font face +class ImplIosFontData : public ImplFontData +{ +public: + ImplIosFontData( const ImplDevFontAttributes&, NSString * ); + + virtual ~ImplIosFontData(); + + virtual ImplFontData* Clone() const; + virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const; + virtual sal_IntPtr GetFontId() const; + + const ImplFontCharMap* GetImplFontCharMap() const; + bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + bool HasChar( sal_uInt32 cChar ) const; + + void ReadOs2Table() const; + void ReadIosCmapEncoding() const; + bool HasCJKSupport() const; + +private: + mutable const ImplFontCharMap* mpCharMap; + mutable vcl::FontCapabilities maFontCapabilities; + mutable bool mbOs2Read; // true if OS2-table related info is valid + mutable bool mbHasOs2Table; + mutable bool mbCmapEncodingRead; // true if cmap encoding of Ios font is read + mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading + mutable bool mbFontCapabilitiesRead; +}; + +// abstracting quartz color instead of having to use an CGFloat[] array +class RGBAColor +{ +public: + RGBAColor( SalColor ); + RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ); //NOTUSEDYET + const float* AsArray() const { return &mfRed; } + bool IsVisible() const { return (mfAlpha > 0); } + void SetAlpha( float fAlpha ) { mfAlpha = fAlpha; } +private: + float mfRed, mfGreen, mfBlue, mfAlpha; +}; + +// ------------------- +// - IosSalGraphics - +// ------------------- +class IosSalGraphics : public SalGraphics +{ +protected: + IosSalFrame* mpFrame; + CGLayerRef mxLayer; // Quartz graphics layer + CGContextRef mrContext; // Quartz drawing context + class XorEmulation* mpXorEmulation; + int mnXorMode; // 0: off 1: on 2: invert only + int mnWidth; + int mnHeight; + int mnBitmapDepth; // zero unless bitmap + /// device resolution of this graphics + long mnRealDPIX; + long mnRealDPIY; + /// some graphics implementations (e.g. IosSalInfoPrinter) scale + /// everything down by a factor (see SetupPrinterGraphics for details) + /// so we have to compensate for it with the inverse factor + double mfFakeDPIScale; + + /// path representing current clip region + CGMutablePathRef mxClipPath; + + /// Drawing colors + /// pen color RGBA + RGBAColor maLineColor; + /// brush color RGBA + RGBAColor maFillColor; + + // Device Font settings + const ImplIosFontData* mpIosFontData; + /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0 + float mfFontStretch; + /// allows text to be rendered without antialiasing + bool mbNonAntialiasedText; + + // Graphics types + + /// is this a printer graphics + bool mbPrinter; + /// is this a virtual device graphics + bool mbVirDev; + /// is this a window graphics + bool mbWindow; + +public: + IosSalGraphics(); + virtual ~IosSalGraphics(); + + bool IsPenVisible() const { return maLineColor.IsVisible(); } + bool IsBrushVisible() const { return maFillColor.IsVisible(); } + + void SetWindowGraphics( IosSalFrame* pFrame ); + void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale ); + void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 ); + + void initResolution( UIWindow* ); + void copyResolution( IosSalGraphics& ); + void updateResolution(); + + bool IsWindowGraphics() const { return mbWindow; } + bool IsPrinterGraphics() const { return mbPrinter; } + bool IsVirDevGraphics() const { return mbVirDev; } + IosSalFrame* getGraphicsFrame() const { return mpFrame; } + void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; } + + void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels + + bool CheckContext(); + void UpdateWindow( CGRect& ); // delivered in NSView coordinates + void RefreshRect( const CGRect& ); + void RefreshRect(float lX, float lY, float lWidth, float lHeight); + + void SetState(); + void UnsetState(); + // InvalidateContext does an UnsetState and sets mrContext to 0 + void InvalidateContext(); + + virtual bool setClipRegion( const Region& ); + + // draw --> LineColor and FillColor and RasterOp and ClipRegion + virtual void drawPixel( long nX, long nY ); + virtual void drawPixel( long nX, long nY, SalColor nSalColor ); + virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ); + virtual void drawRect( long nX, long nY, long nWidth, long nHeight ); + virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry ); + virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry ); + virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency ); + virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry ); + virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry ); + virtual bool drawPolyLine( const ::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ); + + // CopyArea --> No RasterOp, but ClipRegion + virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, + long nSrcHeight, sal_uInt16 nFlags ); + + // CopyBits and DrawBitmap --> RasterOp and ClipRegion + // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics + virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics ); + virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nTransparentColor ); + virtual void drawBitmap( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + const SalBitmap& rTransparentBitmap ); + virtual void drawMask( const SalTwoRect* pPosAry, + const SalBitmap& rSalBitmap, + SalColor nMaskColor ); + + virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ); + virtual SalColor getPixel( long nX, long nY ); + + // invert --> ClipRegion (only Windows or VirDevs) + virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags); + virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags ); + + virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ); + + virtual bool drawAlphaBitmap( const SalTwoRect&, + const SalBitmap& rSourceBitmap, + const SalBitmap& rAlphaBitmap ); + + virtual bool drawAlphaRect( long nX, long nY, long nWidth, + long nHeight, sal_uInt8 nTransparency ); + + CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry); + // native widget rendering methods that require mirroring + virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + const Point& aPos, sal_Bool& rIsInside ); + virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + const rtl::OUString& aCaption ); + virtual sal_Bool drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, + ControlState nState, const ImplControlValue& aValue, + const rtl::OUString& aCaption ); + virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, + const ImplControlValue& aValue, const rtl::OUString& aCaption, + Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion ); + + // get device resolution + virtual void GetResolution( long& rDPIX, long& rDPIY ); + // get the depth of the device + virtual sal_uInt16 GetBitCount() const; + // get the width of the device + virtual long GetGraphicsWidth() const; + + // set the clip region to empty + virtual void ResetClipRegion(); + + // set the line color to transparent (= don't draw lines) + virtual void SetLineColor(); + // set the line color to a specific color + virtual void SetLineColor( SalColor nSalColor ); + // set the fill color to transparent (= don't fill) + virtual void SetFillColor(); + // set the fill color to a specific color, shapes will be + // filled accordingly + virtual void SetFillColor( SalColor nSalColor ); + // enable/disable XOR drawing + virtual void SetXORMode( bool bSet, bool bInvertOnly ); + // set line color for raster operations + virtual void SetROPLineColor( SalROPColor nROPColor ); + // set fill color for raster operations + virtual void SetROPFillColor( SalROPColor nROPColor ); + // set the text color to a specific color + virtual void SetTextColor( SalColor nSalColor ); + // set the font + virtual sal_uInt16 SetFont( ImplFontSelectData*, int nFallbackLevel ); + // get the current font's etrics + virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ); + // get kernign pairs of the current font + // return only PairCount if (pKernPairs == NULL) + virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs ); + // get the repertoire of the current font + virtual const ImplFontCharMap* GetImplFontCharMap() const; + virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const; + // graphics must fill supplied font list + virtual void GetDevFontList( ImplDevFontList* ); + // graphics should call ImplAddDevFontSubstitute on supplied + // OutputDevice for all its device specific preferred font substitutions + virtual void GetDevFontSubstList( OutputDevice* ); + virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName ); + // CreateFontSubset: a method to get a subset of glyhps of a font + // inside a new valid font file + // returns TRUE if creation of subset was successfull + // parameters: rToFile: contains a osl file URL to write the subset to + // pFont: describes from which font to create a subset + // pGlyphIDs: the glyph ids to be extracted + // pEncoding: the character code corresponding to each glyph + // pWidths: the advance widths of the correspoding glyphs (in PS font units) + // nGlyphs: the number of glyphs + // rInfo: additional outgoing information + // implementation note: encoding 0 with glyph id 0 should be added implicitly + // as "undefined character" + virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile, + const ImplFontData* pFont, + long* pGlyphIDs, + sal_uInt8* pEncoding, + sal_Int32* pWidths, + int nGlyphs, + FontSubsetInfo& rInfo // out parameter + ); + + // GetFontEncodingVector: a method to get the encoding map Unicode + // to font encoded character; this is only used for type1 fonts and + // may return NULL in case of unknown encoding vector + // if ppNonEncoded is set and non encoded characters (that is type1 + // glyphs with only a name) exist it is set to the corresponding + // map for non encoded glyphs; the encoding vector contains -1 + // as encoding for these cases + virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); + + // GetEmbedFontData: gets the font data for a font marked + // embeddable by GetDevFontList or NULL in case of error + // parameters: pFont: describes the font in question + // pWidths: the widths of all glyphs from char code 0 to 255 + // pWidths MUST support at least 256 members; + // rInfo: additional outgoing information + // pDataLen: out parameter, contains the byte length of the returned buffer + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); + // frees the font data again + virtual void FreeEmbedFontData( const void* pData, long nDataLen ); + + virtual void GetGlyphWidths( const ImplFontData*, + bool bVertical, + Int32Vector& rWidths, + Ucs2UIntMap& rUnicodeEnc ); + + virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ); + + virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); + virtual void DrawServerFontLayout( const ServerFontLayout& ); + virtual bool supportsOperation( OutDevSupportType ) const; + + // Query the platform layer for control support + virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart ); + + virtual SystemGraphicsData GetGraphicsData() const; + virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const; + +private: + // differences between VCL, Quartz and kHiThemeOrientation coordinate systems + // make some graphics seem to be vertically-mirrored from a VCL perspective + bool IsFlipped() const { return mbWindow; } + + void ApplyXorContext(); + void Pattern50Fill(); + UInt32 getState( ControlState nState ); + UInt32 getTrackState( ControlState nState ); +}; + +class XorEmulation +{ +public: + XorEmulation(); + /*final*/ ~XorEmulation(); + + void SetTarget( int nWidth, int nHeight, int nBitmapDepth, CGContextRef, CGLayerRef ); + bool UpdateTarget(); + void Enable() { mbIsEnabled = true; } + void Disable() { mbIsEnabled = false; } + bool IsEnabled() const { return mbIsEnabled; } + CGContextRef GetTargetContext() const { return mxTargetContext; } + CGContextRef GetMaskContext() const { return (mbIsEnabled ? mxMaskContext : NULL); } + +private: + CGLayerRef mxTargetLayer; + CGContextRef mxTargetContext; + CGContextRef mxMaskContext; + CGContextRef mxTempContext; + sal_uLong* mpMaskBuffer; + sal_uLong* mpTempBuffer; + int mnBufferLongs; + bool mbIsEnabled; +}; + + +// --- some trivial inlines + +inline void IosSalGraphics::RefreshRect( const CGRect& rRect ) +{ + RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height ); +} + +inline RGBAColor::RGBAColor( SalColor nSalColor ) +: mfRed( SALCOLOR_RED(nSalColor) * (1.0/255)) +, mfGreen( SALCOLOR_GREEN(nSalColor) * (1.0/255)) +, mfBlue( SALCOLOR_BLUE(nSalColor) * (1.0/255)) +, mfAlpha( 1.0 ) // opaque +{} + +inline RGBAColor::RGBAColor( float fRed, float fGreen, float fBlue, float fAlpha ) +: mfRed( fRed ) +, mfGreen( fGreen ) +, mfBlue( fBlue ) +, mfAlpha( fAlpha ) +{} + +#endif // _SV_SALGDI_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salinst.h b/vcl/inc/ios/salinst.h new file mode 100644 index 000000000000..9983804bf665 --- /dev/null +++ b/vcl/inc/ios/salinst.h @@ -0,0 +1,199 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALINST_H +#define _SV_SALINST_H + +#include "osl/mutex.hxx" +#include "osl/thread.hxx" +#include "osl/conditn.h" +#include + +#include "ios/iosvcltypes.h" + +#include "salinst.hxx" + +#include + +class IosSalFrame; +class ApplicationEvent; +class Image; + +// ----------------- +// - SalYieldMutex - +// ----------------- + +class SalYieldMutex : public vcl::SolarMutexObject +{ + sal_uLong mnCount; + oslThreadIdentifier mnThreadId; + +public: + SalYieldMutex(); + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + sal_uLong GetAcquireCount() const { return mnCount; } + oslThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +#define YIELD_GUARD osl::SolarGuard aGuard( GetSalData()->mpFirstInstance->GetYieldMutex() ) + + +// ------------------- +// - SalInstanceData - +// ------------------- + +//struct SalInstanceData +//{ +//public: +//}; + +// ------------------ +// - IosSalInstance - +// ------------------ + +class IosSalInstance : public SalInstance +{ + struct SalUserEvent + { + IosSalFrame* mpFrame; + void* mpData; + sal_uInt16 mnType; + + SalUserEvent( IosSalFrame* pFrame, void* pData, sal_uInt16 nType ) : + mpFrame( pFrame ), mpData( pData ), mnType( nType ) + {} + }; + +public: + SalYieldMutex* mpSalYieldMutex; + rtl::OUString maDefaultPrinter; + oslThreadIdentifier maMainThread; + bool mbWaitingYield; + int mnActivePrintJobs; + std::list< SalUserEvent > maUserEvents; + oslMutex maUserEventListMutex; + oslCondition maWaitingYieldCond; + + typedef std::list AppEventList; + static AppEventList aAppEventList; + +public: + IosSalInstance(); + virtual ~IosSalInstance(); + + virtual SalSystem* CreateSystem(); + virtual void DestroySystem(SalSystem*); + virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uLong nStyle ); + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); + virtual void DestroyFrame( SalFrame* pFrame ); + virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); + virtual void DestroyObject( SalObject* pObject ); + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, + long nDX, long nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData ); + virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); + + virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pSetupData ); + virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); + virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); + virtual void DestroyPrinter( SalPrinter* pPrinter ); + virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); + virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); + virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); + virtual String GetDefaultPrinter(); + virtual SalTimer* CreateSalTimer(); + virtual SalI18NImeStatus* CreateI18NImeStatus(); + virtual SalSystem* CreateSalSystem(); + virtual SalBitmap* CreateSalBitmap(); + virtual osl::SolarMutex* GetYieldMutex(); + virtual sal_uLong ReleaseYieldMutex(); + virtual void AcquireYieldMutex( sal_uLong nCount ); + virtual bool CheckYieldMutex(); + virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); + virtual bool AnyInput( sal_uInt16 nType ); + virtual SalMenu* CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu ); + virtual void DestroyMenu( SalMenu* ); + virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); + virtual void DestroyMenuItem( SalMenuItem* ); + virtual SalSession* CreateSalSession(); + virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); + virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); + virtual void SetEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) ); + virtual void SetErrorEventCallback( void* pInstance, bool(*pCallback)(void*,void*,int) ); + + // dtrans implementation + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > + CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ); + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource(); + virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget(); + + void wakeupYield(); + + public: + friend class IosSalFrame; + + void PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData ); + void delayedSettingsChanged( bool bInvalidate ); + + bool isUIAppThread() const; + + void startedPrintJob() { mnActivePrintJobs++; } + void endedPrintJob() { mnActivePrintJobs--; } + + // event subtypes for NSApplicationDefined events + static const short AppExecuteSVMain = 0x7fff; + static const short AppEndLoopEvent = 1; + static const short AppStartTimerEvent = 10; + static const short AppleRemoteEvent = 15; + static const short YieldWakeupEvent = 20; +}; + +// helper class: inverted solar guard +class YieldMutexReleaser +{ + sal_uLong mnCount; + public: + YieldMutexReleaser(); + ~YieldMutexReleaser(); +}; + +// helper class +rtl::OUString GetOUString( CFStringRef ); +rtl::OUString GetOUString( NSString* ); +CFStringRef CreateCFString( const rtl::OUString& ); +NSString* CreateNSString( const rtl::OUString& ); + +CGImageRef CreateCGImage( const Image& ); +UIImage* CreateUIImage( const Image& ); + +#endif // _SV_SALINST_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salmathutils.hxx b/vcl/inc/ios/salmathutils.hxx new file mode 100644 index 000000000000..e81f68e46b0b --- /dev/null +++ b/vcl/inc/ios/salmathutils.hxx @@ -0,0 +1,90 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALMATHUTILS_HXX +#define _SV_SALMATHUTILS_HXX + +#ifdef __cplusplus +extern "C" { +#endif + +// ------------------------------------------------------------------ +// +// Structures +// +// ------------------------------------------------------------------ + +// LRectCoor is an abreviation for rectangular coordinates +// represented as long integers + +struct LRectCoor +{ + long x; + long y; + long z; +}; + +// ------------------------------------------------------------------ +// +// Type Definitions +// +// ------------------------------------------------------------------ + +// LRectCoorVec is an abreviation for vectors in rectangular +// coordinates represented as long integers + +typedef struct LRectCoor LRectCoor; +typedef LRectCoor *LRectCoorVector; +typedef LRectCoorVector *LRectCoorTensor; + +// ------------------------------------------------------------------ +// +// Function Headers +// +// ------------------------------------------------------------------ + +void CSwap ( char &rX, char &rY ); +void UCSwap ( unsigned char &rX, unsigned char &rY ); +void SSwap ( short &rX, short &rY ); +void USSwap ( unsigned short &rX, unsigned short &rY ); +void LSwap ( long &rX, long &rY ); +void ULSwap ( unsigned long &rX, unsigned long &rY ); + +// ------------------------------------------------------------------ + +unsigned long Euclidian2Norm ( const LRectCoorVector pVec ); + +// ------------------------------------------------------------------ + +#ifdef __cplusplus +} +#endif + +#endif // _SV_SALMATHUTILS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salmenu.h b/vcl/inc/ios/salmenu.h new file mode 100644 index 000000000000..3f143ac1d976 --- /dev/null +++ b/vcl/inc/ios/salmenu.h @@ -0,0 +1,122 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALMENU_H +#define _SV_SALMENU_H + +#include "premac.h" +#include +#include "postmac.h" + +#include "salmenu.hxx" + +#include + +class IosSalFrame; +class IosSalMenuItem; + +class IosSalMenu : public SalMenu +{ + std::vector< IosSalMenuItem* > maItems; + +public: // for OOStatusView + struct MenuBarButtonEntry + { + SalMenuButtonItem maButton; + UIImage* mpUIImage; // cached image + NSString* mpToolTipString; + + MenuBarButtonEntry() : mpUIImage( nil ), mpToolTipString( nil ) {} + MenuBarButtonEntry( const SalMenuButtonItem& i_rItem ) + : maButton( i_rItem), mpUIImage( nil ), mpToolTipString( nil ) {} + }; +private: + std::vector< MenuBarButtonEntry > maButtons; + + MenuBarButtonEntry* findButtonItem( sal_uInt16 i_nItemId ); + void releaseButtonEntry( MenuBarButtonEntry& i_rEntry ); + static void statusLayout(); +public: + IosSalMenu( bool bMenuBar ); + virtual ~IosSalMenu(); + + virtual sal_Bool VisibleMenuBar(); // must return TRUE to actually DISPLAY native menu bars + // otherwise only menu messages are processed (eg, OLE on Windows) + + virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ); + virtual void RemoveItem( unsigned nPos ); + virtual void SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ); + virtual void SetFrame( const SalFrame* pFrame ); + virtual void CheckItem( unsigned nPos, sal_Bool bCheck ); + virtual void EnableItem( unsigned nPos, sal_Bool bEnable ); + virtual void SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const XubString& rText ); + virtual void SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage); + virtual void GetSystemMenuData( SystemMenuData* pData ); + virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, sal_uLong nFlags); + virtual bool AddMenuBarButton( const SalMenuButtonItem& ); + virtual void RemoveMenuBarButton( sal_uInt16 nId ); + virtual Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame ); + + int getItemIndexByPos( sal_uInt16 nPos ) const; + const IosSalFrame* getFrame() const; + + void setMainMenu(); + static void unsetMainMenu(); + static void setDefaultMenu(); + static void enableMainMenu( bool bEnable ); + static void addFallbackMenuItem( UIMenuItem* NewItem ); + static void removeFallbackMenuItem( UIMenuItem* pOldItem ); + + const std::vector< MenuBarButtonEntry >& getButtons() const { return maButtons; } + + bool mbMenuBar; // true - Menubar, false - Menu + UIMenuController* mpMenu; + Menu* mpVCLMenu; // the corresponding vcl Menu object + const IosSalFrame* mpFrame; // the frame to dispatch the menu events to + IosSalMenu* mpParentSalMenu; // the parent menu that contains us (and perhaps has a frame) + + static const IosSalMenu* pCurrentMenuBar; + +}; + +class IosSalMenuItem : public SalMenuItem +{ +public: + IosSalMenuItem( const SalItemParams* ); + virtual ~IosSalMenuItem(); + + sal_uInt16 mnId; // Item ID + Menu* mpVCLMenu; // VCL Menu into which this MenuItem is inserted + IosSalMenu* mpParentMenu; // The menu in which this menu item is inserted + IosSalMenu* mpSubMenu; // Sub menu of this item (if defined) + UIMenuItem* mpMenuItem; // The UIMenuItem +}; + +#endif // _SV_SALMENU_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salnstimer.h b/vcl/inc/ios/salnstimer.h new file mode 100644 index 000000000000..cf98276747ee --- /dev/null +++ b/vcl/inc/ios/salnstimer.h @@ -0,0 +1,43 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _VCL_SALNSTIMER_H +#define _VCL_SALNSTIMER_H + +#include "premac.h" +#include +#include "postmac.h" + +@interface TimerCallbackCaller : NSObject +{ +} +-(void)timerElapsed:(NSTimer*)pTimer; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salobj.h b/vcl/inc/ios/salobj.h new file mode 100644 index 000000000000..3203a0d46e93 --- /dev/null +++ b/vcl/inc/ios/salobj.h @@ -0,0 +1,86 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALOBJ_H +#define _SV_SALOBJ_H + +#include "vcl/sysdata.hxx" +#include "salobj.hxx" + +class IosSalFrame; +class IosSalObject; + + +// ----------------- +// - SalObjectData - +// ----------------- + +struct SalObjectData +{ +}; + +class IosSalObject : public SalObject +{ +public: + IosSalFrame* mpFrame; // parent frame + SystemEnvData maSysData; + + long mnClipX; + long mnClipY; + long mnClipWidth; + long mnClipHeight; + bool mbClip; + + long mnX; + long mnY; + long mnWidth; + long mnHeight; + + void setClippedPosSize(); + + IosSalObject( IosSalFrame* pFrame ); + virtual ~IosSalObject(); + + virtual void ResetClipRegion(); + virtual sal_uInt16 GetClipRegionType(); + virtual void BeginSetClipRegion( sal_uLong nRects ); + virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + virtual void EndSetClipRegion(); + virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight ); + virtual void Show( sal_Bool bVisible ); + virtual void Enable( sal_Bool nEnable ); + virtual void GrabFocus(); + virtual void SetBackground(); + virtual void SetBackground( SalColor nSalColor ); + virtual const SystemEnvData* GetSystemData() const; + virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ); +}; + +#endif // _SV_SALOBJ_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salprn.h b/vcl/inc/ios/salprn.h new file mode 100644 index 000000000000..cd90a0f881df --- /dev/null +++ b/vcl/inc/ios/salprn.h @@ -0,0 +1,173 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALPRN_H +#define _SV_SALPRN_H + +#include "ios/iosvcltypes.h" + +#include "salprn.hxx" + +#include + + +// --------------------- +// - IosSalInfoPrinter - +// --------------------- + +class IosSalGraphics; + +class IosSalInfoPrinter : public SalInfoPrinter +{ + /// Printer graphics + IosSalGraphics* mpGraphics; + /// is Graphics used + bool mbGraphics; + /// job active ? + bool mbJob; + + UIPrintFormatter* mpPrinter; + /// cocoa print info object + UIPrintInfo* mpPrintInfo; + + /// FIXME: get real printer context for infoprinter if possible + /// fake context for info printer + /// graphics context for Quartz 2D + CGContextRef mrContext; + /// memory for graphics bitmap context for querying metrics + boost::shared_array< sal_uInt8 > maContextMemory; + + // since changes to UIPrintInfo during a job are ignored + // we have to care for some settings ourselves + // currently we do this for orientation; + // really needed however is a solution for paper formats + Orientation mePageOrientation; + + int mnStartPageOffsetX; + int mnStartPageOffsetY; + sal_Int32 mnCurPageRangeStart; + sal_Int32 mnCurPageRangeCount; + + public: + IosSalInfoPrinter( const SalPrinterQueueInfo& pInfo ); + virtual ~IosSalInfoPrinter(); + + void SetupPrinterGraphics( CGContextRef i_xContext ) const; + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* i_pGraphics ); + virtual sal_Bool Setup( SalFrame* i_pFrame, ImplJobSetup* i_pSetupData ); + virtual sal_Bool SetPrinterData( ImplJobSetup* pSetupData ); + virtual sal_Bool SetData( sal_uLong i_nFlags, ImplJobSetup* i_pSetupData ); + virtual void GetPageInfo( const ImplJobSetup* i_pSetupData, + long& o_rOutWidth, long& o_rOutHeight, + long& o_rPageOffX, long& o_rPageOffY, + long& o_rPageWidth, long& o_rPageHeight ); + virtual sal_uLong GetCapabilities( const ImplJobSetup* i_pSetupData, sal_uInt16 i_nType ); + virtual sal_uLong GetPaperBinCount( const ImplJobSetup* i_pSetupData ); + virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, sal_uLong i_nPaperBin ); + virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData ); + virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData ); + + // the artificial separation between InfoPrinter and Printer + // is not really useful for us + // so let's make IosSalPrinter just a forwarder to IosSalInfoPrinter + // and concentrate the real work in one class + // implement pull model print system + sal_Bool StartJob( const String* i_pFileName, + const String& rJobName, + const String& i_rAppName, + ImplJobSetup* i_pSetupData, + vcl::PrinterController& i_rController ); + sal_Bool EndJob(); + sal_Bool AbortJob(); + SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData ); + sal_Bool EndPage(); + sal_uLong GetErrorCode() const; + + UIPrintInfo* getPrintInfo() const { return mpPrintInfo; } + void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; } + sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; } + sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; } + + // match width/height against known paper formats, possibly switching orientation + const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const; + void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation ); + + private: + IosSalInfoPrinter( const IosSalInfoPrinter& ); + IosSalInfoPrinter& operator=(const IosSalInfoPrinter&); +}; + +// ----------------- +// - IosSalPrinter - +// ----------------- + +class IosSalPrinter : public SalPrinter +{ + IosSalInfoPrinter* mpInfoPrinter; // pointer to the compatible InfoPrinter + public: + IosSalPrinter( IosSalInfoPrinter* i_pInfoPrinter ); + virtual ~IosSalPrinter(); + + virtual sal_Bool StartJob( const XubString* i_pFileName, + const XubString& i_rJobName, + const XubString& i_rAppName, + sal_uLong i_nCopies, + bool i_bCollate, + bool i_bDirect, + ImplJobSetup* i_pSetupData ); + // implement pull model print system + virtual sal_Bool StartJob( const String* i_pFileName, + const String& rJobName, + const String& i_rAppName, + ImplJobSetup* i_pSetupData, + vcl::PrinterController& i_rListener ); + + virtual sal_Bool EndJob(); + virtual sal_Bool AbortJob(); + virtual SalGraphics* StartPage( ImplJobSetup* i_pSetupData, sal_Bool i_bNewJobData ); + virtual sal_Bool EndPage(); + virtual sal_uLong GetErrorCode(); + + private: + IosSalPrinter( const IosSalPrinter& ); + IosSalPrinter& operator=(const IosSalPrinter&); +}; + +const double fPtTo100thMM = 35.27777778; + +inline int PtTo10Mu( double nPoints ) { return (int)(((nPoints)*fPtTo100thMM)+0.5); } + +inline double TenMuToPt( double nUnits ) { return floor(((nUnits)/fPtTo100thMM)+0.5); } + + + +#endif // _SV_SALPRN_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salsys.h b/vcl/inc/ios/salsys.h new file mode 100644 index 000000000000..e586c8dfb356 --- /dev/null +++ b/vcl/inc/ios/salsys.h @@ -0,0 +1,56 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALSYS_H +#define _SV_SALSYS_H + +#include "salsys.hxx" + +class VCL_DLLPUBLIC IosSalSystem : public SalSystem +{ +public: + IosSalSystem() {} + virtual ~IosSalSystem(); + + // get info about the display + virtual unsigned int GetDisplayScreenCount(); + virtual bool IsMultiDisplay(); + virtual unsigned int GetDefaultDisplayNumber(); + virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); + virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); + + virtual rtl::OUString GetScreenName( unsigned int nScreen ); + virtual int ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton); +}; + +#endif // _SV_SALSYS_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saltimer.h b/vcl/inc/ios/saltimer.h new file mode 100644 index 000000000000..b5974219437d --- /dev/null +++ b/vcl/inc/ios/saltimer.h @@ -0,0 +1,54 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +#ifndef _SV_SALTIMER_H +#define _SV_SALTIMER_H + +#include "premac.h" +#include +#include "postmac.h" + +#include "saltimer.hxx" + +class IosSalTimer : public SalTimer +{ + public: + + IosSalTimer(); + virtual ~IosSalTimer(); + + void Start( sal_uLong nMS ); + void Stop(); + + static NSTimer* pRunningTimer; + static bool bDispatchTimer; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/saluimenu.h b/vcl/inc/ios/saluimenu.h new file mode 100644 index 000000000000..ef54daa2d631 --- /dev/null +++ b/vcl/inc/ios/saluimenu.h @@ -0,0 +1,62 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _VCL_SALUIMENU_H +#define _VCL_SALUIMENU_H + +class IosSalMenu; +class IosSalMenuItem; + +@interface SalUIMenu : UIMenuController +{ + /* Caution: SalNSMenu instances occasionally are binary copied + in IosSalMenu::ShowNativePopupMenu. If any members are added, + please take this into account ! + */ + IosSalMenu* mpMenu; +} +-(id)initWithMenu: (IosSalMenu*)pMenu; +-(void)menuNeedsUpdate: (UIMenuController*)pMenu; +-(void)setSalMenu: (IosSalMenu*)pMenu; +@end + +@interface SalUIMenuItem : UIMenuItem +{ + /* Caution: SalUIMenuItem instances occasionally are binary copied + in IosSalMenu::ShowNativePopupMenu. If any members are added, + please take this into account ! + */ + IosSalMenuItem* mpMenuItem; +} +-(id)initWithMenuItem: (IosSalMenuItem*)pMenuItem; +-(void)menuItemTriggered: (id)aSender; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/salvd.h b/vcl/inc/ios/salvd.h new file mode 100644 index 000000000000..e116c5c45bab --- /dev/null +++ b/vcl/inc/ios/salvd.h @@ -0,0 +1,79 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_SALVD_H +#define _SV_SALVD_H + +#include "ios/salcolorutils.hxx" +#include "ios/salgdi.h" + +#include "salvd.hxx" + +#if PRAGMA_ONCE + #pragma once +#endif + +struct SalVirDevData +{ +}; + +typedef struct SalVirDevData SalVirDevData; +typedef SalVirDevData *SalVirDevDataPtr; +typedef SalVirDevDataPtr *SalVirDevDataHandle; + +// ======================================================================= + +class IosSalGraphics; + +class IosSalVirtualDevice : public SalVirtualDevice +{ +private: + bool mbGraphicsUsed; // is Graphics used + bool mbForeignContext; // is mxContext from outside VCL + CGContextRef mxBitmapContext; + int mnBitmapDepth; + CGLayerRef mxLayer; // Quartz layer + IosSalGraphics* mpGraphics; // current VirDev graphics + + void Destroy(); + +public: + IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData ); + virtual ~IosSalVirtualDevice(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics* pGraphics ); + virtual sal_Bool SetSize( long nNewDX, long nNewDY ); + virtual void GetSize( long& rWidth, long& rHeight ); +}; + +// ======================================================================= + +#endif // _SV_SALVD_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/ios/vcluiapp.h b/vcl/inc/ios/vcluiapp.h new file mode 100644 index 000000000000..df4a01ead0de --- /dev/null +++ b/vcl/inc/ios/vcluiapp.h @@ -0,0 +1,53 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _VCL_VCLUIAPP_H +#define _VCL_VCLUIAPP_H + +#include "premac.h" +#include "UIKit/UIKit.h" +#include "postmac.h" + +class IosSalFrame; + +// our very own application +@interface VCL_UIApplication : UIApplication +{ +} +-(void)sendEvent:(UIEvent*)pEvent; +-(void)sendSuperEvent:(UIEvent*)pEvent; +-(BOOL)application: (UIApplication*) app openFile: (NSString*)file; +-(void)application: (UIApplication*) app openFiles: (NSArray*)files; +-(void)applicationWillTerminate: (UIApplication *) app; +-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem; +-(void)removeFallbackMenuItem: (UIMenuItem*)pOldItem; +@end + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vcl/bitmap.hxx b/vcl/inc/vcl/bitmap.hxx index e25bb482f53c..a6ff3129fada 100644 --- a/vcl/inc/vcl/bitmap.hxx +++ b/vcl/inc/vcl/bitmap.hxx @@ -234,7 +234,7 @@ struct BitmapSystemData #if defined( WNT ) void* pDIB; // device independent byte buffer void* pDDB; // if not NULL then this is actually an HBITMAP - #elif defined( QUARTZ ) + #elif defined( QUARTZ ) || defined( IOS ) void* rImageContext; //Image context (CGContextRef) #else void* aPixmap; diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx index cab614841e1d..b5daf28e579d 100644 --- a/vcl/inc/vcl/sysdata.hxx +++ b/vcl/inc/vcl/sysdata.hxx @@ -41,6 +41,18 @@ typedef struct CGLayer *CGLayerRef; class NSView; #endif #endif + +#ifdef IOS +typedef struct CGFont *CGFontRef; +typedef struct CGContext *CGContextRef; +typedef struct CGLayer *CGLayerRef; +#ifdef __OBJC__ +@class UIView; +#else +class UIView; +#endif +#endif + #if defined( WNT ) #include #endif @@ -56,6 +68,8 @@ struct SystemEnvData HWND hWnd; // the window hwnd #elif defined( QUARTZ ) NSView* pView; // the cocoa (NSView *) implementing this object +#elif defined( IOS ) + UIView* pView; // the CocoaTouch (UIView *) implementing this object #elif defined( UNX ) void* pDisplay; // the relevant display connection long aWindow; // the window of the object @@ -84,6 +98,8 @@ struct SystemParentData HWND hWnd; // the window hwnd #elif defined( QUARTZ ) NSView* pView; // the cocoa (NSView *) implementing this object +#elif defined( IOS ) + UIView* pView; // the CocoaTouch (UIView *) implementing this object #elif defined( UNX ) long aWindow; // the window of the object bool bXEmbedSupport:1; // decides whether the object in question @@ -116,8 +132,8 @@ struct SystemGraphicsData unsigned long nSize; // size in bytes of this structure #if defined( WNT ) HDC hDC; // handle to a device context -#elif defined( QUARTZ ) - CGContextRef rCGContext; // QUARTZ graphic context +#elif defined( QUARTZ ) || defined( IOS ) + CGContextRef rCGContext; // CoreGraphics graphic context #elif defined( UNX ) void* pDisplay; // the relevant display connection long hDrawable; // a drawable @@ -139,6 +155,7 @@ struct SystemWindowData unsigned long nSize; // size in bytes of this structure #if defined( WNT ) // meaningless on Windows #elif defined( QUARTZ ) // meaningless on Mac OS X / Quartz +#elif defined( IOS ) // and maybe on iOS, too, then #elif defined( UNX ) void* pVisual; // the visual to be used #endif @@ -169,6 +186,8 @@ struct SystemFontData HFONT hFont; // native font object #elif defined( QUARTZ ) void* aATSUFontID; // native font object +#elif defined( IOS ) + CGFontRef rFont; // native font object #elif defined( UNX ) void* nFontId; // native font id int nFontFlags; // native font flags diff --git a/vcl/ios/source/app/saldata.cxx b/vcl/ios/source/app/saldata.cxx new file mode 100644 index 000000000000..f292b6fae585 --- /dev/null +++ b/vcl/ios/source/app/saldata.cxx @@ -0,0 +1,128 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "ios/saldata.hxx" +#include "ios/saluimenu.h" +#include "ios/salinst.h" + +oslThreadKey SalData::s_aAutoReleaseKey = 0; + +static void SAL_CALL releasePool( void* pPool ) +{ + if( pPool ) + [(NSAutoreleasePool*)pPool release]; +} + +SalData::SalData() +: + mpTimerProc( NULL ), + mpFirstInstance( NULL ), + mpFirstObject( NULL ), + mpFirstVD( NULL ), + mpFirstPrinter( NULL ), + mpFontList( NULL ), + mxRGBSpace( CGColorSpaceCreateDeviceRGB( ) ), + mxGraySpace( CGColorSpaceCreateDeviceGray( ) ), + mxP50Space( NULL ), + mxP50Pattern( NULL ), + mnSystemVersion( VER_TIGER ), + mnDPIX( 0 ), + mnDPIY( 0 ) +{ + if( s_aAutoReleaseKey == 0 ) + s_aAutoReleaseKey = osl_createThreadKey( releasePool ); +} + +SalData::~SalData() +{ + CGPatternRelease( mxP50Pattern ); + CGColorSpaceRelease( mxP50Space ); + CGColorSpaceRelease( mxRGBSpace ); + CGColorSpaceRelease( mxGraySpace ); + if( s_aAutoReleaseKey ) + { + // release the last pool + NSAutoreleasePool* pPool = nil; + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( pPool ) + { + osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); + [pPool release]; + } + + osl_destroyThreadKey( s_aAutoReleaseKey ); + s_aAutoReleaseKey = 0; + } +} + +void SalData::ensureThreadAutoreleasePool() +{ + NSAutoreleasePool* pPool = nil; + if( s_aAutoReleaseKey ) + { + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( ! pPool ) + { + pPool = [[NSAutoreleasePool alloc] init]; + osl_setThreadKeyData( s_aAutoReleaseKey, pPool ); + } + } + else + { + OSL_FAIL( "no autorelease key" ); + } +} + +void SalData::drainThreadAutoreleasePool() +{ + NSAutoreleasePool* pPool = nil; + if( s_aAutoReleaseKey ) + { + pPool = reinterpret_cast( osl_getThreadKeyData( s_aAutoReleaseKey ) ); + if( pPool ) + { + // osl_setThreadKeyData( s_aAutoReleaseKey, NULL ); + // [pPool release]; + [pPool drain]; + } + else + { + pPool = [[NSAutoreleasePool alloc] init]; + osl_setThreadKeyData( s_aAutoReleaseKey, pPool ); + } + } + else + { + OSL_FAIL( "no autorelease key" ); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx new file mode 100644 index 000000000000..b4c944cd31a4 --- /dev/null +++ b/vcl/ios/source/app/salinst.cxx @@ -0,0 +1,828 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include + +#include "tools/fsys.hxx" +#include "tools/getprocessworkingdir.hxx" +#include + +#include "osl/process.h" + +#include "rtl/ustrbuf.hxx" + +#include "vcl/svapp.hxx" +#include "vcl/window.hxx" +#include "vcl/timer.hxx" +#include "vcl/solarmutex.hxx" + +#include "ios/saldata.hxx" +#include "ios/salinst.h" +#include "ios/salframe.h" +#include "ios/salobj.h" +#include "ios/salsys.h" +#include "ios/salvd.h" +#include "ios/salbmp.h" +#include "ios/salprn.h" +#include "ios/saltimer.h" +#include "ios/vcluiapp.h" + +#include "print.h" +#include "impbmp.hxx" +#include "salimestatus.hxx" + +#include + +#include +#include +#include +#include +#include + +using namespace std; +using namespace ::com::sun::star; + +extern sal_Bool ImplSVMain(); + +static int* gpnInit = 0; +static bool bNoSVMain = true; +static bool bLeftMain = false; +// ----------------------------------------------------------------------- + +class IosDelayedSettingsChanged : public Timer +{ + bool mbInvalidate; + public: + IosDelayedSettingsChanged( bool bInvalidate ) : + mbInvalidate( bInvalidate ) + { + } + + virtual void Timeout() + { + SalData* pSalData = GetSalData(); + if( ! pSalData->maFrames.empty() ) + pSalData->maFrames.front()->CallCallback( SALEVENT_SETTINGSCHANGED, NULL ); + + if( mbInvalidate ) + { + for( std::list< IosSalFrame* >::iterator it = pSalData->maFrames.begin(); + it != pSalData->maFrames.end(); ++it ) + { + if( (*it)->mbShown ) + (*it)->SendPaintEvent( NULL ); + } + } + Stop(); + delete this; + } +}; + +void IosSalInstance::delayedSettingsChanged( bool bInvalidate ) +{ + osl::SolarGuard aGuard( *mpSalYieldMutex ); + IosDelayedSettingsChanged* pTimer = new IosDelayedSettingsChanged( bInvalidate ); + pTimer->SetTimeout( 50 ); + pTimer->Start(); +} + + +// the AppEventList must be available before any SalData/SalInst/etc. objects are ready +typedef std::list AppEventList; +AppEventList IosSalInstance::aAppEventList; + +// initialize the VCL_UIApplication object +static void initUIApp() +{ + [VCL_UIApplication sharedApplication]; + + SalData::ensureThreadAutoreleasePool(); +} + +sal_Bool ImplSVMainHook( int * pnInit ) +{ + gpnInit = pnInit; + + bNoSVMain = false; + initUIApp(); + + char* pArgv[] = { "main", NULL }; + UIApplicationMain( 1, pArgv, NULL, NULL ); + + return TRUE; // indicate that ImplSVMainHook is implemented +} + +// ======================================================================= + +void SalAbort( const XubString& rErrorText ) +{ + if( !rErrorText.Len() ) + fprintf( stderr, "Application Error " ); + else + fprintf( stderr, "%s ", + ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() ); + abort(); +} + +// ----------------------------------------------------------------------- + +void InitSalData() +{ + SalData *pSalData = new SalData; + SetSalData( pSalData ); +} + +// ----------------------------------------------------------------------- + +const ::rtl::OUString& SalGetDesktopEnvironment() +{ + static OUString aDesktopEnvironment(RTL_CONSTASCII_USTRINGPARAM( "CocoaTouch" )); + return aDesktopEnvironment; +} + +// ----------------------------------------------------------------------- + +void DeInitSalData() +{ + SalData *pSalData = GetSalData(); + delete pSalData; + SetSalData( NULL ); +} + +// ----------------------------------------------------------------------- + +void InitSalMain() +{ + rtl::OUString urlWorkDir; + rtl_uString *sysWorkDir = NULL; + if (tools::getProcessWorkingDir(urlWorkDir)) + { + oslFileError err2 = osl_getSystemPathFromFileURL(urlWorkDir.pData, &sysWorkDir); + if (err2 == osl_File_E_None) + { + ByteString aPath( getenv( "PATH" ) ); + ByteString aResPath( getenv( "STAR_RESOURCEPATH" ) ); + ByteString aCmdPath( OUStringToOString(OUString(sysWorkDir), RTL_TEXTENCODING_UTF8).getStr() ); + ByteString aTmpPath; + // Get absolute path of command's directory + if ( aCmdPath.Len() ) { + DirEntry aCmdDirEntry( aCmdPath ); + aCmdDirEntry.ToAbs(); + aCmdPath = ByteString( aCmdDirEntry.GetPath().GetFull(), RTL_TEXTENCODING_ASCII_US ); + } + // Assign to PATH environment variable + if ( aCmdPath.Len() ) + { + aTmpPath = ByteString( "PATH=" ); + aTmpPath += aCmdPath; + if ( aPath.Len() ) + aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); + aTmpPath += aPath; + putenv( (char*)aTmpPath.GetBuffer() ); + } + // Assign to STAR_RESOURCEPATH environment variable + if ( aCmdPath.Len() ) + { + aTmpPath = ByteString( "STAR_RESOURCEPATH=" ); + aTmpPath += aCmdPath; + if ( aResPath.Len() ) + aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); + aTmpPath += aResPath; + putenv( (char*)aTmpPath.GetBuffer() ); + } + } + } +} + +// ----------------------------------------------------------------------- + +void DeInitSalMain() +{ +} + +// ======================================================================= + +SalYieldMutex::SalYieldMutex() +{ + mnCount = 0; + mnThreadId = 0; +} + +void SalYieldMutex::acquire() +{ + SolarMutexObject::acquire(); + mnThreadId = osl::Thread::getCurrentIdentifier(); + mnCount++; +} + +void SalYieldMutex::release() +{ + if ( mnThreadId == osl::Thread::getCurrentIdentifier() ) + { + if ( mnCount == 1 ) + mnThreadId = 0; + mnCount--; + } + SolarMutexObject::release(); +} + +sal_Bool SalYieldMutex::tryToAcquire() +{ + if ( SolarMutexObject::tryToAcquire() ) + { + mnThreadId = osl::Thread::getCurrentIdentifier(); + mnCount++; + return sal_True; + } + else + return sal_False; +} + +// ----------------------------------------------------------------------- + +// some convenience functions regarding the yield mutex, aka solar mutex + +sal_Bool ImplSalYieldMutexTryToAcquire() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + return pInst->mpSalYieldMutex->tryToAcquire(); + else + return FALSE; +} + +void ImplSalYieldMutexAcquire() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + pInst->mpSalYieldMutex->acquire(); +} + +void ImplSalYieldMutexRelease() +{ + IosSalInstance* pInst = (IosSalInstance*) GetSalData()->mpFirstInstance; + if ( pInst ) + pInst->mpSalYieldMutex->release(); +} + +// ======================================================================= + +SalInstance* CreateSalInstance() +{ + // this is the case for not using SVMain + // not so good + if( bNoSVMain ) + initUIApp(); + + SalData* pSalData = GetSalData(); + DBG_ASSERT( pSalData->mpFirstInstance == NULL, "more than one instance created" ); + IosSalInstance* pInst = new IosSalInstance; + + // init instance (only one instance in this version !!!) + pSalData->mpFirstInstance = pInst; + // this one is for outside IosSalInstance::Yield + SalData::ensureThreadAutoreleasePool(); + // no focus rects on NWF ios + ImplGetSVData()->maNWFData.mbNoFocusRects = true; + ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true; + ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true; + ImplGetSVData()->maNWFData.mbCenteredTabs = true; + ImplGetSVData()->maNWFData.mbProgressNeedsErase = true; + ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true; + ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10; + ImplGetSVData()->maGDIData.mbNoXORClipping = true; + ImplGetSVData()->maWinData.mbNoSaveBackground = true; + + return pInst; +} + +// ----------------------------------------------------------------------- + +void DestroySalInstance( SalInstance* pInst ) +{ + delete pInst; +} + +// ----------------------------------------------------------------------- + +IosSalInstance::IosSalInstance() +{ + mpSalYieldMutex = new SalYieldMutex; + mpSalYieldMutex->acquire(); + ::tools::SolarMutex::SetSolarMutex( mpSalYieldMutex ); + maMainThread = osl::Thread::getCurrentIdentifier(); + mbWaitingYield = false; + maUserEventListMutex = osl_createMutex(); + mnActivePrintJobs = 0; + maWaitingYieldCond = osl_createCondition(); +} + +// ----------------------------------------------------------------------- + +IosSalInstance::~IosSalInstance() +{ + ::tools::SolarMutex::SetSolarMutex( 0 ); + mpSalYieldMutex->release(); + delete mpSalYieldMutex; + osl_destroyMutex( maUserEventListMutex ); + osl_destroyCondition( maWaitingYieldCond ); +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::wakeupYield() +{ +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::PostUserEvent( IosSalFrame* pFrame, sal_uInt16 nType, void* pData ) +{ + osl_acquireMutex( maUserEventListMutex ); + maUserEvents.push_back( SalUserEvent( pFrame, pData, nType ) ); + osl_releaseMutex( maUserEventListMutex ); + + // notify main loop that an event has arrived + wakeupYield(); +} + +// ----------------------------------------------------------------------- + +osl::SolarMutex* IosSalInstance::GetYieldMutex() +{ + return mpSalYieldMutex; +} + +// ----------------------------------------------------------------------- + +sal_uLong IosSalInstance::ReleaseYieldMutex() +{ + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + if ( pYieldMutex->GetThreadId() == + osl::Thread::getCurrentIdentifier() ) + { + sal_uLong nCount = pYieldMutex->GetAcquireCount(); + sal_uLong n = nCount; + while ( n ) + { + pYieldMutex->release(); + n--; + } + + return nCount; + } + else + return 0; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::AcquireYieldMutex( sal_uLong nCount ) +{ + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + while ( nCount ) + { + pYieldMutex->acquire(); + nCount--; + } +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::CheckYieldMutex() +{ + bool bRet = true; + + SalYieldMutex* pYieldMutex = mpSalYieldMutex; + if ( pYieldMutex->GetThreadId() != osl::Thread::getCurrentIdentifier()) + { + bRet = false; + } + + return bRet; +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::isUIAppThread() const +{ + return osl::Thread::getCurrentIdentifier() == maMainThread; +} + +// ----------------------------------------------------------------------- + +class ReleasePoolHolder +{ + NSAutoreleasePool* mpPool; + public: + ReleasePoolHolder() : mpPool( [[NSAutoreleasePool alloc] init] ) {} + ~ReleasePoolHolder() { [mpPool release]; } +}; + +void IosSalInstance::Yield( bool bWait, bool bHandleAllCurrentEvents ) +{ + // ensure that the per thread autorelease pool is top level and + // will therefore not be destroyed by cocoa implicitly + SalData::ensureThreadAutoreleasePool(); + + // NSAutoreleasePool documentation suggests we should have + // an own pool for each yield level + ReleasePoolHolder aReleasePool; + + // Release all locks so that we don't deadlock when we pull pending + // events from the event queue + bool bDispatchUser = true; + while( bDispatchUser ) + { + sal_uLong nCount = ReleaseYieldMutex(); + + // get one user event + osl_acquireMutex( maUserEventListMutex ); + SalUserEvent aEvent( NULL, NULL, 0 ); + if( ! maUserEvents.empty() ) + { + aEvent = maUserEvents.front(); + maUserEvents.pop_front(); + } + else + bDispatchUser = false; + osl_releaseMutex( maUserEventListMutex ); + + AcquireYieldMutex( nCount ); + + // dispatch it + if( aEvent.mpFrame && IosSalFrame::isAlive( aEvent.mpFrame ) ) + { + aEvent.mpFrame->CallCallback( aEvent.mnType, aEvent.mpData ); + osl_setCondition( maWaitingYieldCond ); + // return if only one event is asked for + if( ! bHandleAllCurrentEvents ) + return; + } + } + + // handle event queue + // events mye be only handled in the thread the app was created + if( mnActivePrintJobs == 0 ) + { + // we need to be woken up by a cocoa-event + // if a user event should be posted by the event handling below + bool bOldWaitingYield = mbWaitingYield; + mbWaitingYield = bWait; + + mbWaitingYield = bOldWaitingYield; + + // collect update rectangles + const std::list< IosSalFrame* > rFrames( GetSalData()->maFrames ); + for( std::list< IosSalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it ) + { + if( (*it)->mbShown && ! (*it)->maInvalidRect.IsEmpty() ) + { + (*it)->Flush( (*it)->maInvalidRect ); + (*it)->maInvalidRect.SetEmpty(); + } + } + osl_setCondition( maWaitingYieldCond ); + } +} + +// ----------------------------------------------------------------------- + +bool IosSalInstance::AnyInput( sal_uInt16 nType ) +{ + if( nType & INPUT_APPEVENT ) + { + if( ! aAppEventList.empty() ) + return true; + if( nType == INPUT_APPEVENT ) + return false; + } + + if( nType & INPUT_TIMER ) + { + if( IosSalTimer::pRunningTimer ) + { + NSDate* pDt = [IosSalTimer::pRunningTimer fireDate]; + if( pDt && [pDt timeIntervalSinceNow] < 0 ) + { + return true; + } + } + } + return false; +} + +// ----------------------------------------------------------------------- + +SalFrame* IosSalInstance::CreateChildFrame( SystemParentData*, sal_uLong /*nSalFrameStyle*/ ) +{ + return NULL; +} + +// ----------------------------------------------------------------------- + +SalFrame* IosSalInstance::CreateFrame( SalFrame* pParent, sal_uLong nSalFrameStyle ) +{ + SalData::ensureThreadAutoreleasePool(); + + SalFrame* pFrame = new IosSalFrame( pParent, nSalFrameStyle ); + return pFrame; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroyFrame( SalFrame* pFrame ) +{ + delete pFrame; +} + +// ----------------------------------------------------------------------- + +SalObject* IosSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, sal_Bool /* bShow */ ) +{ + // SystemWindowData is meaningless on Mac OS X + IosSalObject *pObject = NULL; + + if ( pParent ) + pObject = new IosSalObject( static_cast(pParent) ); + + return pObject; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroyObject( SalObject* pObject ) +{ + delete ( pObject ); +} + +SalSystem* IosSalInstance::CreateSystem() +{ + return new IosSalSystem(); +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::DestroySystem( SalSystem* pSystem ) +{ + delete pSystem; +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::SetEventCallback( void*, bool(*)(void*,void*,int) ) +{ +} + +// ----------------------------------------------------------------------- + +void IosSalInstance::SetErrorEventCallback( void*, bool(*)(void*,void*,int) ) +{ +} + +// ----------------------------------------------------------------------- + +void* IosSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) +{ + rReturnedBytes = 1; + rReturnedType = AsciiCString; + return (void*)""; +} + +// We need to re-encode file urls because osl_getFileURLFromSystemPath converts +// to UTF-8 before encoding non ascii characters, which is not what other apps expect. +static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl) +{ + rtl::OUString extUrl; + + uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory(); + if (sm.is()) + { + uno::Reference< beans::XPropertySet > pset; + sm->queryInterface( getCppuType( &pset )) >>= pset; + if (pset.is()) + { + uno::Reference< uno::XComponentContext > context; + static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ); + pset->getPropertyValue(DEFAULT_CONTEXT) >>= context; + if (context.is()) + extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl); + } + } + return extUrl; +} + +// #i104525# many versions of OSX have problems with some URLs: +// when an app requests OSX to add one of these URLs to the "Recent Items" list +// then this app gets killed (TextEdit, Preview, etc. and also OOo) +static bool isDangerousUrl( const rtl::OUString& rUrl ) +{ + // use a heuristic that detects all known cases since there is no official comment + // on the exact impact and root cause of the OSX bug + const int nLen = rUrl.getLength(); + const sal_Unicode* p = rUrl.getStr(); + for( int i = 0; i < nLen-3; ++i, ++p ) { + if( p[0] != '%' ) + continue; + // escaped percent? + if( (p[1] == '2') && (p[2] == '5') ) + return true; + // escapes are considered to be UTF-8 encoded + // => check for invalid UTF-8 leading byte + if( (p[1] != 'f') && (p[1] != 'F') ) + continue; + int cLowNibble = p[2]; + if( (cLowNibble >= '0' ) && (cLowNibble <= '9')) + return false; + if( cLowNibble >= 'a' ) + cLowNibble -= 'a' - 'A'; + if( (cLowNibble < 'A') || (cLowNibble >= 'C')) + return true; + } + + return false; +} + +void IosSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/) +{ +} + +// ----------------------------------------------------------------------- + +SalTimer* IosSalInstance::CreateSalTimer() +{ + return new IosSalTimer(); +} + +// ----------------------------------------------------------------------- + +SalSystem* IosSalInstance::CreateSalSystem() +{ + return new IosSalSystem(); +} + +// ----------------------------------------------------------------------- + +SalBitmap* IosSalInstance::CreateSalBitmap() +{ + return new IosSalBitmap(); +} + +// ----------------------------------------------------------------------- + +SalSession* IosSalInstance::CreateSalSession() +{ + return NULL; +} + +// ----------------------------------------------------------------------- + +// YieldMutexReleaser +YieldMutexReleaser::YieldMutexReleaser() : mnCount( 0 ) +{ + SalData* pSalData = GetSalData(); + if( ! pSalData->mpFirstInstance->isUIAppThread() ) + { + SalData::ensureThreadAutoreleasePool(); + mnCount = pSalData->mpFirstInstance->ReleaseYieldMutex(); + } +} + +YieldMutexReleaser::~YieldMutexReleaser() +{ + if( mnCount != 0 ) + GetSalData()->mpFirstInstance->AcquireYieldMutex( mnCount ); +} + +////////////////////////////////////////////////////////////// +rtl::OUString GetOUString( CFStringRef rStr ) +{ + if( rStr == 0 ) + return rtl::OUString(); + CFIndex nLength = CFStringGetLength( rStr ); + if( nLength == 0 ) + return rtl::OUString(); + const UniChar* pConstStr = CFStringGetCharactersPtr( rStr ); + if( pConstStr ) + return rtl::OUString( pConstStr, nLength ); + UniChar* pStr = reinterpret_cast( rtl_allocateMemory( sizeof(UniChar)*nLength ) ); + CFRange aRange = { 0, nLength }; + CFStringGetCharacters( rStr, aRange, pStr ); + rtl::OUString aRet( pStr, nLength ); + rtl_freeMemory( pStr ); + return aRet; +} + +rtl::OUString GetOUString( NSString* pStr ) +{ + if( ! pStr ) + return rtl::OUString(); + int nLen = [pStr length]; + if( nLen == 0 ) + return rtl::OUString(); + + rtl::OUStringBuffer aBuf( nLen+1 ); + aBuf.setLength( nLen ); + [pStr getCharacters: const_cast(aBuf.getStr())]; + return aBuf.makeStringAndClear(); +} + +CFStringRef CreateCFString( const rtl::OUString& rStr ) +{ + return CFStringCreateWithCharacters(kCFAllocatorDefault, rStr.getStr(), rStr.getLength() ); +} + +NSString* CreateNSString( const rtl::OUString& rStr ) +{ + return [[NSString alloc] initWithCharacters: rStr.getStr() length: rStr.getLength()]; +} + +CGImageRef CreateCGImage( const Image& rImage ) +{ + BitmapEx aBmpEx( rImage.GetBitmapEx() ); + Bitmap aBmp( aBmpEx.GetBitmap() ); + + if( ! aBmp || ! aBmp.ImplGetImpBitmap() ) + return NULL; + + // simple case, no transparency + IosSalBitmap* pSalBmp = static_cast(aBmp.ImplGetImpBitmap()->ImplGetSalBitmap()); + + if( ! pSalBmp ) + return NULL; + + CGImageRef xImage = NULL; + if( ! (aBmpEx.IsAlpha() || aBmpEx.IsTransparent() ) ) + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else if( aBmpEx.IsAlpha() ) + { + AlphaMask aAlphaMask( aBmpEx.GetAlpha() ); + Bitmap aMask( aAlphaMask.GetBitmap() ); + IosSalBitmap* pMaskBmp = static_cast(aMask.ImplGetImpBitmap()->ImplGetSalBitmap()); + if( pMaskBmp ) + xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + } + else if( aBmpEx.GetTransparentType() == TRANSPARENT_BITMAP ) + { + Bitmap aMask( aBmpEx.GetMask() ); + IosSalBitmap* pMaskBmp = static_cast(aMask.ImplGetImpBitmap()->ImplGetSalBitmap()); + if( pMaskBmp ) + xImage = pSalBmp->CreateWithMask( *pMaskBmp, 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + else + xImage = pSalBmp->CreateCroppedImage( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight ); + } + else if( aBmpEx.GetTransparentType() == TRANSPARENT_COLOR ) + { + Color aTransColor( aBmpEx.GetTransparentColor() ); + SalColor nTransColor = MAKE_SALCOLOR( aTransColor.GetRed(), aTransColor.GetGreen(), aTransColor.GetBlue() ); + xImage = pSalBmp->CreateColorMask( 0, 0, pSalBmp->mnWidth, pSalBmp->mnHeight, nTransColor ); + } + + return xImage; +} + +UIImage* CreateNSImage( const Image& rImage ) +{ + CGImageRef xImage = CreateCGImage( rImage ); + + if( ! xImage ) + return nil; + + Size aSize( rImage.GetSizePixel() ); + UIImage* pImage = [[UIImage alloc] initWithCGImage: xImage]; + CGImageRelease( xImage ); + + return pImage; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salnstimer.mm b/vcl/ios/source/app/salnstimer.mm new file mode 100644 index 000000000000..05445110d8ba --- /dev/null +++ b/vcl/ios/source/app/salnstimer.mm @@ -0,0 +1,59 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "ios/saltimer.h" +#include "ios/salnstimer.h" +#include "ios/salinst.h" +#include "ios/saldata.hxx" + +#include "svdata.hxx" + +@implementation TimerCallbackCaller +-(void)timerElapsed:(NSTimer*)pTimer +{ + (void)pTimer; + ImplSVData* pSVData = ImplGetSVData(); + if( IosSalTimer::bDispatchTimer ) + { + if( pSVData->mpSalTimer ) + { + YIELD_GUARD; + pSVData->mpSalTimer->CallCallback(); + + // NSTimer does not end nextEventMatchingMask of NSApplication + // so we need to wakeup a waiting Yield to inform it something happened + GetSalData()->mpFirstInstance->wakeupYield(); + } + } +} +@end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx new file mode 100644 index 000000000000..1baf357d85a9 --- /dev/null +++ b/vcl/ios/source/app/salsys.cxx @@ -0,0 +1,253 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "tools/rc.hxx" + +#include "rtl/ustrbuf.hxx" + +#include "vcl/button.hxx" + +#include "ios/salsys.h" +#include "ios/saldata.hxx" +#include "ios/salinst.h" + +#include "svids.hrc" + +using ::rtl::OUString; + +// ======================================================================= + +IosSalSystem::~IosSalSystem() +{ +} + +unsigned int IosSalSystem::GetDisplayScreenCount() +{ + NSArray* pScreens = [UIScreen screens]; + return pScreens ? [pScreens count] : 1; +} + +bool IosSalSystem::IsMultiDisplay() +{ + return false; +} + +unsigned int IosSalSystem::GetDefaultDisplayNumber() +{ + return 0; +} + +Rectangle IosSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + Rectangle aRet; + UIScreen* pScreen = nil; + if( pScreens && nScreen < [pScreens count] ) + pScreen = [pScreens objectAtIndex: nScreen]; + else + pScreen = [UIScreen mainScreen]; + + if( pScreen ) + { + CGRect aFrame = pScreen.bounds; + aRet = Rectangle( Point( static_cast(aFrame.origin.x), static_cast(aFrame.origin.y) ), + Size( static_cast(aFrame.size.width), static_cast(aFrame.size.height) ) ); + } + return aRet; +} + +Rectangle IosSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + Rectangle aRet; + UIScreen* pScreen = nil; + if( pScreens && nScreen < [pScreens count] ) + pScreen = [pScreens objectAtIndex: nScreen]; + else + pScreen = [UIScreen mainScreen]; + + if( pScreen ) + { + CGRect aFrame = pScreen.applicationFrame; + aRet = Rectangle( Point( static_cast(aFrame.origin.x), static_cast(aFrame.origin.y) ), + Size( static_cast(aFrame.size.width), static_cast(aFrame.size.height) ) ); + } + return aRet; +} + +rtl::OUString IosSalSystem::GetScreenName( unsigned int nScreen ) +{ + NSArray* pScreens = [UIScreen screens]; + OUString aRet; + if( nScreen < [pScreens count] ) + { + ResMgr* pMgr = ImplGetResMgr(); + if( pMgr ) + { + String aScreenName( ResId( SV_MAC_SCREENNNAME, *pMgr ) ); + aScreenName.SearchAndReplaceAllAscii( "%d", String::CreateFromInt32( nScreen ) ); + aRet = aScreenName; + } + } + return aRet; +} + +static NSString* getStandardString( int nButtonId ) +{ + rtl::OUString aText( Button::GetStandardText( nButtonId ) ); + if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource + { + switch( nButtonId ) + { + case BUTTON_OK: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OK" ) );break; + case BUTTON_ABORT: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Abort" ) );break; + case BUTTON_CANCEL: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Cancel" ) );break; + case BUTTON_RETRY: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Retry" ) );break; + case BUTTON_YES: aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Yes" ) );break; + case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break; + } + } + return aText.getLength() ? CreateNSString( aText) : nil; +} + +@interface MessageboxDelegate : NSObject +{ + int *_resultPtr; +} +- (id)initWithResultPtr:(int *)resultPtr; +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex; +@end + +@implementation MessageboxDelegate +- (id)initWithResultPtr:(int *)resultPtr +{ + _resultPtr = resultPtr; + return [super init]; +} + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + *_resultPtr = buttonIndex; +} +@end + +int IosSalSystem::ShowNativeMessageBox( const String& rTitle, + const String& rMessage, + int nButtonCombination, + int nDefaultButton) +{ + NSString* pTitle = CreateNSString( rTitle ); + NSString* pMessage = CreateNSString( rMessage ); + + struct id_entry + { + int nCombination; + int nDefaultButton; + int nTextIds[3]; + } aButtonIds[] = + { + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, -1, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK, { BUTTON_OK, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_OK, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT, { BUTTON_ABORT, BUTTON_IGNORE, BUTTON_RETRY } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE, { BUTTON_IGNORE, BUTTON_IGNORE, BUTTON_ABORT } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, BUTTON_CANCEL } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_YES, BUTTON_NO } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES, { BUTTON_YES, BUTTON_NO, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO, { BUTTON_NO, BUTTON_YES, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY, { BUTTON_RETRY, BUTTON_CANCEL, -1 } }, + { SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL, SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL, { BUTTON_CANCEL, BUTTON_RETRY, -1 } } + }; + + NSString* pDefText = nil; + NSString* pAltText = nil; + NSString* pOthText = nil; + + unsigned int nC; + for( nC = 0; nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]); nC++ ) + { + if( aButtonIds[nC].nCombination == nButtonCombination ) + { + if( aButtonIds[nC].nDefaultButton == nDefaultButton ) + { + if( aButtonIds[nC].nTextIds[0] != -1 ) + pDefText = getStandardString( aButtonIds[nC].nTextIds[0] ); + if( aButtonIds[nC].nTextIds[1] != -1 ) + pAltText = getStandardString( aButtonIds[nC].nTextIds[1] ); + if( aButtonIds[nC].nTextIds[2] != -1 ) + pOthText = getStandardString( aButtonIds[nC].nTextIds[2] ); + break; + } + } + } + + int nResult = 1; // ??? + // How to do the delegate when this is C++? + MessageboxDelegate *delegate = [[MessageboxDelegate alloc] initWithResultPtr: &nResult]; + UIAlertView *view = [[UIAlertView alloc] initWithTitle: pTitle message: pMessage delegate: delegate + cancelButtonTitle: @"Cancel" otherButtonTitles: nil]; + [view show]; + [view dealloc]; + [delegate dealloc]; + + if( pTitle ) + [pTitle release]; + if( pMessage ) + [pMessage release]; + if( pDefText ) + [pDefText release]; + if( pAltText ) + [pAltText release]; + if( pOthText ) + [pOthText release]; + + int nRet = 0; + if( nC < sizeof(aButtonIds)/sizeof(aButtonIds[0]) && nResult >= 1 && nResult <= 3 ) + { + int nPressed = aButtonIds[nC].nTextIds[nResult-1]; + switch( nPressed ) + { + case BUTTON_NO: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO; break; + case BUTTON_YES: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES; break; + case BUTTON_OK: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK; break; + case BUTTON_CANCEL: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL; break; + case BUTTON_ABORT: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT; break; + case BUTTON_RETRY: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY; break; + case BUTTON_IGNORE: nRet = SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE; break; + } + } + + return nRet; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/saltimer.cxx b/vcl/ios/source/app/saltimer.cxx new file mode 100644 index 000000000000..69401ea502d7 --- /dev/null +++ b/vcl/ios/source/app/saltimer.cxx @@ -0,0 +1,104 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "ios/saltimer.h" +#include "ios/salnstimer.h" +#include "ios/saldata.hxx" +#include "ios/salframe.h" +#include "ios/salinst.h" + +// ======================================================================= + +NSTimer* IosSalTimer::pRunningTimer = nil; +bool IosSalTimer::bDispatchTimer = false; + + +void ImplSalStartTimer( sal_uLong nMS ) +{ + SalData* pSalData = GetSalData(); + if( pSalData->mpFirstInstance->isUIAppThread() ) + { + IosSalTimer::bDispatchTimer = true; + NSTimeInterval aTI = double(nMS)/1000.0; + if( IosSalTimer::pRunningTimer != nil ) + { + if( [IosSalTimer::pRunningTimer timeInterval] == aTI ) + // set new fire date + [IosSalTimer::pRunningTimer setFireDate: [NSDate dateWithTimeIntervalSinceNow: aTI]]; + else + { + [IosSalTimer::pRunningTimer invalidate]; + IosSalTimer::pRunningTimer = nil; + } + } + if( IosSalTimer::pRunningTimer == nil ) + { + IosSalTimer::pRunningTimer = [NSTimer scheduledTimerWithTimeInterval: aTI + target: [[[TimerCallbackCaller alloc] init] autorelease] + selector: @selector(timerElapsed:) + userInfo: nil + repeats: YES]; + } + } + else + { + SalData::ensureThreadAutoreleasePool(); + // post an event so we can get into the main thread + // ??? + } +} + +void ImplSalStopTimer() +{ + IosSalTimer::bDispatchTimer = false; +} + +IosSalTimer::IosSalTimer( ) +{ +} + +IosSalTimer::~IosSalTimer() +{ + ImplSalStopTimer(); +} + +void IosSalTimer::Start( sal_uLong nMS ) +{ + ImplSalStartTimer( nMS ); +} + +void IosSalTimer::Stop() +{ + ImplSalStopTimer(); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm new file mode 100644 index 000000000000..e40d8a7eb792 --- /dev/null +++ b/vcl/ios/source/app/vcluiapp.mm @@ -0,0 +1,101 @@ +/* -*- 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + // MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "rtl/ustrbuf.hxx" + +#include "vcl/window.hxx" +#include "vcl/svapp.hxx" +#include "vcl/cmdevt.hxx" + +#include "ios/vcluiapp.h" +#include "ios/salinst.h" +#include "ios/saldata.hxx" +#include "ios/salframe.h" +#include "ios/salframeview.h" + +#include "impimagetree.hxx" + +@implementation VCL_UIApplication +-(void)sendEvent:(UIEvent*)pEvent +{ + UIEventType eType = [pEvent type]; + [super sendEvent: pEvent]; +} + +-(void)sendSuperEvent:(UIEvent*)pEvent +{ + [super sendEvent: pEvent]; +} + +-(BOOL)application: (UIApplication*)app openFile: (NSString*)pFile +{ + (void)app; + const rtl::OUString aFile( GetOUString( pFile ) ); + return YES; +} + +-(void)application: (UIApplication*) app openFiles: (NSArray*)files +{ + (void)app; + rtl::OUStringBuffer aFileList( 256 ); + + NSEnumerator* it = [files objectEnumerator]; + NSString* pFile = nil; + + while( (pFile = [it nextObject]) != nil ) + { + const rtl::OUString aFile( GetOUString( pFile ) ); + } + + if( aFileList.getLength() ) + { + // we have no back channel here, we have to assume success, in which case + // replyToOpenOrPrint does not need to be called according to documentation + // [app replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; + const ApplicationEvent* pAppEvent = new ApplicationEvent( String(), ApplicationAddress(), + APPEVENT_OPEN_STRING, aFileList.makeStringAndClear() ); + IosSalInstance::aAppEventList.push_back( pAppEvent ); + } +} + +-(void)addFallbackMenuItem: (UIMenuItem*)pNewItem +{ + IosSalMenu::addFallbackMenuItem( pNewItem ); +} + +-(void)removeFallbackMenuItem: (UIMenuItem*)pItem +{ + IosSalMenu::removeFallbackMenuItem( pItem ); +} + +@end + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx index 80e853b3b654..0c3adf887023 100644 --- a/vcl/source/salmain/salmain.cxx +++ b/vcl/source/salmain/salmain.cxx @@ -36,7 +36,7 @@ #include "salinst.hxx" -SAL_IMPLEMENT_MAIN() { +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); return SVMain(); } diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index f72decce183e..1de33b56b15b 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -250,6 +250,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) // FIXME: this is wrong nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); (void)bUseJava; +#elif defined IOS + // FIXME: this is wrong + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); #elif defined UNX if( !bUseJava ) { diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 1ab898011672..1e4157f5fcd3 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -8428,6 +8428,16 @@ uno::Reference< XDragSource > Window::GetDragSource() aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget")); aDragSourceAL[ 1 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); aDropTargetAL[ 0 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); +#elif defined IOS + /* What does LibreOffice's use of DND concepts mean on + * iOS, huh, is this both inter-app DND (which clearly is + * meaningless), or intra-app? Anyway, use the same code + * as for MacOSX for now, even if meaningless... + */ + aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource")); + aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget")); + aDragSourceAL[ 1 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); + aDropTargetAL[ 0 ] = makeAny( static_cast( reinterpret_cast(pEnvData->pView) ) ); #elif defined UNX aDropTargetAL.realloc( 3 ); aDragSourceAL.realloc( 3 ); -- cgit v1.2.3 From d3abc64751208b690605c44dfd06c72be2af05e7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 14 Jul 2011 22:45:11 +0300 Subject: Fix compilation for iOS --- canvas/source/cairo/cairo_quartz_cairo.cxx | 15 +++++++++++---- canvas/source/cairo/cairo_quartz_cairo.hxx | 6 ++++++ canvas/source/cairo/cairo_textlayout.cxx | 7 ++++++- canvas/source/cairo/makefile.mk | 12 ++++++++---- 4 files changed, 31 insertions(+), 9 deletions(-) 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 @@ -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([[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 +#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE #include +#else +#include +#define NSView UIView +#endif #include #include "postmac.h" 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/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index 076deb2f17bf..59d1512701a7 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -56,6 +56,10 @@ CFLAGS+=$(CAIRO_CFLAGS) CFLAGS+=-I$(SOLARINCDIR)/cairo .ENDIF +.IF "$(OS)" == "IOS" +CFLAGS+= -x objective-c++ -fobjc-exceptions -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 +.ENDIF + .IF "$(verbose)"!="" || "$(VERBOSE)"!="" CDEFS+= -DVERBOSE .ENDIF @@ -88,18 +92,18 @@ SHL1STDLIBS+= $(CAIRO_LIBS) SHL1STDLIBS+= -lcairo -lpixman-1 .ENDIF -.IF "$(GUIBASE)"=="aqua" -# native Mac OS X (Quartz) +.IF "$(GUIBASE)"=="aqua" || "$(GUIBASE)"=="cocoatouch" +# native Mac OS X (Quartz) or iOS SLOFILES+= $(SLO)$/cairo_quartz_cairo.obj CFLAGSCXX+=$(OBJCXXFLAGS) -.ELSE # "$(GUIBASE)"=="aqua" +.ELSE # "$(GUIBASE)"=="aqua" || "$(GUIBASE)"=="cocoatouch" # Xlib SLOFILES+= $(SLO)$/cairo_xlib_cairo.obj SHL1STDLIBS+= $(FONTCONFIG_LIBS) -lX11 -lXrender $(FREETYPE_LIBS) CFLAGS+= $(FREETYPE_CFLAGS) -.ENDIF # "$(GUIBASE)"=="aqua" +.ENDIF # "$(GUIBASE)"=="aqua" || "$(GUIBASE)"=="cocoatouch" .ELSE # "$(GUI)"=="UNX" -- cgit v1.2.3 From e5e19089a22a71ea27164e7a9f74fa5a33cfa1f4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 01:53:13 +0300 Subject: WNTGCC fix --- vcl/Library_vcl.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 42e57144d5f4..044b067624f5 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -551,10 +551,17 @@ $(eval $(call gb_Library_set_ldflags,vcl,\ endif ifeq ($(OS),WNT) +ifeq ($(COM),MSC) $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ /ENTRY:LibMain@12 \ )) +endif +ifeq ($(COM),GCC) +$(eval $(call gb_Library_set_ldflags,vcl,\ + $$(LDFLAGS) \ +)) +endif $(eval $(call gb_Library_add_linked_libs,vcl,\ advapi32 \ gdi32 \ -- cgit v1.2.3 From 99a8c8dac8929dc83db36162e14932d3468b1330 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Thu, 14 Jul 2011 18:09:42 -0700 Subject: Replace List with std::vector< SvNumberFormatter* > --- svl/source/numbers/zforlist.cxx | 57 +++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 933c1b2df4db..8ff4867274c0 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -100,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() { @@ -134,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(); } } -- cgit v1.2.3 From 86c53492cc40e2d43bd3dac89698b844df961e0e Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 15 Jul 2011 07:51:13 +0200 Subject: error: attempt to increment a singular iterator --- svtools/source/graphic/grfcache.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index 4251c1ba7fe2..e0aa6595f6ac 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -325,21 +325,19 @@ void GraphicCacheEntry::AddGraphicObjectReference( const GraphicObject& rObj, Gr bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& rObj ) { - bool bRet = false; - for( GraphicObjectList_impl::iterator it = maGraphicObjectList.begin(); - ( it < maGraphicObjectList.end() ) && !bRet; + it != maGraphicObjectList.end(); ++it ) { if( &rObj == *it ) { maGraphicObjectList.erase( it ); - bRet = true; + return true; } } - return bRet; + return false; } // ----------------------------------------------------------------------------- -- cgit v1.2.3 From 4dfecb62c5e595439cacec3da393c45faf093d9a Mon Sep 17 00:00:00 2001 From: Peter Rabi Date: Thu, 14 Jul 2011 22:40:18 +0200 Subject: merged the 3 executables into one in module rsc Also removed the ability to use alternatives for rscpp and rsc2. Contributed under license LGPLv3+/MPL. --- rsc/prj/build.lst | 2 +- rsc/prj/d.lst | 4 - rsc/source/prj/gui.cxx | 11 +-- rsc/source/prj/makefile.mk | 21 ++--- rsc/source/prj/start.cxx | 178 ++++++++++++++----------------------------- rsc/source/rscpp/cpp.h | 4 +- rsc/source/rscpp/cpp1.c | 2 + rsc/source/rscpp/cppmain.c | 43 ----------- rsc/source/rscpp/makefile.mk | 16 ---- 9 files changed, 72 insertions(+), 209 deletions(-) delete mode 100644 rsc/source/rscpp/cppmain.c 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/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 #include -#include #include #include @@ -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 cee2ae0612be..be085254354f 100644 --- a/rsc/source/prj/start.cxx +++ b/rsc/source/prj/start.cxx @@ -50,39 +50,20 @@ #include /*************** 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,7 +143,7 @@ static sal_Bool CallPrePro( const ByteString& rPrePro, } } - nExit = spawnvp( P_WAIT, rPrePro.GetBuffer(), (char* const*)pCmdL->GetBlock() ); + nRet = rscpp_main( pCmdL->GetCount()-1, (char**)pCmdL->GetBlock() ); if ( fRspFile ) #if OSL_DEBUG_LEVEL > 5 @@ -170,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; @@ -182,89 +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" ); } - nExit = spawnvp( P_WAIT, aRsc2Name.GetBuffer(), (char* const*)aNewCmdL.GetBlock() ); + 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 ); } @@ -280,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; @@ -294,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 ) { @@ -327,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; @@ -379,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; @@ -391,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/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 #include #include "cppdef.h" diff --git a/rsc/source/rscpp/cppmain.c b/rsc/source/rscpp/cppmain.c deleted file mode 100644 index 144576e2846b..000000000000 --- a/rsc/source/rscpp/cppmain.c +++ /dev/null @@ -1,43 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define NOMAIN - -#include -#include -#include "cppdef.h" -#include "cpp.h" - -int main( argc, argv ) - int argc; - char *argv[]; -{ - return( start_cpp( argc, argv ) ); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 - - -- cgit v1.2.3 From 50f1b1ff71f603040045903ee383995d29b03e75 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Fri, 15 Jul 2011 05:41:00 -0700 Subject: Replace List with std::vector< SvxIconChoiceCtrlEntry* > --- svtools/source/contnr/imivctl.hxx | 823 ++++++++++++++++++++----------------- svtools/source/contnr/imivctl1.cxx | 193 ++++----- svtools/source/contnr/imivctl2.cxx | 36 +- 3 files changed, 573 insertions(+), 479 deletions(-) diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 06d905f7a757..ced1856eeceb 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -83,8 +83,8 @@ class IcnGridMap_Impl; // Breitenoffset Highlight-Rect bei Text #define LROFFS_TEXT 2 -#define DEFAULT_MAX_VIRT_WIDTH 200 -#define DEFAULT_MAX_VIRT_HEIGHT 200 +#define DEFAULT_MAX_VIRT_WIDTH 200 +#define DEFAULT_MAX_VIRT_HEIGHT 200 #define VIEWMODE_MASK (WB_ICON | WB_SMALLICON | WB_DETAILS) @@ -105,7 +105,7 @@ enum IcnViewFieldType // struct LocalFocus { - sal_Bool bOn; + sal_Bool bOn; Rectangle aRect; Color aPenColor; @@ -116,32 +116,47 @@ struct LocalFocus // // Entry-List // -class EntryList_Impl : public List +typedef ::std::vector< SvxIconChoiceCtrlEntry* > SvxIconChoiceCtrlEntryList_impl; + +class EntryList_Impl { private: - - using List::Replace; - + SvxIconChoiceCtrlEntryList_impl maIconChoiceCtrlEntryList; SvxIconChoiceCtrl_Impl* _pOwner; void Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ); public: - EntryList_Impl( - SvxIconChoiceCtrl_Impl*, - sal_uInt16 _nInitSize = 1024, - sal_uInt16 _nReSize = 1024 ); - EntryList_Impl( - SvxIconChoiceCtrl_Impl*, - sal_uInt16 _nBlockSize, - sal_uInt16 _nInitSize, - sal_uInt16 _nReSize ); + EntryList_Impl( SvxIconChoiceCtrl_Impl* ); ~EntryList_Impl(); - void Clear(); - void Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos ); - SvxIconChoiceCtrlEntry* Remove( sal_uLong nPos ); - void Remove( SvxIconChoiceCtrlEntry* pEntry ); + void clear(); + + SvxIconChoiceCtrlEntry* remove( size_t nPos ); + void remove( SvxIconChoiceCtrlEntry* pEntry ); + + size_t size() + { + return maIconChoiceCtrlEntryList.size(); + } + size_t size() const + { + return maIconChoiceCtrlEntryList.size(); + } + + SvxIconChoiceCtrlEntry* operator[]( size_t nPos ) + { + return ( nPos < maIconChoiceCtrlEntryList.size() ) + ? maIconChoiceCtrlEntryList[ nPos ] + : NULL; + } + SvxIconChoiceCtrlEntry* operator[]( size_t nPos ) const + { + return ( nPos < maIconChoiceCtrlEntryList.size() ) + ? maIconChoiceCtrlEntryList[ nPos ] + : NULL; + } + void insert( size_t nPos, SvxIconChoiceCtrlEntry* pEntry ); }; @@ -155,388 +170,449 @@ class SvxIconChoiceCtrl_Impl friend class EntryList_Impl; friend class IcnGridMap_Impl; - sal_Bool bChooseWithCursor; - EntryList_Impl aEntries; - ScrollBar aVerSBar; - ScrollBar aHorSBar; - ScrollBarBox aScrBarBox; - Rectangle aCurSelectionRect; - SvPtrarr aSelectedRectList; - Timer aEditTimer; // fuer Inplace-Editieren - Timer aAutoArrangeTimer; - Timer aDocRectChangedTimer; - Timer aVisRectChangedTimer; - Timer aCallSelectHdlTimer; - Size aVirtOutputSize; - Size aImageSize; - Size aDefaultTextSize; - Size aOutputSize; // Pixel - Point aDDLastEntryPos; - Point aDDLastRectPos; - Point aDDPaintOffs; - Point aDDStartPos; + sal_Bool bChooseWithCursor; + EntryList_Impl aEntries; + ScrollBar aVerSBar; + ScrollBar aHorSBar; + ScrollBarBox aScrBarBox; + Rectangle aCurSelectionRect; + SvPtrarr aSelectedRectList; + Timer aEditTimer; // fuer Inplace-Editieren + Timer aAutoArrangeTimer; + Timer aDocRectChangedTimer; + Timer aVisRectChangedTimer; + Timer aCallSelectHdlTimer; + Size aVirtOutputSize; + Size aImageSize; + Size aDefaultTextSize; + Size aOutputSize; // Pixel + Point aDDLastEntryPos; + Point aDDLastRectPos; + Point aDDPaintOffs; + Point aDDStartPos; SvtIconChoiceCtrl* pView; - IcnCursor_Impl* pImpCursor; - IcnGridMap_Impl* pGridMap; - long nMaxVirtWidth; // max. Breite aVirtOutputSize bei ALIGN_TOP - long nMaxVirtHeight; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT - List* pZOrderList; - SvPtrarr* pColumns; - IcnViewEdit_Impl* pEdit; - WinBits nWinBits; - long nMaxBoundHeight; // Hoehe des hoechsten BoundRects - sal_uInt16 nFlags; - sal_uInt16 nCurTextDrawFlags; - sal_uLong nUserEventAdjustScrBars; - sal_uLong nUserEventShowCursor; + IcnCursor_Impl* pImpCursor; + IcnGridMap_Impl* pGridMap; + long nMaxVirtWidth; // max. Breite aVirtOutputSize bei ALIGN_TOP + long nMaxVirtHeight; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT + List* pZOrderList; + SvPtrarr* pColumns; + IcnViewEdit_Impl* pEdit; + WinBits nWinBits; + long nMaxBoundHeight; // Hoehe des hoechsten BoundRects + sal_uInt16 nFlags; + sal_uInt16 nCurTextDrawFlags; + sal_uLong nUserEventAdjustScrBars; + sal_uLong nUserEventShowCursor; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - sal_Bool bHighlightFramePressed; + sal_Bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead; // Eintrag oben links SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pPrevDropTarget; SvxIconChoiceCtrlEntry* pHdlEntry; SvxIconChoiceCtrlEntry* pDDRefEntry; - VirtualDevice* pDDDev; - VirtualDevice* pDDBufDev; - VirtualDevice* pDDTempDev; - VirtualDevice* pEntryPaintDev; + VirtualDevice* pDDDev; + VirtualDevice* pDDBufDev; + VirtualDevice* pDDTempDev; + VirtualDevice* pEntryPaintDev; SvxIconChoiceCtrlEntry* pAnchor; // fuer Selektion - LocalFocus aFocus; // Data for focusrect + LocalFocus aFocus; // Data for focusrect ::svt::AccessibleFactoryAccess aAccFactory; - List* pDraggedSelection; + List* pDraggedSelection; SvxIconChoiceCtrlEntry* pCurEditedEntry; SvxIconChoiceCtrlTextMode eTextMode; - SelectionMode eSelectionMode; - sal_uLong nSelectionCount; + SelectionMode eSelectionMode; + sal_uLong nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; - sal_Bool bBoundRectsDirty; - sal_Bool bUpdateMode; - sal_Bool bEntryEditingEnabled; - sal_Bool bInDragDrop; - - void ShowCursor( sal_Bool bShow ); - - void ImpArrange( sal_Bool bKeepPredecessors = sal_False ); - void AdjustVirtSize( const Rectangle& ); - void ResetVirtSize(); - void CheckScrollBars(); - - DECL_LINK( ScrollUpDownHdl, ScrollBar * ); - DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); - DECL_LINK( EditTimeoutHdl, Timer* ); - DECL_LINK( UserEventHdl, void* ); - DECL_LINK( EndScrollHdl, void* ); - DECL_LINK( AutoArrangeHdl, void* ); - DECL_LINK( DocRectChangedHdl, void* ); - DECL_LINK( VisRectChangedHdl, void* ); - DECL_LINK( CallSelectHdlHdl, void* ); - - void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False); - void PositionScrollBars( long nRealWidth, long nRealHeight ); - long GetScrollBarPageSize( long nVisibleRange ) const { return ((nVisibleRange*75)/100); } - long GetScrollBarLineSize() const { return nMaxBoundHeight / 2; } + sal_Bool bBoundRectsDirty; + sal_Bool bUpdateMode; + sal_Bool bEntryEditingEnabled; + sal_Bool bInDragDrop; + + void ShowCursor( sal_Bool bShow ); + + void ImpArrange( sal_Bool bKeepPredecessors = sal_False ); + void AdjustVirtSize( const Rectangle& ); + void ResetVirtSize(); + void CheckScrollBars(); + + DECL_LINK( ScrollUpDownHdl, ScrollBar * ); + DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); + DECL_LINK( EditTimeoutHdl, Timer* ); + DECL_LINK( UserEventHdl, void* ); + DECL_LINK( EndScrollHdl, void* ); + DECL_LINK( AutoArrangeHdl, void* ); + DECL_LINK( DocRectChangedHdl, void* ); + DECL_LINK( VisRectChangedHdl, void* ); + DECL_LINK( CallSelectHdlHdl, void* ); + + void AdjustScrollBars( sal_Bool bVirtSizeGrowedOnly = sal_False); + void PositionScrollBars( long nRealWidth, long nRealHeight ); + long GetScrollBarPageSize( long nVisibleRange ) const + { + return ((nVisibleRange*75)/100); + } + long GetScrollBarLineSize() const + { + return nMaxBoundHeight / 2; + } sal_Bool HandleScrollCommand( const CommandEvent& rCmd ); - void ToDocPos( Point& rPosPixel ) { rPosPixel -= pView->GetMapMode().GetOrigin(); } - void InitScrollBarBox(); + void ToDocPos( Point& rPosPixel ) + { + rPosPixel -= pView->GetMapMode().GetOrigin(); + } + void InitScrollBarBox(); SvxIconChoiceCtrlEntry* FindNewCursor(); - void ToggleSelection( SvxIconChoiceCtrlEntry* ); - void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False ); - void Center( SvxIconChoiceCtrlEntry* pEntry ) const; - void StopEditTimer() { aEditTimer.Stop(); } - void StartEditTimer() { aEditTimer.Start(); } - void ImpHideDDIcon(); - void CallSelectHandler( SvxIconChoiceCtrlEntry* ); - void SelectRect( - SvxIconChoiceCtrlEntry* pEntry1, - SvxIconChoiceCtrlEntry* pEntry2, - sal_Bool bAdd = sal_True, - SvPtrarr* pOtherRects = 0 ); - - void SelectRange( - SvxIconChoiceCtrlEntry* pStart, - SvxIconChoiceCtrlEntry* pEnd, - sal_Bool bAdd = sal_True ); - - void AddSelectedRect( const Rectangle& ); - void AddSelectedRect( - SvxIconChoiceCtrlEntry* pEntry1, - SvxIconChoiceCtrlEntry* pEntry2 ); - - void ClearSelectedRectList(); - void ClearColumnList(); - Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; - - void ClipAtVirtOutRect( Rectangle& rRect ) const; - void AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCtrlEntry* pStart=0 ); - Point AdjustAtGrid( - const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) - const Rectangle& rBoundRect ) const; + void ToggleSelection( SvxIconChoiceCtrlEntry* ); + void DeselectAllBut( SvxIconChoiceCtrlEntry*, sal_Bool bPaintSync=sal_False ); + void Center( SvxIconChoiceCtrlEntry* pEntry ) const; + void StopEditTimer() { aEditTimer.Stop(); } + void StartEditTimer() { aEditTimer.Start(); } + void ImpHideDDIcon(); + void CallSelectHandler( SvxIconChoiceCtrlEntry* ); + void SelectRect( + SvxIconChoiceCtrlEntry* pEntry1, + SvxIconChoiceCtrlEntry* pEntry2, + sal_Bool bAdd = sal_True, + SvPtrarr* pOtherRects = 0 + ); + + void SelectRange( + SvxIconChoiceCtrlEntry* pStart, + SvxIconChoiceCtrlEntry* pEnd, + sal_Bool bAdd = sal_True + ); + + void AddSelectedRect( const Rectangle& ); + void AddSelectedRect( + SvxIconChoiceCtrlEntry* pEntry1, + SvxIconChoiceCtrlEntry* pEntry2 + ); + + void ClearSelectedRectList(); + void ClearColumnList(); + Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; + + void ClipAtVirtOutRect( Rectangle& rRect ) const; + void AdjustAtGrid( const SvPtrarr& rRow, SvxIconChoiceCtrlEntry* pStart=0 ); + Point AdjustAtGrid( + const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) + const Rectangle& rBoundRect + ) const; sal_uLong GetPredecessorGrid( const Point& rDocPos) const; - void InitPredecessors(); - void ClearPredecessors(); + void InitPredecessors(); + void ClearPredecessors(); sal_Bool CheckVerScrollBar(); sal_Bool CheckHorScrollBar(); - void CancelUserEvents(); - void EntrySelected( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bSelect, - sal_Bool bSyncPaint ); - void SaveSelection( List** ); - void RepaintEntries( sal_uInt16 nEntryFlagsMask ); - void SetListPositions(); - void SetDefaultTextSize(); - sal_Bool IsAutoArrange() const { - return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); } - sal_Bool IsAutoAdjust() const { - return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); } - void DocRectChanged() { aDocRectChangedTimer.Start(); } - void VisRectChanged() { aVisRectChangedTimer.Start(); } - void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False ); - - DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* ); - - void ShowFocus ( Rectangle& rRect ); - void HideFocus (); - void DrawFocusRect ( OutputDevice* pOut ); + void CancelUserEvents(); + void EntrySelected( + SvxIconChoiceCtrlEntry* pEntry, + sal_Bool bSelect, + sal_Bool bSyncPaint + ); + void SaveSelection( List** ); + void RepaintEntries( sal_uInt16 nEntryFlagsMask ); + void SetListPositions(); + void SetDefaultTextSize(); + sal_Bool IsAutoArrange() const + { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoArrange); + } + sal_Bool IsAutoAdjust() const + { + return (sal_Bool)(ePositionMode == IcnViewPositionModeAutoAdjust); + } + void DocRectChanged() { aDocRectChangedTimer.Start(); } + void VisRectChanged() { aVisRectChangedTimer.Start(); } + void SetOrigin( const Point&, sal_Bool bDoNotUpdateWallpaper = sal_False ); + + DECL_LINK( TextEditEndedHdl, IcnViewEdit_Impl* ); + + void ShowFocus ( Rectangle& rRect ); + void HideFocus (); + void DrawFocusRect ( OutputDevice* pOut ); sal_Bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const; public: - long nGridDX, - nGridDY; - long nHorSBarHeight, - nVerSBarWidth; + long nGridDX; + long nGridDY; + long nHorSBarHeight; + long nVerSBarWidth; - SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); - ~SvxIconChoiceCtrl_Impl(); + SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); + ~SvxIconChoiceCtrl_Impl(); sal_Bool SetChoiceWithCursor ( sal_Bool bDo = sal_True ) { sal_Bool bOld=bChooseWithCursor; bChooseWithCursor = bDo; return bOld; } - void Clear( sal_Bool bInCtor = sal_False ); - void SetStyle( WinBits nWinStyle ); - WinBits GetStyle() const { return nWinBits; } - void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 ); - void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL ); - void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ); - void FontModified(); - void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True ); - void SelectEntry( - SvxIconChoiceCtrlEntry*, - sal_Bool bSelect, - sal_Bool bCallHdl = sal_True, - sal_Bool bAddToSelection = sal_False, - sal_Bool bSyncPaint = sal_False ); - void Paint( const Rectangle& rRect ); + void Clear( sal_Bool bInCtor = sal_False ); + void SetStyle( WinBits nWinStyle ); + WinBits GetStyle() const { return nWinBits; } + void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 ); + void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL ); + void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ); + void FontModified(); + void SelectAll( sal_Bool bSelect = sal_True, sal_Bool bPaint = sal_True ); + void SelectEntry( + SvxIconChoiceCtrlEntry*, + sal_Bool bSelect, + sal_Bool bCallHdl = sal_True, + sal_Bool bAddToSelection = sal_False, + sal_Bool bSyncPaint = sal_False + ); + void Paint( const Rectangle& rRect ); sal_Bool MouseButtonDown( const MouseEvent& ); sal_Bool MouseButtonUp( const MouseEvent& ); sal_Bool MouseMove( const MouseEvent&); sal_Bool RequestHelp( const HelpEvent& rHEvt ); - void SetCursor_Impl( - SvxIconChoiceCtrlEntry* pOldCursor, - SvxIconChoiceCtrlEntry* pNewCursor, - sal_Bool bMod1, - sal_Bool bShift, - sal_Bool bPaintSync = sal_False); + void SetCursor_Impl( + SvxIconChoiceCtrlEntry* pOldCursor, + SvxIconChoiceCtrlEntry* pNewCursor, + sal_Bool bMod1, + sal_Bool bShift, + sal_Bool bPaintSync = sal_False + ); sal_Bool KeyInput( const KeyEvent& ); - void Resize(); - void GetFocus(); - void LoseFocus(); - void SetUpdateMode( sal_Bool bUpdate ); + void Resize(); + void GetFocus(); + void LoseFocus(); + void SetUpdateMode( sal_Bool bUpdate ); sal_Bool GetUpdateMode() const { return bUpdateMode; } - void PaintEntry( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bIsBackgroundPainted=sal_False ); - void PaintEntry( - SvxIconChoiceCtrlEntry*, - const Point&, - OutputDevice* pOut = 0, - sal_Bool bIsBackgroundPainted = sal_False); - void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* ); - - void SetEntryPos( - SvxIconChoiceCtrlEntry* pEntry, - const Point& rPos, - sal_Bool bAdjustRow = sal_False, - sal_Bool bCheckScrollBars = sal_False, - sal_Bool bKeepGridMap = sal_False ); - - void InvalidateEntry( SvxIconChoiceCtrlEntry* ); + void PaintEntry( + SvxIconChoiceCtrlEntry* pEntry, + sal_Bool bIsBackgroundPainted=sal_False + ); + void PaintEntry( + SvxIconChoiceCtrlEntry*, + const Point&, + OutputDevice* pOut = 0, + sal_Bool bIsBackgroundPainted = sal_False + ); + void PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* ); + + void SetEntryPos( + SvxIconChoiceCtrlEntry* pEntry, + const Point& rPos, + sal_Bool bAdjustRow = sal_False, + sal_Bool bCheckScrollBars = sal_False, + sal_Bool bKeepGridMap = sal_False + ); + + void InvalidateEntry( SvxIconChoiceCtrlEntry* ); IcnViewFieldType GetItem( SvxIconChoiceCtrlEntry*, const Point& rAbsPos ); - void SetNoSelection(); + void SetNoSelection(); SvxIconChoiceCtrlEntry* GetCurEntry() const { return pCursor; } - void SetCursor( - SvxIconChoiceCtrlEntry*, - // sal_True == bei Single-Selection die Sel. mitfuehren - sal_Bool bSyncSingleSelection = sal_True, - sal_Bool bShowFocusAsync = sal_False ); + void SetCursor( + SvxIconChoiceCtrlEntry*, + // sal_True == bei Single-Selection die Sel. mitfuehren + sal_Bool bSyncSingleSelection = sal_True, + sal_Bool bShowFocusAsync = sal_False + ); SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False ); SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); - Point GetEntryPos( SvxIconChoiceCtrlEntry* ); - void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True ); - - void Arrange(sal_Bool bKeepPredecessors = sal_False, long nSetMaxVirtWidth =0, long nSetMaxVirtHeight =0 ); - - Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); - Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 ); - Rectangle CalcTextRect( - SvxIconChoiceCtrlEntry*, - const Point* pPos = 0, - sal_Bool bForInplaceEdit = sal_False, - const String* pStr = 0 ); - - long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const; - long CalcBoundingHeight( SvxIconChoiceCtrlEntry* ) const; - Size CalcBoundingSize( SvxIconChoiceCtrlEntry* ) const; - void FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ); - void SetBoundingRect_Impl( - SvxIconChoiceCtrlEntry* pEntry, - const Point& rPos, - const Size& rBoundingSize ); + Point GetEntryPos( SvxIconChoiceCtrlEntry* ); + void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True ); + + void Arrange( + sal_Bool bKeepPredecessors = sal_False, + long nSetMaxVirtWidth =0, + long nSetMaxVirtHeight =0 + ); + + Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); + Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = 0 ); + Rectangle CalcTextRect( + SvxIconChoiceCtrlEntry*, + const Point* pPos = 0, + sal_Bool bForInplaceEdit = sal_False, + const String* pStr = 0 + ); + + long CalcBoundingWidth( SvxIconChoiceCtrlEntry* ) const; + long CalcBoundingHeight( SvxIconChoiceCtrlEntry* ) const; + Size CalcBoundingSize( SvxIconChoiceCtrlEntry* ) const; + void FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ); + void SetBoundingRect_Impl( + SvxIconChoiceCtrlEntry* pEntry, + const Point& rPos, + const Size& rBoundingSize + ); // berechnet alle BoundRects neu - void RecalcAllBoundingRects(); + void RecalcAllBoundingRects(); // berechnet alle ungueltigen BoundRects neu - void RecalcAllBoundingRectsSmart(); - const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); - void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* ); - void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; } + void RecalcAllBoundingRectsSmart(); + const Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); + void InvalidateBoundingRect( SvxIconChoiceCtrlEntry* ); + void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; bBoundRectsDirty = sal_True; } sal_Bool IsBoundingRectValid( const Rectangle& rRect ) const { return (sal_Bool)( rRect.Right() != LONG_MAX ); } - void PaintEmphasis( - const Rectangle& rRect1, - const Rectangle& rRect2, - sal_Bool bSelected, - sal_Bool bDropTarget, - sal_Bool bCursored, - OutputDevice* pOut, - sal_Bool bIsBackgroundPainted = sal_False); - - void PaintItem( - const Rectangle& rRect, - IcnViewFieldType eItem, - SvxIconChoiceCtrlEntry* pEntry, - sal_uInt16 nPaintFlags, - OutputDevice* pOut, - const String* pStr = 0, - ::vcl::ControlLayoutData* _pLayoutData = NULL ); + void PaintEmphasis( + const Rectangle& rRect1, + const Rectangle& rRect2, + sal_Bool bSelected, + sal_Bool bDropTarget, + sal_Bool bCursored, + OutputDevice* pOut, + sal_Bool bIsBackgroundPainted = sal_False + ); + + void PaintItem( + const Rectangle& rRect, + IcnViewFieldType eItem, + SvxIconChoiceCtrlEntry* pEntry, + sal_uInt16 nPaintFlags, + OutputDevice* pOut, + const String* pStr = 0, + ::vcl::ControlLayoutData* _pLayoutData = NULL + ); // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == sal_True - void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } + void CheckBoundingRects() { if (bBoundRectsDirty) RecalcAllBoundingRectsSmart(); } // berechnet alle invalidierten BoundingRects neu - void UpdateBoundingRects(); - void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow ); - void PrepareCommandEvent( const CommandEvent& ); - void Command( const CommandEvent& rCEvt ); - void ToTop( SvxIconChoiceCtrlEntry* ); + void UpdateBoundingRects(); + void ShowTargetEmphasis( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bShow ); + void PrepareCommandEvent( const CommandEvent& ); + void Command( const CommandEvent& rCEvt ); + void ToTop( SvxIconChoiceCtrlEntry* ); sal_uLong GetSelectionCount() const; - void SetGrid( const Size& ); - Size GetMinGrid() const; + void SetGrid( const Size& ); + Size GetMinGrid() const; sal_uLong GetGridCount( const Size& rSize, sal_Bool bCheckScrBars, sal_Bool bSmartScrBar ) const; - void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); - const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const; + void Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar = sal_False ); + const Size& GetItemSize( SvxIconChoiceCtrlEntry*, IcnViewFieldType ) const; - void HideDDIcon(); - void ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, const Point& rPos ); - void HideShowDDIcon( - SvxIconChoiceCtrlEntry* pRefEntry, - const Point& rPos ); + void HideDDIcon(); + void ShowDDIcon( SvxIconChoiceCtrlEntry* pRefEntry, const Point& rPos ); + void HideShowDDIcon( + SvxIconChoiceCtrlEntry* pRefEntry, + const Point& rPos + ); sal_Bool IsOver( - SvPtrarr* pSelectedRectList, - const Rectangle& rEntryBoundRect ) const; - - void SelectRect( - const Rectangle&, - sal_Bool bAdd = sal_True, - SvPtrarr* pOtherRects = 0 ); - - void CalcScrollOffsets( - const Point& rRefPosPixel, - long& rX, - long& rY, - sal_Bool bDragDrop = sal_False, - sal_uInt16 nBorderWidth = 10 ); + SvPtrarr* pSelectedRectList, + const Rectangle& rEntryBoundRect + ) const; + + void SelectRect( + const Rectangle&, + sal_Bool bAdd = sal_True, + SvPtrarr* pOtherRects = 0 + ); + + void CalcScrollOffsets( + const Point& rRefPosPixel, + long& rX, + long& rY, + sal_Bool bDragDrop = sal_False, + sal_uInt16 nBorderWidth = 10 + ); sal_Bool IsTextHit( SvxIconChoiceCtrlEntry* pEntry, const Point& rDocPos ); - void MakeVisible( - const Rectangle& rDocPos, - sal_Bool bInScrollBarEvent=sal_False, - sal_Bool bCallRectChangedHdl = sal_True ); - - void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 ); - void SetEntryTextMode( SvxIconChoiceCtrlTextMode, SvxIconChoiceCtrlEntry* pEntry = 0 ); + void MakeVisible( + const Rectangle& rDocPos, + sal_Bool bInScrollBarEvent=sal_False, + sal_Bool bCallRectChangedHdl = sal_True + ); + + void AdjustEntryAtGrid( SvxIconChoiceCtrlEntry* pStart = 0 ); + void SetEntryTextMode( + SvxIconChoiceCtrlTextMode, + SvxIconChoiceCtrlEntry* pEntry = 0 + ); SvxIconChoiceCtrlTextMode GetTextMode( const SvxIconChoiceCtrlEntry* pEntry = 0 ) const; - void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry ); - void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; } + void ShowEntryFocusRect( const SvxIconChoiceCtrlEntry* pEntry ); + void EnableEntryEditing( sal_Bool bEnable ) { bEntryEditingEnabled = bEnable; } sal_Bool IsEntryEditingEnabled() const { return bEntryEditingEnabled; } sal_Bool IsEntryEditing() const { return (sal_Bool)(pCurEditedEntry!=0); } - void EditEntry( SvxIconChoiceCtrlEntry* pEntry ); - void StopEntryEditing( sal_Bool bCancel ); - void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ); - sal_uLong GetEntryCount() const { return aEntries.Count(); } - SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return (SvxIconChoiceCtrlEntry*)aEntries.GetObject(nPos); } + void EditEntry( SvxIconChoiceCtrlEntry* pEntry ); + void StopEntryEditing( sal_Bool bCancel ); + void LockEntryPos( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bLock ); + size_t GetEntryCount() const { return aEntries.size(); } + SvxIconChoiceCtrlEntry* GetEntry( size_t nPos ) + { + return aEntries[ nPos ]; + } + SvxIconChoiceCtrlEntry* GetEntry( size_t nPos ) const + { + return aEntries[ nPos ]; + } SvxIconChoiceCtrlEntry* GetFirstSelectedEntry( sal_uLong& ) const; SvxIconChoiceCtrlEntry* GetNextSelectedEntry( sal_uLong& ) const; SvxIconChoiceCtrlEntry* GetHdlEntry() const { return pHdlEntry; } - void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; } + void SetHdlEntry( SvxIconChoiceCtrlEntry* pEntry ) { pHdlEntry = pEntry; } SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const; - void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; } - SelectionMode GetSelectionMode() const { return eSelectionMode; } + void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; } + SelectionMode GetSelectionMode() const { return eSelectionMode; } sal_Bool AreEntriesMoved() const { return (sal_Bool)((nFlags & F_MOVED_ENTRIES)!=0); } - void SetEntriesMoved( sal_Bool bMoved ) - { - if( bMoved ) nFlags |= F_MOVED_ENTRIES; - else nFlags &= ~(F_MOVED_ENTRIES); - } + void SetEntriesMoved( sal_Bool bMoved ) + { + if( bMoved ) + nFlags |= F_MOVED_ENTRIES; + else + nFlags &= ~(F_MOVED_ENTRIES); + } sal_uLong GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; - void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos ); - void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; } - void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags ); + void SetEntryListPos( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nNewPos ); + void SetEntryImageSize( const Size& rSize ) { aImageSize = rSize; } + void SetEntryFlags( SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nFlags ); SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); SvxIconChoiceCtrlEntry* GoUpDown( SvxIconChoiceCtrlEntry*, sal_Bool bDown ); - void InitSettings(); - Rectangle GetOutputRect() const; + void InitSettings(); + Rectangle GetOutputRect() const; sal_Bool ArePredecessorsSet() const { return (sal_Bool)(pHead != 0); } SvxIconChoiceCtrlEntry* GetPredecessorHead() const { return pHead; } - void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); + void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); sal_Bool GetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry** ppPredecessor); // liefert gueltige Ergebnisse nur im AutoArrange-Modus! SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& ); - void SetPositionMode( SvxIconChoiceCtrlPositionMode ); + void SetPositionMode( SvxIconChoiceCtrlPositionMode ); SvxIconChoiceCtrlPositionMode GetPositionMode() const { return ePositionMode;} - void Flush(); - void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); + void Flush(); + void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; const SvxIconChoiceCtrlColumnInfo* GetItemColumn( sal_uInt16 nSubItem, long& rLeft ) const; - Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); } - Rectangle GetVisibleRect() const { return GetOutputRect(); } - - void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry,sal_Bool bKeepHighlightFlags=sal_False ); - void HideEntryHighlightFrame(); - void DrawHighlightFrame( OutputDevice* pOut, - const Rectangle& rBmpRect, sal_Bool bHide ); - void StopSelectTimer() { aCallSelectHdlTimer.Stop(); } - void Tracking( const TrackingEvent& rTEvt ); - Point GetPopupMenuPosPixel() const; + Rectangle GetDocumentRect() const { return Rectangle( Point(), aVirtOutputSize ); } + Rectangle GetVisibleRect() const { return GetOutputRect(); } + + void SetEntryHighlightFrame( + SvxIconChoiceCtrlEntry* pEntry, + sal_Bool bKeepHighlightFlags=sal_False + ); + void HideEntryHighlightFrame(); + void DrawHighlightFrame( + OutputDevice* pOut, + const Rectangle& rBmpRect, + sal_Bool bHide + ); + void StopSelectTimer() { aCallSelectHdlTimer.Stop(); } + void Tracking( const TrackingEvent& rTEvt ); + Point GetPopupMenuPosPixel() const; sal_Bool HandleShortCutKey( const KeyEvent& rKeyEvent ); - void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); + void CallEventListeners( sal_uLong nEvent, void* pData = NULL ); - inline ::svt::IAccessibleFactory& - GetAccessibleFactory() { return aAccFactory.getFactory(); } + inline ::svt::IAccessibleFactory& GetAccessibleFactory() + { + return aAccFactory.getFactory(); + } }; // ---------------------------------------------------------------------------------------------- @@ -544,28 +620,40 @@ public: class IcnCursor_Impl { SvxIconChoiceCtrl_Impl* pView; - SvPtrarr* pColumns; - SvPtrarr* pRows; - long nCols; - long nRows; - short nDeltaWidth; - short nDeltaHeight; + SvPtrarr* pColumns; + SvPtrarr* pRows; + long nCols; + long nRows; + short nDeltaWidth; + short nDeltaHeight; SvxIconChoiceCtrlEntry* pCurEntry; - void SetDeltas(); - void ImplCreate(); - void Create() { if( !pColumns ) ImplCreate(); } - - sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvxIconChoiceCtrlEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, - sal_Bool bDown, sal_Bool bSimple ); - - SvxIconChoiceCtrlEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, - sal_Bool bRight, sal_Bool bSimple ); + void SetDeltas(); + void ImplCreate(); + void Create() { if( !pColumns ) ImplCreate(); } + + sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); + SvxIconChoiceCtrlEntry* SearchCol( + sal_uInt16 nCol, + sal_uInt16 nTop, + sal_uInt16 nBottom, + sal_uInt16 nPref, + sal_Bool bDown, + sal_Bool bSimple + ); + + SvxIconChoiceCtrlEntry* SearchRow( + sal_uInt16 nRow, + sal_uInt16 nRight, + sal_uInt16 nLeft, + sal_uInt16 nPref, + sal_Bool bRight, + sal_Bool bSimple + ); public: - IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner ); - ~IcnCursor_Impl(); - void Clear(); + IcnCursor_Impl( SvxIconChoiceCtrl_Impl* pOwner ); + ~IcnCursor_Impl(); + void Clear(); // fuer Cursortravelling usw. SvxIconChoiceCtrlEntry* GoLeftRight( SvxIconChoiceCtrlEntry*, sal_Bool bRight ); @@ -576,8 +664,8 @@ public: // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und // muessen mit DestroyGridAdjustData geloescht werden - void CreateGridAjustData( SvPtrarr& pLists, SvxIconChoiceCtrlEntry* pRow=0); - static void DestroyGridAdjustData( SvPtrarr& rLists ); + void CreateGridAjustData( SvPtrarr& pLists, SvxIconChoiceCtrlEntry* pRow=0); + static void DestroyGridAdjustData( SvPtrarr& rLists ); }; // ---------------------------------------------------------------------------------------------- @@ -588,47 +676,46 @@ typedef sal_uLong GridId; class IcnGridMap_Impl { - Rectangle _aLastOccupiedGrid; + Rectangle _aLastOccupiedGrid; SvxIconChoiceCtrl_Impl* _pView; - sal_Bool* _pGridMap; - sal_uInt16 _nGridCols, _nGridRows; + sal_Bool* _pGridMap; + sal_uInt16 _nGridCols, _nGridRows; - void Expand(); - void Create_Impl(); - void Create() { if(!_pGridMap) Create_Impl(); } + void Expand(); + void Create_Impl(); + void Create() { if(!_pGridMap) Create_Impl(); } - void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const; + void GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const; public: - IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView); - ~IcnGridMap_Impl(); - - void Clear(); - - GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 ); - GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ); - GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True ); - - void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True ); - void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True ) - { - DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); - if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) ) - _pGridMap[ nId ] = bOccupy; - } - - Rectangle GetGridRect( GridId ); - void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY ); - static sal_uLong GetGridCount( const Size& rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight ); - - void OutputSizeChanged(); + IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView); + ~IcnGridMap_Impl(); + + void Clear(); + + GridId GetGrid( const Point& rDocPos, sal_Bool* pbClipped = 0 ); + GridId GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY ); + GridId GetUnoccupiedGrid( sal_Bool bOccupyFound=sal_True ); + + void OccupyGrids( const SvxIconChoiceCtrlEntry*, sal_Bool bOccupy = sal_True ); + void OccupyGrid( GridId nId, sal_Bool bOccupy = sal_True ) + { + DBG_ASSERT(!_pGridMap || nId<(sal_uLong)(_nGridCols*_nGridRows),"OccupyGrid: Bad GridId"); + if(_pGridMap && nId < (sal_uLong)(_nGridCols *_nGridRows) ) + _pGridMap[ nId ] = bOccupy; + } + + Rectangle GetGridRect( GridId ); + void GetGridCoord( GridId, sal_uInt16& rGridX, sal_uInt16& rGridY ); + static sal_uLong GetGridCount( + const Size& rSizePixel, + sal_uInt16 nGridWidth, + sal_uInt16 nGridHeight + ); + + void OutputSizeChanged(); }; - - - - #endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index cdb95366d560..df9b81dab0c7 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -224,13 +224,13 @@ void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor ) pView->Invalidate(INVALIDATE_NOCHILDREN); } AdjustScrollBars(); - sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pCur = aEntries[ nCur ]; delete pCur; } - aEntries.Clear(); + aEntries.clear(); DocRectChanged(); VisRectChanged(); } @@ -292,19 +292,18 @@ void SvxIconChoiceCtrl_Impl::FontModified() ShowCursor( sal_True ); } -void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos, +void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t nPos, const Point* pPos ) { StopEditTimer(); - aEntries.Insert( pEntry, nPos ); - if( (nFlags & F_ENTRYLISTPOS_VALID) && nPos >= aEntries.Count() - 1 ) - pEntry->nPos = aEntries.Count() - 1; + aEntries.insert( nPos, pEntry ); + if( (nFlags & F_ENTRYLISTPOS_VALID) && nPos >= aEntries.size() - 1 ) + pEntry->nPos = aEntries.size() - 1; else nFlags &= ~F_ENTRYLISTPOS_VALID; pZOrderList->Insert( (void*)pEntry, LIST_APPEND ); //pZOrderList->Count() ); pImpCursor->Clear(); -// pGridMap->Clear(); if( pPos ) { Size aSize( CalcBoundingSize( pEntry ) ); @@ -376,10 +375,10 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() if( nFlags & F_ENTRYLISTPOS_VALID ) return; - sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; pEntry->nPos = nCur; } nFlags |= F_ENTRYLISTPOS_VALID; @@ -408,7 +407,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) if( pEntry->IsSelected() ) CallSelectHandler( 0 ); - if( aEntries.Count() == 1 && aEntries.GetObject(0) == pEntry ) + if( aEntries.size() == 1 && aEntries[ 0 ] == pEntry ) { Clear(); return; @@ -435,21 +434,21 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) } sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False; - if( bCurEntryPosValid && aEntries.GetObject(aEntries.Count()-1) != pEntry ) + if( bCurEntryPosValid && aEntries[ aEntries.size()-1 ] != pEntry ) nFlags &= ~F_ENTRYLISTPOS_VALID; sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry ); pZOrderList->Remove( nPos ); if( bCurEntryPosValid ) { DBG_ASSERT(aEntries.GetObject(pEntry->nPos)==pEntry,"RemoveEntry: Wrong nPos in entry"); - aEntries.Remove( pEntry->nPos ); + aEntries.remove( pEntry->nPos ); } else - aEntries.Remove( pEntry ); + aEntries.remove( pEntry ); pImpCursor->Clear(); pGridMap->Clear(); delete pEntry; - if( IsAutoArrange() && aEntries.Count() ) + if( IsAutoArrange() && aEntries.size() ) aAutoArrangeTimer.Start(); if( bSetNewCursor ) { @@ -544,10 +543,10 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() StopEditTimer(); aVirtOutputSize.Width() = 0; aVirtOutputSize.Height() = 0; - const sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + const size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pCur = aEntries[ nCur ]; pCur->ClearFlags( ICNVIEW_FLAG_POS_MOVED ); if( pCur->IsPosLocked() ) { @@ -616,25 +615,25 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::InitPredecessors() { DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized"); - sal_uLong nCount = aEntries.Count(); + size_t nCount = aEntries.size(); if( nCount ) { - SvxIconChoiceCtrlEntry* pPrev = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); - for( sal_uLong nCur = 1; nCur <= nCount; nCur++ ) + SvxIconChoiceCtrlEntry* pPrev = aEntries[ 0 ]; + for( size_t nCur = 1; nCur <= nCount; nCur++ ) { pPrev->ClearFlags( ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED | ICNVIEW_FLAG_PRED_SET); SvxIconChoiceCtrlEntry* pNext; if( nCur == nCount ) - pNext = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); + pNext = aEntries[ 0 ]; else - pNext = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + pNext = aEntries[ nCur ]; pPrev->pflink = pNext; pNext->pblink = pPrev; pPrev = pNext; } - pHead = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); + pHead = aEntries[ 0 ]; } else pHead = 0; @@ -645,10 +644,10 @@ void SvxIconChoiceCtrl_Impl::ClearPredecessors() { if( pHead ) { - sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pCur = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pCur = aEntries[ nCur ]; pCur->pflink = 0; pCur->pblink = 0; pCur->ClearFlags( ICNVIEW_FLAG_PRED_SET ); @@ -750,7 +749,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) #endif nFlags |= F_PAINTED; - if( !aEntries.Count() ) + if( !aEntries.size() ) return; if( !pCursor ) { @@ -767,7 +766,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) } if( !bfound ) - pCursor = (SvxIconChoiceCtrlEntry*)aEntries.First(); + pCursor = aEntries[ 0 ]; } // Show Focus at Init-Time @@ -786,8 +785,8 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) pView->SetClipRegion( aOutputArea ); } - const sal_uInt16 nListInitSize = aEntries.Count() > USHRT_MAX ? - USHRT_MAX : (sal_uInt16)aEntries.Count(); + const sal_uInt16 nListInitSize = aEntries.size() > USHRT_MAX ? + USHRT_MAX : (sal_uInt16)aEntries.size(); List* pNewZOrderList = new List( nListInitSize ); List* pPaintedEntries = new List( nListInitSize ); @@ -1379,7 +1378,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_END: if( pCursor ) { - pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( aEntries.Count() - 1 ); + pNewCursor = aEntries[ aEntries.size() - 1 ]; SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -1387,7 +1386,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_HOME: if( pCursor ) { - pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( 0 ); + pNewCursor = aEntries[ 0 ]; SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift, sal_True ); } break; @@ -2345,15 +2344,15 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { nMaxBoundHeight = 0; pZOrderList->Clear(); - sal_uLong nCount = aEntries.Count(); - sal_uLong nCur; + size_t nCount = aEntries.size(); + size_t nCur; SvxIconChoiceCtrlEntry* pEntry; if( !IsAutoArrange() || !pHead ) { for( nCur = 0; nCur < nCount; nCur++ ) { - pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + pEntry = aEntries[ nCur ]; FindBoundingRect( pEntry ); pZOrderList->Insert( pEntry, LIST_APPEND ); } @@ -2379,15 +2378,15 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() { nMaxBoundHeight = 0; pZOrderList->Clear(); - sal_uLong nCur; + size_t nCur; SvxIconChoiceCtrlEntry* pEntry; - const sal_uLong nCount = aEntries.Count(); + const size_t nCount = aEntries.size(); if( !IsAutoArrange() || !pHead ) { for( nCur = 0; nCur < nCount; nCur++ ) { - pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + pEntry = aEntries[ nCur ]; if( IsBoundingRectValid( pEntry->aRect )) { Size aBoundSize( pEntry->aRect.GetSize() ); @@ -2424,10 +2423,10 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() void SvxIconChoiceCtrl_Impl::UpdateBoundingRects() { - const sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + const size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; GetEntryBoundRect( pEntry ); } } @@ -2906,7 +2905,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindNewCursor() } } else - pNewCursor = (SvxIconChoiceCtrlEntry*)aEntries.First(); + pNewCursor = aEntries[ 0 ]; DBG_ASSERT(!pNewCursor|| (pCursor&&pCursor!=pNewCursor),"FindNewCursor failed"); return pNewCursor; } @@ -2935,10 +2934,10 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryN // // !!!!!!! Todo: Evtl. Z-Orderlist abarbeiten !!!!!!! // - sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; if( pEntry != pThisEntryNot && pEntry->IsSelected() ) SelectEntry( pEntry, sal_False, sal_True, sal_True, bPaintSync ); } @@ -3605,8 +3604,8 @@ sal_Bool SvxIconChoiceCtrl_Impl::IsMnemonicChar( sal_Unicode cChar, sal_uLong& r { sal_Bool bRet = sal_False; const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - sal_uLong nEntryCount = GetEntryCount(); - for ( sal_uLong i = 0; i < nEntryCount; ++i ) + size_t nEntryCount = GetEntryCount(); + for ( size_t i = 0; i < nEntryCount; ++i ) { if ( rI18nHelper.MatchMnemonic( GetEntry( i )->GetText(), cChar ) ) { @@ -3751,12 +3750,12 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong return pCurHighlightFrame; } - sal_uLong nCount = aEntries.Count(); + size_t nCount = aEntries.size(); if( !pHead ) { - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; if( pEntry->IsSelected() ) { rPos = nCur; @@ -3788,14 +3787,14 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry( sal_uLong // kein Round Robin! SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uLong& rStartPos ) const { - sal_uLong nCount = aEntries.Count(); + size_t nCount = aEntries.size(); if( rStartPos > nCount || !GetSelectionCount() ) return 0; if( !pHead ) { - for( sal_uLong nCur = rStartPos+1; nCur < nCount; nCur++ ) + for( size_t nCur = rStartPos+1; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; if( pEntry->IsSelected() ) { rStartPos = nCur; @@ -3805,7 +3804,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextSelectedEntry( sal_uLong& } else { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( rStartPos ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ rStartPos ]; pEntry = pEntry->pflink; while( pEntry != pHead ) { @@ -3826,10 +3825,10 @@ void SvxIconChoiceCtrl_Impl::SelectAll( sal_Bool bSelect, sal_Bool bPaint ) { bPaint = sal_True; - sal_uLong nCount = aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) + size_t nCount = aEntries.size(); + for( size_t nCur = 0; nCur < nCount && (bSelect || GetSelectionCount() ); nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; SelectEntry( pEntry, bSelect, sal_True, sal_True, bPaint ); } nFlags &= (~F_ADD_MODE); @@ -3986,13 +3985,13 @@ sal_uLong SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntr void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry, sal_uLong nNewPos ) { - sal_uLong nCurPos = GetEntryListPos( pListEntry ); + size_t nCurPos = GetEntryListPos( pListEntry ); if( nCurPos == nNewPos ) return; - aEntries.List::Remove( nCurPos ); - aEntries.List::Insert( (void*)pListEntry, nNewPos ); + aEntries.remove( nCurPos ); + aEntries.insert( nNewPos, pListEntry ); // Eintragspositionen anpassen - sal_uLong nStart, nEnd; + size_t nStart, nEnd; if( nNewPos < nCurPos ) { nStart = nNewPos; @@ -4005,7 +4004,7 @@ void SvxIconChoiceCtrl_Impl::SetEntryListPos( SvxIconChoiceCtrlEntry* pListEntry } for( ; nStart <= nEnd; nStart++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nStart ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nStart ]; pEntry->nPos = nStart; } } @@ -4073,15 +4072,7 @@ void SvxIconChoiceCtrl_Impl::InitSettings() } } -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nInitSize , sal_uInt16 _nReSize ) : - List( _nInitSize, _nReSize ), - _pOwner( pOwner ) -{ - _pOwner->pHead = 0; -} - -EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner, sal_uInt16 _nBlockSize, sal_uInt16 _nInitSize, sal_uInt16 _nReSize ) : - List( _nBlockSize, _nInitSize, _nReSize ), +EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner ) : _pOwner( pOwner ) { _pOwner->pHead = 0; @@ -4092,31 +4083,47 @@ EntryList_Impl::~EntryList_Impl() _pOwner->pHead = 0; } -void EntryList_Impl::Clear() +void EntryList_Impl::clear() { _pOwner->pHead = 0; - List::Clear(); + maIconChoiceCtrlEntryList.clear(); } -void EntryList_Impl::Insert( SvxIconChoiceCtrlEntry* pEntry, sal_uLong nPos ) +void EntryList_Impl::insert( size_t nPos, SvxIconChoiceCtrlEntry* pEntry ) { - List::Insert( pEntry, nPos ); + if ( nPos < maIconChoiceCtrlEntryList.size() ) { + maIconChoiceCtrlEntryList.insert( maIconChoiceCtrlEntryList.begin() + nPos, pEntry ); + } else { + maIconChoiceCtrlEntryList.push_back( pEntry ); + } if( _pOwner->pHead ) pEntry->SetBacklink( _pOwner->pHead->pblink ); } -SvxIconChoiceCtrlEntry* EntryList_Impl::Remove( sal_uLong nPos ) +SvxIconChoiceCtrlEntry* EntryList_Impl::remove( size_t nPos ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)List::Remove( nPos ); - DBG_ASSERT(pEntry,"EntryList_Impl::Remove > Entry not found"); - Removed_Impl( pEntry ); + SvxIconChoiceCtrlEntry* pEntry = NULL; + if ( nPos < maIconChoiceCtrlEntryList.size() ) { + pEntry = maIconChoiceCtrlEntryList[ nPos ]; + maIconChoiceCtrlEntryList.erase( maIconChoiceCtrlEntryList.begin() + nPos ); + Removed_Impl( pEntry ); + } return pEntry; } -void EntryList_Impl::Remove( SvxIconChoiceCtrlEntry* pEntry ) +void EntryList_Impl::remove( SvxIconChoiceCtrlEntry* pEntry ) { - List::Remove( (void*)pEntry ); - Removed_Impl( pEntry ); + for ( + SvxIconChoiceCtrlEntryList_impl::iterator it = maIconChoiceCtrlEntryList.begin(); + it < maIconChoiceCtrlEntryList.end(); + ++it + ) { + if ( *it == pEntry ) { + maIconChoiceCtrlEntryList.erase( it ); + Removed_Impl( pEntry ); + break; + } + } } void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) @@ -4139,14 +4146,14 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMode ) { - sal_uLong nCur; + size_t nCur; if( eMode == ePositionMode ) return; SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode; ePositionMode = eMode; - sal_uLong nCount = aEntries.Count(); + size_t nCount = aEntries.size(); if( eOldMode == IcnViewPositionModeAutoArrange ) { @@ -4154,7 +4161,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod // mit ungewollten Ueberlappungen, da diese Eintrage im Arrange // nicht beruecksichtigt werden. #if 1 - if( aEntries.Count() ) + if( aEntries.size() ) aAutoArrangeTimer.Start(); #else if( pHead ) @@ -4181,7 +4188,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod List aMovedEntries; for( nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; if( pEntry->GetFlags() & (ICNVIEW_FLAG_POS_LOCKED | ICNVIEW_FLAG_POS_MOVED)) { SvxIconChoiceCtrlEntry_Impl* pE = new SvxIconChoiceCtrlEntry_Impl( @@ -4197,7 +4204,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod } for( nCur = 0; nCur < nCount; nCur++ ) delete (SvxIconChoiceCtrlEntry_Impl*)aMovedEntries.GetObject( nCur ); - if( aEntries.Count() ) + if( aEntries.size() ) aAutoArrangeTimer.Start(); } else if( ePositionMode == IcnViewPositionModeAutoAdjust ) @@ -4267,7 +4274,7 @@ sal_Bool SvxIconChoiceCtrl_Impl::GetEntryPredecessor( SvxIconChoiceCtrlEntry* pE if( pEntry == pHead ) { - SvxIconChoiceCtrlEntry* pFirst = (SvxIconChoiceCtrlEntry*)aEntries.GetObject(0); + SvxIconChoiceCtrlEntry* pFirst = aEntries[ 0 ]; if( pFirst != pEntry ) return sal_True; return sal_False; @@ -4286,13 +4293,13 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos )); Point aNewPos( aCenterRect.Center() ); sal_uLong nGrid = GetPredecessorGrid( aNewPos ); - sal_uLong nCount = aEntries.Count(); + size_t nCount = aEntries.size(); if( nGrid == ULONG_MAX ) return 0; if( nGrid >= nCount ) nGrid = nCount - 1; if( !pHead ) - return (SvxIconChoiceCtrlEntry*)aEntries.GetObject( nGrid ); + return aEntries[ nGrid ]; SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 // todo: Liste von hinten aufrollen wenn nGrid > nCount/2 diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index d21ff9139a49..1b0575fbd9bd 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -85,10 +85,10 @@ void IcnCursor_Impl::ImplCreate() pColumns = new SvPtrarr[ nCols ]; pRows = new SvPtrarr[ nRows ]; - sal_uLong nCount = pView->aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = pView->aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = pView->aEntries[ nCur ]; // const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); Rectangle rRect( pView->CalcBmpRect( pEntry,0 ) ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / nDeltaHeight ); @@ -357,8 +357,8 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS if( bDown ) { nNewPos += nEntriesInView; - if( nNewPos >= (long)pView->aEntries.Count() ) - nNewPos = pView->aEntries.Count() - 1; + if( nNewPos >= (long)pView->aEntries.size() ) + nNewPos = pView->aEntries.size() - 1; } else { @@ -367,7 +367,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS nNewPos = 0; } if( nPos != nNewPos ) - return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( (sal_uLong)nNewPos ); + return pView->aEntries[ (size_t)nNewPos ]; return 0; } long nOpt = pView->GetEntryBoundRect( pStart ).Top(); @@ -410,10 +410,10 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlE if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) ) { sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry ); - if( bDown && nPos < (pView->aEntries.Count() - 1) ) - return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos + 1 ); + if( bDown && nPos < (pView->aEntries.size() - 1) ) + return pView->aEntries[ nPos + 1 ]; else if( !bDown && nPos > 0 ) - return (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nPos - 1 ); + return pView->aEntries[ nPos - 1 ]; return 0; } @@ -504,10 +504,10 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, nCurList ); } - const sal_uLong nCount = pView->aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + const size_t nCount = pView->aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = pView->aEntries[ nCur ]; const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); @@ -523,10 +523,10 @@ void IcnCursor_Impl::CreateGridAjustData( SvPtrarr& rLists, SvxIconChoiceCtrlEnt short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY ); SvPtrarr* pRow = new SvPtrarr; rLists.Insert( (void*)pRow, 0 ); - sal_uLong nCount = pView->aEntries.Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + size_t nCount = pView->aEntries.size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pView->aEntries.GetObject( nCur ); + SvxIconChoiceCtrlEntry* pEntry = pView->aEntries[ nCur ]; Rectangle rRect( pView->CalcBmpRect(pEntry) ); //const Rectangle& rRect = pView->GetEntryBoundRect( pEntry ); short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); @@ -601,9 +601,9 @@ void IcnGridMap_Impl::Create_Impl() _pGridMap = new sal_Bool[ _nGridRows * _nGridCols]; memset( (void*)_pGridMap, 0, _nGridRows * _nGridCols ); - const sal_uLong nCount = _pView->aEntries.Count(); - for( sal_uLong nCur=0; nCur < nCount; nCur++ ) - OccupyGrids( (SvxIconChoiceCtrlEntry*)_pView->aEntries.GetObject( nCur )); + const size_t nCount = _pView->aEntries.size(); + for( size_t nCur=0; nCur < nCount; nCur++ ) + OccupyGrids( _pView->aEntries[ nCur ] ); } void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const -- cgit v1.2.3 From 4b282f0eb8e5fa37f23ce3e4cbc5b349aea93925 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 16:00:42 +0300 Subject: Use gb_Library_win32_OLDNAMES No need for the OLDNAMESLIB, we already had gb_Library_win32_OLDNAMES for this purpose. --- vcl/Library_vcl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 044b067624f5..bf0d1a096ca8 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -571,7 +571,7 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ mpr \ msimg32 \ msvcrt \ - $(OLDNAMESLIB) \ + $(gb_Library_win32_OLDNAMES) \ ole32 \ shell32 \ user32 \ -- cgit v1.2.3 From 48aa50e1fa9b9c4e819aeaf77c098da52d457ec1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 16:05:19 +0300 Subject: Just using CAIRO_LIBS in ldflags is not enough --- vcl/Library_vcl.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index bf0d1a096ca8..19c1c9e7fcf6 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -490,10 +490,24 @@ $(eval $(call gb_Library_set_cxxflags,vcl,\ $$(CAIRO_CFLAGS) \ -DSYSTEM_CAIRO \ )) + +# CAIRO_LIBS contains both -L and -l options. Thes sets LDFLAGS which +# goes early into the linking command line before the object files. So +# on platforms where libraries are searched for symbols undefined at +# that point as they occur on the command line, it is pointless to +# search the cairo library at that point as no references to cairo +# entries have been read from object files yet. $(eval $(call gb_Library_set_ldflags,vcl,\ $$(LDFLAGS) \ $$(CAIRO_LIBS) \ )) + +# Thus we also need to add cairo to the list of linked libs. These go +# after the object files on the linking command line. +$(eval $(call gb_Library_add_linked_libs,vcl,\ + cairo \ +)) + else $(eval $(call gb_Library_add_linked_libs,vcl,\ cairo \ -- cgit v1.2.3 From 4e7a52e48b746d83cef31d79d4be9cd6d3acd660 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 15 Jul 2011 16:00:21 +0200 Subject: fix uninitialized member --- vcl/source/gdi/gdimtf.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 984386028cdc..30740176d676 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -254,6 +254,7 @@ size_t ImpLabelList::ImplGetLabelPos( const String& rLabelName ) // --------------- GDIMetaFile::GDIMetaFile() : + nCurrentActionElement( 0 ), aPrefSize ( 1, 1 ), pPrev ( NULL ), pNext ( NULL ), -- cgit v1.2.3 From 380971f0789084417470edc5ff1a2ced3e1a53f0 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 17:53:03 +0300 Subject: Adapt for windres, use the actual lower-case file names --- vcl/win/source/src/salsrc.rc | 167 ++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/vcl/win/source/src/salsrc.rc b/vcl/win/source/src/salsrc.rc index 11b967ff475b..147b80fc3e8c 100644 --- a/vcl/win/source/src/salsrc.rc +++ b/vcl/win/source/src/salsrc.rc @@ -1,3 +1,4 @@ +/* -*- Mode: Fundamental; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,94 +29,94 @@ // for WINVER #include -#ifndef _SV_SALIDS_HRC #include -#endif -SAL_RESID_POINTER_NULL CURSOR NULLPTR.CUR +SAL_RESID_POINTER_NULL CURSOR nullptr.cur #if ( WINVER < 0x0400 ) -SAL_RESID_POINTER_HELP CURSOR HELP.CUR +SAL_RESID_POINTER_HELP CURSOR help.cur #endif #ifndef WNT -SAL_RESID_POINTER_HSIZE CURSOR HSIZE.CUR -SAL_RESID_POINTER_VSIZE CURSOR VSIZE.CUR -SAL_RESID_POINTER_NESWSIZE CURSOR NESWSIZE.CUR -SAL_RESID_POINTER_NWSESIZE CURSOR NWSESIZE.CUR +SAL_RESID_POINTER_HSIZE CURSOR hsize.cur +SAL_RESID_POINTER_VSIZE CURSOR vsize.cur +SAL_RESID_POINTER_NESWSIZE CURSOR neswsize.cur +SAL_RESID_POINTER_NWSESIZE CURSOR nwsesize.cur #endif -SAL_RESID_POINTER_CROSS CURSOR CROSS.CUR -SAL_RESID_POINTER_MOVE CURSOR MOVE.CUR -SAL_RESID_POINTER_HSPLIT CURSOR HSPLIT.CUR -SAL_RESID_POINTER_VSPLIT CURSOR VSPLIT.CUR -SAL_RESID_POINTER_HSIZEBAR CURSOR HSIZEBAR.CUR -SAL_RESID_POINTER_VSIZEBAR CURSOR VSIZEBAR.CUR -SAL_RESID_POINTER_HAND CURSOR HAND.CUR -SAL_RESID_POINTER_REFHAND CURSOR REFHAND.CUR -SAL_RESID_POINTER_PEN CURSOR PEN.CUR -SAL_RESID_POINTER_MAGNIFY CURSOR MAGNIFY.CUR -SAL_RESID_POINTER_FILL CURSOR FILL.CUR -SAL_RESID_POINTER_ROTATE CURSOR ROTATE.CUR -SAL_RESID_POINTER_HSHEAR CURSOR HSHEAR.CUR -SAL_RESID_POINTER_VSHEAR CURSOR VSHEAR.CUR -SAL_RESID_POINTER_MIRROR CURSOR MIRROR.CUR -SAL_RESID_POINTER_CROOK CURSOR CROOK.CUR -SAL_RESID_POINTER_CROP CURSOR CROP.CUR -SAL_RESID_POINTER_MOVEPOINT CURSOR MOVEPT.CUR -SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR MOVEBW.CUR -SAL_RESID_POINTER_MOVEDATA CURSOR MOVEDATA.CUR -SAL_RESID_POINTER_COPYDATA CURSOR COPYDATA.CUR -SAL_RESID_POINTER_LINKDATA CURSOR LINKDATA.CUR -SAL_RESID_POINTER_MOVEDATALINK CURSOR MOVEDLNK.CUR -SAL_RESID_POINTER_COPYDATALINK CURSOR COPYDLNK.CUR -SAL_RESID_POINTER_MOVEFILE CURSOR MOVEF.CUR -SAL_RESID_POINTER_COPYFILE CURSOR COPYF.CUR -SAL_RESID_POINTER_LINKFILE CURSOR LINKF.CUR -SAL_RESID_POINTER_MOVEFILELINK CURSOR MOVEFLNK.CUR -SAL_RESID_POINTER_COPYFILELINK CURSOR COPYFLNK.CUR -SAL_RESID_POINTER_MOVEFILES CURSOR MOVEF2.CUR -SAL_RESID_POINTER_COPYFILES CURSOR COPYF2.CUR -SAL_RESID_POINTER_NOTALLOWED CURSOR NOTALLOW.CUR -SAL_RESID_POINTER_DRAW_LINE CURSOR DLINE.CUR -SAL_RESID_POINTER_DRAW_RECT CURSOR DRECT.CUR -SAL_RESID_POINTER_DRAW_POLYGON CURSOR DPOLYGON.CUR -SAL_RESID_POINTER_DRAW_BEZIER CURSOR DBEZIER.CUR -SAL_RESID_POINTER_DRAW_ARC CURSOR DARC.CUR -SAL_RESID_POINTER_DRAW_PIE CURSOR DPIE.CUR -SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR DCIRCCUT.CUR -SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR DELLIPSE.CUR -SAL_RESID_POINTER_DRAW_FREEHAND CURSOR DFREE.CUR -SAL_RESID_POINTER_DRAW_CONNECT CURSOR DCONNECT.CUR -SAL_RESID_POINTER_DRAW_TEXT CURSOR DTEXT.CUR -SAL_RESID_POINTER_DRAW_CAPTION CURSOR DCAPT.CUR -SAL_RESID_POINTER_CHART CURSOR CHART.CUR -SAL_RESID_POINTER_DETECTIVE CURSOR DETECTIV.CUR -SAL_RESID_POINTER_PIVOT_COL CURSOR PIVOTCOL.CUR -SAL_RESID_POINTER_PIVOT_ROW CURSOR PIVOTROW.CUR -SAL_RESID_POINTER_PIVOT_FIELD CURSOR PIVOTFLD.CUR -SAL_RESID_POINTER_PIVOT_DELETE CURSOR PIVOTDEL.CUR -SAL_RESID_POINTER_CHAIN CURSOR CHAIN.CUR -SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR CHAINNOT.CUR -SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR TIMEMOVE.CUR -SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR TIMESIZE.CUR -SAL_RESID_POINTER_AUTOSCROLL_N CURSOR ASN.CUR -SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ASS.CUR -SAL_RESID_POINTER_AUTOSCROLL_W CURSOR ASW.CUR -SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ASE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR ASNW.CUR -SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR ASNE.CUR -SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR ASSW.CUR -SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR ASSE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR ASNS.CUR -SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR ASWE.CUR -SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR ASNSWE.CUR -SAL_RESID_POINTER_AIRBRUSH CURSOR AIRBRUSH.CUR -SAL_RESID_POINTER_TEXT_VERTICAL CURSOR VTEXT.CUR -SAL_RESID_POINTER_TAB_SELECT_S CURSOR TBLSELS.CUR -SAL_RESID_POINTER_TAB_SELECT_E CURSOR TBLSELE.CUR -SAL_RESID_POINTER_TAB_SELECT_SE CURSOR TBLSELSE.CUR -SAL_RESID_POINTER_TAB_SELECT_W CURSOR TBLSELW.CUR -SAL_RESID_POINTER_TAB_SELECT_SW CURSOR TBLSELSW.CUR -SAL_RESID_POINTER_PAINTBRUSH CURSOR PNTBRSH.CUR +SAL_RESID_POINTER_CROSS CURSOR cross.cur +SAL_RESID_POINTER_MOVE CURSOR move.cur +SAL_RESID_POINTER_HSPLIT CURSOR hsplit.cur +SAL_RESID_POINTER_VSPLIT CURSOR vsplit.cur +SAL_RESID_POINTER_HSIZEBAR CURSOR hsizebar.cur +SAL_RESID_POINTER_VSIZEBAR CURSOR vsizebar.cur +SAL_RESID_POINTER_HAND CURSOR hand.cur +SAL_RESID_POINTER_REFHAND CURSOR refhand.cur +SAL_RESID_POINTER_PEN CURSOR pen.cur +SAL_RESID_POINTER_MAGNIFY CURSOR magnify.cur +SAL_RESID_POINTER_FILL CURSOR fill.cur +SAL_RESID_POINTER_ROTATE CURSOR rotate.cur +SAL_RESID_POINTER_HSHEAR CURSOR hshear.cur +SAL_RESID_POINTER_VSHEAR CURSOR vshear.cur +SAL_RESID_POINTER_MIRROR CURSOR mirror.cur +SAL_RESID_POINTER_CROOK CURSOR crook.cur +SAL_RESID_POINTER_CROP CURSOR crop.cur +SAL_RESID_POINTER_MOVEPOINT CURSOR movept.cur +SAL_RESID_POINTER_MOVEBEZIERWEIGHT CURSOR movebw.cur +SAL_RESID_POINTER_MOVEDATA CURSOR movedata.cur +SAL_RESID_POINTER_COPYDATA CURSOR copydata.cur +SAL_RESID_POINTER_LINKDATA CURSOR linkdata.cur +SAL_RESID_POINTER_MOVEDATALINK CURSOR movedlnk.cur +SAL_RESID_POINTER_COPYDATALINK CURSOR copydlnk.cur +SAL_RESID_POINTER_MOVEFILE CURSOR movef.cur +SAL_RESID_POINTER_COPYFILE CURSOR copyf.cur +SAL_RESID_POINTER_LINKFILE CURSOR linkf.cur +SAL_RESID_POINTER_MOVEFILELINK CURSOR moveflnk.cur +SAL_RESID_POINTER_COPYFILELINK CURSOR copyflnk.cur +SAL_RESID_POINTER_MOVEFILES CURSOR movef2.cur +SAL_RESID_POINTER_COPYFILES CURSOR copyf2.cur +SAL_RESID_POINTER_NOTALLOWED CURSOR notallow.cur +SAL_RESID_POINTER_DRAW_LINE CURSOR dline.cur +SAL_RESID_POINTER_DRAW_RECT CURSOR drect.cur +SAL_RESID_POINTER_DRAW_POLYGON CURSOR dpolygon.cur +SAL_RESID_POINTER_DRAW_BEZIER CURSOR dbezier.cur +SAL_RESID_POINTER_DRAW_ARC CURSOR darc.cur +SAL_RESID_POINTER_DRAW_PIE CURSOR dpie.cur +SAL_RESID_POINTER_DRAW_CIRCLECUT CURSOR dcirccut.cur +SAL_RESID_POINTER_DRAW_ELLIPSE CURSOR dellipse.cur +SAL_RESID_POINTER_DRAW_FREEHAND CURSOR dfree.cur +SAL_RESID_POINTER_DRAW_CONNECT CURSOR dconnect.cur +SAL_RESID_POINTER_DRAW_TEXT CURSOR dtext.cur +SAL_RESID_POINTER_DRAW_CAPTION CURSOR dcapt.cur +SAL_RESID_POINTER_CHART CURSOR chart.cur +SAL_RESID_POINTER_DETECTIVE CURSOR detectiv.cur +SAL_RESID_POINTER_PIVOT_COL CURSOR pivotcol.cur +SAL_RESID_POINTER_PIVOT_ROW CURSOR pivotrow.cur +SAL_RESID_POINTER_PIVOT_FIELD CURSOR pivotfld.cur +SAL_RESID_POINTER_PIVOT_DELETE CURSOR pivotdel.cur +SAL_RESID_POINTER_CHAIN CURSOR chain.cur +SAL_RESID_POINTER_CHAIN_NOTALLOWED CURSOR chainnot.cur +SAL_RESID_POINTER_TIMEEVENT_MOVE CURSOR timemove.cur +SAL_RESID_POINTER_TIMEEVENT_SIZE CURSOR timesize.cur +SAL_RESID_POINTER_AUTOSCROLL_N CURSOR asn.cur +SAL_RESID_POINTER_AUTOSCROLL_S CURSOR ass.cur +SAL_RESID_POINTER_AUTOSCROLL_W CURSOR asw.cur +SAL_RESID_POINTER_AUTOSCROLL_E CURSOR ase.cur +SAL_RESID_POINTER_AUTOSCROLL_NW CURSOR asnw.cur +SAL_RESID_POINTER_AUTOSCROLL_NE CURSOR asne.cur +SAL_RESID_POINTER_AUTOSCROLL_SW CURSOR assw.cur +SAL_RESID_POINTER_AUTOSCROLL_SE CURSOR asse.cur +SAL_RESID_POINTER_AUTOSCROLL_NS CURSOR asns.cur +SAL_RESID_POINTER_AUTOSCROLL_WE CURSOR aswe.cur +SAL_RESID_POINTER_AUTOSCROLL_NSWE CURSOR asnswe.cur +SAL_RESID_POINTER_AIRBRUSH CURSOR airbrush.cur +SAL_RESID_POINTER_TEXT_VERTICAL CURSOR vtext.cur +SAL_RESID_POINTER_TAB_SELECT_S CURSOR tblsels.cur +SAL_RESID_POINTER_TAB_SELECT_E CURSOR tblsele.cur +SAL_RESID_POINTER_TAB_SELECT_SE CURSOR tblselse.cur +SAL_RESID_POINTER_TAB_SELECT_W CURSOR tblselw.cur +SAL_RESID_POINTER_TAB_SELECT_SW CURSOR tblselsw.cur +SAL_RESID_POINTER_PAINTBRUSH CURSOR pntbrsh.cur + +SAL_RESID_BITMAP_50 BITMAP "50.bmp" -SAL_RESID_BITMAP_50 BITMAP 50.BMP +SAL_RESID_ICON_DEFAULT ICON sd.ico -SAL_RESID_ICON_DEFAULT ICON SD.ICO +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From 602cbe4d175a264186504786cfbfb3ed3cf77be9 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sun, 17 Jul 2011 06:44:39 -0700 Subject: Fix type missmatch in SvxIconChoiceCtrl_Impl. Sorry about that. My compiler (gcc 4.0) doesn't notice on a 32bit build. Thanks go to Maciej Rumianowski for pointing this out. --- svtools/source/contnr/imivctl.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index ced1856eeceb..5dc71796a392 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -351,7 +351,7 @@ public: void Clear( sal_Bool bInCtor = sal_False ); void SetStyle( WinBits nWinStyle ); WinBits GetStyle() const { return nWinBits; } - void InsertEntry( SvxIconChoiceCtrlEntry*, sal_uLong nPos, const Point* pPos=0 ); + void InsertEntry( SvxIconChoiceCtrlEntry*, size_t nPos, const Point* pPos=0 ); void CreateAutoMnemonics( MnemonicGenerator* _pGenerator = NULL ); void RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ); void FontModified(); -- cgit v1.2.3 From f0c04d9bf3e8e4f3d2ab63f81355375a4331595a Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 17 Jul 2011 16:13:06 +0200 Subject: Some fixes for compilation --- svtools/source/contnr/imivctl1.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index df9b81dab0c7..a3b73c4508df 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -440,7 +440,7 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) pZOrderList->Remove( nPos ); if( bCurEntryPosValid ) { - DBG_ASSERT(aEntries.GetObject(pEntry->nPos)==pEntry,"RemoveEntry: Wrong nPos in entry"); + DBG_ASSERT(aEntries[pEntry->nPos]==pEntry,"RemoveEntry: Wrong nPos in entry"); aEntries.remove( pEntry->nPos ); } else @@ -4136,7 +4136,7 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) _pOwner->pHead = pEntry->pflink; else { - DBG_ASSERT(!Count(),"EntryList_Impl::Remove > Invalid predecessor" ); + DBG_ASSERT(size() > 0,"EntryList_Impl::Remove > Invalid predecessor" ); _pOwner->pHead = 0; } } -- cgit v1.2.3 From d4908036350fc1f581ae03674c330a2411ea32b1 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 17 Jul 2011 23:23:55 +0200 Subject: An error in my previous fix --- svtools/source/contnr/imivctl1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index a3b73c4508df..be1576c8c55c 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -4136,7 +4136,7 @@ void EntryList_Impl::Removed_Impl( SvxIconChoiceCtrlEntry* pEntry ) _pOwner->pHead = pEntry->pflink; else { - DBG_ASSERT(size() > 0,"EntryList_Impl::Remove > Invalid predecessor" ); + DBG_ASSERT(!size(),"EntryList_Impl::Remove > Invalid predecessor" ); _pOwner->pHead = 0; } } -- cgit v1.2.3 From c4da6f3c9af37f70026614e6f18bd273023caa11 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 18 Jul 2011 00:43:43 +0200 Subject: Some cppcheck cleaning --- vcl/source/fontsubset/gsub.cxx | 4 ++-- vcl/source/window/menu.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index da0d84cec089..7dcdc42e88f4 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -162,7 +162,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, } } - if( !aFeatureIndexList.size() ) + if( aFeatureIndexList.empty() ) return true; UshortList aLookupIndexList; @@ -318,7 +318,7 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, } // now apply the glyph substitutions that have been collected in this subtable - if( aSubstVector.size() > 0 ) + if( !aSubstVector.empty() ) { GlyphSubstitution* pGSubstitution = new GlyphSubstitution; pTTFile->pGSubstitution = (void*)pGSubstitution; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index d4e16ed6c121..9e47d34716cb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -156,7 +156,7 @@ struct MenuItemData pSalMenuItem ( NULL ) {} ~MenuItemData(); - bool HasCheck() + bool HasCheck() const { return bChecked || ( nBits & ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) ); } -- cgit v1.2.3 From 7cc4502556b94a3ad3eb486ad176c8291c9c8615 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Mon, 18 Jul 2011 10:34:05 +0900 Subject: fix code pointer in comment --- i18npool/inc/i18npool/lang.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From ea8a56a59310d39fe912661dfa9ceaee1cc3de79 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 18 Jul 2011 11:09:12 +0100 Subject: add new InsertAutomaticEntryColor method --- svtools/inc/svtools/ctrlbox.hxx | 3 ++- svtools/source/control/ctrlbox.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx index 56c69e0d078b..d346b3b6af85 100644 --- a/svtools/inc/svtools/ctrlbox.hxx +++ b/svtools/inc/svtools/ctrlbox.hxx @@ -190,7 +190,8 @@ public: sal_uInt16 nPos = LISTBOX_APPEND ); virtual sal_uInt16 InsertEntry( const Color& rColor, const XubString& rStr, sal_uInt16 nPos = LISTBOX_APPEND ); - void InsertAutomaticEntry(); + void InsertAutomaticEntryColor(const Color &rAutoColorValue); + bool IsAutomaticSelected() { return !GetSelectEntryPos(); } using ListBox::RemoveEntry; virtual void RemoveEntry( sal_uInt16 nPos ); virtual void Clear(); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 14dae85f4ee8..e185705806be 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -180,10 +180,10 @@ sal_uInt16 ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr // ----------------------------------------------------------------------- -void ColorListBox::InsertAutomaticEntry() +void ColorListBox::InsertAutomaticEntryColor(const Color &rColor) { // insert the "Automatic"-entry always on the first position - InsertEntry( Color( COL_AUTO ), SvtResId( STR_SVT_AUTOMATIC_COLOR ), 0 ); + InsertEntry( rColor, SvtResId( STR_SVT_AUTOMATIC_COLOR ), 0 ); } // ----------------------------------------------------------------------- -- cgit v1.2.3 From c2a850fcfa25229514daaa294cc06c67300f49a8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Jul 2011 22:06:47 +0100 Subject: callcatcher: remove unused methods --- l10ntools/inc/export.hxx | 1 - l10ntools/inc/l10ntools/file.hxx | 1 - l10ntools/source/file.cxx | 5 -- l10ntools/source/localize.cxx | 144 --------------------------------------- l10ntools/source/merge.cxx | 8 --- 5 files changed, 159 deletions(-) diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index bf3308b85215..c33960fa8468 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -480,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 ); 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/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/localize.cxx b/l10ntools/source/localize.cxx index 5af7bfcb5c18..9cacee6bebd6 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -204,12 +204,6 @@ private: const ByteString &rCollectMode ); void WorkOnDirectory( const ByteString &rDirectory ); - 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(); @@ -561,144 +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; -} - } using namespace transex3; diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 584a84bbbf56..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 ); -- cgit v1.2.3 From 8104b3710e4942881d1e1e9969a28d5fd556521c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 14 Jul 2011 22:07:32 +0100 Subject: callcatcher: remove unused methods --- svl/inc/svl/urihelper.hxx | 26 -------------- svl/source/misc/urihelper.cxx | 61 --------------------------------- svtools/inc/svtools/syntaxhighlight.hxx | 8 ----- svtools/source/edit/syntaxhighlight.cxx | 35 ------------------- vcl/inc/vcl/window.hxx | 1 - vcl/source/window/window2.cxx | 5 --- 6 files changed, 136 deletions(-) diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 67326861642c..61be9f6c831d 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx @@ -177,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/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 3f46d8ab9f5b..1bef290f3dfd 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -865,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/svtools/inc/svtools/syntaxhighlight.hxx b/svtools/inc/svtools/syntaxhighlight.hxx index a9a0c5a2da58..f4bcca15a68d 100644 --- a/svtools/inc/svtools/syntaxhighlight.hxx +++ b/svtools/inc/svtools/syntaxhighlight.hxx @@ -129,14 +129,6 @@ class SimpleTokenizer_Impl sal_Bool getNextToken( /*out*/TokenTypes& reType, /*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos ); - String getTokStr( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ); - -#ifdef DBG_UTIL - // TEST: Token ausgeben - String getFullTokenStr( /*out*/TokenTypes eType, - /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ); -#endif - const char** ppListKeyWords; sal_uInt16 nKeyWordCount; diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx index 6ccaa07453d8..df9c9d1acea9 100644 --- a/svtools/source/edit/syntaxhighlight.cxx +++ b/svtools/source/edit/syntaxhighlight.cxx @@ -675,41 +675,6 @@ sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, return sal_True; } -String SimpleTokenizer_Impl::getTokStr - ( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) -{ - return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); -} - -#ifdef DBG_UTIL -// TEST: Token ausgeben -String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType, - /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos ) -{ - String aOut; - switch( eType ) - { - case TT_UNKNOWN: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_UNKNOWN:") ); break; - case TT_IDENTIFIER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_IDENTIFIER:") ); break; - case TT_WHITESPACE: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_WHITESPACE:") ); break; - case TT_NUMBER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_NUMBER:") ); break; - case TT_STRING: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_STRING:") ); break; - case TT_EOL: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_EOL:") ); break; - case TT_COMMENT: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_COMMENT:") ); break; - case TT_ERROR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_ERROR:") ); break; - case TT_OPERATOR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_OPERATOR:") ); break; - case TT_KEYWORDS: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_KEYWORD:") ); break; - case TT_PARAMETER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_PARAMETER:") ); break; - } - if( eType != TT_EOL ) - { - aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) ); - } - aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") ); - return aOut; -} -#endif - SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLanguage(aLang) { memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index df82b7870854..8cc7bfd0894f 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -914,7 +914,6 @@ public: void SetFakeFocus( bool bFocus ); sal_Bool IsCompoundControl() const; - sal_Bool HasCompoundControlFocus() const; static sal_uIntPtr SaveFocus(); static sal_Bool EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore = sal_True ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index bf81d2665f48..a2dd24378e37 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1759,11 +1759,6 @@ sal_Bool Window::IsCompoundControl() const return mpWindowImpl->mbCompoundControl; } -sal_Bool Window::HasCompoundControlFocus() const -{ - return mpWindowImpl->mbCompoundControlHasFocus; -} - sal_Bool Window::IsChildPointerOverwrite() const { return mpWindowImpl->mbChildPtrOverwrite; -- cgit v1.2.3 From e689ed9b937213225f9d8c7f57d324041eff7f4b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 Jul 2011 22:18:44 +0100 Subject: callcatcher: unused methods --- tools/inc/tools/inetmime.hxx | 3 --- tools/inc/tools/inetmsg.hxx | 1 - tools/source/inet/inetmime.cxx | 17 ----------------- tools/source/inet/inetmsg.cxx | 8 -------- vcl/inc/vcl/print.hxx | 1 - vcl/source/gdi/print.cxx | 10 ---------- vcl/source/window/toolbox.cxx | 25 ------------------------- 7 files changed, 65 deletions(-) diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index 059c34a9515a..cf8f8173cac7 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -533,9 +533,6 @@ public: static void writeUTF8(INetMIMEOutputSink & rSink, sal_uInt32 nChar); - static void writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, - int nMinDigits = 1); - static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, HeaderFieldType eType, const UniString & rBody, diff --git a/tools/inc/tools/inetmsg.hxx b/tools/inc/tools/inetmsg.hxx index cf96dc98d5be..b06541a8323d 100644 --- a/tools/inc/tools/inetmsg.hxx +++ b/tools/inc/tools/inetmsg.hxx @@ -482,7 +482,6 @@ public: return GetHeaderValue (m_nIndex[INETMSG_MIME_VERSION]); } - void SetContentDescription (const UniString& rDescription); UniString GetContentDescription (void) const { return GetHeaderValue (m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]); diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 1db41b4d73ba..2442b768e426 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -1956,23 +1956,6 @@ void INetMIME::writeUTF8(INetMIMEOutputSink & rSink, sal_uInt32 nChar) << sal_Char((nChar & 0x3F) | 0x80); } -//============================================================================ -// static -void INetMIME::writeUnsigned(INetMIMEOutputSink & rSink, sal_uInt32 nValue, - int nMinDigits) -{ - sal_Char aBuffer[10]; - // max unsigned 32 bit value (4294967295) has 10 places - sal_Char * p = aBuffer; - for (; nValue > 0; nValue /= 10) - *p++ = sal_Char(getDigit(nValue % 10)); - nMinDigits -= p - aBuffer; - while (nMinDigits-- > 0) - rSink << '0'; - while (p != aBuffer) - rSink << *--p; -} - //============================================================================ // static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index aa6a00313352..1645e9ba7aea 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -1005,14 +1005,6 @@ void INetMIMEMessage::SetMIMEVersion (const UniString& rVersion) m_nIndex[INETMSG_MIME_VERSION]); } -void INetMIMEMessage::SetContentDescription (const String& rDescription) -{ - SetHeaderField_Impl ( - INetMIME::HEADER_FIELD_TEXT, - MIMEHDR(INETMSG_MIME_CONTENT_DESCRIPTION), rDescription, - m_nIndex[INETMSG_MIME_CONTENT_DESCRIPTION]); -} - void INetMIMEMessage::SetContentDisposition (const String& rDisposition) { SetHeaderField_Impl ( diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index 3d266160b3e2..120198328e49 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -265,7 +265,6 @@ private: SAL_DLLPRIVATE void ImplUpdatePageData(); SAL_DLLPRIVATE void ImplUpdateFontList(); SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest ); - DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* ); SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr& ); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index ef3c68ec5355..440da9c5bb56 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1440,16 +1440,6 @@ sal_uLong Printer::ImplSalPrinterErrorCodeToVCL( sal_uLong nError ) // ----------------------------------------------------------------------- -IMPL_LINK( Printer, ImplDestroyPrinterAsync, void*, pSalPrinter ) -{ - SalPrinter* pPrinter = (SalPrinter*)pSalPrinter; - ImplSVData* pSVData = ImplGetSVData(); - pSVData->mpDefInst->DestroyPrinter( pPrinter ); - return 0; -} - -// ----------------------------------------------------------------------- - sal_Bool Printer::EndJob() { sal_Bool bRet = sal_False; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 0304033d03f9..288cbe103afe 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -194,8 +194,6 @@ public: void UpdateDragRect(); DECL_LINK( SelectHdl, Accelerator* ); - void StartCustomizeMode(); - void EndCustomizeMode(); sal_Bool IsCustomizeMode() { return mbCustomizeMode; } sal_Bool IsResizeMode() { return mbResizeMode; } }; @@ -1503,29 +1501,6 @@ IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel ) // ----------------------------------------------------------------------- -void ImplTBDragMgr::StartCustomizeMode() -{ - mbCustomizeMode = sal_True; - - for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { - (*mpBoxList)[ i ]->ImplStartCustomizeMode(); - } -} - -// ----------------------------------------------------------------------- - -void ImplTBDragMgr::EndCustomizeMode() -{ - mbCustomizeMode = sal_False; - - for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { - (*mpBoxList)[ i ]->ImplEndCustomizeMode(); - } -} - -// ----------------------------------------------------------------------- - - static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect, sal_uInt16 nStyle ) { -- cgit v1.2.3 From 5f2acb17260ee3c874412ba79bc966292100bccc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 16 Jul 2011 22:15:49 +0100 Subject: add a SvStream::remainingSize --- tools/inc/tools/stream.hxx | 2 ++ tools/source/stream/stream.cxx | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 71cae4e0e3f2..dc097b8c563f 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -390,6 +390,8 @@ public: sal_Size Seek( sal_Size nPos ); sal_Size SeekRel( sal_sSize nPos ); sal_Size Tell() const { return nBufFilePos+nBufActualPos; } + //length between current (Tell()) pos and end of stream + sal_Size remainingSize(); void Flush(); sal_Bool IsEof() const { return bIsEof; } // next Tell() <= nSize diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 242f9bb04dc1..2917776e6212 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1797,6 +1797,18 @@ sal_Size SvStream::Seek( sal_Size nFilePos ) return nBufFilePos + nBufActualPos; } +//probably not as inefficient as it looks seeing as STREAM_SEEK_TO_END in the +//Seek backends is nomally special cased feel free to make this virtual and add +//good implementations for SvFileStream etc +sal_Size SvStream::remainingSize() +{ + sal_Size nCurr = Tell(); + sal_Size nEnd = Seek(STREAM_SEEK_TO_END); + sal_Size nMaxAvailable = nEnd-nCurr; + Seek(nCurr); + return nMaxAvailable; +} + /************************************************************************* |* |* Stream::Flush() -- cgit v1.2.3 From 03ea8631d3b468965ff514d0293d7e2c72442413 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 17 Jul 2011 22:27:38 +0100 Subject: callcatcher: remove unused getTunnelIdentifier --- vcl/inc/vcl/canvastools.hxx | 5 ----- vcl/source/helper/canvastools.cxx | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/vcl/inc/vcl/canvastools.hxx b/vcl/inc/vcl/canvastools.hxx index e82d397a92f0..ce6c7bcafe68 100644 --- a/vcl/inc/vcl/canvastools.hxx +++ b/vcl/inc/vcl/canvastools.hxx @@ -144,11 +144,6 @@ namespace vcl ::BitmapEx VCL_DLLPUBLIC bitmapExFromXBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XIntegerReadOnlyBitmap >& xInputBitmap ); - /** get a unique identifier for identification in XUnoTunnel interface - */ - enum TunnelIdentifierType { Id_BitmapEx = 0 }; - const com::sun::star::uno::Sequence< sal_Int8 > VCL_DLLPUBLIC getTunnelIdentifier( TunnelIdentifierType eType ); - // Color conversions (vcl/tools Color <-> canvas standard color space) // =================================================================== diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx index ac8e658f7bd8..7b152938744b 100644 --- a/vcl/source/helper/canvastools.cxx +++ b/vcl/source/helper/canvastools.cxx @@ -185,23 +185,6 @@ namespace vcl //--------------------------------------------------------------------------------------- - const uno::Sequence< sal_Int8 > getTunnelIdentifier( TunnelIdentifierType eType ) - { - static boost::unordered_map< int, uno::Sequence< sal_Int8 > > aIds; - boost::unordered_map< int, uno::Sequence< sal_Int8 > >::iterator it = - aIds.find( eType ); - if( it == aIds.end() ) - { - uno::Sequence< sal_Int8 > aNewId( 16 ); - rtl_createUuid( (sal_uInt8*)aNewId.getArray(), NULL, sal_True ); - aIds[ eType ] = aNewId; - it = aIds.find( eType ); - } - return it->second; - } - - //--------------------------------------------------------------------------------------- - namespace { inline bool operator==( const rendering::IntegerBitmapLayout& rLHS, -- cgit v1.2.3 From eba93f7545a7f8c4604ac83a1e4873cb97c90d7c Mon Sep 17 00:00:00 2001 From: Francois Tigeot Date: Mon, 18 Jul 2011 14:07:26 +0200 Subject: Remove an unused #define --- unotools/source/ucbhelper/xtempfile.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index bf4a88112929..55733702039c 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -37,10 +37,6 @@ namespace css = com::sun::star; -// copy define from desktop\source\app\appinit.cxx - -#define DESKTOP_TEMPNAMEBASE_DIR "/temp/soffice.tmp" - OTempFileService::OTempFileService(::css::uno::Reference< ::css::uno::XComponentContext > const & context) : ::cppu::PropertySetMixin< ::css::io::XTempFile >( context -- cgit v1.2.3 From 2274aae7558c69c93ab9d3decb1202caca52f6fc Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Sun, 17 Jul 2011 13:26:54 -0700 Subject: Replace List with SvxIconChoiceCtrlEntryList_impl --- svtools/inc/svtools/ivctrl.hxx | 2 - svtools/source/contnr/imivctl.hxx | 3 +- svtools/source/contnr/imivctl1.cxx | 162 +++++++++++++++++++------------------ svtools/source/contnr/ivctrl.cxx | 6 -- 4 files changed, 86 insertions(+), 87 deletions(-) diff --git a/svtools/inc/svtools/ivctrl.hxx b/svtools/inc/svtools/ivctrl.hxx index 13bf8bcdd24a..ba3daeed58f4 100644 --- a/svtools/inc/svtools/ivctrl.hxx +++ b/svtools/inc/svtools/ivctrl.hxx @@ -341,8 +341,6 @@ public: SvxIconChoiceCtrlEntry* GetEntry( const Point& rPosPixel, sal_Bool bHit = sal_False ) const; // Gibt den naechsten ueber pCurEntry liegenden Eintrag (ZOrder) SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const; - // Gibt den naechsten unter pCurEntry liegenden Eintrag (ZOrder) - SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rPosPixel, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const; // in dem sal_uLong wird die Position in der Liste des gefunden Eintrags zurueckgegeben SvxIconChoiceCtrlEntry* GetSelectedEntry( sal_uLong& rPos ) const; diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 5dc71796a392..18b34b780fde 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -195,7 +195,7 @@ class SvxIconChoiceCtrl_Impl IcnGridMap_Impl* pGridMap; long nMaxVirtWidth; // max. Breite aVirtOutputSize bei ALIGN_TOP long nMaxVirtHeight; // max. Hoehe aVirtOutputSize bei ALIGN_LEFT - List* pZOrderList; + SvxIconChoiceCtrlEntryList_impl* pZOrderList; SvPtrarr* pColumns; IcnViewEdit_Impl* pEdit; WinBits nWinBits; @@ -416,7 +416,6 @@ public: SvxIconChoiceCtrlEntry* GetEntry( const Point& rDocPos, sal_Bool bHit = sal_False ); SvxIconChoiceCtrlEntry* GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); - SvxIconChoiceCtrlEntry* GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ); Point GetEntryPos( SvxIconChoiceCtrlEntry* ); void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, sal_Bool bBound = sal_True ); diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index be1576c8c55c..8602fa4cacfd 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -103,8 +103,10 @@ public: sal_Bool IsGrabFocus() const { return bGrabFocus; } }; -SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, - WinBits nWinStyle ) : +SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( + SvtIconChoiceCtrl* pCurView, + WinBits nWinStyle +) : aEntries( this ), aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ), aHorSBar( pCurView, WB_DRAG | WB_HSCROLL ), @@ -129,7 +131,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pCurView, bHighlightFramePressed = sal_False; eSelectionMode = MULTIPLE_SELECTION; pView = pCurView; - pZOrderList = new List; //SvPtrarr; + pZOrderList = new SvxIconChoiceCtrlEntryList_impl(); ePositionMode = IcnViewPositionModeFree; SetStyle( nWinStyle ); nFlags = 0; @@ -218,7 +220,7 @@ void SvxIconChoiceCtrl_Impl::Clear( sal_Bool bInCtor ) nMaxVirtHeight = aSize.Height() - nHorSBarHeight; if( nMaxVirtHeight <= 0 ) nMaxVirtHeight = DEFAULT_MAX_VIRT_HEIGHT; - pZOrderList->Clear(); //Remove(0,pZOrderList->Count()); + pZOrderList->clear(); SetOrigin( Point() ); if( bUpdateMode ) pView->Invalidate(INVALIDATE_NOCHILDREN); @@ -302,7 +304,7 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t else nFlags &= ~F_ENTRYLISTPOS_VALID; - pZOrderList->Insert( (void*)pEntry, LIST_APPEND ); //pZOrderList->Count() ); + pZOrderList->push_back( pEntry ); pImpCursor->Clear(); if( pPos ) { @@ -436,11 +438,22 @@ void SvxIconChoiceCtrl_Impl::RemoveEntry( SvxIconChoiceCtrlEntry* pEntry ) sal_Bool bCurEntryPosValid = (nFlags & F_ENTRYLISTPOS_VALID) ? sal_True : sal_False; if( bCurEntryPosValid && aEntries[ aEntries.size()-1 ] != pEntry ) nFlags &= ~F_ENTRYLISTPOS_VALID; - sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry ); - pZOrderList->Remove( nPos ); + + for ( + SvxIconChoiceCtrlEntryList_impl::iterator it = pZOrderList->begin(); + it < pZOrderList->end(); + ++it + ) { + if ( *it == pEntry ) + { + pZOrderList->erase( it ); + break; + } + } + if( bCurEntryPosValid ) { - DBG_ASSERT(aEntries[pEntry->nPos]==pEntry,"RemoveEntry: Wrong nPos in entry"); + DBG_ASSERT(aEntries[ pEntry->nPos ] == pEntry,"RemoveEntry: Wrong nPos in entry"); aEntries.remove( pEntry->nPos ); } else @@ -773,7 +786,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) if ( pView->HasFocus() ) GetFocus(); - sal_uLong nCount = pZOrderList->Count(); + size_t nCount = pZOrderList->size(); if( !nCount ) return; @@ -785,35 +798,33 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) pView->SetClipRegion( aOutputArea ); } - const sal_uInt16 nListInitSize = aEntries.size() > USHRT_MAX ? - USHRT_MAX : (sal_uInt16)aEntries.size(); - List* pNewZOrderList = new List( nListInitSize ); - List* pPaintedEntries = new List( nListInitSize ); + SvxIconChoiceCtrlEntryList_impl* pNewZOrderList = new SvxIconChoiceCtrlEntryList_impl(); + SvxIconChoiceCtrlEntryList_impl* pPaintedEntries = new SvxIconChoiceCtrlEntryList_impl(); - sal_uLong nPos = 0; + size_t nPos = 0; while( nCount ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nPos ]; const Rectangle& rBoundRect = GetEntryBoundRect( pEntry ); if( rRect.IsOver( rBoundRect ) ) { PaintEntry( pEntry, rBoundRect.TopLeft(), pView, sal_True ); // Eintraege, die neu gezeichnet werden, auf Top setzen - pPaintedEntries->Insert( pEntry, LIST_APPEND ); + pPaintedEntries->push_back( pEntry ); } else - pNewZOrderList->Insert( pEntry, LIST_APPEND ); + pNewZOrderList->push_back( pEntry ); nCount--; nPos++; } delete pZOrderList; pZOrderList = pNewZOrderList; - nCount = pPaintedEntries->Count(); + nCount = pPaintedEntries->size(); if( nCount ) { - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) - pZOrderList->Insert( pPaintedEntries->GetObject(nCur), LIST_APPEND); + for( size_t nCur = 0; nCur < nCount; nCur++ ) + pZOrderList->push_back( (*pPaintedEntries)[ nCur ] ); } delete pPaintedEntries; @@ -823,7 +834,7 @@ void SvxIconChoiceCtrl_Impl::Paint( const Rectangle& rRect ) void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask ) { - const sal_uLong nCount = pZOrderList->Count(); + const size_t nCount = pZOrderList->size(); if( !nCount ) return; @@ -834,9 +845,9 @@ void SvxIconChoiceCtrl_Impl::RepaintEntries( sal_uInt16 nEntryFlagsMask ) bResetClipRegion = sal_True; pView->SetClipRegion( aOutRect ); } - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nCur ]; if( pEntry->GetFlags() & nEntryFlagsMask ) { const Rectangle& rBoundRect = GetEntryBoundRect( pEntry ); @@ -1597,11 +1608,11 @@ sal_Bool SvxIconChoiceCtrl_Impl::CheckHorScrollBar() if(!( nWinBits & WB_HSCROLL) && !aOrigin.X() ) { long nWidth = aOutputSize.Width(); - const sal_uLong nCount = pZOrderList->Count(); + const size_t nCount = pZOrderList->size(); long nMostRight = 0; - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nCur ]; long nRight = GetEntryBoundRect(pEntry).Right(); if( nRight > nWidth ) return sal_False; @@ -1636,10 +1647,10 @@ sal_Bool SvxIconChoiceCtrl_Impl::CheckVerScrollBar() { long nDeepest = 0; long nHeight = aOutputSize.Height(); - const sal_uLong nCount = pZOrderList->Count(); - for( sal_uLong nCur = 0; nCur < nCount; nCur++ ) + const size_t nCount = pZOrderList->size(); + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)pZOrderList->GetObject(nCur); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nCur ]; long nBottom = GetEntryBoundRect(pEntry).Bottom(); if( nBottom > nHeight ) return sal_False; @@ -2098,11 +2109,11 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, { CheckBoundingRects(); // Z-Order-Liste vom Ende her absuchen - sal_uLong nCount = pZOrderList->Count(); + size_t nCount = pZOrderList->size(); while( nCount ) { nCount--; - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCount)); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nCount ]; if( pEntry->aRect.IsInside( rDocPos ) ) { if( bHit ) @@ -2125,45 +2136,32 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetEntry( const Point& rDocPos, return 0; } -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ) -{ +SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetNextEntry( + const Point& rDocPos, + SvxIconChoiceCtrlEntry* pCurEntry +) { CheckBoundingRects(); SvxIconChoiceCtrlEntry* pTarget = 0; - const sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); - if( nStartPos != LIST_ENTRY_NOTFOUND ) - { - const sal_uLong nCount = pZOrderList->Count(); - for( sal_uLong nCur = nStartPos+1; nCur < nCount; nCur++ ) + + for ( + SvxIconChoiceCtrlEntryList_impl::iterator it = pZOrderList->begin(); + it < pZOrderList->end(); + ++it + ) { + if ( *it == pCurEntry ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nCur)); - if( pEntry->aRect.IsInside( rDocPos ) ) + while ( ++it < pZOrderList->end() ) { - pTarget = pEntry; - break; + if ( (*it)->aRect.IsInside( rDocPos ) ) + { + pTarget = *it; + break; + } } + break; } } - return pTarget; -} -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetPrevEntry( const Point& rDocPos, SvxIconChoiceCtrlEntry* pCurEntry ) -{ - CheckBoundingRects(); - SvxIconChoiceCtrlEntry* pTarget = 0; - sal_uLong nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); - if( nStartPos != LIST_ENTRY_NOTFOUND && nStartPos != 0 ) - { - nStartPos--; - do - { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nStartPos)); - if( pEntry->aRect.IsInside( rDocPos ) ) - { - pTarget = pEntry; - break; - } - } while( nStartPos > 0 ); - } return pTarget; } @@ -2343,7 +2341,7 @@ Size SvxIconChoiceCtrl_Impl::CalcBoundingSize( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { nMaxBoundHeight = 0; - pZOrderList->Clear(); + pZOrderList->clear(); size_t nCount = aEntries.size(); size_t nCur; SvxIconChoiceCtrlEntry* pEntry; @@ -2354,7 +2352,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { pEntry = aEntries[ nCur ]; FindBoundingRect( pEntry ); - pZOrderList->Insert( pEntry, LIST_APPEND ); + pZOrderList->push_back( pEntry ); } } else @@ -2365,7 +2363,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() { DBG_ASSERT(pEntry->pflink&&pEntry->pblink,"SvxIconChoiceCtrl_Impl::RecalcAllBoundingRect > Bad link(s)"); FindBoundingRect( pEntry ); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); + pZOrderList->push_back( pEntry ); pEntry = pEntry->pflink; nCur++; } @@ -2377,7 +2375,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRects() void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() { nMaxBoundHeight = 0; - pZOrderList->Clear(); + pZOrderList->clear(); size_t nCur; SvxIconChoiceCtrlEntry* pEntry; const size_t nCount = aEntries.size(); @@ -2395,7 +2393,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() } else FindBoundingRect( pEntry ); - pZOrderList->Insert( pEntry, LIST_APPEND ); + pZOrderList->push_back( pEntry ); } } else @@ -2413,7 +2411,7 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() } else FindBoundingRect( pEntry ); - pZOrderList->Insert( pEntry, LIST_APPEND ); + pZOrderList->push_back( pEntry ); pEntry = pEntry->pflink; nCur++; } @@ -2760,11 +2758,21 @@ void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt ) void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry ) { - if( pZOrderList->GetObject( pZOrderList->Count() - 1 ) != pEntry ) - { - sal_uLong nPos = pZOrderList->GetPos( (void*)pEntry ); - pZOrderList->Remove( nPos ); - pZOrderList->Insert( pEntry, LIST_APPEND ); + if( !pZOrderList->empty() + && pEntry != pZOrderList->back() + ) { + for( + SvxIconChoiceCtrlEntryList_impl::iterator it = pZOrderList->begin(); + it < pZOrderList->end(); + ++it + ) { + if ( *it == pEntry ) + { + pZOrderList->erase( it ); + pZOrderList->push_back( pEntry ); + break; + } + } } } @@ -3140,7 +3148,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, SvPtrarr* pOtherRects ) { aCurSelectionRect = rRect; - if( !pZOrderList || !pZOrderList->Count() ) + if( !pZOrderList || !pZOrderList->size() ) return; // Flag setzen, damit im Select kein ToTop gerufen wird @@ -3149,7 +3157,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, CheckBoundingRects(); pView->Update(); - const sal_uLong nCount = pZOrderList->Count(); + const size_t nCount = pZOrderList->size(); Rectangle aRect( rRect ); aRect.Justify(); @@ -3162,9 +3170,9 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, sal_Bool bAdd, pView->SetClipRegion( GetOutputRect() ); } - for( sal_uLong nPos = 0; nPos < nCount; nPos++ ) + for( size_t nPos = 0; nPos < nCount; nPos++ ) { - SvxIconChoiceCtrlEntry* pEntry = (SvxIconChoiceCtrlEntry*)(pZOrderList->GetObject(nPos )); + SvxIconChoiceCtrlEntry* pEntry = (*pZOrderList)[ nPos ]; if( !IsBoundingRectValid( pEntry->aRect )) FindBoundingRect( pEntry ); diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index f26de38cc1ab..7f1b374cb34a 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -360,12 +360,6 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetNextEntry( const Point& rPixPos, S return ((SvtIconChoiceCtrl*)this)->_pImp->GetNextEntry( aPos, pCurEntry ); } -SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetPrevEntry( const Point& rPixPos, SvxIconChoiceCtrlEntry* pCurEntry, sal_Bool ) const -{ - Point aPos( rPixPos ); - aPos -= GetMapMode().GetOrigin(); - return ((SvtIconChoiceCtrl*)this)->_pImp->GetPrevEntry( aPos, pCurEntry ); -} sal_uLong SvtIconChoiceCtrl::GetEntryCount() const { return _pImp->GetEntryCount(); -- cgit v1.2.3 From 40bbd3a61ae980840999b2410f681cae4c341531 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Mon, 18 Jul 2011 20:55:51 -0700 Subject: Whitespace cleanup --- vcl/inc/unx/salbmp.h | 242 +++++++++++++++++++++----------------- vcl/unx/generic/gdi/salbmp.cxx | 261 ++++++++++++++++++++++++++++------------- 2 files changed, 314 insertions(+), 189 deletions(-) diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index a389195308d3..42230d8bbde7 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -51,80 +51,118 @@ class VCLPLUG_GEN_PUBLIC X11SalBitmap : public SalBitmap { private: - static BitmapBuffer* ImplCreateDIB( const Size& rSize, - sal_uInt16 nBitCount, - const BitmapPalette& rPal ); - static BitmapBuffer* ImplCreateDIB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight, - bool bGrey ); + static BitmapBuffer* ImplCreateDIB( + const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal + ); + + static BitmapBuffer* ImplCreateDIB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, + bool bGrey + ); public: static ImplSalBitmapCache* mpCache; - static sal_uIntPtr mnCacheInstCount; + static sal_uIntPtr mnCacheInstCount; static void ImplCreateCache(); static void ImplDestroyCache(); void ImplRemovedFromCache(); bool SnapShot (Display* pDisplay, XLIB_Window hWindow); - bool ImplCreateFromXImage( Display* pDisplay, - XLIB_Window hWindow, - int nScreen, - XImage* pImage); + bool ImplCreateFromXImage( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage + ); private: - BitmapBuffer* mpDIB; ImplSalDDB* mpDDB; bool mbGrey; public: - SAL_DLLPRIVATE bool ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight ); - - SAL_DLLPRIVATE XImage* ImplCreateXImage( SalDisplay* pSalDisp, - int nScreen, long nDepth, - const SalTwoRect& rTwoRect ) const; - - SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( Drawable, int nScreen, long nDrawableDepth, - const SalTwoRect& ) const; - void ImplDraw( Drawable aDrawable, int nScreen, long nDrawableDepth, - const SalTwoRect& rTwoRect, const GC& rGC ) const; + SAL_DLLPRIVATE bool ImplCreateFromDrawable( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight + ); + + SAL_DLLPRIVATE XImage* ImplCreateXImage( + SalDisplay* pSalDisp, + int nScreen, + long nDepth, + const SalTwoRect& rTwoRect + ) const; + + SAL_DLLPRIVATE ImplSalDDB* ImplGetDDB( + Drawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& + ) const; + + void ImplDraw( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC + ) const; public: - X11SalBitmap(); - virtual ~X11SalBitmap(); + X11SalBitmap(); + virtual ~X11SalBitmap(); // overload pure virtual methods - virtual bool Create( const Size& rSize, - sal_uInt16 nBitCount, - const BitmapPalette& rPal ); - virtual bool Create( const SalBitmap& rSalBmp ); - virtual bool Create( const SalBitmap& rSalBmp, - SalGraphics* pGraphics ); - virtual bool Create( const SalBitmap& rSalBmp, - sal_uInt16 nNewBitCount ); - virtual bool Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + virtual bool Create( + const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal + ); + + virtual bool Create( const SalBitmap& rSalBmp ); + virtual bool Create( + const SalBitmap& rSalBmp, + SalGraphics* pGraphics + ); + + virtual bool Create( + const SalBitmap& rSalBmp, + sal_uInt16 nNewBitCount + ); + + virtual bool Create( + const ::com::sun::star::uno::Reference< + ::com::sun::star::rendering::XBitmapCanvas + > xBitmapCanvas, Size& rSize, - bool bMask = false ); + bool bMask = false + ); - virtual void Destroy(); + virtual void Destroy(); - virtual Size GetSize() const; + virtual Size GetSize() const; virtual sal_uInt16 GetBitCount() const; - virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); - virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); - virtual bool GetSystemData( BitmapSystemData& rData ); + virtual BitmapBuffer* AcquireBuffer( bool bReadOnly ); + virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ); + virtual bool GetSystemData( BitmapSystemData& rData ); }; // -------------- @@ -142,37 +180,66 @@ private: ImplSalDDB() {} - static void ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, - Drawable aDstDrawable, long nDstDrawableDepth, - long nSrcX, long nSrcY, - long nDestWidth, long nDestHeight, - long nDestX, long nDestY, const GC& rGC ); + static void ImplDraw( + Drawable aSrcDrawable, + long nSrcDrawableDepth, + Drawable aDstDrawable, + long nDstDrawableDepth, + long nSrcX, + long nSrcY, + long nDestWidth, + long nDestHeight, + long nDestX, + long nDestY, + const GC& rGC + ); public: - ImplSalDDB( XImage* pImage, - Drawable aDrawable, int nScreen, - const SalTwoRect& rTwoRect ); - ImplSalDDB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, long nWidth, long nHeight ); - ImplSalDDB( Display* pDisplay, - XLIB_Window hWindow, - int nScreen, - XImage* pImage); + ImplSalDDB( + XImage* pImage, + Drawable aDrawable, + int nScreen, + const SalTwoRect& rTwoRect + ); + + ImplSalDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight + ); + + ImplSalDDB( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage + ); + ~ImplSalDDB(); Pixmap ImplGetPixmap() const { return maPixmap; } long ImplGetWidth() const { return maTwoRect.mnDestWidth; } long ImplGetHeight() const { return maTwoRect.mnDestHeight; } long ImplGetDepth() const { return mnDepth; } - sal_uIntPtr ImplGetMemSize() const { return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); } + sal_uIntPtr ImplGetMemSize() const + { + return( ( maTwoRect.mnDestWidth * maTwoRect.mnDestHeight * mnDepth ) >> 3 ); + } int ImplGetScreen() const { return mnScreen; } bool ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const; - void ImplDraw( Drawable aDrawable, long nDrawableDepth, - const SalTwoRect& rTwoRect, const GC& rGC ) const; + + void ImplDraw( + Drawable aDrawable, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC + ) const; }; // ---------------------- @@ -184,7 +251,7 @@ class ImplSalBitmapCache private: List maBmpList; - sal_uIntPtr mnTotalSize; + sal_uIntPtr mnTotalSize; public: @@ -198,47 +265,4 @@ public: #endif // _SV_SALBMP_HXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 3349e6ef3c01..0b9e69abb940 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -32,6 +32,7 @@ #include #include #include + #ifdef FREEBSD #include #endif @@ -69,14 +70,14 @@ SalBitmap* X11SalInstance::CreateSalBitmap() } ImplSalBitmapCache* X11SalBitmap::mpCache = NULL; -sal_uLong X11SalBitmap::mnCacheInstCount = 0; +sal_uLong X11SalBitmap::mnCacheInstCount = 0; // ----------------------------------------------------------------------------- -X11SalBitmap::X11SalBitmap() : - mpDIB( NULL ), - mpDDB( NULL ), - mbGrey( false ) +X11SalBitmap::X11SalBitmap() + : mpDIB( NULL ) + , mpDDB( NULL ) + , mbGrey( false ) { } @@ -115,9 +116,19 @@ void X11SalBitmap::ImplRemovedFromCache() // ----------------------------------------------------------------------------- -BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ) -{ - DBG_ASSERT( nBitCount == 1 || nBitCount == 4 || nBitCount == 8 || nBitCount == 16 || nBitCount == 24, "Unsupported BitCount!" ); +BitmapBuffer* X11SalBitmap::ImplCreateDIB( + const Size& rSize, + sal_uInt16 nBitCount, + const BitmapPalette& rPal +) { + DBG_ASSERT( + nBitCount == 1 + || nBitCount == 4 + || nBitCount == 8 + || nBitCount == 16 + || nBitCount == 24 + , "Unsupported BitCount!" + ); BitmapBuffer* pDIB = NULL; @@ -192,13 +203,16 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCou // ----------------------------------------------------------------------------- -BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - long nX, long nY, - long nWidth, long nHeight, - bool bGrey ) -{ +BitmapBuffer* X11SalBitmap::ImplCreateDIB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight, + bool bGrey +) { BitmapBuffer* pDIB = NULL; if( aDrawable && nWidth && nHeight && nDrawableDepth ) @@ -221,7 +235,7 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { const SalTwoRect aTwoRect = { 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight }; BitmapBuffer aSrcBuf; - sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP; + sal_uLong nDstFormat = BMP_FORMAT_BOTTOM_UP; const BitmapPalette* pDstPal = NULL; aSrcBuf.mnFormat = BMP_FORMAT_TOP_DOWN; @@ -239,14 +253,20 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, { case( 1 ): { - aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL ); + aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_1BIT_LSB_PAL + : BMP_FORMAT_1BIT_MSB_PAL + ); nDstFormat |= BMP_FORMAT_1BIT_MSB_PAL; } break; case( 4 ): { - aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL ); + aSrcBuf.mnFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_4BIT_LSN_PAL + : BMP_FORMAT_4BIT_MSN_PAL + ); nDstFormat |= BMP_FORMAT_4BIT_MSN_PAL; } break; @@ -270,7 +290,6 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else { aSrcBuf.mnFormat |= BMP_FORMAT_16BIT_TC_MSB_MASK; - // aSrcBuf.maColorMask = ColorMask( pImage->red_mask ), SWAPSHORT( pImage->green_mask ), SWAPSHORT( pImage->blue_mask ) ); } } break; @@ -289,10 +308,15 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, case( 32 ): { if( LSBFirst == pImage->byte_order ) - aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA ); + aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_RGBA + : BMP_FORMAT_32BIT_TC_BGRA + ); else - aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB ); - + aSrcBuf.mnFormat |= ( pSalDisp->GetVisual(nScreen).red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_ABGR + : BMP_FORMAT_32BIT_TC_ARGB + ); nDstFormat |= BMP_FORMAT_24BIT_TC_BGR; } break; @@ -326,7 +350,9 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, else if( aSrcBuf.mnBitCount <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << nDrawableDepth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + , (sal_uLong)(1 << nDrawableDepth) + ); rPal.SetEntryCount( nCols ); pDstPal = &rPal; @@ -354,7 +380,12 @@ BitmapBuffer* X11SalBitmap::ImplCreateDIB( Drawable aDrawable, // ----------------------------------------------------------------------------- -XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const +XImage* X11SalBitmap::ImplCreateXImage( + SalDisplay *pSalDisp, + int nScreen, + long nDepth, + const SalTwoRect& rTwoRect +) const { XImage* pImage = NULL; @@ -393,11 +424,17 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long switch( pImage->bits_per_pixel ) { case( 1 ): - nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_1BIT_LSB_PAL : BMP_FORMAT_1BIT_MSB_PAL ); + nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_1BIT_LSB_PAL + : BMP_FORMAT_1BIT_MSB_PAL + ); break; case( 4 ): - nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order ? BMP_FORMAT_4BIT_LSN_PAL : BMP_FORMAT_4BIT_MSN_PAL ); + nDstFormat |= ( LSBFirst == pImage->bitmap_bit_order + ? BMP_FORMAT_4BIT_LSN_PAL + : BMP_FORMAT_4BIT_MSN_PAL + ); break; case( 8 ): @@ -437,9 +474,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long case( 32 ): { if( LSBFirst == pImage->byte_order ) - nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_RGBA : BMP_FORMAT_32BIT_TC_BGRA ); + nDstFormat |= ( pImage->red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_RGBA + : BMP_FORMAT_32BIT_TC_BGRA + ); else - nDstFormat |= ( pImage->red_mask == 0xFF ? BMP_FORMAT_32BIT_TC_ABGR : BMP_FORMAT_32BIT_TC_ARGB ); + nDstFormat |= ( pImage->red_mask == 0xFF + ? BMP_FORMAT_32BIT_TC_ABGR + : BMP_FORMAT_32BIT_TC_ARGB + ); } break; } @@ -467,7 +510,9 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long else if( pImage->depth <= 8 ) { const SalColormap& rColMap = pSalDisp->GetColormap( nScreen ); - const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed(), (sal_uLong)(1 << pImage->depth) ); + const sal_uInt16 nCols = Min( (sal_uLong)rColMap.GetUsed() + , (sal_uLong)(1 << pImage->depth) + ); pPal = new BitmapPalette( nCols ); @@ -506,10 +551,15 @@ XImage* X11SalBitmap::ImplCreateXImage( SalDisplay *pSalDisp, int nScreen, long } // ----------------------------------------------------------------------------- -bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, - int nScreen, long nDrawableDepth, - long nX, long nY, long nWidth, long nHeight ) -{ +bool X11SalBitmap::ImplCreateFromDrawable( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight +) { Destroy(); if( aDrawable && nWidth && nHeight && nDrawableDepth ) @@ -519,8 +569,7 @@ bool X11SalBitmap::ImplCreateFromDrawable( Drawable aDrawable, } // ----------------------------------------------------------------------------- -bool -X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) +bool X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) { if (hWindow != None) { @@ -598,9 +647,12 @@ X11SalBitmap::SnapShot (Display* pDisplay, XLIB_Window hWindow) return False; } -bool -X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) -{ +bool X11SalBitmap::ImplCreateFromXImage ( + Display* pDisplay, + XLIB_Window hWindow, + int nScreen, + XImage* pImage +) { Destroy(); if (pImage != NULL && pImage->width != 0 && pImage->height != 0 && pImage->depth != 0) @@ -611,10 +663,12 @@ X11SalBitmap::ImplCreateFromXImage (Display* pDisplay, XLIB_Window hWindow, int return False; } -ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - const SalTwoRect& rTwoRect ) const +ImplSalDDB* X11SalBitmap::ImplGetDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect +) const { if( !mpDDB || !mpDDB->ImplMatches( nScreen, nDrawableDepth, rTwoRect ) ) { @@ -708,11 +762,13 @@ ImplSalDDB* X11SalBitmap::ImplGetDDB( Drawable aDrawable, // ----------------------------------------------------------------------------- -void X11SalBitmap::ImplDraw( Drawable aDrawable, - int nScreen, - long nDrawableDepth, - const SalTwoRect& rTwoRect, - const GC& rGC ) const +void X11SalBitmap::ImplDraw( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC +) const { ImplGetDDB( aDrawable, nScreen, nDrawableDepth, rTwoRect ); if( mpDDB ) @@ -782,9 +838,14 @@ bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 ) // ----------------------------------------------------------------------------- -bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, Size& rSize, bool bMask ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); +bool X11SalBitmap::Create( + const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmapCanvas > xBitmapCanvas, + Size& rSize, + bool bMask +) { + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > + xFastPropertySet( xBitmapCanvas, ::com::sun::star::uno::UNO_QUERY ); + if( xFastPropertySet.get() ) { sal_Int32 depth; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > args; @@ -794,7 +855,15 @@ bool X11SalBitmap::Create( const ::com::sun::star::uno::Reference< ::com::sun::s if( ( args[1] >>= pixmapHandle ) && ( args[2] >>= depth ) ) { mbGrey = bMask; - bool bSuccess = ImplCreateFromDrawable( pixmapHandle, 0, depth, 0, 0, (long) rSize.Width(), (long) rSize.Height() ); + bool bSuccess = ImplCreateFromDrawable( + pixmapHandle, + 0, + depth, + 0, + 0, + (long) rSize.Width(), + (long) rSize.Height() + ); bool bFreePixmap = false; if( bSuccess && (args[0] >>= bFreePixmap) && bFreePixmap ) XFreePixmap( GetX11SalData()->GetDisplay()->GetDisplay(), pixmapHandle ); @@ -860,10 +929,15 @@ BitmapBuffer* X11SalBitmap::AcquireBuffer( bool ) { if( !mpDIB && mpDDB ) { - mpDIB = ImplCreateDIB( mpDDB->ImplGetPixmap(), - mpDDB->ImplGetScreen(), - mpDDB->ImplGetDepth(), - 0, 0, mpDDB->ImplGetWidth(), mpDDB->ImplGetHeight(), mbGrey ); + mpDIB = ImplCreateDIB( + mpDDB->ImplGetPixmap(), + mpDDB->ImplGetScreen(), + mpDDB->ImplGetDepth(), + 0, 0, + mpDDB->ImplGetWidth(), + mpDDB->ImplGetHeight(), + mbGrey + ); } return mpDIB; @@ -905,11 +979,11 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData ) // - ImplSalDDB - // -------------- -ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) : - maPixmap ( 0 ), - maTwoRect ( rTwoRect ), - mnDepth ( pImage->depth ), - mnScreen ( nScreen ) +ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const SalTwoRect& rTwoRect ) + : maPixmap ( 0 ) + , maTwoRect ( rTwoRect ) + , mnDepth ( pImage->depth ) + , mnScreen ( nScreen ) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -937,8 +1011,8 @@ ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, int nScreen, const S // ----------------------------------------------------------------------------------------- // create from XImage -ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) : - mnScreen( nScreen ) +ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XImage* pImage) + : mnScreen( nScreen ) { maPixmap = XCreatePixmap (pDisplay, hWindow, pImage->width, pImage->height, pImage->depth); if (maPixmap != 0) @@ -975,9 +1049,16 @@ ImplSalDDB::ImplSalDDB (Display* pDisplay, XLIB_Window hWindow, int nScreen, XIm // ----------------------------------------------------------------------------- -ImplSalDDB::ImplSalDDB( Drawable aDrawable, int nScreen, long nDrawableDepth, long nX, long nY, long nWidth, long nHeight ) : - mnDepth( nDrawableDepth ), - mnScreen( nScreen ) +ImplSalDDB::ImplSalDDB( + Drawable aDrawable, + int nScreen, + long nDrawableDepth, + long nX, + long nY, + long nWidth, + long nHeight +) : mnDepth( nDrawableDepth ) + , mnScreen( nScreen ) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); @@ -1023,18 +1104,26 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) { - if( rTwoRect.mnSrcX == maTwoRect.mnSrcX && rTwoRect.mnSrcY == maTwoRect.mnSrcY && - rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight && - rTwoRect.mnDestWidth == maTwoRect.mnDestWidth && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight ) + if ( rTwoRect.mnSrcX == maTwoRect.mnSrcX + && rTwoRect.mnSrcY == maTwoRect.mnSrcY + && rTwoRect.mnSrcWidth == maTwoRect.mnSrcWidth + && rTwoRect.mnSrcHeight == maTwoRect.mnSrcHeight + && rTwoRect.mnDestWidth == maTwoRect.mnDestWidth + && rTwoRect.mnDestHeight == maTwoRect.mnDestHeight + ) { // absolutely indentically bRet = sal_True; } - else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight && - maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight && - rTwoRect.mnSrcX >= maTwoRect.mnSrcX && rTwoRect.mnSrcY >= maTwoRect.mnSrcY && - ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) && - ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) ) + else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth + && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight + && maTwoRect.mnSrcWidth == maTwoRect.mnDestWidth + && maTwoRect.mnSrcHeight == maTwoRect.mnDestHeight + && rTwoRect.mnSrcX >= maTwoRect.mnSrcX + && rTwoRect.mnSrcY >= maTwoRect.mnSrcY + && ( rTwoRect.mnSrcX + rTwoRect.mnSrcWidth ) <= ( maTwoRect.mnSrcX + maTwoRect.mnSrcWidth ) + && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) + ) { bRet = sal_True; } @@ -1045,7 +1134,12 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwoRect& rTwoRect, const GC& rGC ) const +void ImplSalDDB::ImplDraw( + Drawable aDrawable, + long nDrawableDepth, + const SalTwoRect& rTwoRect, + const GC& rGC +) const { ImplDraw( maPixmap, mnDepth, aDrawable, nDrawableDepth, rTwoRect.mnSrcX - maTwoRect.mnSrcX, rTwoRect.mnSrcY - maTwoRect.mnSrcY, @@ -1055,12 +1149,19 @@ void ImplSalDDB::ImplDraw( Drawable aDrawable, long nDrawableDepth, const SalTwo // ----------------------------------------------------------------------------- -void ImplSalDDB::ImplDraw( Drawable aSrcDrawable, long nSrcDrawableDepth, - Drawable aDstDrawable, long, - long nSrcX, long nSrcY, - long nDestWidth, long nDestHeight, - long nDestX, long nDestY, const GC& rGC ) -{ +void ImplSalDDB::ImplDraw( + Drawable aSrcDrawable, + long nSrcDrawableDepth, + Drawable aDstDrawable, + long, + long nSrcX, + long nSrcY, + long nDestWidth, + long nDestHeight, + long nDestX, + long nDestY, + const GC& rGC +) { SalDisplay* pSalDisp = GetX11SalData()->GetDisplay(); Display* pXDisp = pSalDisp->GetDisplay(); -- cgit v1.2.3 From c0f93aac002a1bec3aef4eb137012722bba5aba6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Jul 2011 23:30:36 +0100 Subject: callcatcher: unused INetMIME::getDigit --- tools/inc/tools/inetmime.hxx | 9 --------- tools/source/inet/inetmime.cxx | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/tools/inc/tools/inetmime.hxx b/tools/inc/tools/inetmime.hxx index cf8f8173cac7..4a3abe577101 100644 --- a/tools/inc/tools/inetmime.hxx +++ b/tools/inc/tools/inetmime.hxx @@ -352,15 +352,6 @@ public: */ static inline int getBase64Weight(sal_uInt32 nChar); - /** Get a decimal digit encoded as US-ASCII. - - @param nWeight Must be in the range 0--9, inclusive. - - @return The decimal digit corresponding to nWeight (US-ASCII - '0'--'9'). - */ - static sal_uInt32 getDigit(int nWeight); - /** Get a hexadecimal digit encoded as US-ASCII. @param nWeight Must be in the range 0--15, inclusive. diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 2442b768e426..d1178f29253e 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -490,18 +490,6 @@ bool INetMIME::isIMAPAtomChar(sal_uInt32 nChar) return isUSASCII(nChar) && aMap[nChar]; } -//============================================================================ -// static -sal_uInt32 INetMIME::getDigit(int nWeight) -{ - DBG_ASSERT(nWeight >= 0 && nWeight < 10, - "INetMIME::getDigit(): Bad weight"); - - static const sal_Char aDigits[16] - = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; - return aDigits[nWeight]; -} - //============================================================================ // static sal_uInt32 INetMIME::getHexDigit(int nWeight) -- cgit v1.2.3 From 3314acfa46192c02e7049974c019aefca0ebda6b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Jul 2011 23:51:01 +0100 Subject: callcatcher: remove unused GetTemporaryStorageOfFormat --- comphelper/inc/comphelper/storagehelper.hxx | 8 -------- comphelper/source/misc/storagehelper.cxx | 17 ----------------- 2 files changed, 25 deletions(-) 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/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 @@ -313,23 +313,6 @@ sal_Int32 OStorageHelper::GetXStorageFormat( return nResult; } -// ---------------------------------------------------------------------- -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, -- cgit v1.2.3 From b2262e8be35d51cc18afeb60486f19576a81adc0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jul 2011 00:12:15 +0100 Subject: callcatcher: remove some unused methods --- vcl/inc/vcl/toolbox.hxx | 2 -- vcl/source/window/toolbox.cxx | 46 ------------------------------------------- 2 files changed, 48 deletions(-) diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 4542a51984b7..dd482c610d95 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -265,8 +265,6 @@ private: using Window::ImplInvalidate; SAL_DLLPRIVATE void ImplInvalidate( sal_Bool bNewCalc = sal_False, sal_Bool bFullPaint = sal_False ); SAL_DLLPRIVATE void ImplUpdateItem( sal_uInt16 nIndex = 0xFFFF ); - SAL_DLLPRIVATE void ImplStartCustomizeMode(); - SAL_DLLPRIVATE void ImplEndCustomizeMode(); SAL_DLLPRIVATE const XubString& ImplConvertMenuString( const XubString& rStr ); SAL_DLLPRIVATE sal_Bool ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat = sal_False ); SAL_DLLPRIVATE sal_Bool ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel = sal_False ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 288cbe103afe..742d821a1f7e 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -3768,52 +3768,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_uInt16 nHighlight, sal_Bool bPa // ----------------------------------------------------------------------- -void ToolBox::ImplStartCustomizeMode() -{ - mbCustomizeMode = sal_True; - - mpData->ImplClearLayoutData(); - - std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); - while ( it != mpData->m_aItems.end() ) - { - if ( it->mbShowWindow ) - { - it->mpWindow->Hide(); - - if ( !(it->maRect.IsEmpty()) ) - Invalidate( it->maRect ); - } - - ++it; - } -} - -// ----------------------------------------------------------------------- - -void ToolBox::ImplEndCustomizeMode() -{ - mbCustomizeMode = sal_False; - - mpData->ImplClearLayoutData(); - - std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); - while ( it != mpData->m_aItems.end() ) - { - if ( it->mbShowWindow ) - { - if ( !(it->maRect.IsEmpty()) ) - Invalidate( it->maRect ); - - it->mpWindow->Show(); - } - - ++it; - } -} - -// ----------------------------------------------------------------------- - void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem ) { if ( !pItem->maRect.IsEmpty() ) -- cgit v1.2.3 From bf355b97ee4b53e38975f0e1847eda5b3e05f920 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jul 2011 09:21:10 +0100 Subject: Resolves: fdo#38095 half&full width forms need to remain asian --- i18npool/qa/cppunit/test_breakiterator.cxx | 51 +++++- .../source/breakiterator/breakiteratorImpl.cxx | 200 +++++++++++++++------ 2 files changed, 191 insertions(+), 60 deletions(-) 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(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..9c6d09d7d6ec 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(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(scriptTypes) + + //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(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) { -- cgit v1.2.3 From c1cf6f343b278f7ef74c9b17318d864eafe3e79d Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 19 Jul 2011 12:45:50 +0200 Subject: fix typo in the last commit scriptListCount should get initialized by scriptList variable --- i18npool/source/breakiterator/breakiteratorImpl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index 9c6d09d7d6ec..e81bfff9452a 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -535,7 +535,7 @@ namespace {UBLOCK_LATIN_EXTENDED_C, UBLOCK_LATIN_EXTENDED_D, ScriptType::LATIN} }; - #define scriptListCount SAL_N_ELEMENTS(scriptTypes) + #define scriptListCount SAL_N_ELEMENTS(scriptList) //always sets rScriptType // -- cgit v1.2.3 From 21cd1cd2c640aa923e6ee39acf0325c7e84487d6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jul 2011 13:39:34 +0100 Subject: Resolves: rhbz#715549 use fontconfig's detected format when available --- vcl/inc/vcl/fontmanager.hxx | 2 +- vcl/unx/generic/fontmanager/fontconfig.cxx | 12 ++++- vcl/unx/generic/fontmanager/fontmanager.cxx | 81 ++++++++++++++++++----------- 3 files changed, 62 insertions(+), 33 deletions(-) diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx index 145c4d0a2169..467297668b5a 100644 --- a/vcl/inc/vcl/fontmanager.hxx +++ b/vcl/inc/vcl/fontmanager.hxx @@ -333,7 +333,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager void getFontAttributesFromXLFD( PrintFont* pFont, const std::list< rtl::OString >& rXLFDs ) const; - bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts ) const; + bool analyzeFontFile( int nDirID, const rtl::OString& rFileName, const std::list< rtl::OString >& rXLFDs, std::list< PrintFont* >& rNewFonts, const char *pFormat=NULL ) const; rtl::OUString convertTrueTypeName( void* pNameRecord ) const; // actually a NameRecord* formt font subsetting code void analyzeTrueTypeFamilyName( void* pTTFont, std::list< rtl::OUString >& rnames ) const; // actually a TrueTypeFont* from font subsetting code bool analyzeTrueTypeFile( PrintFont* pFont ) const; diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 66faa526872c..38a5e93e56f3 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -68,6 +68,9 @@ using namespace psp; #ifndef FC_EMBOLDEN #define FC_EMBOLDEN "embolden" #endif +#ifndef FC_FONTFORMAT + #define FC_FONTFORMAT "fontformat" +#endif #include #include @@ -467,6 +470,7 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_mapfonts[i], FC_SPACING, 0, &spacing); FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline); FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry); + FcResult eFormatRes = FcPatternGetString(pFSet->fonts[i], FC_FONTFORMAT, 0, &format); if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch ) continue; @@ -488,13 +493,14 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map 2) fprintf( stderr, "found font \"%s\" in file %s\n" " weight = %d, slant = %d, style = \"%s\"\n" - " spacing = %d, outline = %d\n" + " spacing = %d, outline = %d, format %s\n" , family, file , eWeightRes == FcResultMatch ? weight : -1 , eSpacRes == FcResultMatch ? slant : -1 , eStyleRes == FcResultMatch ? (const char*) style : "" , eSpacRes == FcResultMatch ? spacing : -1 , eOutRes == FcResultMatch ? outline : -1 + , eFormatRes == FcResultMatch ? (const char*)format : "" ); #endif @@ -529,7 +535,9 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map aDummy; - analyzeFontFile( nDirID, aBase, aDummy, aFonts ); + if (eFormatRes != FcResultMatch) + format = NULL; + analyzeFontFile( nDirID, aBase, aDummy, aFonts, (const char*)format ); #if OSL_DEBUG_LEVEL > 1 if( aFonts.empty() ) fprintf( stderr, "Warning: file \"%s\" is unusable to psprint\n", aOrgPath.getStr() ); diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 1427daedb193..8936df327aeb 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -1281,9 +1281,12 @@ int PrintFontManager::addFontFile( const ::rtl::OString& rFileName, int /*nFaceN return nFontId; } -// ------------------------------------------------------------------------- +enum fontFormat +{ + UNKNOWN, TRUETYPE, CFF, TYPE1, AFM +}; -bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts ) const +bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const ::std::list& rXLFDs, ::std::list< PrintFontManager::PrintFont* >& rNewFonts, const char *pFormat ) const { rNewFonts.clear(); @@ -1297,8 +1300,32 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co if( access( aFullPath.getStr(), R_OK ) ) return false; - ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) ); - if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) ) + fontFormat eFormat = UNKNOWN; + if (pFormat) + { + if (!strcmp(pFormat, "TrueType")) + eFormat = TRUETYPE; + else if (!strcmp(pFormat, "CFF")) + eFormat = CFF; + else if (!strcmp(pFormat, "Type 1")) + eFormat = TYPE1; + } + if (eFormat == UNKNOWN) + { + ByteString aExt( rFontFile.copy( rFontFile.lastIndexOf( '.' )+1 ) ); + if( aExt.EqualsIgnoreCaseAscii( "pfb" ) || aExt.EqualsIgnoreCaseAscii( "pfa" ) ) + eFormat = TYPE1; + else if( aExt.EqualsIgnoreCaseAscii( "afm" ) ) + eFormat = AFM; + else if( aExt.EqualsIgnoreCaseAscii( "ttf" ) + || aExt.EqualsIgnoreCaseAscii( "ttc" ) + || aExt.EqualsIgnoreCaseAscii( "tte" ) ) // #i33947# for Gaiji support + eFormat = TRUETYPE; + else if( aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too + eFormat = CFF; + } + + if (eFormat == TYPE1) { // check for corresponding afm metric // first look for an adjacent file @@ -1352,7 +1379,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co } } } - else if( aExt.EqualsIgnoreCaseAscii( "afm" ) ) + else if (eFormat == AFM) { ByteString aFilePath( aDir ); aFilePath.Append( '/' ); @@ -1365,34 +1392,14 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co else delete pFont; } - else if( aExt.EqualsIgnoreCaseAscii( "ttf" ) - || aExt.EqualsIgnoreCaseAscii( "tte" ) // #i33947# for Gaiji support - || aExt.EqualsIgnoreCaseAscii( "otf" ) ) // check for TTF- and PS-OpenType too - { - TrueTypeFontFile* pFont = new TrueTypeFontFile(); - pFont->m_nDirectory = nDirID; - pFont->m_aFontFile = rFontFile; - pFont->m_nCollectionEntry = -1; - - if( rXLFDs.size() ) - getFontAttributesFromXLFD( pFont, rXLFDs ); - // need to read the font anyway to get aliases inside the font file - if( ! analyzeTrueTypeFile( pFont ) ) - { - delete pFont; - pFont = NULL; - } - else - rNewFonts.push_back( pFont ); - } - else if( aExt.EqualsIgnoreCaseAscii( "ttc" ) ) + else if (eFormat == TRUETYPE || eFormat == CFF) { // get number of ttc entries int nLength = CountTTCFonts( aFullPath.getStr() ); if( nLength ) { #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "%s contains %d fonts\n", aFullPath.getStr(), nLength ); + fprintf( stderr, "ttc: %s contains %d fonts\n", aFullPath.getStr(), nLength ); #endif for( int i = 0; i < nLength; i++ ) { @@ -1411,10 +1418,24 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co rNewFonts.push_back( pFont ); } } -#if OSL_DEBUG_LEVEL > 1 else - fprintf( stderr, "CountTTCFonts( \"%s/%s\" ) failed\n", getDirectory(nDirID).getStr(), rFontFile.getStr() ); -#endif + { + TrueTypeFontFile* pFont = new TrueTypeFontFile(); + pFont->m_nDirectory = nDirID; + pFont->m_aFontFile = rFontFile; + pFont->m_nCollectionEntry = -1; + + if( rXLFDs.size() ) + getFontAttributesFromXLFD( pFont, rXLFDs ); + // need to read the font anyway to get aliases inside the font file + if( ! analyzeTrueTypeFile( pFont ) ) + { + delete pFont; + pFont = NULL; + } + else + rNewFonts.push_back( pFont ); + } } return ! rNewFonts.empty(); } -- cgit v1.2.3 From 8e2abdc5151a4bcef63f9138f2c35837af36ffe4 Mon Sep 17 00:00:00 2001 From: Troy Rollo Date: Tue, 19 Jul 2011 14:47:02 +0100 Subject: Preserve RTF \'00 sequences (NULL) in strings --- svtools/source/svrtf/parrtf.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index a475343dcaac..5a04328045c6 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -341,7 +341,27 @@ void SvRTFParser::ScanText( const sal_Unicode cBreak ) ByteString aByteString; while (1) { - aByteString.Append((char)GetHexValue()); + char c = (char)GetHexValue(); + + if (c) + { + aByteString.Append(c); + } + else + { + /* \'00 is a valid internal character in a + * string in RTF, however ByteString::Append + * does nothing if '\0' is passed in. It is + * otherwise capable of handling strings with + * embedded NULs, so add a '\1' and then + * change it, as ByteString::SetChar does not + * care if the character is '\0'. + */ + int nLen = aByteString.Len(); + + aByteString.Append('\001'); + aByteString.SetChar(nLen, '\0'); + } bool bBreak = false; sal_Char nSlash = '\\'; -- cgit v1.2.3 From eb4d2342b8acf2110831e6bcb4a16566a2a6db8c Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Wed, 20 Jul 2011 10:58:18 +0200 Subject: add gd_GB (Gaelic, Scottish) locale data #i117857# --- i18npool/source/localedata/data/gd_GB.xml | 357 +++++++++++++++++++++ .../source/localedata/data/localedata_euro.map | 17 + i18npool/source/localedata/data/makefile.mk | 1 + i18npool/source/localedata/localedata.cxx | 1 + 4 files changed, 376 insertions(+) create mode 100644 i18npool/source/localedata/data/gd_GB.xml 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 @@ + + + + + +gd +Gaelic, Scottish + + +GB +United Kingdom + + + + +/ +, +. +: +. +; +, +, + + + + + + + + + +m +f +metric + + + +General + + +0 + + +0.00 + + +#,##0 + + +#,##0.00 + + +#,###.00 + + +0.00E+00 + + +0.00E+000 + + +0% + + +0.00% + + +[CURRENCY]#,##0;-[CURRENCY]#,##0 + + +[CURRENCY]#,##0.00;-[CURRENCY]#,##0.00 + + +[CURRENCY]#,##0;[RED]-[CURRENCY]#,##0 + + +[CURRENCY]#,##0.00;[RED]-[CURRENCY]#,##0.00 + + +CCC#,##0.00 + + +[CURRENCY]#,##0.--;[RED]-[CURRENCY]#,##0.-- + + +D/MM/YY + + +NNNNDD, MMMM YYYY + + +DD/MM/YY + + +DD/MM/YYYY + + +D, MMM YY + + +D, MMM YYYY + + +D, MMM YYYY + + +D, MMMM YYYY + + +D, MMMM YY + + +NN, DD/MMM/YY + + +NN, D, MMM YY + + +NN, D, MMMM YYYY + + +NNNND, MMMM YYYY + + +MM/DD + + +YY-MM-DD +ISO 8601 + + +YYYY-MM-DD +ISO 8601 + + +MM/YY + + +MMM/DD + + +MMMM + + +QQ YY + + +WW + + +HH:MM + + +HH:MM:SS + + +HH:MM AM/PM + + +HH:MM:SS AM/PM + + +[HH]:MM:SS + + +MM:SS.00 + + +[HH]:MM:SS.00 + + +DD/MM/YY HH:MM + + +DD/MM/YYYY HH:MM:SS AM/PM + + + + + +IGNORE_CASE + + + + +IGNORE_CASE + + + +AÀÁBCDEÈÉFGHIJKÌLMNOÒÓPQRSTUÙVWXYZ +0 +1 +td +td + + + + + +sun +DiD +DiDòmhnaich + + +mon +DiL +DiLuain + + +tue +DiM +DiMàirt + + +wed +DiC +DiCiadain + + +thu +Dia +DiarDaoin + + +fri +Dih +DihAoine + + +sat +DiS +DiSathairne + + + + +jan +Faoi +Faoilleach + + +feb +Gearr +Gearran + + +mar +Màrt +Màrt + + +apr +Gibl +Giblean + + +may +Cèit +Cèitean + + +jun +Ògmh +Ògmhios + + +jul +Iuch +Iuchar + + +aug +Lùna +Lùnastal + + +sep +Sult +Sultain + + +oct +Dàmh +Dàmhair + + +nov +Samh +Samhain + + +dec +Dùbh +Dùbhlachd + + + + +bc +RC +ro Chrìost + + +ad +AD +as dèidh Chrìost + + + +mon + +1 + + + + +GBP +£ +GBP +Punnd Sasannach +2 + + + + + + + + + +Fìor +Breug +Ràithe 1 +Ràithe 2 +Ràithe 3 +Ràithe 4 +Os cionn +Fo +R 1 +R 2 +R 3 +R 4 + + + + + + + + + + + + + + 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 c93a3f316165..cefe90422e3b 100644 --- a/i18npool/source/localedata/data/makefile.mk +++ b/i18npool/source/localedata/data/makefile.mk @@ -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 \ 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 }, -- cgit v1.2.3 From c7272c328892bec2c1adac64fd5b72b157fceb8d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 12:13:56 +0100 Subject: add GF_ROTL support to cairo vertical rendering --- vcl/unx/generic/gdi/salgdi3.cxx | 77 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 25dc002cfdc5..bf95d229e000 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -288,9 +288,18 @@ void* CairoFontsCache::FindCachedFont(const CairoFontsCache::CacheId &rId) return NULL; } +namespace +{ + bool hasRotation(int nRotation) + { + return nRotation != 0; + } +} + void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) { std::vector cairo_glyphs; + std::vector glyph_extrarotation; cairo_glyphs.reserve( 256 ); Point aPos; @@ -302,6 +311,19 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) aGlyph.x = aPos.X(); aGlyph.y = aPos.Y(); cairo_glyphs.push_back(aGlyph); + + switch (aGlyphId & GF_ROTMASK) + { + case GF_ROTL: // left + glyph_extrarotation.push_back(900); + break; + case GF_ROTR: // right + glyph_extrarotation.push_back(-900); + break; + default: + glyph_extrarotation.push_back(0); + break; + } } if (cairo_glyphs.empty()) @@ -373,19 +395,56 @@ void X11SalGraphics::DrawCairoAAFontString( const ServerFontLayout& rLayout ) cairo_matrix_t m; const ImplFontSelectData& rFSD = rFont.GetFontSelData(); - int nWidth = rFSD.mnWidth ? rFSD.mnWidth : rFSD.mnHeight; + int nHeight = rFSD.mnHeight; + int nWidth = rFSD.mnWidth ? rFSD.mnWidth : nHeight; + + std::vector::const_iterator aEnd = glyph_extrarotation.end(); + std::vector::const_iterator aStart = glyph_extrarotation.begin(); + std::vector::const_iterator aI = aStart; + while (aI != aEnd) + { + int nGlyphRotation = *aI; - cairo_matrix_init_identity(&m); + std::vector::const_iterator aNext = std::find_if(aI+1, aEnd, hasRotation); - if (rLayout.GetOrientation()) - cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + cairo_matrix_init_identity(&m); - cairo_matrix_scale(&m, nWidth, rFSD.mnHeight); - if (rFont.NeedsArtificialItalic()) - m.xy = -m.xx * 0x6000L / 0x10000L; + if (rFont.NeedsArtificialItalic()) + m.xy = -m.xx * 0x6000L / 0x10000L; + + if (rLayout.GetOrientation()) + cairo_matrix_rotate(&m, (3600 - rLayout.GetOrientation()) * M_PI / 1800.0); + + cairo_matrix_scale(&m, nWidth, nHeight); + + if (nGlyphRotation) + { + cairo_matrix_rotate(&m, (3600 - nGlyphRotation) * M_PI / 1800.0); + + cairo_font_extents_t extents; + cairo_font_extents(cr, &extents); + //gives the same positions as pre-cairo conversion, but I don't like them + double xdiff = -extents.descent/(extents.height+extents.descent); + cairo_matrix_translate(&m, xdiff, 1); + } + + cairo_set_font_matrix(cr, &m); + size_t nStartIndex = std::distance(aStart, aI); + size_t nLen = std::distance(aI, aNext); + cairo_show_glyphs(cr, &cairo_glyphs[nStartIndex], nLen); + +#if OSL_DEBUG_LEVEL > 2 + //draw origin + cairo_save (cr); + cairo_rectangle (cr, cairo_glyphs[nStartIndex].x, cairo_glyphs[nStartIndex].y, 5, 5); + cairo_set_source_rgba (cr, 1, 0, 0, 0.80); + cairo_fill (cr); + cairo_restore (cr); +#endif + + aI = aNext; + } - cairo_set_font_matrix(cr, &m); - cairo_show_glyphs(cr, &cairo_glyphs[0], cairo_glyphs.size()); cairo_destroy(cr); } -- cgit v1.2.3 From a82d0899abaffa7d7e535eeb4850746f1d4cd566 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 12:19:38 +0100 Subject: don't prohibit rendering text with cairo due to antialias advice anymore --- vcl/unx/generic/gdi/salgdi3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index bf95d229e000..4934ed7f83fa 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -246,7 +246,7 @@ namespace { bool isCairoRenderable(const ServerFont& rFont) { - return rFont.GetFtFace() && rFont.GetAntialiasAdvice(); + return rFont.GetFtFace(); } } //namespace -- cgit v1.2.3 From 5ff29e7a9302c51ca5a41d398ee247141bcde11d Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 20 Jul 2011 05:26:52 -0700 Subject: Replace List with std::list< ImplBmpObj* > MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bool should be set to "false" & "true" not the sal_ versions of them. Special thanks go to Matúš Kukan for compiling and help fixing the patch. --- vcl/inc/unx/salbmp.h | 6 ++++- vcl/unx/generic/gdi/salbmp.cxx | 59 +++++++++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 42230d8bbde7..0fa69ae5a72f 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -36,6 +36,7 @@ #include #include #include +#include struct BitmapBuffer; class BitmapPalette; @@ -246,11 +247,14 @@ public: // - ImplSalBitmapCache - // ---------------------- +struct ImplBmpObj; + class ImplSalBitmapCache { private: + typedef ::std::list< ImplBmpObj* > BmpList_impl; - List maBmpList; + BmpList_impl maBmpList; sal_uIntPtr mnTotalSize; public: diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 0b9e69abb940..22a5d1eddb26 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -826,14 +826,14 @@ bool X11SalBitmap::Create( const SalBitmap& rSSalBmp ) bool X11SalBitmap::Create( const SalBitmap&, SalGraphics* ) { - return sal_False; + return false; } // ----------------------------------------------------------------------------- bool X11SalBitmap::Create( const SalBitmap&, sal_uInt16 ) { - return sal_False; + return false; } // ----------------------------------------------------------------------------- @@ -1100,7 +1100,7 @@ ImplSalDDB::~ImplSalDDB() bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRect ) const { - bool bRet = sal_False; + bool bRet = false; if( ( maPixmap != 0 ) && ( ( mnDepth == nDepth ) || ( 1 == mnDepth ) ) && nScreen == mnScreen) { @@ -1113,7 +1113,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe ) { // absolutely indentically - bRet = sal_True; + bRet = true; } else if( rTwoRect.mnSrcWidth == rTwoRect.mnDestWidth && rTwoRect.mnSrcHeight == rTwoRect.mnDestHeight @@ -1125,7 +1125,7 @@ bool ImplSalDDB::ImplMatches( int nScreen, long nDepth, const SalTwoRect& rTwoRe && ( rTwoRect.mnSrcY + rTwoRect.mnSrcHeight ) <= ( maTwoRect.mnSrcY + maTwoRect.mnSrcHeight ) ) { - bRet = sal_True; + bRet = true; } } @@ -1209,12 +1209,18 @@ ImplSalBitmapCache::~ImplSalBitmapCache() void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uLong nFlags ) { - ImplBmpObj* pObj; - bool bFound = sal_False; - - for( pObj = (ImplBmpObj*) maBmpList.Last(); pObj && !bFound; pObj = (ImplBmpObj*) maBmpList.Prev() ) + ImplBmpObj* pObj = NULL; + bool bFound = false; + + for( + BmpList_impl::iterator it = maBmpList.begin(); + (it != maBmpList.end() ) && !bFound ; + ++it + ) { + pObj = *it; if( pObj->mpBmp == pBmp ) - bFound = sal_True; + bFound = true; + } mnTotalSize += nMemSize; @@ -1224,21 +1230,24 @@ void ImplSalBitmapCache::ImplAdd( X11SalBitmap* pBmp, sal_uLong nMemSize, sal_uL pObj->mnMemSize = nMemSize, pObj->mnFlags = nFlags; } else - maBmpList.Insert( new ImplBmpObj( pBmp, nMemSize, nFlags ), LIST_APPEND ); + maBmpList.push_back( new ImplBmpObj( pBmp, nMemSize, nFlags ) ); } // ----------------------------------------------------------------------------- void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp ) { - for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.Last(); pObj; pObj = (ImplBmpObj*) maBmpList.Prev() ) - { - if( pObj->mpBmp == pBmp ) + for( + BmpList_impl::iterator it = maBmpList.begin(); + it != maBmpList.end(); + ++it + ) { + if( (*it)->mpBmp == pBmp ) { - maBmpList.Remove( pObj ); - pObj->mpBmp->ImplRemovedFromCache(); - mnTotalSize -= pObj->mnMemSize; - delete pObj; + (*it)->mpBmp->ImplRemovedFromCache(); + mnTotalSize -= (*it)->mnMemSize; + delete *it; + maBmpList.erase( it ); break; } } @@ -1248,13 +1257,15 @@ void ImplSalBitmapCache::ImplRemove( X11SalBitmap* pBmp ) void ImplSalBitmapCache::ImplClear() { - for( ImplBmpObj* pObj = (ImplBmpObj*) maBmpList.First(); pObj; pObj = (ImplBmpObj*) maBmpList.Next() ) - { - pObj->mpBmp->ImplRemovedFromCache(); - delete pObj; + for( + BmpList_impl::iterator it = maBmpList.begin(); + it != maBmpList.end(); + ++it + ) { + (*it)->mpBmp->ImplRemovedFromCache(); + delete *it; } - - maBmpList.Clear(); + maBmpList.clear(); mnTotalSize = 0; } -- cgit v1.2.3 From 91ee802640453de271dac368ad22b315e2527905 Mon Sep 17 00:00:00 2001 From: Joseph Powers Date: Wed, 20 Jul 2011 06:33:30 -0700 Subject: Whitespace cleanup --- svtools/source/filter/wmf/winmtf.hxx | 467 +++++++++++++++++++++-------------- 1 file changed, 283 insertions(+), 184 deletions(-) diff --git a/svtools/source/filter/wmf/winmtf.hxx b/svtools/source/filter/wmf/winmtf.hxx index 16e9296a2b8f..270af93a4675 100644 --- a/svtools/source/filter/wmf/winmtf.hxx +++ b/svtools/source/filter/wmf/winmtf.hxx @@ -298,7 +298,6 @@ struct WMF_APMFILEHEADER; //============================ WMFReader ================================== - #ifdef WIN_MTF_ASSERT #define WIN_MTF_ASSERT_INIT 0x80000000 #define WIN_MTF_ASSERT_ONCE 0x40000000 @@ -319,35 +318,34 @@ public : void excludeClipRect( const Rectangle& rRect ); void moveClipRegion( const Size& rSize ); - bool isEmpty() const { return maClip.isCleared(); } + bool isEmpty() const { return maClip.isCleared(); } basegfx::B2DPolyPolygon getClipPath() const; - bool operator==( const WinMtfClipPath& rPath ) const - { - return maClip == rPath.maClip; - }; + bool operator==( const WinMtfClipPath& rPath ) const + { + return maClip == rPath.maClip; + }; }; class WinMtfPathObj : public PolyPolygon { - sal_Bool bClosed; + sal_Bool bClosed; - public : +public : WinMtfPathObj() { bClosed = sal_True; } - void Init() { Clear(); bClosed = sal_True; }; - void ClosePath(); - - void AddPoint( const Point& rPoint ); - void AddPolygon( const Polygon& rPoly ); - void AddPolyLine( const Polygon& rPoly ); - void AddPolyPolygon( const PolyPolygon& rPolyPolygon ); + void Init() { Clear(); bClosed = sal_True; }; + void ClosePath(); + void AddPoint( const Point& rPoint ); + void AddPolygon( const Polygon& rPoly ); + void AddPolyLine( const Polygon& rPoly ); + void AddPolyPolygon( const PolyPolygon& rPolyPolygon ); }; struct WinMtfFontStyle { - Font aFont; + Font aFont; WinMtfFontStyle( LOGFONTW& rLogFont ); }; @@ -362,7 +360,7 @@ typedef enum { struct WinMtfFillStyle { Color aFillColor; - sal_Bool bTransparent; + sal_Bool bTransparent; WinMtfFillStyleType aType; Bitmap aBmp; @@ -387,11 +385,35 @@ struct WinMtfFillStyle } sal_Bool operator==( const WinMtfFillStyle& rStyle ) - { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) && ( aType == rStyle.aType ) ); } + { + return ( ( aFillColor == rStyle.aFillColor ) + && ( bTransparent == rStyle.bTransparent ) + && ( aType == rStyle.aType ) + ); + } sal_Bool operator==( WinMtfFillStyle* pStyle ) - { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) && ( aType == pStyle->aType ) ); } - WinMtfFillStyle& operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; aBmp = rStyle.aBmp; aType = rStyle.aType; return *this; } - WinMtfFillStyle& operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; aBmp = pStyle->aBmp; aType = pStyle->aType; return *this; } + { + return ( ( aFillColor == pStyle->aFillColor ) + && ( bTransparent == pStyle->bTransparent ) + && ( aType == pStyle->aType ) + ); + } + WinMtfFillStyle& operator=( const WinMtfFillStyle& rStyle ) + { + aFillColor = rStyle.aFillColor; + bTransparent = rStyle.bTransparent; + aBmp = rStyle.aBmp; + aType = rStyle.aType; + return *this; + } + WinMtfFillStyle& operator=( WinMtfFillStyle* pStyle ) + { + aFillColor = pStyle->aFillColor; + bTransparent = pStyle->bTransparent; + aBmp = pStyle->aBmp; + aType = pStyle->aType; + return *this; + } }; // ----------------------------------------------------------------------------- @@ -415,8 +437,20 @@ struct WinMtfLineStyle aLineInfo ( rStyle ), bTransparent( bTrans ) {} - sal_Bool operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); } - sal_Bool operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); } + sal_Bool operator==( const WinMtfLineStyle& rStyle ) + { + return ( ( aLineColor == rStyle.aLineColor ) + && ( bTransparent == rStyle.bTransparent ) + && ( aLineInfo == rStyle.aLineInfo ) + ); + } + sal_Bool operator==( WinMtfLineStyle* pStyle ) + { + return ( ( aLineColor == pStyle->aLineColor ) + && ( bTransparent == pStyle->bTransparent ) + && ( aLineInfo == pStyle->aLineInfo ) + ); + } WinMtfLineStyle& operator=( const WinMtfLineStyle& rStyle ) { aLineColor = rStyle.aLineColor; @@ -490,13 +524,30 @@ struct BSaveStruct sal_uInt32 nWinRop; WinMtfFillStyle aStyle; - BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, sal_uInt32 nRop, WinMtfFillStyle& rStyle ) : - aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ), aStyle ( rStyle ){} + BSaveStruct( + const Bitmap& rBmp, + const Rectangle& rOutRect, + sal_uInt32 nRop, + WinMtfFillStyle& rStyle + ) + : aBmp( rBmp ) + , aOutRect( rOutRect ) + , nWinRop( nRop ) + , aStyle ( rStyle ) + {} }; // ----------------------------------------------------------------------------- -enum GDIObjectType { GDI_DUMMY = 0, GDI_PEN = 1, GDI_BRUSH = 2, GDI_FONT = 3, GDI_PALETTE = 4, GDI_BITMAP = 5, GDI_REGION = 6 }; +enum GDIObjectType { + GDI_DUMMY = 0, + GDI_PEN = 1, + GDI_BRUSH = 2, + GDI_FONT = 3, + GDI_PALETTE = 4, + GDI_BITMAP = 5, + GDI_REGION = 6 +}; struct GDIObj { @@ -546,163 +597,193 @@ struct GDIObj class WinMtfOutput { - WinMtfPathObj aPathObj; - WinMtfClipPath aClipPath; - - WinMtfLineStyle maLatestLineStyle; - WinMtfLineStyle maLineStyle; - WinMtfFillStyle maLatestFillStyle; - WinMtfFillStyle maFillStyle; - Font maLatestFont; - Font maFont; - sal_uInt32 mnLatestTextAlign; - sal_uInt32 mnTextAlign; - Color maLatestTextColor; - Color maTextColor; - Color maLatestBkColor; - Color maBkColor; - sal_uInt32 mnLatestTextLayoutMode; - sal_uInt32 mnTextLayoutMode; - sal_uInt32 mnLatestBkMode; - sal_uInt32 mnBkMode; - RasterOp meLatestRasterOp; - RasterOp meRasterOp; - - std::vector< GDIObj* > vGDIObj; - - Point maActPos; - - sal_uInt32 mnRop; - sal_Bool mbNopMode; - sal_Bool mbFillStyleSelected; - sal_Bool mbClipNeedsUpdate; - sal_Bool mbComplexClip; - - std::vector< SaveStructPtr > vSaveStack; - - sal_uInt32 mnGfxMode; - sal_uInt32 mnMapMode; - sal_uInt16 mnUnitsPerInch; - - XForm maXForm; - sal_Int32 mnDevOrgX, mnDevOrgY; - sal_Int32 mnDevWidth, mnDevHeight; - sal_Int32 mnWinOrgX, mnWinOrgY; // aktuelles Window-Origin - sal_Int32 mnWinExtX, mnWinExtY; // aktuelles Window-Extent - - sal_Int32 mnPixX, mnPixY; // Reference Device in pixel - sal_Int32 mnMillX, mnMillY; // Reference Device in Mill - Rectangle mrclFrame; // rectangle in logical units 1/100th mm - Rectangle mrclBounds; - - GDIMetaFile* mpGDIMetaFile; - - void UpdateLineStyle(); - void UpdateFillStyle(); - - Point ImplMap( const Point& rPt ); - Size ImplMap( const Size& rSz ); - Rectangle ImplMap( const Rectangle& rRectangle ); - void ImplMap( Font& rFont ); - Polygon& ImplMap( Polygon& rPolygon ); - PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon ); - void ImplResizeObjectArry( sal_uInt32 nNewEntry ); - void ImplSetNonPersistentLineColorTransparenz(); - void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly ); - void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap ); - - public: - - void SetDevOrg( const Point& rPoint ); - void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ); - void SetDevExt( const Size& rSize ); - void ScaleDevExt( double fX, double fY ); - - void SetWinOrg( const Point& rPoint ); - void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY ); - void SetWinExt( const Size& rSize ); - void ScaleWinExt( double fX, double fY ); - - void SetrclBounds( const Rectangle& rRect ); - void SetrclFrame( const Rectangle& rRect ); - void SetRefPix( const Size& rSize ); - void SetRefMill( const Size& rSize ); - - sal_uInt32 GetMapMode() const { return mnMapMode; }; - void SetMapMode( sal_uInt32 mnMapMode ); - void SetUnitsPerInch( sal_uInt16 nUnitsPerInch ); - void SetWorldTransform( const XForm& rXForm ); - void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); - - void Push(); - void Pop(); - - sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp ); - void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ); - - void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; - sal_Int32 GetGfxMode() const { return mnGfxMode; }; - void SetBkMode( sal_uInt32 nMode ); - void SetBkColor( const Color& rColor ); - void SetTextColor( const Color& rColor ); - void SetTextAlign( sal_uInt32 nAlign ); - void CreateObject( GDIObjectType, void* pStyle = NULL ); - void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL ); - void DeleteObject( sal_Int32 nIndex ); - void SelectObject( sal_Int32 nIndex ); - CharSet GetCharSet(){ return maFont.GetCharSet(); }; - WinMtfFillStyle& GetFillStyle () { return maFillStyle; } - void SetFont( const Font& rFont ); - const Font& GetFont() const; - void SetTextLayoutMode( const sal_uInt32 nLayoutMode ); - sal_uInt32 GetTextLayoutMode() const; - - void ClearPath(){ aPathObj.Init(); }; - void ClosePath(){ aPathObj.ClosePath(); }; - const PolyPolygon& GetPathObj(){ return aPathObj; }; - - void MoveTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); - void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); - void DrawPixel( const Point& rSource, const Color& rColor ); - void DrawLine( const Point& rSource, const Point& rDest ); - void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True ); - void DrawRoundRect( const Rectangle& rRect, const Size& rSize ); - void DrawEllipse( const Rectangle& rRect ); - void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, sal_Bool bDrawTo = sal_False ); - void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); - void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ); - void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False ); - void DrawPolyPolygon( PolyPolygon& rPolyPolygon, sal_Bool bRecordPath = sal_False ); - void DrawPolyLine( Polygon& rPolygon, sal_Bool bDrawTo = sal_False, sal_Bool bRecordPath = sal_False ); - void DrawPolyBezier( Polygon& rPolygin, sal_Bool bDrawTo = sal_False, sal_Bool bRecordPath = sal_False ); - void DrawText( Point& rPosition, String& rString, sal_Int32* pDXArry = NULL, sal_Bool bRecordPath = sal_False, - sal_Int32 nGraphicsMode = GM_COMPATIBLE ); - void ResolveBitmapActions( List& rSaveList ); - - void IntersectClipRect( const Rectangle& rRect ); - void ExcludeClipRect( const Rectangle& rRect ); - void MoveClipRegion( const Size& rSize ); - void SetClipPath( const PolyPolygon& rPolyPoly, sal_Int32 nClippingMode, sal_Bool bIsMapped ); - void UpdateClipRegion(); - void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); - - void PassEMFPlus( void* pBuffer, sal_uInt32 nLength ); - void PassEMFPlusHeaderInfo(); - - WinMtfOutput( GDIMetaFile& rGDIMetaFile ); - virtual ~WinMtfOutput(); + WinMtfPathObj aPathObj; + WinMtfClipPath aClipPath; + + WinMtfLineStyle maLatestLineStyle; + WinMtfLineStyle maLineStyle; + WinMtfFillStyle maLatestFillStyle; + WinMtfFillStyle maFillStyle; + Font maLatestFont; + Font maFont; + sal_uInt32 mnLatestTextAlign; + sal_uInt32 mnTextAlign; + Color maLatestTextColor; + Color maTextColor; + Color maLatestBkColor; + Color maBkColor; + sal_uInt32 mnLatestTextLayoutMode; + sal_uInt32 mnTextLayoutMode; + sal_uInt32 mnLatestBkMode; + sal_uInt32 mnBkMode; + RasterOp meLatestRasterOp; + RasterOp meRasterOp; + + std::vector< GDIObj* > vGDIObj; + + Point maActPos; + + sal_uInt32 mnRop; + sal_Bool mbNopMode; + sal_Bool mbFillStyleSelected; + sal_Bool mbClipNeedsUpdate; + sal_Bool mbComplexClip; + + std::vector< SaveStructPtr > vSaveStack; + + sal_uInt32 mnGfxMode; + sal_uInt32 mnMapMode; + sal_uInt16 mnUnitsPerInch; + + XForm maXForm; + sal_Int32 mnDevOrgX, mnDevOrgY; + sal_Int32 mnDevWidth, mnDevHeight; + sal_Int32 mnWinOrgX, mnWinOrgY; // aktuelles Window-Origin + sal_Int32 mnWinExtX, mnWinExtY; // aktuelles Window-Extent + + sal_Int32 mnPixX, mnPixY; // Reference Device in pixel + sal_Int32 mnMillX, mnMillY; // Reference Device in Mill + Rectangle mrclFrame; // rectangle in logical units 1/100th mm + Rectangle mrclBounds; + + GDIMetaFile* mpGDIMetaFile; + + void UpdateLineStyle(); + void UpdateFillStyle(); + + Point ImplMap( const Point& rPt ); + Size ImplMap( const Size& rSz ); + Rectangle ImplMap( const Rectangle& rRectangle ); + void ImplMap( Font& rFont ); + Polygon& ImplMap( Polygon& rPolygon ); + PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon ); + void ImplResizeObjectArry( sal_uInt32 nNewEntry ); + void ImplSetNonPersistentLineColorTransparenz(); + void ImplDrawClippedPolyPolygon( const PolyPolygon& rPolyPoly ); + void ImplDrawBitmap( const Point& rPos, const Size& rSize, const BitmapEx rBitmap ); + +public: + + void SetDevOrg( const Point& rPoint ); + void SetDevOrgOffset( sal_Int32 nXAdd, sal_Int32 nYAdd ); + void SetDevExt( const Size& rSize ); + void ScaleDevExt( double fX, double fY ); + + void SetWinOrg( const Point& rPoint ); + void SetWinOrgOffset( sal_Int32 nX, sal_Int32 nY ); + void SetWinExt( const Size& rSize ); + void ScaleWinExt( double fX, double fY ); + + void SetrclBounds( const Rectangle& rRect ); + void SetrclFrame( const Rectangle& rRect ); + void SetRefPix( const Size& rSize ); + void SetRefMill( const Size& rSize ); + + sal_uInt32 GetMapMode() const { return mnMapMode; }; + void SetMapMode( sal_uInt32 mnMapMode ); + void SetUnitsPerInch( sal_uInt16 nUnitsPerInch ); + void SetWorldTransform( const XForm& rXForm ); + void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); + + void Push(); + void Pop(); + + sal_uInt32 SetRasterOp( sal_uInt32 nRasterOp ); + void StrokeAndFillPath( sal_Bool bStroke, sal_Bool bFill ); + + void SetGfxMode( sal_Int32 nGfxMode ){ mnGfxMode = nGfxMode; }; + sal_Int32 GetGfxMode() const { return mnGfxMode; }; + void SetBkMode( sal_uInt32 nMode ); + void SetBkColor( const Color& rColor ); + void SetTextColor( const Color& rColor ); + void SetTextAlign( sal_uInt32 nAlign ); + void CreateObject( GDIObjectType, void* pStyle = NULL ); + void CreateObject( sal_Int32 nIndex, GDIObjectType, void* pStyle = NULL ); + void DeleteObject( sal_Int32 nIndex ); + void SelectObject( sal_Int32 nIndex ); + CharSet GetCharSet(){ return maFont.GetCharSet(); }; + WinMtfFillStyle& GetFillStyle () { return maFillStyle; } + void SetFont( const Font& rFont ); + const Font& GetFont() const; + void SetTextLayoutMode( const sal_uInt32 nLayoutMode ); + sal_uInt32 GetTextLayoutMode() const; + + void ClearPath(){ aPathObj.Init(); }; + void ClosePath(){ aPathObj.ClosePath(); }; + const PolyPolygon& GetPathObj(){ return aPathObj; }; + + void MoveTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); + void LineTo( const Point& rPoint, sal_Bool bRecordPath = sal_False ); + void DrawPixel( const Point& rSource, const Color& rColor ); + void DrawLine( const Point& rSource, const Point& rDest ); + void DrawRect( const Rectangle& rRect, sal_Bool bEdge = sal_True ); + void DrawRoundRect( const Rectangle& rRect, const Size& rSize ); + void DrawEllipse( const Rectangle& rRect ); + void DrawArc( + const Rectangle& rRect, + const Point& rStartAngle, + const Point& rEndAngle, + sal_Bool bDrawTo = sal_False + ); + void DrawPie( + const Rectangle& rRect, + const Point& rStartAngle, + const Point& rEndAngle + ); + void DrawChord( + const Rectangle& rRect, + const Point& rStartAngle, + const Point& rEndAngle + ); + void DrawPolygon( Polygon& rPolygon, sal_Bool bRecordPath = sal_False ); + void DrawPolyPolygon( PolyPolygon& rPolyPolygon, sal_Bool bRecordPath = sal_False ); + void DrawPolyLine( + Polygon& rPolygon, + sal_Bool bDrawTo = sal_False, + sal_Bool bRecordPath = sal_False + ); + void DrawPolyBezier( + Polygon& rPolygin, + sal_Bool bDrawTo = sal_False, + sal_Bool bRecordPath = sal_False + ); + void DrawText( + Point& rPosition, + String& rString, + sal_Int32* pDXArry = NULL, + sal_Bool bRecordPath = sal_False, + sal_Int32 nGraphicsMode = GM_COMPATIBLE + ); + void ResolveBitmapActions( List& rSaveList ); + + void IntersectClipRect( const Rectangle& rRect ); + void ExcludeClipRect( const Rectangle& rRect ); + void MoveClipRegion( const Size& rSize ); + void SetClipPath( + const PolyPolygon& rPolyPoly, + sal_Int32 nClippingMode, + sal_Bool bIsMapped + ); + void UpdateClipRegion(); + void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); + + void PassEMFPlus( void* pBuffer, sal_uInt32 nLength ); + void PassEMFPlusHeaderInfo(); + + WinMtfOutput( GDIMetaFile& rGDIMetaFile ); + virtual ~WinMtfOutput(); }; // ----------------------------------------------------------------------------- class WinMtf { - protected: +protected: WinMtfOutput* pOut; // SvStream* pWMF; // Die einzulesende WMF/EMF-Datei - sal_uInt32 nStartPos, nEndPos; + sal_uInt32 nStartPos, nEndPos; List aBmpSaveList; FilterConfigItem* pFilterConfigItem; @@ -714,10 +795,14 @@ class WinMtf Color ReadColor(); void Callback( sal_uInt16 nPercent ); - WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, FilterConfigItem* pConfigItem = NULL ); + WinMtf( + WinMtfOutput* pOut, + SvStream& rStreamWMF, + FilterConfigItem* pConfigItem = NULL + ); ~WinMtf(); - public: +public: }; @@ -730,16 +815,26 @@ class EnhWMFReader : public WinMtf sal_Bool bEMFPlus; - sal_Bool ReadHeader(); - Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); // Liesst und konvertiert ein Rechteck + sal_Bool ReadHeader(); + // Liesst und konvertiert ein Rechteck + Rectangle ReadRectangle( sal_Int32, sal_Int32, sal_Int32, sal_Int32 ); void ImplExtTextOut( sal_Bool bWideCharakter ); public: - EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) - : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ), bRecordPath( sal_False ), bEMFPlus( sal_False ) {}; + EnhWMFReader( + SvStream& rStreamWMF, + GDIMetaFile& rGDIMetaFile, + FilterConfigItem* pConfigItem = NULL + ) + : WinMtf( new WinMtfOutput( rGDIMetaFile ) + , rStreamWMF + , pConfigItem ) + , bRecordPath( sal_False ) + , bEMFPlus( sal_False ) + {}; ~EnhWMFReader(); - sal_Bool ReadEnhWMF(); + sal_Bool ReadEnhWMF(); void ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC); void ReadGDIComment(); }; @@ -751,7 +846,7 @@ class WMFReader : public WinMtf private: VirtualDevice aVDev; // just for the purpose of "IsFontAvailable" - sal_uInt16 nUnitsPerInch; + sal_uInt16 nUnitsPerInch; sal_uInt32 nRecSize; // embedded EMF data @@ -771,7 +866,7 @@ private: sal_uInt32 nUnicodeEscapeAction; // Liesst den Kopf der WMF-Datei - sal_Bool ReadHeader(WMF_APMFILEHEADER *pAPMHeader); + sal_Bool ReadHeader( WMF_APMFILEHEADER *pAPMHeader ); // Liesst die Parameter des Rocords mit der Funktionsnummer nFunction. void ReadRecordParams( sal_uInt16 nFunction ); @@ -784,10 +879,14 @@ private: public: - WMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) + WMFReader( + SvStream& rStreamWMF, + GDIMetaFile& rGDIMetaFile, + FilterConfigItem* pConfigItem = NULL + ) : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ) , pEMFStream(NULL) - {} + {} ~WMFReader(); -- cgit v1.2.3 From 63bd3f537793e83adccbccc6936ca730138d9aae Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:10:17 +0200 Subject: callcatcher: cleanup Application::Foo --- vcl/inc/vcl/svapp.hxx | 14 ----- vcl/source/app/svapp.cxx | 140 ----------------------------------------------- 2 files changed, 154 deletions(-) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 20eec8a9811e..d0212fbc4d37 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -232,8 +232,6 @@ public: virtual void InitFinished(); virtual void DeInit(); - static void InitAppRes( const ResId& rResId ); - static sal_uInt16 GetCommandLineParamCount(); static XubString GetCommandLineParam( sal_uInt16 nParam ); static const XubString& GetAppFileName(); @@ -256,7 +254,6 @@ public: static sal_Bool IsInMain(); static sal_Bool IsInExecute(); - static sal_Bool IsShutDown(); static sal_Bool IsInModalMode(); static sal_uInt16 GetModalModeCount(); @@ -264,7 +261,6 @@ public: static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY ); static sal_uLong GetLastInputInterval(); static sal_Bool IsUICaptured(); - static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL ); virtual void SystemSettingsChanging( AllSettings& rSettings, Window* pFrame ); @@ -300,7 +296,6 @@ public: static void RemoveMouseAndKeyEvents( Window *pWin ); static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); - static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); @@ -357,16 +352,11 @@ public: static sal_Bool InsertAccel( Accelerator* pAccel ); static void RemoveAccel( Accelerator* pAccel ); - static void FlushAccel(); static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); - static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL ); - static void RemoveHotKey( sal_uLong nId ); static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL ); static void RemoveEventHook( sal_uLong nId ); static long CallEventHooks( NotifyEvent& rEvt ); - static long CallPreNotify( NotifyEvent& rEvt ); - static long CallEvent( NotifyEvent& rEvt ); static void SetHelp( Help* pHelp = NULL ); static Help* GetHelp(); @@ -390,9 +380,7 @@ public: static sal_uInt16 GetSystemWindowMode(); static void SetDialogScaleX( short nScale ); - static short GetDialogScaleX(); - static void SetFontPath( const String& rPath ); static const String& GetFontPath(); static UniqueItemId CreateUniqueId(); @@ -407,8 +395,6 @@ public: static void SetFilterHdl( const Link& rLink ); static const Link& GetFilterHdl(); - static sal_Bool IsAccessibilityEnabled(); - static void EnableHeadlessMode( sal_Bool bEnable = sal_True ); static sal_Bool IsHeadlessModeEnabled(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e6619cbfd20b..dc63f172d87a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -241,12 +241,6 @@ Application::~Application() // ----------------------------------------------------------------------- -void Application::InitAppRes( const ResId& ) -{ -} - -// ----------------------------------------------------------------------- - sal_Bool Application::QueryExit() { WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin; @@ -549,13 +543,6 @@ sal_Bool Application::IsInExecute() // ----------------------------------------------------------------------- -sal_Bool Application::IsShutDown() -{ - return ImplGetSVData()->maAppData.mbAppQuit; -} - -// ----------------------------------------------------------------------- - sal_Bool Application::IsInModalMode() { return (ImplGetSVData()->maAppData.mnModalMode != 0); @@ -609,34 +596,6 @@ sal_Bool Application::IsUICaptured() // ----------------------------------------------------------------------- -sal_Bool Application::IsUserActive( sal_uInt16 nTest ) -{ - if ( nTest & (USERACTIVE_MOUSEDRAG | USERACTIVE_INPUT) ) - { - if ( IsUICaptured() ) - return sal_True; - } - - if ( nTest & USERACTIVE_INPUT ) - { - if ( GetLastInputInterval() < 500 ) - return sal_True; - - if ( AnyInput( INPUT_KEYBOARD ) ) - return sal_True; - } - - if ( nTest & USERACTIVE_MODALDIALOG ) - { - if ( ImplGetSVData()->maAppData.mnModalDialog ) - return sal_True; - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - void Application::SystemSettingsChanging( AllSettings& /*rSettings*/, Window* /*pFrame*/ ) { @@ -1064,15 +1023,6 @@ sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId ) // ----------------------------------------------------------------------- -sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData ) -{ - sal_uLong nEventId; - PostUserEvent( nEventId, nEvent, pEventData ); - return nEventId; -} - -// ----------------------------------------------------------------------- - sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller ) { sal_uLong nEventId; @@ -1453,16 +1403,6 @@ void Application::RemoveAccel( Accelerator* pAccel ) // ----------------------------------------------------------------------- -void Application::FlushAccel() -{ - ImplSVData* pSVData = ImplGetSVData(); - - if ( pSVData->maAppData.mpAccelMgr ) - pSVData->maAppData.mpAccelMgr->FlushAccel(); -} - -// ----------------------------------------------------------------------- - sal_Bool Application::CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { ImplSVData* pSVData = ImplGetSVData(); @@ -1535,13 +1475,6 @@ void Application::SetDialogScaleX( short nScale ) // ----------------------------------------------------------------------- -short Application::GetDialogScaleX() -{ - return ImplGetSVData()->maAppData.mnDialogScaleX; -} - -// ----------------------------------------------------------------------- - void Application::SetDefDialogParent( Window* pWindow ) { ImplGetSVData()->maWinData.mpDefDialogParent = pWindow; @@ -1663,19 +1596,6 @@ const String& Application::GetFontPath() // ----------------------------------------------------------------------- -void Application::SetFontPath( const String& rPath ) -{ - ImplSVData* pSVData = ImplGetSVData(); - - // if it doesn't exist create a new one - if( !pSVData->maAppData.mpFontPath ) - pSVData->maAppData.mpFontPath = new String( rPath ); - else - *(pSVData->maAppData.mpFontPath) = rPath; -} - -// ----------------------------------------------------------------------- - UniqueItemId Application::CreateUniqueId() { ImplSVData* pSVData = ImplGetSVData(); @@ -1801,47 +1721,6 @@ void ImplFreeHotKeyData() // ----------------------------------------------------------------------- -sal_uIntPtr Application::AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData ) -{ - ImplSVData* pSVData = ImplGetSVData(); - ImplHotKey* pHotKeyData = new ImplHotKey; - pHotKeyData->mpUserData = pData; - pHotKeyData->maKeyCode = rKeyCode; - pHotKeyData->maLink = rLink; - pHotKeyData->mpNext = pSVData->maAppData.mpFirstHotKey; - pSVData->maAppData.mpFirstHotKey = pHotKeyData; - return (sal_uIntPtr)pHotKeyData; -} - -// ----------------------------------------------------------------------- - -void Application::RemoveHotKey( sal_uIntPtr nId ) -{ - ImplSVData* pSVData = ImplGetSVData(); - ImplHotKey* pFindHotKeyData = (ImplHotKey*)nId; - ImplHotKey* pPrevHotKeyData = NULL; - ImplHotKey* pHotKeyData = pSVData->maAppData.mpFirstHotKey; - while ( pHotKeyData ) - { - if ( pHotKeyData == pFindHotKeyData ) - { - if ( pPrevHotKeyData ) - pPrevHotKeyData->mpNext = pFindHotKeyData->mpNext; - else - pSVData->maAppData.mpFirstHotKey = pFindHotKeyData->mpNext; - delete pFindHotKeyData; - break; - } - - pPrevHotKeyData = pHotKeyData; - pHotKeyData = pHotKeyData->mpNext; - } - - DBG_ASSERT( pHotKeyData, "Application::RemoveHotKey() - HotKey is not added" ); -} - -// ----------------------------------------------------------------------- - void ImplFreeEventHookData() { ImplSVData* pSVData = ImplGetSVData(); @@ -1919,20 +1798,6 @@ long Application::CallEventHooks( NotifyEvent& rEvt ) // ----------------------------------------------------------------------- -long Application::CallPreNotify( NotifyEvent& rEvt ) -{ - return ImplCallPreNotify( rEvt ); -} - -// ----------------------------------------------------------------------- - -long Application::CallEvent( NotifyEvent& rEvt ) -{ - return ImplCallEvent( rEvt ); -} - -// ----------------------------------------------------------------------- - const LocaleDataWrapper& Application::GetAppLocaleDataWrapper() { return GetSettings().GetLocaleDataWrapper(); @@ -2008,11 +1873,6 @@ void Application::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r pSVData->mpDefInst->AddToRecentDocumentList(rFileUrl, rMimeType); } -sal_Bool Application::IsAccessibilityEnabled() -{ - return sal_False; -} - sal_Bool InitAccessBridge( sal_Bool bShowCancel, sal_Bool &rCancelled ) { sal_Bool bRet = true; -- cgit v1.2.3 From f79a846c6d2cc1e4213334ec7b47d0e1680bafa7 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:13:16 +0200 Subject: callcatcher: cleanup Animation::Foo --- vcl/inc/vcl/animate.hxx | 3 --- vcl/source/gdi/animate.cxx | 44 -------------------------------------------- 2 files changed, 47 deletions(-) diff --git a/vcl/inc/vcl/animate.hxx b/vcl/inc/vcl/animate.hxx index aaf88c8b6e76..956f63f330f8 100644 --- a/vcl/inc/vcl/animate.hxx +++ b/vcl/inc/vcl/animate.hxx @@ -192,8 +192,6 @@ public: sal_Bool operator!=( const Animation& rAnimation ) const { return !(*this==rAnimation); } - sal_Bool IsEqual( const Animation& rAnimation ) const; - sal_Bool IsEmpty() const; void SetEmpty(); @@ -254,7 +252,6 @@ public: ); sal_Bool Invert(); sal_Bool Mirror( sal_uLong nMirrorFlags ); - sal_Bool Dither( sal_uLong nDitherFlags = BMP_DITHER_MATRIX ); sal_Bool Adjust( short nLuminancePercent = 0, short nContrastPercent = 0, diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 8cb6a47d902e..9dcbce01ffaf 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -190,27 +190,6 @@ sal_Bool Animation::operator==( const Animation& rAnimation ) const // ------------------------------------------------------------------ -sal_Bool Animation::IsEqual( const Animation& rAnimation ) const -{ - const size_t nCount = maList.size(); - sal_Bool bRet = sal_False; - - if( rAnimation.maList.size() == nCount - && rAnimation.maBitmapEx.IsEqual( maBitmapEx ) - && rAnimation.maGlobalSize == maGlobalSize - && rAnimation.meCycleMode == meCycleMode - ) - { - for( size_t n = 0; ( n < nCount ) && !bRet; n++ ) - if( maList[ n ]->IsEqual( *rAnimation.maList[ n ] ) ) - bRet = sal_True; - } - - return bRet; -} - -// ------------------------------------------------------------------ - sal_Bool Animation::IsEmpty() const { return( maBitmapEx.IsEmpty() && maList.empty() ); @@ -763,29 +742,6 @@ sal_Bool Animation::Mirror( sal_uLong nMirrorFlags ) // ----------------------------------------------------------------------- -sal_Bool Animation::Dither( sal_uLong nDitherFlags ) -{ - DBG_ASSERT( !IsInAnimation(), "Animation modified while it is animated" ); - - sal_Bool bRet; - - if( !IsInAnimation() && !maList.empty() ) - { - bRet = sal_True; - - for( size_t i = 0, n = maList.size(); ( i < n ) && bRet; ++i ) - bRet = maList[ i ]->aBmpEx.Dither( nDitherFlags ); - - maBitmapEx.Dither( nDitherFlags ); - } - else - bRet = sal_False; - - return bRet; -} - -// ----------------------------------------------------------------------- - sal_Bool Animation::Adjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent, short nChannelGPercent, short nChannelBPercent, double fGamma, sal_Bool bInvert ) -- cgit v1.2.3 From c2f4124291d1da026c97a560babf0a0dde5c76b6 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:24:13 +0200 Subject: callcatcher: cleanup BrowseBox --- svtools/inc/svtools/brwbox.hxx | 21 ----- svtools/source/brwbox/brwbox1.cxx | 188 -------------------------------------- svtools/source/brwbox/brwbox2.cxx | 7 -- 3 files changed, 216 deletions(-) diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx index edfacfa77e00..42bf18ff62db 100644 --- a/svtools/inc/svtools/brwbox.hxx +++ b/svtools/inc/svtools/brwbox.hxx @@ -409,9 +409,6 @@ protected: long CalcReverseZoom(long nVal); - HeaderBar* GetHeaderBar() const; - // header bar access for derived classes - inline const DataFlavorExVector& GetDataFlavors() const; @@ -493,20 +490,10 @@ public: // inserting, changing, removing and freezing of columns void InsertHandleColumn( sal_uLong nWidth ); - void InsertDataColumn( sal_uInt16 nItemId, const Image& rImage, - long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE, - sal_uInt16 nPos = HEADERBAR_APPEND ); void InsertDataColumn( sal_uInt16 nItemId, const XubString& rText, long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE, sal_uInt16 nPos = HEADERBAR_APPEND ); - void InsertDataColumn( sal_uInt16 nItemId, - const Image& rImage, const XubString& rText, - long nSize, HeaderBarItemBits nBits = HIB_STDSTYLE, - sal_uInt16 nPos = HEADERBAR_APPEND, - // Hilfstext bei leerem rText - const String* pHelpText = 0 ); void SetColumnTitle( sal_uInt16 nColumnId, const String &rTitle ); - void SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags ); void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth ); void SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ); void FreezeColumn( sal_uInt16 nColumnId, sal_Bool bFreeze = sal_True ); @@ -534,14 +521,12 @@ public: void ResetScroll(); long ScrollColumns( long nColumns ); long ScrollRows( long nRows ); - long ScrollPages( long nPagesY ); sal_Bool MakeFieldVisible( long nRow, sal_uInt16 nColId, sal_Bool bComplete = sal_False ); // access and movement of cursor long GetCurRow() const { return nCurRow; } sal_uInt16 GetCurColumnId() const { return nCurColId; } sal_Bool GoToRow( long nRow ); - sal_Bool GoToRowAndDoNotModifySelection( long nRow ); sal_Bool GoToColumnId( sal_uInt16 nColId ); sal_Bool GoToRowColumnId( long nRow, sal_uInt16 nColId ); @@ -557,23 +542,18 @@ public: sal_uInt16 GetSelectColumnCount() const; virtual bool IsRowSelected( long nRow ) const; bool IsColumnSelected( sal_uInt16 nColumnId ) const; - sal_Bool IsAllSelected() const; long FirstSelectedRow( sal_Bool bInverse = sal_False ); long LastSelectedRow(); - long PrevSelectedRow(); long NextSelectedRow(); const MultiSelection* GetColumnSelection() const { return pColSel; } const MultiSelection* GetSelection() const { return bMultiSelection ? uRow.pSel : 0; } - void SetSelection( const MultiSelection &rSelection ); long FirstSelectedColumn( ) const; - long NextSelectedColumn( ) const; sal_Bool IsResizing() const { return bResizing; } // access to positions of fields, column and rows - Window& GetEventWindow() const; Window& GetDataWindow() const { return *pDataWin; } Rectangle GetRowRectPixel( long nRow, sal_Bool bRelToBrowser = sal_True ) const; @@ -599,7 +579,6 @@ public: void Dispatch( sal_uInt16 nId ); void SetMode( BrowserMode nMode = 0 ); BrowserMode GetMode( ) const { return m_nCurrentMode; } - bool IsInCommandEvent() const; void SetCursorColor(const Color& _rCol); Color GetCursorColor() const { return m_aCursorColor; } diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 31e4a187574f..3619355ce355 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -265,36 +265,6 @@ void BrowseBox::InsertHandleColumn( sal_uLong nWidth ) ColumnInserted( 0 ); } -//------------------------------------------------------------------- -void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const Image& rImage, - long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos ) -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - if ( nPos < pCols->size() ) - { - BrowserColumns::iterator it = pCols->begin(); - ::std::advance( it, nPos ); - pCols->insert( it, new BrowserColumn( nItemId, rImage, String(), nWidth, GetZoom(), nBits ) ); - } - else - { - pCols->push_back( new BrowserColumn( nItemId, rImage, String(), nWidth, GetZoom(), nBits ) ); - } - if ( nCurColId == 0 ) - nCurColId = nItemId; - if ( getDataWindow()->pHeaderBar ) - { - // Handlecolumn nicht in der Headerbar - sal_uInt16 nHeaderPos = nPos; - if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0)) - nHeaderPos--; - getDataWindow()->pHeaderBar->InsertItem( - nItemId, rImage, nWidth, nBits, nHeaderPos ); - } - ColumnInserted( nPos ); -} - //------------------------------------------------------------------- void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const XubString& rText, @@ -327,45 +297,6 @@ void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const XubString& rText, ColumnInserted( nPos ); } -//------------------------------------------------------------------- - -void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, - const Image& rImage, const XubString& rText, - long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos, - const String* pHelpText ) -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - if ( nPos < pCols->size() ) - { - BrowserColumns::iterator it = pCols->begin(); - ::std::advance( it, nPos ); - pCols->insert( it, new BrowserColumn( nItemId, rImage, rText, nWidth, GetZoom(), nBits ) ); - } - else - { - pCols->push_back( new BrowserColumn( nItemId, rImage, rText, nWidth, GetZoom(), nBits ) ); - } - - if ( nCurColId == 0 ) - nCurColId = nItemId; - if ( getDataWindow()->pHeaderBar ) - { - // Handlecolumn nicht in der Headerbar - sal_uInt16 nHeaderPos = nPos; - if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0)) - nHeaderPos--; - - getDataWindow()->pHeaderBar->InsertItem( - nItemId, rImage, rText, nWidth, nBits, nHeaderPos ); - if( pHelpText && !rText.Len() ) - { - getDataWindow()->pHeaderBar->SetHelpText( - nItemId, *pHelpText ); - } - } - ColumnInserted( nPos ); -} //------------------------------------------------------------------- sal_uInt16 BrowseBox::ToggleSelectedColumn() { @@ -594,35 +525,6 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) //------------------------------------------------------------------- -void BrowseBox::SetColumnMode( sal_uInt16 nColumnId, BrowserColumnMode nFlags ) -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - // never set mode of the handle-column - if ( nColumnId == 0 ) - return; - - // get the position in the current array - size_t nColumnPos = GetColumnPos( nColumnId ); - if ( nColumnPos >= pCols->size() ) - // not available! - return; - - // does the state change? - BrowserColumn *pCol = (*pCols)[ nColumnPos ]; - if ( pCol->Flags() != nFlags ) - { - pCol->Flags() = sal::static_int_cast< HeaderBarItemBits >(nFlags); - - // redraw visible colums - if ( GetUpdateMode() && ( pCol->IsFrozen() || nColumnPos > nFirstCol ) ) - Invalidate( Rectangle( Point(0,0), - Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) ); - } -} - -//------------------------------------------------------------------- - void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const String& rTitle ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1213,15 +1115,6 @@ long BrowseBox::ScrollRows( long nRows ) //------------------------------------------------------------------- -long BrowseBox::ScrollPages( long ) -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - return ScrollRows( pDataWin->GetSizePixel().Height() / GetDataRowHeight() ); -} - -//------------------------------------------------------------------- - void BrowseBox::RowModified( long nRow, sal_uInt16 nColId ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1589,12 +1482,6 @@ sal_Bool BrowseBox::GoToRow( long nRow) //------------------------------------------------------------------- -sal_Bool BrowseBox::GoToRowAndDoNotModifySelection( long nRow ) -{ - return GoToRow( nRow, sal_False, sal_True ); -} - -//------------------------------------------------------------------- sal_Bool BrowseBox::GoToRow( long nRow, sal_Bool bRowColMove, sal_Bool bKeepSelection ) { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -1808,43 +1695,6 @@ void BrowseBox::SetNoSelection() //------------------------------------------------------------------- -void BrowseBox::SetSelection( const MultiSelection &rSel ) -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - DBG_ASSERT( bMultiSelection, "SetSelection only allowed with Multi-Selection-Mode" ); - - // prepare inverted areas - OSL_TRACE( "BrowseBox: %p->HideCursor", this ); - ToggleSelection(); - - // assign Selection - *uRow.pSel = rSel; - - // only highlight painted areas - pDataWin->Update(); - - // notify derived class - if ( !bSelecting ) - Select(); - else - bSelect = sal_True; - - // restore screen - ToggleSelection(); - OSL_TRACE( "BrowseBox: %p->ShowCursor", this ); - - if ( isAccessibleAlive() ) - { - commitTableEvent( - SELECTION_CHANGED, - Any(), - Any() - ); - } -} - -//------------------------------------------------------------------- - void BrowseBox::SelectAll() { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2077,12 +1927,6 @@ long BrowseBox::FirstSelectedColumn( ) const return pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION; } -//------------------------------------------------------------------- -long BrowseBox::NextSelectedColumn( ) const -{ - return pColSel ? pColSel->NextSelected() : BROWSER_ENDOFSELECTION; -} - //------------------------------------------------------------------- long BrowseBox::FirstSelectedRow( sal_Bool bInverse ) @@ -2103,15 +1947,6 @@ long BrowseBox::NextSelectedRow() //------------------------------------------------------------------- -long BrowseBox::PrevSelectedRow() -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - return bMultiSelection ? uRow.pSel->PrevSelected() : BROWSER_ENDOFSELECTION; -} - -//------------------------------------------------------------------- - long BrowseBox::LastSelectedRow() { DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); @@ -2140,15 +1975,6 @@ bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const //------------------------------------------------------------------- -sal_Bool BrowseBox::IsAllSelected() const -{ - DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants); - - return bMultiSelection && uRow.pSel->IsAllSelected(); -} - -//------------------------------------------------------------------- - sal_Bool BrowseBox::MakeFieldVisible ( long nRow, // Zeilen-Nr des Feldes (beginnend mit 0) @@ -2592,13 +2418,6 @@ long BrowseBox::GetDataRowHeight() const //------------------------------------------------------------------- -Window& BrowseBox::GetEventWindow() const -{ - return *getDataWindow()->pEventWin; -} - -//------------------------------------------------------------------- - BrowserHeader* BrowseBox::CreateHeaderBar( BrowseBox* pParent ) { BrowserHeader* pNewBar = new BrowserHeader( pParent ); @@ -2663,13 +2482,6 @@ long BrowseBox::CalcReverseZoom(long nVal) return nVal; } -//------------------------------------------------------------------- -HeaderBar* BrowseBox::GetHeaderBar() const -{ - return getDataWindow()->pHeaderBar; -} -//------------------------------------------------------------------- - void BrowseBox::CursorMoved() { // before implementing more here, please adjust the EditBrowseBox diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 9c9796baa90b..f62a95170c6a 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -149,13 +149,6 @@ void BrowseBox::Command( const CommandEvent& rEvt ) //=================================================================== -bool BrowseBox::IsInCommandEvent() const -{ - return getDataWindow()->bInCommand; -} - -//=================================================================== - void BrowseBox::StateChanged( StateChangedType nStateChange ) { Control::StateChanged( nStateChange ); -- cgit v1.2.3 From d8a09482fb417d60fa3ff79070ef9e701b44d3ad Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 15:26:15 +0200 Subject: callcatcher: remove unused BigInt::DivMod --- tools/inc/tools/bigint.hxx | 1 - tools/source/generic/bigint.cxx | 69 ----------------------------------------- 2 files changed, 70 deletions(-) diff --git a/tools/inc/tools/bigint.hxx b/tools/inc/tools/bigint.hxx index 58810fffdd99..1b1d60bdb6e3 100644 --- a/tools/inc/tools/bigint.hxx +++ b/tools/inc/tools/bigint.hxx @@ -105,7 +105,6 @@ public: sal_Bool IsOne() const; sal_Bool IsLong() const { return !bIsBig; } void Abs(); - void DivMod( const BigInt &rDivisor, BigInt &rMod ); #ifdef _TLBIGINT_INT64 sal_Bool INT64 ( SbxINT64 *p ) const; sal_Bool UINT64( SbxUINT64 *p ) const; diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx index 4392e56d5e44..2312f3c5eeaf 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -855,75 +855,6 @@ BigInt& BigInt::operator/=( const BigInt& rVal ) // ----------------------------------------------------------------------- -void BigInt::DivMod( const BigInt& rVal, BigInt& rMod ) -{ - if ( !rVal.bIsBig ) - { - if ( rVal.nVal == 0 ) - { - OSL_FAIL( "BigInt::operator/ --> divide by zero" ); - return; - } - - if ( !bIsBig ) - { - // wir bewegen uns im ungefaehrlichem Bereich - rMod = BigInt( nVal % rVal.nVal ); - nVal /= rVal.nVal; - return; - } - - if ( rVal.nVal == 1 ) - { - rMod = BigInt( (long)0 ); - return; - } - - if ( rVal.nVal == -1 ) - { - rMod = BigInt( (long)0 ); - bIsNeg = !bIsNeg; - return; - } - - if ( rVal.nVal <= (long)0xFFFF && rVal.nVal >= -(long)0xFFFF ) - { - // ein BigInt durch ein sal_uInt16 teilen - sal_uInt16 nTmp; - if ( rVal.nVal < 0 ) - { - nTmp = (sal_uInt16) -rVal.nVal; - bIsNeg = !bIsNeg; - } - else - nTmp = (sal_uInt16) rVal.nVal; - - Div( nTmp, nTmp ); - rMod = BigInt( (long)nTmp ); - Normalize(); - return; - } - } - - if ( ABS_IsLess( rVal ) ) - { - rMod = *this; - *this = BigInt( (long)0 ); - return; - } - - // BigInt durch BigInt teilen - BigInt aTmp1, aTmp2; - aTmp1.MakeBigInt( *this ); - aTmp2.MakeBigInt( rVal ); - aTmp1.DivLong(aTmp2, *this); - Normalize(); - aTmp1.ModLong(aTmp2, rMod); // nicht optimal - rMod.Normalize(); -} - -// ----------------------------------------------------------------------- - BigInt& BigInt::operator%=( const BigInt& rVal ) { if ( !rVal.bIsBig ) -- cgit v1.2.3 From ded34422f2e6cd7b795b7e51828cf9ff3e50b35d Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 19 Jul 2011 17:23:58 +0200 Subject: callcatcher: cleanup Accelerator --- vcl/inc/vcl/accel.hxx | 15 --- vcl/source/window/accel.cxx | 263 +------------------------------------------- 2 files changed, 5 insertions(+), 273 deletions(-) diff --git a/vcl/inc/vcl/accel.hxx b/vcl/inc/vcl/accel.hxx index cf21000ee08a..79109e08cd4c 100644 --- a/vcl/inc/vcl/accel.hxx +++ b/vcl/inc/vcl/accel.hxx @@ -83,9 +83,6 @@ public: void InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode ); void InsertItem( const ResId& rResId ); - void RemoveItem( sal_uInt16 nItemId ); - void RemoveItem( const KeyCode rKeyCode ); - void Clear(); sal_uInt16 GetCurItemId() const { return mnCurId; } const KeyCode& GetCurKeyCode() const { return maCurKeyCode; } @@ -94,21 +91,9 @@ public: sal_uInt16 GetItemCount() const; sal_uInt16 GetItemId( sal_uInt16 nPos ) const; - KeyCode GetItemKeyCode( sal_uInt16 nPos ) const; - sal_uInt16 GetItemId( const KeyCode& rKeyCode ) const; KeyCode GetKeyCode( sal_uInt16 nItemId ) const; - sal_Bool IsIdValid( sal_uInt16 nItemId ) const; - sal_Bool Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); - void SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ); Accelerator* GetAccel( sal_uInt16 nItemId ) const; - void SetAccel( const KeyCode rKeyCode, Accelerator* pAccel ); - Accelerator* GetAccel( const KeyCode rKeyCode ) const; - - void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True ); - sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const; - void EnableItem( const KeyCode rKeyCode, sal_Bool bEnable = sal_True ); - sal_Bool IsItemEnabled( const KeyCode rKeyCode ) const; void SetHelpText( const XubString& rHelpText ) { maHelpStr = rHelpText; } const XubString& GetHelpText() const { return maHelpStr; } diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index ebf15497b229..3fb5aabc4a35 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -410,85 +410,6 @@ void Accelerator::InsertItem( const ResId& rResId ) // ----------------------------------------------------------------------- -void Accelerator::RemoveItem( sal_uInt16 nItemId ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - // Aus der Id-Liste entfernen - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL; - if ( pEntry && pEntry->mnId == nItemId ) - { - mpData->maKeyTable.Remove( pEntry->maKeyCode.GetFullKeyCode() ); - - ImplAccelList::iterator it = mpData->maIdList.begin(); - ::std::advance( it, nIndex ); - mpData->maIdList.erase( it ); - - // AutoResAccel zerstoeren - if ( pEntry->mpAutoAccel ) - delete pEntry->mpAutoAccel; - - delete pEntry; - } - else - break; - } - while ( nIndex < nItemCount ); - } -} - -// ----------------------------------------------------------------------- - -void Accelerator::RemoveItem( const KeyCode rKeyCode ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - { - // Aus der Id-Liste entfernen - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId ); - sal_uInt16 nItemCount = GetItemCount(); - do - { - if ( mpData->maIdList[ nIndex ] == pEntry ) - break; - nIndex++; - } - while ( nIndex < nItemCount ); - - mpData->maKeyTable.Remove( rKeyCode.GetFullKeyCode() ); - - ImplAccelList::iterator it = mpData->maIdList.begin(); - ::std::advance( it, nIndex ); - mpData->maIdList.erase( it ); - - // AutoResAccel zerstoeren - if ( pEntry->mpAutoAccel ) - delete pEntry->mpAutoAccel; - - delete pEntry; - } -} - -// ----------------------------------------------------------------------- - -void Accelerator::Clear() -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplDeleteData(); - mpData->maKeyTable.Clear(); -} - -// ----------------------------------------------------------------------- - sal_uInt16 Accelerator::GetItemCount() const { DBG_CHKTHIS( Accelerator, NULL ); @@ -498,45 +419,6 @@ sal_uInt16 Accelerator::GetItemCount() const // ----------------------------------------------------------------------- -sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; - if ( pEntry ) - return pEntry->mnId; - else - return 0; -} - -// ----------------------------------------------------------------------- - -KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; - if ( pEntry ) - return pEntry->maKeyCode; - else - return KeyCode(); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mnId; - else - return 0; -} - -// ----------------------------------------------------------------------- - KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -550,66 +432,15 @@ KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); - return (nIndex != ACCELENTRY_NOTFOUND); -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) +sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const { DBG_CHKTHIS( Accelerator, NULL ); - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); + ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL; if ( pEntry ) - { - if ( pEntry->mbEnabled ) - { - sal_Bool bDel = sal_False; - mnCurId = pEntry->mnId; - maCurKeyCode = rKeyCode; - mnCurRepeat = nRepeat; - mpDel = &bDel; - Select(); - if ( !bDel ) - { - mnCurId = 0; - maCurKeyCode = KeyCode(); - mnCurRepeat = 0; - } - - return sal_True; - } - } - - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; - if ( pEntry->mnId != nItemId ) - break; - - pEntry->mpAccel = pAccel; - nIndex++; - } - while ( nIndex < nItemCount ); - } + return pEntry->mnId; + else + return 0; } // ----------------------------------------------------------------------- @@ -627,90 +458,6 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const // ----------------------------------------------------------------------- -void Accelerator::SetAccel( const KeyCode rKeyCode, Accelerator* pAccel ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - pEntry->mpAccel = pAccel; -} - -// ----------------------------------------------------------------------- - -Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mpAccel; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - { - sal_uInt16 nItemCount = GetItemCount(); - do - { - ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; - if ( pEntry->mnId != nItemId ) - break; - - pEntry->mbEnabled = bEnable; - nIndex++; - } - while ( nIndex < nItemCount ); - } -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); - if ( nIndex != ACCELENTRY_NOTFOUND ) - return mpData->maIdList[ nIndex ]->mbEnabled; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable ) -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - pEntry->mbEnabled = bEnable; -} - -// ----------------------------------------------------------------------- - -sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const -{ - DBG_CHKTHIS( Accelerator, NULL ); - - ImplAccelEntry* pEntry = ImplGetAccelData( rKeyCode ); - if ( pEntry ) - return pEntry->mbEnabled; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - Accelerator& Accelerator::operator=( const Accelerator& rAccel ) { DBG_CHKTHIS( Accelerator, NULL ); -- cgit v1.2.3 From aa40ec4414ccb3d64f6f72faab84fa127af9974c Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 20 Jul 2011 11:11:47 +0200 Subject: callcatcher: bring Application::PostUserEvent back --- vcl/inc/vcl/svapp.hxx | 1 + vcl/source/app/svapp.cxx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index d0212fbc4d37..b233a3c07c03 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -296,6 +296,7 @@ public: static void RemoveMouseAndKeyEvents( Window *pWin ); static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); + static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index dc63f172d87a..9d54803f7f3b 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1023,6 +1023,15 @@ sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId ) // ----------------------------------------------------------------------- +sal_uLong Application::PostUserEvent( sal_uLong nEvent, void* pEventData ) +{ + sal_uLong nEventId; + PostUserEvent( nEventId, nEvent, pEventData ); + return nEventId; +} + +// ----------------------------------------------------------------------- + sal_uLong Application::PostUserEvent( const Link& rLink, void* pCaller ) { sal_uLong nEventId; -- cgit v1.2.3 From 1a44a8fc7e8f86af327034bf66ca08e9a414fb75 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Wed, 20 Jul 2011 19:00:09 +0200 Subject: callcatcher: clean up B3dTransformationSet --- tools/inc/tools/b3dtrans.hxx | 14 -------- tools/source/generic/b3dtrans.cxx | 67 --------------------------------------- 2 files changed, 81 deletions(-) diff --git a/tools/inc/tools/b3dtrans.hxx b/tools/inc/tools/b3dtrans.hxx index bcf690d0fae7..420db468291a 100644 --- a/tools/inc/tools/b3dtrans.hxx +++ b/tools/inc/tools/b3dtrans.hxx @@ -161,7 +161,6 @@ public: // Projection void SetProjection(const basegfx::B3DHomMatrix& mProject); const basegfx::B3DHomMatrix& GetProjection(); - const basegfx::B3DHomMatrix& GetInvProjection(); // Texture const basegfx::B2DHomMatrix& GetTexture() { return maTexture; } @@ -175,9 +174,7 @@ public: void SetDeviceRectangle(double fL=-1.0, double fR=1.0, double fB=-1.0, double fT=1.0, sal_Bool bBroadCastChange=sal_True); double GetDeviceRectangleWidth() const { return mfRightBound - mfLeftBound; } double GetDeviceRectangleHeight() const { return mfTopBound - mfBottomBound; } - void SetFrontClippingPlane(double fF=0.0); double GetFrontClippingPlane() { return mfNearBound; } - void SetBackClippingPlane(double fB=1.0); double GetBackClippingPlane() { return mfFarBound; } void SetPerspective(sal_Bool bNew); sal_Bool GetPerspective() { return mbPerspective; } @@ -186,16 +183,6 @@ public: const Rectangle& GetViewportRectangle() { return maViewportRectangle; } void CalcViewport(); - // Transponierte Inverse fuer Vectortransformationen - const basegfx::B3DHomMatrix& GetInvTransObjectToEye(); - - // Speziell zum Umwandeln von Punkten Objekt -> Device - const basegfx::B3DHomMatrix& GetObjectToDevice(); - - // Speziell zum Umwandeln von Punkten World -> View - const basegfx::B3DHomMatrix& GetMatFromWorldToView(); - const basegfx::B3DHomMatrix& GetInvMatFromWorldToView(); - // Bounds des Viewports lesen const basegfx::B3DVector& GetScale(); const basegfx::B3DVector& GetTranslate(); @@ -224,7 +211,6 @@ protected: void PostSetObjectTrans(); void PostSetOrientation(); void PostSetProjection(); - void PostSetTexture(); void PostSetViewport(); void CalcMatObjectToDevice(); diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index 9c1c5c9a10b7..1f731e1fd387 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -233,13 +233,6 @@ const basegfx::B3DHomMatrix& B3dTransformationSet::GetProjection() return maProjection; } -const basegfx::B3DHomMatrix& B3dTransformationSet::GetInvProjection() -{ - if(!mbProjectionValid) - CalcViewport(); - return maInvProjection; -} - void B3dTransformationSet::PostSetProjection() { // Zuweisen und Inverse bestimmen @@ -251,16 +244,6 @@ void B3dTransformationSet::PostSetProjection() mbWorldToViewValid = sal_False; } -/************************************************************************* -|* -|* Texturtransformation -|* -\************************************************************************/ - -void B3dTransformationSet::PostSetTexture() -{ -} - /************************************************************************* |* |* Viewport-Transformation @@ -422,28 +405,6 @@ void B3dTransformationSet::DeviceRectangleChange() { } -void B3dTransformationSet::SetFrontClippingPlane(double fF) -{ - if(mfNearBound != fF) - { - mfNearBound = fF; - mbProjectionValid = sal_False; - mbObjectToDeviceValid = sal_False; - mbWorldToViewValid = sal_False; - } -} - -void B3dTransformationSet::SetBackClippingPlane(double fB) -{ - if(mfFarBound != fB) - { - mfFarBound = fB; - mbProjectionValid = sal_False; - mbObjectToDeviceValid = sal_False; - mbWorldToViewValid = sal_False; - } -} - void B3dTransformationSet::SetPerspective(sal_Bool bNew) { if(mbPerspective != bNew) @@ -503,13 +464,6 @@ void B3dTransformationSet::CalcMatObjectToDevice() mbObjectToDeviceValid = sal_True; } -const basegfx::B3DHomMatrix& B3dTransformationSet::GetObjectToDevice() -{ - if(!mbObjectToDeviceValid) - CalcMatObjectToDevice(); - return maObjectToDevice; -} - void B3dTransformationSet::CalcMatInvTransObjectToEye() { maInvTransObjectToEye = maObjectTrans; @@ -528,13 +482,6 @@ void B3dTransformationSet::CalcMatInvTransObjectToEye() mbInvTransObjectToEyeValid = sal_True; } -const basegfx::B3DHomMatrix& B3dTransformationSet::GetInvTransObjectToEye() -{ - if(!mbInvTransObjectToEyeValid) - CalcMatInvTransObjectToEye(); - return maInvTransObjectToEye; -} - void B3dTransformationSet::CalcMatFromWorldToView() { maMatFromWorldToView = maOrientation; @@ -550,20 +497,6 @@ void B3dTransformationSet::CalcMatFromWorldToView() mbWorldToViewValid = sal_True; } -const basegfx::B3DHomMatrix& B3dTransformationSet::GetMatFromWorldToView() -{ - if(!mbWorldToViewValid) - CalcMatFromWorldToView(); - return maMatFromWorldToView; -} - -const basegfx::B3DHomMatrix& B3dTransformationSet::GetInvMatFromWorldToView() -{ - if(!mbWorldToViewValid) - CalcMatFromWorldToView(); - return maInvMatFromWorldToView; -} - /************************************************************************* |* |* Direkter Zugriff auf verschiedene Transformationen -- cgit v1.2.3 From b0a77d0b6e97cb0e4d93a657a788a3ee7dee0d77 Mon Sep 17 00:00:00 2001 From: Maciej Rumianowski Date: Tue, 19 Jul 2011 10:19:45 +0200 Subject: Port SfxIntegerListItem to ::std::vector For calc to be free of SvULongs SfxIntegerListItem has to use SvULongs. Additionaly a constructor with Sequence used in calc. --- svl/inc/svl/ilstitem.hxx | 8 ++++---- svl/source/items/ilstitem.cxx | 24 +++++++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) 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 #include - -class SvULongs; +#include 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/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 -#define _SVSTDARR_ULONGS -#include - 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 ) : SfxPoolItem( which ) { - m_aList.realloc( rList.Count() ); - for ( sal_uInt16 n=0; n& rList ) const { - for ( sal_Int32 n=0; n(n) ); + rList.reserve( m_aList.getLength() ); + for ( sal_Int32 n=0; n Date: Thu, 21 Jul 2011 07:48:52 +0300 Subject: Build the cairo canvas also for Windows if we don't build the DirectX one --- canvas/prj/build.lst | 2 +- canvas/source/cairo/makefile.mk | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/canvas/prj/build.lst b/canvas/prj/build.lst index 4719f157dfca..dad6e28c0ea5 100644 --- a/canvas/prj/build.lst +++ b/canvas/prj/build.lst @@ -4,7 +4,7 @@ cv canvas\inc nmake - all cv_inc NULL cv canvas\source\tools nmake - all cv_tools cv_inc NULL cv canvas\source\vcl nmake - all cv_vcl cv_tools cv_inc NULL cv canvas\source\simplecanvas nmake - all cv_simplecanvas cv_tools cv_inc NULL -cv canvas\source\cairo nmake - u cv_cairo cv_tools cv_inc NULL +cv canvas\source\cairo nmake - all cv_cairo cv_tools cv_inc NULL cv canvas\source\directx nmake - w cv_directx cv_tools cv_inc NULL cv canvas\source\null nmake - all cv_null cv_tools cv_inc NULL cv canvas\source\factory nmake - all cv_factory cv_inc NULL diff --git a/canvas/source/cairo/makefile.mk b/canvas/source/cairo/makefile.mk index 59d1512701a7..cbcfbe1aa710 100644 --- a/canvas/source/cairo/makefile.mk +++ b/canvas/source/cairo/makefile.mk @@ -47,6 +47,13 @@ DLLPRE = @echo "Cannot build cairocanvas without cairo..." .ENDIF +# --- Don't build for Windows unless we're compiling with --disable-directx ----------- +.IF "$(GUI)" == "WNT" && "$(ENABLE_DIRECTX)" != "" +@all: + @echo "Building with the DirectX canvas so not bothering with the cairo one..." +.ENDIF + + # --- Common ---------------------------------------------------------- -- cgit v1.2.3 From ee403ac2a0ade9b1bc98b3b3e453cedaf03732e6 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 21 Jul 2011 07:49:27 +0300 Subject: Generate import library that matches libs.mk for WNTGCC --- canvas/source/tools/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/canvas/source/tools/makefile.mk b/canvas/source/tools/makefile.mk index ab4f545a3bdd..3169eadb6d95 100644 --- a/canvas/source/tools/makefile.mk +++ b/canvas/source/tools/makefile.mk @@ -62,7 +62,11 @@ SLOFILES = \ $(SLO)$/verifyinput.obj SHL1TARGET= $(TARGET)$(DLLPOSTFIX) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET)$(DLLPOSTFIX) +.ENDIF SHL1STDLIBS= $(SALLIB) $(CPPULIB) $(BASEGFXLIB) $(CPPUHELPERLIB) $(COMPHELPERLIB) $(VCLLIB) $(TKLIB) $(TOOLSLIB) SHL1LIBS= $(SLB)$/$(TARGET).lib -- cgit v1.2.3 From 89493bd815436638b1da3852362d75bdac3d43ae Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 21 Jul 2011 10:26:33 +0300 Subject: Generate correctly named import library for WNTGCC --- cppcanvas/util/makefile.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cppcanvas/util/makefile.mk b/cppcanvas/util/makefile.mk index 01cf6234602c..351ca878e6d0 100644 --- a/cppcanvas/util/makefile.mk +++ b/cppcanvas/util/makefile.mk @@ -45,7 +45,11 @@ LIB1FILES=\ $(SLB)$/cppcanvastools.lib SHL1TARGET= $(TARGET)$(DLLPOSTFIX) +.IF "$(COM)" == "MSC" SHL1IMPLIB= i$(TARGET) +.ELSE +SHL1IMPLIB= $(TARGET)$(DLLPOSTFIX) +.ENDIF SHL1STDLIBS= $(TOOLSLIB) $(CPPULIB) $(SALLIB) $(VCLLIB) $(COMPHELPERLIB) $(CANVASTOOLSLIB) $(CPPUHELPERLIB) $(BASEGFXLIB) $(I18NISOLANGLIB) $(SVTOOLLIB) .IF "$(debug)$(dbgutil)"!="" -- cgit v1.2.3 From 3e4269deb560f2f3f8156edd530bae96a8c7dbb1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 21:36:09 +0100 Subject: ByteString::CreateFromInt32->rtl::OStringBuffer::append --- svtools/source/svhtml/htmlout.cxx | 42 +++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx index b1b428d8fd3b..f1d56f7f6fc5 100644 --- a/svtools/source/svhtml/htmlout.cxx +++ b/svtools/source/svhtml/htmlout.cxx @@ -658,11 +658,16 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, (const IMapRectangleObject *)pObj; pShape = OOO_STRING_SVTOOLS_HTML_SH_rect; Rectangle aRect( pRectObj->GetRectangle() ); - ((((((aCoords = - ByteString::CreateFromInt32(aRect.Left())) += ',') - += ByteString::CreateFromInt32(aRect.Top())) += ',') - += ByteString::CreateFromInt32(aRect.Right())) += ',') - += ByteString::CreateFromInt32(aRect.Bottom()); + + aCoords = rtl::OStringBuffer() + .append(static_cast(aRect.Left())) + .append(',') + .append(static_cast(aRect.Top())) + .append(',') + .append(static_cast(aRect.Right())) + .append(',') + .append(static_cast(aRect.Bottom())) + .makeStringAndClear(); } break; case( IMAP_OBJ_CIRCLE ): @@ -672,10 +677,14 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, pShape= OOO_STRING_SVTOOLS_HTML_SH_circ; Point aCenter( pCirc->GetCenter() ); long nOff = pCirc->GetRadius(); - ((((aCoords = - ByteString::CreateFromInt32(aCenter.X())) += ',') - += ByteString::CreateFromInt32(aCenter.Y())) += ',') - += ByteString::CreateFromInt32(nOff); + + aCoords = rtl::OStringBuffer() + .append(static_cast(aCenter.X())) + .append(',') + .append(static_cast(aCenter.Y())) + .append(',') + .append(static_cast(nOff)) + .makeStringAndClear(); } break; case( IMAP_OBJ_POLYGON ): @@ -685,20 +694,23 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream, pShape= OOO_STRING_SVTOOLS_HTML_SH_poly; Polygon aPoly( pPolyObj->GetPolygon() ); sal_uInt16 nCount = aPoly.GetSize(); + rtl::OStringBuffer aTmpBuf; if( nCount>0 ) { const Point& rPoint = aPoly[0]; - ((aCoords = - ByteString::CreateFromInt32(rPoint.X())) += ',') - += ByteString::CreateFromInt32(rPoint.Y()); + aTmpBuf.append(static_cast(rPoint.X())) + .append(',') + .append(static_cast(rPoint.Y())); } for( sal_uInt16 j=1; j(rPoint.X())) + .append(',') + .append(static_cast(rPoint.Y())); } + aCoords = aTmpBuf.makeStringAndClear(); } break; default: -- cgit v1.2.3 From a035737e46ec58ffbb11f95780e1573b40fc746e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 21:41:40 +0100 Subject: ByteString::CreateFromInt32->rtl::OString::valueOf --- padmin/source/cmddlg.cxx | 8 ++++---- padmin/source/newppdlg.cxx | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) 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() ) -- cgit v1.2.3 From cba97d1d22d8cd24ab7fd762832ca42d17b330a7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 20 Jul 2011 21:59:22 +0100 Subject: callcatcher: unused ThreadExecutor --- vcl/inc/vcl/threadex.hxx | 18 ------------------ vcl/source/helper/threadex.cxx | 40 ---------------------------------------- 2 files changed, 58 deletions(-) diff --git a/vcl/inc/vcl/threadex.hxx b/vcl/inc/vcl/threadex.hxx index 429b43e6ac7c..c5333d847fa1 100644 --- a/vcl/inc/vcl/threadex.hxx +++ b/vcl/inc/vcl/threadex.hxx @@ -39,24 +39,6 @@ namespace vcl { - class VCL_DLLPUBLIC ThreadExecutor - { - oslThread m_aThread; - oslCondition m_aFinish; - long m_nReturn; - - #ifdef THREADEX_IMPLEMENTATION - public: - SAL_DLLPRIVATE static void SAL_CALL worker( void* ); - #endif - public: - ThreadExecutor(); - virtual ~ThreadExecutor(); - - virtual long doIt() = 0; - long execute(); - }; - class VCL_DLLPUBLIC SolarThreadExecutor { oslCondition m_aStart; diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx index ad351410e2c2..f0db5e3a372f 100644 --- a/vcl/source/helper/threadex.cxx +++ b/vcl/source/helper/threadex.cxx @@ -35,46 +35,6 @@ using namespace vcl; -ThreadExecutor::ThreadExecutor() -{ - m_aFinish = osl_createCondition(); - m_aThread = NULL; -} - -ThreadExecutor::~ThreadExecutor() -{ - osl_destroyCondition( m_aFinish ); - if( m_aThread ) - osl_destroyThread( m_aThread ); -} - -extern "C" -{ - static void call_worker( void* pInstance ) - { - ThreadExecutor::worker( pInstance ); - } -} - -void ThreadExecutor::worker( void* pInstance ) -{ - ThreadExecutor* pThis = ((ThreadExecutor*)pInstance); - pThis->m_nReturn = pThis->doIt(); - osl_setCondition( pThis->m_aFinish ); -} - -long ThreadExecutor::execute() -{ - osl_resetCondition( m_aFinish ); - if( m_aThread ) - osl_destroyThread( m_aThread ), m_aThread = NULL; - m_aThread = osl_createThread( call_worker, this ); - while( ! osl_checkCondition( m_aFinish ) ) - Application::Reschedule(); - return m_nReturn; -} - - SolarThreadExecutor::SolarThreadExecutor() :m_nReturn( 0 ) ,m_bTimeout( false ) -- cgit v1.2.3 From 7b2d0c9ad2d2d28b898136c3f6bd00cea4da283a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 15 Jul 2011 01:40:22 +0300 Subject: Make this compile for iOS I said compile, not work. --- toolkit/Library_tk.mk | 5 +++++ toolkit/source/awt/vclxsystemdependentwindow.cxx | 11 +++++++++++ toolkit/source/awt/vclxtoolkit.cxx | 11 +++++++++++ toolkit/source/awt/vclxtopwindow.cxx | 11 +++++++++++ toolkit/source/awt/vclxwindow1.cxx | 6 ++++++ 5 files changed, 44 insertions(+) diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk index 84c05eb752ab..e07878f1e90a 100644 --- a/toolkit/Library_tk.mk +++ b/toolkit/Library_tk.mk @@ -167,6 +167,11 @@ $(eval $(call gb_Library_set_cxxflags,tk,\ $$(CXXFLAGS) $(gb_OBJCXXFLAGS))) endif +ifeq ($(GUIBASE),cocoatouch) +$(eval $(call gb_Library_set_cxxflags,tk,\ + $$(CXXFLAGS) $(gb_OBJCXXFLAGS))) +endif + ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD, $(OS))) $(eval $(call gb_Library_add_linked_libs,tk,\ X11 \ diff --git a/toolkit/source/awt/vclxsystemdependentwindow.cxx b/toolkit/source/awt/vclxsystemdependentwindow.cxx index 7cb667b18528..646462521af6 100644 --- a/toolkit/source/awt/vclxsystemdependentwindow.cxx +++ b/toolkit/source/awt/vclxsystemdependentwindow.cxx @@ -46,6 +46,12 @@ #include "postmac.h" #endif +#ifdef IOS +#include "premac.h" +#include +#include "postmac.h" +#endif + #include #include #include @@ -97,6 +103,11 @@ IMPL_XTYPEPROVIDER_END { aRet <<= (sal_IntPtr)pSysData->pView; } +#elif (defined IOS) + if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_IOS ) + { + aRet <<= (sal_IntPtr)pSysData->pView; + } #elif (defined UNX) if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW ) { diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index b6655ab56d98..19a76c9052c8 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -64,6 +64,13 @@ #include #include "postmac.h" #endif + +#ifdef IOS +#include "premac.h" +#include +#include "postmac.h" +#endif + #include #include @@ -982,6 +989,8 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp, aParentData.nSize = sizeof( aParentData ); #if defined QUARTZ aParentData.pView = reinterpret_cast(nWindowHandle); + #elif defined IOS + aParentData.pView = reinterpret_cast(nWindowHandle); #elif defined UNX aParentData.aWindow = nWindowHandle; aParentData.bXEmbedSupport = bXEmbed; @@ -1206,6 +1215,8 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow( aParentData.nSize = sizeof( aParentData ); #if defined QUARTZ aParentData.pView = reinterpret_cast(nWindowHandle); + #elif defined IOS + aParentData.pView = reinterpret_cast(nWindowHandle); #elif defined UNX aParentData.aWindow = nWindowHandle; aParentData.bXEmbedSupport = bXEmbed; diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx index 8bf3c861c01d..44f8f94cb50c 100644 --- a/toolkit/source/awt/vclxtopwindow.cxx +++ b/toolkit/source/awt/vclxtopwindow.cxx @@ -37,6 +37,12 @@ #include "postmac.h" #endif +#if defined ( IOS ) +#include "premac.h" +#include +#include "postmac.h" +#endif + #include #include #include @@ -109,6 +115,11 @@ Sequence< Type > VCLXTopWindow_Base::getTypes() throw(RuntimeException) { aRet <<= (sal_IntPtr)pSysData->pView; } +#elif (defined IOS) + if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_IOS ) + { + aRet <<= (sal_IntPtr)pSysData->pView; + } #elif (defined UNX) if( SystemType == ::com::sun::star::lang::SystemDependent::SYSTEM_XWINDOW ) { diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx index 6a9c64ba3c95..28d97fcb826d 100644 --- a/toolkit/source/awt/vclxwindow1.cxx +++ b/toolkit/source/awt/vclxwindow1.cxx @@ -43,6 +43,10 @@ #include "premac.h" #include #include "postmac.h" +#elif defined ( IOS ) +#include "premac.h" +#include +#include "postmac.h" #endif #include @@ -96,6 +100,8 @@ void VCLXWindow::SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle ) aSysParentData.hWnd = (HWND) nHandle; #elif defined( QUARTZ ) aSysParentData.pView = reinterpret_cast(nHandle); +#elif defined( IOS ) + aSysParentData.pView = reinterpret_cast(nHandle); #elif defined( UNX ) aSysParentData.aWindow = (long)nHandle; aSysParentData.bXEmbedSupport = bXEmbed; -- cgit v1.2.3 From d423fd54604ee9fa60c028528c93d5b6c25fbb71 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 18 Jul 2011 20:30:24 +0300 Subject: Start at trying to build these test programs for iOS --- vcl/workben/makefile.mk | 4 ++++ vcl/workben/svdem.cxx | 2 +- vcl/workben/vcldemo.cxx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vcl/workben/makefile.mk b/vcl/workben/makefile.mk index d52737507a20..810b1fb42a00 100644 --- a/vcl/workben/makefile.mk +++ b/vcl/workben/makefile.mk @@ -49,6 +49,10 @@ OBJFILES= \ # --- Targets ------------------------------------------------------ +.IF "$(OS)" == "IOS" +CFLAGS += -x objective-c++ -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 +.ENDIF + # svdem APP1NOSAL= TRUE diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index 4898aed1a995..ee5cbb2ba420 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -51,7 +51,7 @@ void Main(); // ----------------------------------------------------------------------- -SAL_IMPLEMENT_MAIN() +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 547660fa1e1e..3c75c643fe4a 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -56,7 +56,7 @@ void Main(); // ----------------------------------------------------------------------- -SAL_IMPLEMENT_MAIN() +SAL_IMPLEMENT_MAIN_WITH_GUI() { tools::extendApplicationEnvironment(); -- cgit v1.2.3 From 74140442bbf39e19bdc05f1cfb975f5a11751f2c Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Thu, 21 Jul 2011 13:46:53 +0200 Subject: Drop macros from componentmodule.hxx --- comphelper/inc/comphelper/componentmodule.hxx | 92 -------------------------- comphelper/source/inc/comphelper_module.hxx | 50 +++++++++++++- comphelper/source/misc/comphelper_module.cxx | 19 +++++- comphelper/source/misc/comphelper_services.cxx | 7 +- svtools/workben/unodialog/udlg_services.cxx | 7 +- 5 files changed, 79 insertions(+), 96 deletions(-) diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx index 198d6c37bb20..5893313c8497 100644 --- a/comphelper/inc/comphelper/componentmodule.hxx +++ b/comphelper/inc/comphelper/componentmodule.hxx @@ -270,98 +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::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_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/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 {}; + } + + 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/svtools/workben/unodialog/udlg_services.cxx b/svtools/workben/unodialog/udlg_services.cxx index bf9386dd7aea..cb2949791e9c 100644 --- a/svtools/workben/unodialog/udlg_services.cxx +++ b/svtools/workben/unodialog/udlg_services.cxx @@ -56,6 +56,11 @@ namespace udlg } // namespace udlg //........................................................................ -IMPLEMENT_COMPONENT_LIBRARY_API( ::udlg::UdlgModule, ::udlg::initializeModule ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::udlg::initializeModule(); + return ::udlg::UdlgModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From ca402fa0dae85f7f289398af34aa43cf06d14e87 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 21 Jul 2011 10:36:32 +0200 Subject: callcatcher: completely remove SvIconView --- svtools/Library_svt.mk | 2 - svtools/Package_inc.mk | 1 - svtools/inc/svtools/svicnvw.hxx | 289 --- svtools/source/contnr/svicnvw.cxx | 813 ------- svtools/source/contnr/svimpicn.cxx | 4093 ------------------------------------ 5 files changed, 5198 deletions(-) delete mode 100644 svtools/inc/svtools/svicnvw.hxx delete mode 100644 svtools/source/contnr/svicnvw.cxx delete mode 100644 svtools/source/contnr/svimpicn.cxx diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 2dee92a7dceb..c3dac5e44649 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -112,9 +112,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/contnr/imivctl1 \ svtools/source/contnr/imivctl2 \ svtools/source/contnr/ivctrl \ - svtools/source/contnr/svicnvw \ svtools/source/contnr/svimpbox \ - svtools/source/contnr/svimpicn \ svtools/source/contnr/svlbitm \ svtools/source/contnr/svlbox \ svtools/source/contnr/svtabbx \ diff --git a/svtools/Package_inc.mk b/svtools/Package_inc.mk index 39d2331641fc..428dac1f414f 100644 --- a/svtools/Package_inc.mk +++ b/svtools/Package_inc.mk @@ -133,7 +133,6 @@ $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/statusbarcontroller.hx $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdctrl.hxx,svtools/stdctrl.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stdmenu.hxx,svtools/stdmenu.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/stringtransfer.hxx,svtools/stringtransfer.hxx)) -$(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svicnvw.hxx,svtools/svicnvw.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbitm.hxx,svtools/svlbitm.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svlbox.hxx,svtools/svlbox.hxx)) $(eval $(call gb_Package_add_file,svtools_inc,inc/svtools/svmedit.hxx,svtools/svmedit.hxx)) diff --git a/svtools/inc/svtools/svicnvw.hxx b/svtools/inc/svtools/svicnvw.hxx deleted file mode 100644 index 30773b101547..000000000000 --- a/svtools/inc/svtools/svicnvw.hxx +++ /dev/null @@ -1,289 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SVICNVW_HXX -#define _SVICNVW_HXX - -#include -#include - -class SvImpIconView; -class SvLBoxEntry; -class SvLBoxItem; -class SvLBoxString; -class SvLBoxContextBmp; -class SvPtrarr; - -#define WB_ICON 0x0001 -#define WB_NAME 0x0002 -#define WB_TEXT 0x0004 -#define WB_FLOW 0x0008 - -#define ICNVW_FLAG_POS_LOCKED 0x0001 -#define ICNVW_FLAG_USER1 0x1000 -#define ICNVW_FLAG_USER2 0x2000 -#define ICNVW_FLAG_USER3 0x4000 -#define ICNVW_FLAG_USER4 0x8000 - -enum SvIconViewTextMode -{ - ShowTextFull = 1, - ShowTextShort, - ShowTextSmart, // not implemented - ShowTextDontKnow // only for entries (uses config? from the view) -}; - -class SvIcnVwDataEntry : public SvViewDataEntry -{ -friend class SvImpIconView; - sal_uInt16 nIcnVwFlags; - SvIconViewTextMode eTextMode; -public: - Rectangle aRect; // Bounding-Rect of the Entry - Rectangle aGridRect; // set in grid mode - Size aTextSize; // set in grid mode only - sal_uInt16 nX,nY; // for keyboard control - SvIcnVwDataEntry(); - virtual ~SvIcnVwDataEntry(); - - sal_Bool IsEntryPosLocked() const { return (sal_Bool)((nIcnVwFlags & ICNVW_FLAG_POS_LOCKED) !=0); } - void ClearVwFlags( sal_uInt16 nMask ) { nIcnVwFlags &= (~nMask); } - void SetVwFlags( sal_uInt16 nMask ) { nIcnVwFlags |= nMask; } - sal_uInt16 GetVwFlags() const { return nIcnVwFlags; } - SvIconViewTextMode GetTextMode() const { return eTextMode; } -}; - -#define SV_LISTBOX_ID_ICONVIEW 2 - -class SvIconView : public SvLBox -{ - friend class SvImpIconView; - - SvImpIconView* pImp; - Image aCollapsedEntryBmp; - Image aExpandedEntryBmp; - sal_uInt16 nIcnVwFlags; - void SetModel( SvLBoxTreeList* ); - -protected: - - using SvLBox::CreateEntry; - SvLBoxEntry* CreateEntry( const XubString&, const Image&, const Image&); - void ViewDataInitialized( SvLBoxEntry* ); - virtual SvViewData* CreateViewData( SvListEntry* ); - virtual void InitViewData( SvViewData* pData, SvListEntry* pEntry ); - - void EditingRequest(SvLBoxEntry*,SvLBoxItem*,const Point& ); - void EditedText( const XubString& ); - void EditItemText( SvLBoxEntry*,SvLBoxItem*,const Selection& ); - SvLBoxEntry* pCurEdEntry; - SvLBoxItem* pCurEdItem; - - virtual void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); - virtual void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); - virtual void Command( const CommandEvent& rCEvt ); - virtual void PreparePaint( SvLBoxEntry* ); - virtual void StateChanged( StateChangedType nStateChange ); - -public: - - SvIconView( Window* pParent,WinBits nWinStyle=0 ); - SvIconView( Window* pParent,const ResId& rResId ); - ~SvIconView(); - - void DisconnectFromModel(); - - SvLBoxEntry* InsertEntry( const XubString& rText, SvLBoxEntry* pParent = 0, - sal_Bool bChildsOnDemand = sal_False, - sal_uLong nPos=LIST_APPEND ); - - SvLBoxEntry* InsertEntry( const XubString& rText, - const Image& rExpandedEntryBmp, - const Image& rCollapsedEntryBmp, - SvLBoxEntry* pParent = 0, - sal_Bool bChildsOnDemand = sal_False, - sal_uLong nPos = LIST_APPEND ); - - const Image& GetDefaultExpandedEntryBmp() const { return aExpandedEntryBmp;} - const Image& GetDefaultCollapsedEntryBmp() const { return aCollapsedEntryBmp;} - void SetDefaultExpandedEntryBmp( const Image& rBmp) { aExpandedEntryBmp=rBmp;} - void SetDefaultCollapsedEntryBmp( const Image& rBmp ) { aCollapsedEntryBmp=rBmp;} - - void SetEntryText(SvLBoxEntry*, const XubString& ); - void SetExpandedEntryBmp(SvLBoxEntry*, const Image& ); - void SetCollapsedEntryBmp(SvLBoxEntry*, const Image& ); - - XubString GetEntryText(SvLBoxEntry*) const; - Image GetExpandedEntryBmp(SvLBoxEntry*) const; - Image GetCollapsedEntryBmp(SvLBoxEntry*) const; - - virtual SvLBoxEntry* CloneEntry( SvLBoxEntry* pSource ); - - virtual sal_uInt16 IsA(); - - virtual void RequestingChilds( SvLBoxEntry* pParent ); - - virtual void Paint( const Rectangle& rRect ); - virtual void MouseButtonDown( const MouseEvent& rMEvt ); - virtual void MouseButtonUp( const MouseEvent& rMEvt ); - virtual void MouseMove( const MouseEvent& rMEvt ); - virtual void KeyInput( const KeyEvent& rKEvt ); - virtual void Resize(); - virtual void GetFocus(); - virtual void LoseFocus(); - void SetUpdateMode( sal_Bool ); - - using SvListView::SetModel; - virtual void SetModel( SvLBoxTreeList*, SvLBoxEntry* pParent ); - virtual void ModelHasCleared(); - virtual void ModelHasInserted( SvListEntry* pEntry ); - virtual void ModelHasInsertedTree( SvListEntry* pEntry ); - virtual void ModelIsMoving(SvListEntry* pSource, - SvListEntry* pTargetParent, sal_uLong nChildPos ); - virtual void ModelHasMoved(SvListEntry* pSource ); - virtual void ModelIsRemoving( SvListEntry* pEntry ); - virtual void ModelHasRemoved( SvListEntry* pEntry ); - virtual void ModelHasEntryInvalidated( SvListEntry* pEntry ); - - virtual void ShowTargetEmphasis( SvLBoxEntry*, sal_Bool bShow ); - using Window::GetDropTarget; - virtual SvLBoxEntry* GetDropTarget( const Point& ); - virtual Region GetDragRegion() const; - // NotifyMoving/Copying is overloaded, since GetDropTarget - // returns a "magic pointer" if the drop happens in/on an empty - // area(?) of the IconView - virtual sal_Bool NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos); - virtual sal_Bool NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos); - - // returns TopLeft of the BoundingRect. Add MapMode.Origin to get the - // position relative to the window - Point GetEntryPosition( SvLBoxEntry* ) const; - void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos); - void SetEntryPosition( SvLBoxEntry*, const Point& rDocPos, - sal_Bool bAdjustAtGrid ); - - void SetFont( const Font& rFont ); - void SetDefaultFont(); - - using SvLBox::GetEntry; - SvLBoxEntry* GetEntry( const Point& rPixPos, sal_Bool ) const; - // returns the entry just above pCurEntry (z-wise) - SvLBoxEntry* GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const; - // returns the entry just below pCurEntry (z-wise) - SvLBoxEntry* GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const; - - SvLBoxEntry* GetEntryFromLogicPos( const Point& rDocPos ) const; - - virtual void PaintEntry( SvLBoxEntry* ); - virtual void PaintEntry( SvLBoxEntry*, const Point& rDocPos ); - Rectangle GetFocusRect( SvLBoxEntry* ); - void InvalidateEntry( SvLBoxEntry* ); - void MakeVisible( SvLBoxEntry* ); - - void SetDragDropMode( DragDropMode ); - void SetSelectionMode( SelectionMode ); - - using SvListView::Select; - sal_Bool Select( SvLBoxEntry* pEntry, sal_Bool bSelect=sal_True ); - void SelectAll( sal_Bool bSelect, sal_Bool bPaint=sal_True ); - virtual void SetCurEntry( SvLBoxEntry* _pEntry ); - virtual SvLBoxEntry* - GetCurEntry() const; - - // locigal coordinates - void SelectRect( - const Rectangle& rRect, - sal_Bool bAdd = sal_False, - // inverts the intersection with rRect - // (ignored if bAdd == sal_False) - SvPtrarr* pOtherRects = 0, - short nBorderOffs = -5 ); - sal_uLong GetSelectionCount() const; - - virtual void Arrange(); - void SetSpaceBetweenEntries( long nHor, long Ver ); - long GetHorSpaceBetweenEntries(); - long GetVerSpaceBetweenEntries(); - - void EnableInplaceEditing( sal_Bool bEnable ); - void EditEntry( SvLBoxEntry* pEntry = 0 ); - virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& ); - virtual sal_Bool EditedEntry( SvLBoxEntry*, const XubString& rNewText ); - - void SetCurParent( SvLBoxEntry* pNewParent ); - SvLBoxEntry* GetCurParent() const; - - virtual void ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, sal_uLong nPos ); - - // pass (0, 0) to switch off grid mode - void SetGrid( long nDX, long nDY ); - - // nDeltaY < 0 : View moves up relative to Doc - // nDeltaY > 0 : View moves down relative to Doc - // nDeltaX < 0 : View moves left relative to Doc - // nDeltaX > 0 : View moves right relative to Doc - using Window::Scroll; - virtual void Scroll( long nDeltaX, long nDeltaY, sal_uInt16 nFlags = 0 ); - - virtual void PrepareCommandEvent( const CommandEvent& ); - virtual void StartDrag( sal_Int8 nAction, const Point& ); - virtual void DragFinished( sal_Int8 ); - virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); - using SvLBox::ExecuteDrop; - virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); - - void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); - void HideDDIcon(); - void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); - - // to scroll during Drag&Drop - void CalcScrollOffsets( - const Point& rRefPosPixel, - long& rScrollX, - long& rScrollY, - sal_Bool bInDragDrop = sal_False, - sal_uInt16 nBorderWidth = 10 ); - - using Window::EndTracking; - void EndTracking(); - void AdjustAtGrid( SvLBoxEntry* pEntry = 0 ); - void LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock = sal_True ); - sal_Bool IsEntryPosLocked( const SvLBoxEntry* pEntry ) const; - - void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); - SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0 ) const; - - void ShowFocusRect( const SvLBoxEntry* pEntry ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx deleted file mode 100644 index 41d6a100c1f3..000000000000 --- a/svtools/source/contnr/svicnvw.cxx +++ /dev/null @@ -1,813 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#include -#include -#include -#include - -#define ICNVW_BLOCK_ENTRYINS 0x0001 - -SvIcnVwDataEntry::SvIcnVwDataEntry() - : nIcnVwFlags(0),eTextMode(ShowTextDontKnow) -{ -} - -SvIcnVwDataEntry::~SvIcnVwDataEntry() -{ -} - -SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) : - SvLBox( pParent, nWinStyle | WB_BORDER ) -{ - nIcnVwFlags = 0; - pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON ); - pImp->mpViewData = 0; - SetSelectionMode( SINGLE_SELECTION ); - SetLineColor(); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) ); - SetDefaultFont(); -} - -SvIconView::SvIconView( Window* pParent , const ResId& rResId ) : - SvLBox( pParent, rResId ) -{ - pImp = new SvImpIconView( this, GetModel(), WB_BORDER | WB_ICON ); - nIcnVwFlags = 0; - pImp->mpViewData = 0; - SetLineColor(); - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) ); - SetDefaultFont(); - pImp->SetSelectionMode( GetSelectionMode() ); -} - -SvIconView::~SvIconView() -{ - delete pImp; -} - -void SvIconView::SetDefaultFont() -{ - SetFont( GetFont() ); -} - -SvLBoxEntry* SvIconView::CreateEntry( const XubString& rStr, - const Image& rCollEntryBmp, const Image& rExpEntryBmp ) -{ - SvLBoxEntry* pEntry = new SvLBoxEntry; - - SvLBoxContextBmp* pContextBmp = - new SvLBoxContextBmp( pEntry,0, rCollEntryBmp,rExpEntryBmp, 0xffff ); - pEntry->AddItem( pContextBmp ); - - SvLBoxString* pString = new SvLBoxString( pEntry, 0, rStr ); - pEntry->AddItem( pString ); - - return pEntry; -} - -void SvIconView::DisconnectFromModel() -{ - SvLBox::DisconnectFromModel(); - pImp->SetModel( GetModel(), 0 ); -} - - -SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, - SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos ) -{ - SvLBoxEntry* pEntry = CreateEntry( - rText, aCollapsedEntryBmp, aExpandedEntryBmp ); - pEntry->EnableChildsOnDemand( bChildsOnDemand ); - - if ( !pParent ) - SvLBox::Insert( pEntry, nPos ); - else - SvLBox::Insert( pEntry, pParent, nPos ); - return pEntry; -} - -SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText, - const Image& rExpEntryBmp, - const Image& rCollEntryBmp, - SvLBoxEntry* pParent, sal_Bool bChildsOnDemand, sal_uLong nPos) -{ - SvLBoxEntry* pEntry = CreateEntry( - rText, rCollEntryBmp, rExpEntryBmp ); - - pEntry->EnableChildsOnDemand( bChildsOnDemand ); - if ( !pParent ) - SvLBox::Insert( pEntry, nPos ); - else - SvLBox::Insert( pEntry, pParent, nPos ); - return pEntry; -} - - -void SvIconView::SetEntryText(SvLBoxEntry* pEntry, const XubString& rStr) -{ - SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if ( pItem ) - { - pItem->SetText( pEntry, rStr ); - GetModel()->InvalidateEntry( pEntry ); - } -} - -void SvIconView::SetExpandedEntryBmp(SvLBoxEntry* pEntry, const Image& rBmp) -{ - SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if ( pItem ) - { - pItem->SetBitmap2( rBmp ); - GetModel()->InvalidateEntry( pEntry ); - } -} - -void SvIconView::SetCollapsedEntryBmp(SvLBoxEntry* pEntry, - const Image& rBmp ) -{ - SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if ( pItem ) - { - pItem->SetBitmap1( rBmp ); - GetModel()->InvalidateEntry( pEntry ); - } -} - -XubString SvIconView::GetEntryText(SvLBoxEntry* pEntry ) const -{ - XubString aStr; - SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if ( pItem ) - aStr = pItem->GetText(); - return aStr; -} - -Image SvIconView::GetExpandedEntryBmp(SvLBoxEntry* pEntry) const -{ - Image aBmp; - SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if ( pItem ) - aBmp = pItem->GetBitmap2(); - return aBmp; -} - -Image SvIconView::GetCollapsedEntryBmp(SvLBoxEntry* pEntry) const -{ - Image aBmp; - SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if ( pItem ) - aBmp = pItem->GetBitmap1(); - return aBmp; -} - - -SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource ) -{ - XubString aStr; - Image aCollEntryBmp; - Image aExpEntryBmp; - - SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if ( pStringItem ) - aStr = pStringItem->GetText(); - SvLBoxContextBmp* pBmpItem =(SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if ( pBmpItem ) - { - aCollEntryBmp = pBmpItem->GetBitmap1(); - aExpEntryBmp = pBmpItem->GetBitmap2(); - } - SvLBoxEntry* pEntry = CreateEntry( aStr, aCollEntryBmp, aExpEntryBmp ); - pEntry->SvListEntry::Clone( pSource ); - pEntry->EnableChildsOnDemand( pSource->HasChildsOnDemand() ); - pEntry->SetUserData( pSource->GetUserData() ); - return pEntry; -} - - -sal_uInt16 SvIconView::IsA() -{ - return SV_LISTBOX_ID_ICONVIEW; -} - -void SvIconView::RequestingChilds( SvLBoxEntry* pParent ) -{ - if ( !pParent->HasChilds() ) - InsertEntry( String::CreateFromAscii(""), pParent, sal_False, LIST_APPEND ); -} - -void SvIconView::Paint( const Rectangle& rRect ) -{ - pImp->Paint( rRect ); -} - -void SvIconView::MouseButtonDown( const MouseEvent& rMEvt ) -{ - pImp->MouseButtonDown( rMEvt ); -} - -void SvIconView::MouseButtonUp( const MouseEvent& rMEvt ) -{ - pImp->MouseButtonUp( rMEvt ); -} - -void SvIconView::MouseMove( const MouseEvent& rMEvt ) -{ - pImp->MouseMove( rMEvt ); -} - -void SvIconView::KeyInput( const KeyEvent& rKEvt ) -{ - // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down - if( IsEditingActive() ) - return; - - nImpFlags |= SVLBOX_IS_TRAVELSELECT; - sal_Bool bKeyUsed = pImp->KeyInput( rKEvt ); - if ( !bKeyUsed ) - SvLBox::KeyInput( rKEvt ); - nImpFlags &= ~SVLBOX_IS_TRAVELSELECT; -} - -void SvIconView::Resize() -{ - pImp->Resize(); - SvLBox::Resize(); -} - -void SvIconView::GetFocus() -{ - pImp->GetFocus(); - SvLBox::GetFocus(); -} - -void SvIconView::LoseFocus() -{ - pImp->LoseFocus(); - SvLBox::LoseFocus(); -} - -void SvIconView::SetUpdateMode( sal_Bool bUpdate ) -{ - Control::SetUpdateMode( bUpdate ); - if ( bUpdate ) - pImp->UpdateAll(); -} - -void SvIconView::SetModel( SvLBoxTreeList* ) -{ -} - -void SvIconView::SetModel( SvLBoxTreeList* pNewModel, SvLBoxEntry* pParent ) -{ - nIcnVwFlags |= ICNVW_BLOCK_ENTRYINS; - SvLBox::SetModel( pNewModel ); - nIcnVwFlags &= (~ICNVW_BLOCK_ENTRYINS); - if ( pParent && pParent->HasChildsOnDemand() ) - RequestingChilds( pParent ); - pImp->SetModel( pNewModel, pParent ); -} - -void SvIconView::ModelHasCleared() -{ - SvLBox::ModelHasCleared(); - pImp->Clear(); -} - -void SvIconView::ModelHasInserted( SvListEntry* pEntry ) -{ - if( !(nIcnVwFlags & ICNVW_BLOCK_ENTRYINS ) ) - pImp->EntryInserted( (SvLBoxEntry*)pEntry ); -} - -void SvIconView::ModelHasInsertedTree( SvListEntry* pEntry ) -{ - pImp->TreeInserted( (SvLBoxEntry*)pEntry ); -} - -void SvIconView::ModelIsMoving(SvListEntry* pSource, - SvListEntry* /* pTargetParent */ , sal_uLong /* nChildPos */ ) -{ - pImp->MovingEntry( (SvLBoxEntry*)pSource ); -} - -void SvIconView::ModelHasMoved(SvListEntry* pSource ) -{ - pImp->EntryMoved( (SvLBoxEntry*)pSource ); -} - -void SvIconView::ModelIsRemoving( SvListEntry* pEntry ) -{ - pImp->RemovingEntry( (SvLBoxEntry*)pEntry ); - NotifyRemoving( (SvLBoxEntry*)pEntry ); -} - -void SvIconView::ModelHasRemoved( SvListEntry* /* pEntry */ ) -{ - pImp->EntryRemoved(); -} - -void SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) -{ - // die einzelnen Items des Entries reinitialisieren - SvLBox::ModelHasEntryInvalidated( pEntry ); - // painten - pImp->ModelHasEntryInvalidated( pEntry ); -} - -void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool bShow ) -{ - pImp->ShowTargetEmphasis( pEntry, bShow ); -} - -Point SvIconView::GetEntryPosition( SvLBoxEntry* pEntry ) const -{ - return ((SvIconView*)this)->pImp->GetEntryPosition( pEntry ); -} - -void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos) -{ - pImp->SetEntryPosition( pEntry, rPos, sal_False, sal_True ); -} - -void SvIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, sal_Bool bAdjustAtGrid ) -{ - pImp->SetEntryPosition( pEntry, rPos, bAdjustAtGrid ); -} - -void SvIconView::SetFont( const Font& rFont ) -{ - Font aTempFont( rFont ); - aTempFont.SetTransparent( sal_True ); - SvLBox::SetFont( aTempFont ); - RecalcViewData(); - pImp->ChangedFont(); -} - -void SvIconView::ViewDataInitialized( SvLBoxEntry* pEntry ) -{ - pImp->ViewDataInitialized( pEntry ); -} - -SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos ) -{ - return pImp->GetDropTarget( rPos ); -} - -SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, sal_Bool ) const -{ - Point aPos( rPixPos ); - aPos -= GetMapMode().GetOrigin(); - return ((SvIconView*)this)->pImp->GetEntry( aPos ); -} - -SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const -{ - return ((SvIconView*)this)->pImp->GetEntry( rDocPos ); -} - - -void SvIconView::StateChanged( StateChangedType i_nStateChange ) -{ - SvLBox::StateChanged( i_nStateChange ); - if ( i_nStateChange == STATE_CHANGE_STYLE ) - pImp->SetStyle( GetStyle() ); -} - -void SvIconView::PaintEntry( SvLBoxEntry* pEntry ) -{ - pImp->PaintEntry( pEntry ); -} - - -void SvIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos ) -{ - pImp->PaintEntry( pEntry, rPos ); -} - -Rectangle SvIconView::GetFocusRect( SvLBoxEntry* pEntry ) -{ - return pImp->CalcFocusRect( pEntry ); -} - -void SvIconView::InvalidateEntry( SvLBoxEntry* pEntry ) -{ - pImp->InvalidateEntry( pEntry ); -} - -void SvIconView::SetDragDropMode( DragDropMode nDDMode ) -{ - SvLBox::SetDragDropMode( nDDMode ); - pImp->SetDragDropMode( nDDMode ); -} - -void SvIconView::SetSelectionMode( SelectionMode eSelectMode ) -{ - SvLBox::SetSelectionMode( eSelectMode ); - pImp->SetSelectionMode( eSelectMode ); -} - -sal_Bool SvIconView::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) -{ - EndEditing(); - sal_Bool bRetVal = SvListView::Select( pEntry, bSelect ); - if( bRetVal ) - { - pImp->EntrySelected( pEntry, bSelect ); - pHdlEntry = pEntry; - SelectHdl(); - } - return bRetVal; -} - -void SvIconView::SelectAll( sal_Bool bSelect, sal_Bool ) -{ - SvLBoxEntry* pEntry = pImp->GetCurParent(); - pEntry = FirstChild( pEntry ); - while( pEntry ) - { - Select( pEntry, bSelect ); - pEntry = NextSibling( pEntry ); - } -} - -void SvIconView::SetCurEntry( SvLBoxEntry* _pEntry ) -{ - pImp->SetCursor( _pEntry ); - OnCurrentEntryChanged(); -} - -SvLBoxEntry* SvIconView::GetCurEntry() const -{ - return pImp->GetCurEntry(); -} - -void SvIconView::Arrange() -{ -#ifdef DBG_UTIL - sal_uInt16 n=1; - if( n == 1 && n-1 == 0 ) - { - pImp->Arrange(); - } - else - { - pImp->AdjustAtGrid(); - } -#else - pImp->Arrange(); -#endif -} - - -void SvIconView::SetSpaceBetweenEntries( long nX, long nY ) -{ - pImp->SetSpaceBetweenEntries( nX, nY ); -} - -sal_Bool SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) -{ - return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos); -} - -sal_Bool SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) -{ - return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); -} - - -void SvIconView::EnableInplaceEditing( sal_Bool bEnable ) -{ - SvLBox::EnableInplaceEditing( bEnable ); -} - -void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem, - const Point& ) -{ - if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING ) - { - Selection aSel( SELECTION_MIN, SELECTION_MAX ); - if ( EditingEntry( pEntry, aSel ) ) - { - SelectAll( sal_False ); - EditItemText( pEntry, (SvLBoxString*)pItem, aSel ); - } - } -} - - -void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem, - const Selection& rSel ) -{ - DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?"); - pCurEdEntry = pEntry; - pCurEdItem = pItem; - Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,sal_True )); - - aRect.Bottom() += 4; - pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen! - aRect.Bottom() -= 4; - - Point aPos( aRect.TopLeft() ); - aPos += GetMapMode().GetOrigin(); // Dok-Koord. -> Window-Koord. - aRect.SetPos( aPos ); - - aRect.Bottom() += 2; // sieht huebscher aus - - EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, sal_True ); -} - -void SvIconView::EditEntry( SvLBoxEntry* pEntry ) -{ - if( !pEntry ) - pEntry = pImp->GetCurEntry(); - if( pEntry ) - { - SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if( pItem ) - { - Selection aSel( SELECTION_MIN, SELECTION_MAX ); - if( EditingEntry( pEntry, aSel ) ) - { - SelectAll( sal_False ); - EditItemText( pEntry, pItem, aSel ); - } - } - } -} - -void SvIconView::EditedText( const XubString& rStr ) -{ - XubString aRefStr( ((SvLBoxString*)pCurEdItem)->GetText() ); - if ( EditedEntry( pCurEdEntry, rStr ) ) - { - ((SvLBoxString*)pCurEdItem)->SetText( pCurEdEntry, rStr ); - pModel->InvalidateEntry( pCurEdEntry ); - } - if( GetSelectionMode()==SINGLE_SELECTION && !GetSelectionCount()) - Select( pCurEdEntry ); -} - - -sal_Bool SvIconView::EditingEntry( SvLBoxEntry*, Selection& ) -{ - return sal_True; -} - -sal_Bool SvIconView::EditedEntry( SvLBoxEntry*, const XubString& ) -{ - return sal_True; -} - - -void SvIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo) -{ - pImp->WriteDragServerInfo( rPos, pInfo ); -} - -void SvIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo ) -{ - pImp->ReadDragServerInfo( rPos, pInfo ); -} - -void SvIconView::Command( const CommandEvent& rCEvt ) -{ - pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() ); -} - -void SvIconView::SetCurParent( SvLBoxEntry* pNewParent ) -{ - if ( pNewParent && pNewParent->HasChildsOnDemand() ) - RequestingChilds( pNewParent ); - pImp->SetCurParent( pNewParent ); -} - -SvLBoxEntry* SvIconView::GetCurParent() const -{ - return pImp->GetCurParent(); -} - -SvViewData* SvIconView::CreateViewData( SvListEntry* ) -{ - SvIcnVwDataEntry* pEntryData = new SvIcnVwDataEntry; - return (SvViewData*)pEntryData; -} - -void SvIconView::InitViewData( SvViewData* pData, SvListEntry* pEntry ) -{ - SvLBox::InitViewData( pData, pEntry ); - pImp->InvalidateBoundingRect( ((SvIcnVwDataEntry*)pData)->aRect ); -} - -Region SvIconView::GetDragRegion() const -{ - Rectangle aRect; - SvLBoxEntry* pEntry = GetCurEntry(); - if( pEntry ) - aRect = pImp->GetBoundingRect( pEntry ); - Region aRegion( aRect ); - return aRegion; -} - -sal_uLong SvIconView::GetSelectionCount() const -{ - return (sal_uLong)(pImp->GetSelectionCount()); -} - -void SvIconView::SetGrid( long nDX, long nDY ) -{ - pImp->SetGrid( nDX, nDY ); -} - -void SvIconView::ModelNotification( sal_uInt16 nActionId, SvListEntry* pEntry1, - SvListEntry* pEntry2, sal_uLong nPos ) -{ - SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos ); - switch( nActionId ) - { - case LISTACTION_RESORTING: - SetUpdateMode( sal_False ); - break; - - case LISTACTION_RESORTED: - SetUpdateMode( sal_True ); - Arrange(); - break; - - case LISTACTION_CLEARED: - if( IsUpdateMode() ) - Update(); - break; - } -} - - -void SvIconView::Scroll( long nDeltaX, long nDeltaY, sal_uInt16 ) -{ - pImp->Scroll( nDeltaX, nDeltaY, sal_False ); -} - -void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt ) -{ - pImp->PrepareCommandEvent( rCEvt.GetMousePosPixel() ); -} - -void SvIconView::StartDrag( sal_Int8 nAction, const Point& rPos ) -{ - pImp->SttDrag( rPos ); - SvLBoxEntry* pEntry = GetEntry( rPos, sal_True ); - pImp->mpViewData = pEntry; - SvLBox::StartDrag( nAction, rPos ); -} - -void SvIconView::DragFinished( sal_Int8 ) -{ - pImp->EndDrag(); -} - -sal_Int8 SvIconView::AcceptDrop( const AcceptDropEvent& rEvt ) -{ - if( pImp->mpViewData ) - pImp->HideDDIcon(); - sal_Int8 nRet = SvLBox::AcceptDrop( rEvt ); - if( DND_ACTION_NONE != nRet ) - pImp->ShowDDIcon( pImp->mpViewData, rEvt.maPosPixel ); - - return nRet; -} - -sal_Int8 SvIconView::ExecuteDrop( const ExecuteDropEvent& rEvt ) -{ - if( pImp->mpViewData ) - { - pImp->HideDDIcon(); - pImp->mpViewData = 0; - } - return SvLBox::ExecuteDrop( rEvt ); -} - -void SvIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ) -{ - pImp->ShowDDIcon( pRefEntry, rPos ); -} - -void SvIconView::HideDDIcon() -{ - pImp->HideDDIcon(); -} - -void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ) -{ - pImp->HideShowDDIcon( pRefEntry, rPos ); -} - -void SvIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, - SvPtrarr* pRects, short nOffs ) -{ - pImp->SelectRect( rRect, bAdd, pRects, nOffs ); -} - -void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY, - sal_Bool b, sal_uInt16 nBorderWidth ) -{ - pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth ); -} - -void SvIconView::EndTracking() -{ - pImp->EndTracking(); -} - -void SvIconView::MakeVisible( SvLBoxEntry* pEntry ) -{ - pImp->MakeVisible( pEntry ); -} - -void SvIconView::PreparePaint( SvLBoxEntry* ) -{ -} - -void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry ) -{ - pImp->AdjustAtGrid( pEntry ); -} - -void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, sal_Bool bLock ) -{ - SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry ); - if( bLock ) - pViewData->SetVwFlags( ICNVW_FLAG_POS_LOCKED ); - else - pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED ); -} - -sal_Bool SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const -{ - const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry ); - return pViewData->IsEntryPosLocked(); -} - -void SvIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry ) -{ - pImp->SetTextMode( eMode, pEntry ); -} - -SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const -{ - return pImp->GetTextMode( pEntry ); -} - -SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const -{ - Point aPos( rPixPos ); - aPos -= GetMapMode().GetOrigin(); - return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry ); -} - -SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, sal_Bool ) const -{ - Point aPos( rPixPos ); - aPos -= GetMapMode().GetOrigin(); - return ((SvIconView*)this)->pImp->GetPrevEntry( aPos, pCurEntry ); -} - -void SvIconView::ShowFocusRect( const SvLBoxEntry* pEntry ) -{ - pImp->ShowFocusRect( pEntry ); -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx deleted file mode 100644 index 3514c7b6a271..000000000000 --- a/svtools/source/contnr/svimpicn.cxx +++ /dev/null @@ -1,4093 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#include -#include -#include -#ifdef DBG_UTIL -#include -#endif - -#include -#include -#include -#include -#include - - - -#define VIEWMODE_ICON 0x0001 // Text unter Bitmap -#define VIEWMODE_NAME 0x0002 // Text rechts neben Bitmap -#define VIEWMODE_TEXT 0x0004 // Text ohne Bitmap - -#define DD_SCROLL_PIXEL 10 - -// alle Angaben in Pixel - -#define ICONVIEW_OFFS_BMP_STRING 3 - -// fuer das Bounding-Rectangle -#define LROFFS_BOUND 2 -#define TBOFFS_BOUND 2 - -// fuer das Focus-Rectangle um Icons -#define LROFFS_ICON 2 -#define TBOFFS_ICON 2 - -#define NAMEVIEW_OFFS_BMP_STRING 3 - -// Abstaende von Fensterraendern -#define LROFFS_WINBORDER 4 -#define TBOFFS_WINBORDER 4 - -// Breitenoffset Highlight-Rect bei Text -#define LROFFS_TEXT 2 - - -#define ICNVIEWDATA(xPtr) (SvIcnVwDataEntry*)(pView->GetViewDataEntry(xPtr)) -#define ICNVIEWDATA2(xPtr) (SvIcnVwDataEntry*)(pView->pView->GetViewDataEntry(xPtr)) - -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -// ------------------------------------------------------------------------- -// Hilfsfunktionen von Thomas Hosemann zur mehrzeiligen Ausgabe von -// Strings. Die Funktionen werden spaeter in StarView integriert. -// ------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- - -// keine doppelten Defines -#ifdef TEXT_DRAW_CLIP -#undef TEXT_DRAW_CLIP -#endif -#ifdef TEXT_DRAW_MULTILINE -#undef TEXT_DRAW_MULTILINE -#endif -#ifdef TEXT_DRAW_WORDBREAK -#undef TEXT_DRAW_WORDBREAK -#endif - -// #define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001) -// #define TEXT_DRAW_3DLOOK ((sal_uInt16)0x0002) -// #define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0004) -#define TEXT_DRAW_LEFT ((sal_uInt16)0x0010) -#define TEXT_DRAW_CENTER ((sal_uInt16)0x0020) -#define TEXT_DRAW_RIGHT ((sal_uInt16)0x0040) -#define TEXT_DRAW_TOP ((sal_uInt16)0x0080) -#define TEXT_DRAW_VCENTER ((sal_uInt16)0x0100) -#define TEXT_DRAW_BOTTOM ((sal_uInt16)0x0200) -#define TEXT_DRAW_ENDELLIPSIS ((sal_uInt16)0x0400) -#define TEXT_DRAW_PATHELLIPSIS ((sal_uInt16)0x0800) -#define TEXT_DRAW_CLIP ((sal_uInt16)0x1000) -#define TEXT_DRAW_MULTILINE ((sal_uInt16)0x2000) -#define TEXT_DRAW_WORDBREAK ((sal_uInt16)0x4000) - -XubString GetEllipsisString( OutputDevice* pDev, - const XubString& rStr, long nMaxWidth, - sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) -{ - XubString aStr = rStr; - - if ( nStyle & TEXT_DRAW_ENDELLIPSIS ) - { - sal_uInt16 nIndex = pDev->GetTextBreak( rStr, nMaxWidth ); - if ( nIndex != STRING_LEN ) - { - aStr.Erase( nIndex ); - if ( nIndex > 1 ) - { - aStr.AppendAscii("..."); - while ( aStr.Len() && - (pDev->GetTextWidth( aStr ) > nMaxWidth) ) - { - if ( (nIndex > 1) || (nIndex == aStr.Len()) ) - nIndex--; - aStr.Erase( nIndex, 1 ); - } - } - - if ( !aStr.Len() && (nStyle & TEXT_DRAW_CLIP) ) - aStr += rStr.GetChar( 0 ); - } - } - - return aStr; -} - -class TextLineInfo -{ -private: - long mnWidth; - sal_uInt16 mnIndex; - sal_uInt16 mnLen; - -public: - TextLineInfo( long nWidth, sal_uInt16 nIndex, sal_uInt16 nLen ) - { - mnWidth = nWidth; - mnIndex = nIndex; - mnLen = nLen; - } - - long GetWidth() const { return mnWidth; } - sal_uInt16 GetIndex() const { return mnIndex; } - sal_uInt16 GetLen() const { return mnLen; } -}; - -#define MULTITEXTLINEINFO_RESIZE 16 -typedef TextLineInfo* PTextLineInfo; - -class MultiTextLineInfo -{ -private: - PTextLineInfo* mpLines; - sal_uInt16 mnLines; - sal_uInt16 mnSize; - -public: - MultiTextLineInfo(); - ~MultiTextLineInfo(); - - void AddLine( TextLineInfo* pLine ); - void Clear(); - - TextLineInfo* GetLine( sal_uInt16 nLine ) const - { return mpLines[nLine]; } - sal_uInt16 Count() const { return mnLines; } - -private: - MultiTextLineInfo( const MultiTextLineInfo& ); - MultiTextLineInfo& operator=( const MultiTextLineInfo& ); -}; - -MultiTextLineInfo::MultiTextLineInfo() -{ - mpLines = new PTextLineInfo[MULTITEXTLINEINFO_RESIZE]; - mnLines = 0; - mnSize = MULTITEXTLINEINFO_RESIZE; -} - -MultiTextLineInfo::~MultiTextLineInfo() -{ - for ( sal_uInt16 i = 0; i < mnLines; i++ ) - delete mpLines[i]; - delete [] mpLines; -} - -void MultiTextLineInfo::AddLine( TextLineInfo* pLine ) -{ - if ( mnSize == mnLines ) - { - mnSize += MULTITEXTLINEINFO_RESIZE; - PTextLineInfo* pNewLines = new PTextLineInfo[mnSize]; - memcpy( pNewLines, mpLines, mnLines*sizeof(PTextLineInfo) ); - mpLines = pNewLines; - } - - mpLines[mnLines] = pLine; - mnLines++; -} - -void MultiTextLineInfo::Clear() -{ - for ( sal_uInt16 i = 0; i < mnLines; i++ ) - delete mpLines[i]; - mnLines = 0; -} - -// ----------------------------------------------------------------------- - -long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, - long nWidth, const XubString& rStr, - sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) -{ - rLineInfo.Clear(); - if ( !rStr.Len() ) - return 0; - if ( nWidth <= 0 ) - nWidth = 1; - - sal_uInt16 nStartPos = 0; // Start-Position der Zeile - sal_uInt16 nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort - sal_uInt16 nLastWordPos = 0; // Position des letzten Wortanfangs - sal_uInt16 i = 0; - sal_uInt16 nPos; // StartPositon der Zeile (nur Temp) - sal_uInt16 nLen; // Laenge der Zeile (nur Temp) - sal_uInt16 nStrLen = rStr.Len(); - long nMaxLineWidth = 0; // Maximale Zeilenlaenge - long nLineWidth; // Aktuelle Zeilenlaenge - long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile - xub_Unicode c; - xub_Unicode c2; - const xub_Unicode* pStr = rStr.GetBuffer(); - sal_Bool bHardBreak = sal_False; - - do - { - c = pStr[i]; - - // Auf Zeilenende ermitteln - if ( (c == _CR) || (c == _LF) ) - bHardBreak = sal_True; - else - bHardBreak = sal_False; - - // Testen, ob ein Wortende erreicht ist - if ( bHardBreak || (i == nStrLen) || - (((c == ' ') || (c == '-')) && (nStyle & TEXT_DRAW_WORDBREAK)) ) - { - nLen = i-nStartPos; - if ( c == '-' ) - nLen++; - nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLen ); - - // Findet ein Zeilenumbruch statt - if ( bHardBreak || (i == nStrLen) || - ((nLineWidth >= nWidth) && (nStyle & TEXT_DRAW_WORDBREAK)) ) - { - nPos = nStartPos; - - if ( (nLineWidth >= nWidth) && (nStyle & TEXT_DRAW_WORDBREAK) ) - { - nLineWidth = nLastLineWidth; - nLen = nLastLineLen; - nStartPos = nLastWordPos; - nLastLineLen = i-nStartPos; - nLastWordPos = nStartPos+nLastLineLen+1; - if ( c == '-' ) - nLastLineLen++; - else if ( bHardBreak && (i > nStartPos) ) - i--; - } - else - { - nStartPos = i; - // Zeilenende-Zeichen und '-' beruecksichtigen - if ( bHardBreak ) - { - nStartPos++; - c2 = pStr[i+1]; - if ( (c != c2) && ((c2 == _CR) || (c2 == _LF)) ) - { - nStartPos++; - i++; - } - } - else if ( c != '-' ) - nStartPos++; - nLastWordPos = nStartPos; - nLastLineLen = 0; - } - - if ( nLineWidth > nMaxLineWidth ) - nMaxLineWidth = nLineWidth; - - if ( nLen || bHardBreak ) - rLineInfo.AddLine( new TextLineInfo( nLineWidth, nPos, nLen ) ); - - // Testen, ob aktuelles Wort noch auf die Zeile passt, - // denn ansonsten mueessen wir es auftrennen - if ( nLastLineLen ) - { - nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLastLineLen ); - if ( nLineWidth > nWidth ) - { - // Wenn ein Wortumbruch in einem Wort stattfindet, - // ist die maximale Zeilenlaenge die Laenge - // des laengsten Wortes - if ( nLineWidth > nMaxLineWidth ) - nMaxLineWidth = nLineWidth; - - // Solange Wort auftrennen, bis es auf eine Zeile passt - do - { - nPos = pDev->GetTextBreak( rStr, nWidth, nStartPos, nLastLineLen ); - nLen = nPos-nStartPos; - if ( !nLen ) - { - nPos++; - nLen++; - } - nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLen ); - rLineInfo.AddLine( new TextLineInfo( nLineWidth, nStartPos, nLen ) ); - nStartPos = nPos; - nLastLineLen = nLastLineLen - nLen; - nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLastLineLen ); - } - while ( nLineWidth > nWidth ); - } - nLastLineWidth = nLineWidth; - - // Bei Stringende muessen wir die letzte Zeile auch noch - // dranhaengen - if ( (i == nStrLen) && nLastLineLen ) - rLineInfo.AddLine( new TextLineInfo( nLastLineWidth, nStartPos, nLastLineLen ) ); - } - else - nLastLineWidth = 0; - } - else - { - nLastLineWidth = nLineWidth; - nLastLineLen = nLen; - nLastWordPos = nStartPos+nLastLineLen; - if ( c != '-' ) - nLastWordPos++; - } - } - - i++; - } - while ( i <= nStrLen ); - - return nMaxLineWidth; -} - -// ----------------------------------------------------------------------- - -sal_uInt16 GetTextLines( OutputDevice* pDev, const Rectangle& rRect, - const XubString& rStr, - sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK, - long* pMaxWidth = NULL ) -{ - MultiTextLineInfo aMultiLineInfo; - long nMaxWidth = GetTextLines( pDev, aMultiLineInfo, - rRect.GetWidth(), rStr, nStyle ); - if ( pMaxWidth ) - *pMaxWidth = nMaxWidth; - return aMultiLineInfo.Count(); -} - -// ----------------------------------------------------------------------- - -Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect, - const XubString& rStr, - sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK ) -{ - Rectangle aRect = rRect; - sal_uInt16 nLines; - long nWidth = rRect.GetWidth(); - long nMaxWidth; - long nTextHeight; - - if ( nStyle & TEXT_DRAW_MULTILINE ) - { - MultiTextLineInfo aMultiLineInfo; - TextLineInfo* pLineInfo; - sal_uInt16 nFormatLines; - - nMaxWidth = 0; - GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); - nFormatLines = aMultiLineInfo.Count(); - nTextHeight = pDev->GetTextHeight(); - nLines = (sal_uInt16)(aRect.GetHeight()/nTextHeight); - if ( nFormatLines <= nLines ) - nLines = nFormatLines; - else - { - if ( !(nStyle & TEXT_DRAW_ENDELLIPSIS) ) - nLines = nFormatLines; - else - nMaxWidth = nWidth; - } - for ( sal_uInt16 i = 0; i < nLines; i++ ) - { - pLineInfo = aMultiLineInfo.GetLine( i ); - if ( pLineInfo->GetWidth() > nMaxWidth ) - nMaxWidth = pLineInfo->GetWidth(); - } - } - else - { - nLines = 1; - nMaxWidth = pDev->GetTextWidth( rStr ); - nTextHeight = pDev->GetTextHeight(); - if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ENDELLIPSIS) ) - nMaxWidth = nWidth; - } - - if ( nStyle & TEXT_DRAW_RIGHT ) - aRect.Left() = aRect.Right()-nMaxWidth+1; - else if ( nStyle & TEXT_DRAW_CENTER ) - { - aRect.Left() += (nWidth-nMaxWidth)/2; - aRect.Right() = aRect.Left()+nMaxWidth-1; - } - else - aRect.Right() = aRect.Left()+nMaxWidth-1; - - if ( nStyle & TEXT_DRAW_BOTTOM ) - aRect.Top() = aRect.Bottom()-(nTextHeight*nLines)+1; - else if ( nStyle & TEXT_DRAW_VCENTER ) - { - aRect.Top() += (aRect.GetHeight()-(nTextHeight*nLines))/2; - aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1; - } - else - aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1; - - return aRect; -} - -// ----------------------------------------------------------------------- - -void DrawText( OutputDevice* pDev, const Rectangle& rRect, - const XubString& rStr, sal_uInt16 nStyle = 0 ) -{ - if ( !rStr.Len() || rRect.IsEmpty() ) - return; - - Point aPos = rRect.TopLeft(); - long nWidth = rRect.GetWidth(); - long nHeight = rRect.GetHeight(); - FontAlign eAlign = pDev->GetFont().GetAlign(); - - if ( ((nWidth <= 0) || (nHeight <= 0)) && (nStyle & TEXT_DRAW_CLIP) ) - return; - - // Mehrzeiligen Text behandeln wir anders - if ( nStyle & TEXT_DRAW_MULTILINE ) - { - String aLastLine; - Region aOldRegion; - MultiTextLineInfo aMultiLineInfo; - TextLineInfo* pLineInfo; - long nTextHeight = pDev->GetTextHeight(); - long nMaxTextWidth; - sal_uInt16 i; - sal_uInt16 nLines = (sal_uInt16)(nHeight/nTextHeight); - sal_uInt16 nFormatLines; - sal_Bool bIsClipRegion = sal_False; - nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle ); - - nFormatLines = aMultiLineInfo.Count(); - if ( nFormatLines > nLines ) - { - if ( nStyle & TEXT_DRAW_ENDELLIPSIS ) - { - // Letzte Zeile zusammenbauen und kuerzen - nFormatLines = nLines-1; - pLineInfo = aMultiLineInfo.GetLine( nFormatLines ); - aLastLine = rStr.Copy( pLineInfo->GetIndex() ); - aLastLine.ConvertLineEnd( LINEEND_LF ); - aLastLine.SearchAndReplace( _LF, ' ' ); - aLastLine = GetEllipsisString( pDev, aLastLine, nWidth, nStyle ); - nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM); - nStyle |= TEXT_DRAW_TOP; - } - } - else - { - if ( nMaxTextWidth <= nWidth ) - nStyle &= ~TEXT_DRAW_CLIP; - } - - // Clipping setzen - if ( nStyle & TEXT_DRAW_CLIP ) - { - bIsClipRegion = pDev->IsClipRegion(); - if ( bIsClipRegion ) - { - aOldRegion = pDev->GetClipRegion(); - pDev->IntersectClipRegion( rRect ); - } - else - { - Region aRegion( rRect ); - pDev->SetClipRegion( aRegion ); - } - } - - // Vertikales Alignment - if ( nStyle & TEXT_DRAW_BOTTOM ) - aPos.Y() += nHeight-(nFormatLines*nTextHeight); - else if ( nStyle & TEXT_DRAW_VCENTER ) - aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2; - - // Font Alignment - if ( eAlign == ALIGN_BOTTOM ) - aPos.Y() += nTextHeight; - else if ( eAlign == ALIGN_BASELINE ) - aPos.Y() += pDev->GetFontMetric().GetAscent(); - - // Alle Zeilen ausgeben, bis auf die letzte - for ( i = 0; i < nFormatLines; i++ ) - { - pLineInfo = aMultiLineInfo.GetLine( i ); - if ( nStyle & TEXT_DRAW_RIGHT ) - aPos.X() += nWidth-pLineInfo->GetWidth(); - else if ( nStyle & TEXT_DRAW_CENTER ) - aPos.X() += (nWidth-pLineInfo->GetWidth())/2; - pDev->DrawText( aPos, rStr, pLineInfo->GetIndex(), pLineInfo->GetLen() ); - aPos.Y() += nTextHeight; - aPos.X() = rRect.Left(); - } - - // Gibt es noch eine letzte Zeile, dann diese linksbuendig ausgeben, - // da die Zeile gekuerzt wurde - if ( aLastLine.Len() ) - pDev->DrawText( aPos, aLastLine ); - - // Clipping zuruecksetzen - if ( nStyle & TEXT_DRAW_CLIP ) - { - if ( bIsClipRegion ) - pDev->SetClipRegion( aOldRegion ); - else - pDev->SetClipRegion(); - } - } - else - { - XubString aStr = rStr; - Size aTextSize(pDev->GetTextWidth( aStr ), pDev->GetTextHeight()); - - // Evt. Text kuerzen - if ( aTextSize.Width() > nWidth ) - { - if ( nStyle & TEXT_DRAW_ENDELLIPSIS ) - { - aStr = GetEllipsisString( pDev, rStr, nWidth, nStyle ); - nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT); - nStyle |= TEXT_DRAW_LEFT; - aTextSize.Width() = pDev->GetTextWidth(aStr); - } - } - else - { - if ( aTextSize.Height() <= nHeight ) - nStyle &= ~TEXT_DRAW_CLIP; - } - - // Vertikales Alignment - if ( nStyle & TEXT_DRAW_RIGHT ) - aPos.X() += nWidth-aTextSize.Width(); - else if ( nStyle & TEXT_DRAW_CENTER ) - aPos.X() += (nWidth-aTextSize.Width())/2; - - // Font Alignment - if ( eAlign == ALIGN_BOTTOM ) - aPos.Y() += aTextSize.Height(); - else if ( eAlign == ALIGN_BASELINE ) - aPos.Y() += pDev->GetFontMetric().GetAscent(); - - if ( nStyle & TEXT_DRAW_BOTTOM ) - aPos.Y() += nHeight-aTextSize.Height(); - else if ( nStyle & TEXT_DRAW_VCENTER ) - aPos.Y() += (nHeight-aTextSize.Height())/2; - - if ( nStyle & TEXT_DRAW_CLIP ) - { - sal_Bool bIsClipRegion = pDev->IsClipRegion(); - if ( bIsClipRegion ) - { - Region aOldRegion = pDev->GetClipRegion(); - pDev->IntersectClipRegion( rRect ); - pDev->DrawText( aPos, aStr ); - pDev->SetClipRegion( aOldRegion ); - } - else - { - Region aRegion( rRect ); - pDev->SetClipRegion( aRegion ); - pDev->DrawText( aPos, aStr ); - pDev->SetClipRegion(); - } - } - else - pDev->DrawText( aPos, aStr ); - } -} - -// ----------------------------------------------------------------------- - - -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- - - -#define DRAWTEXT_FLAGS (TEXT_DRAW_CENTER|TEXT_DRAW_TOP|TEXT_DRAW_ENDELLIPSIS|\ - TEXT_DRAW_CLIP|TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK) - - -class ImpIcnCursor -{ - SvImpIconView* pView; - SvPtrarr* pColumns; - SvPtrarr* pRows; - sal_Bool* pGridMap; - long nGridDX, nGridDY; - long nGridCols, nGridRows; - long nCols; - long nRows; - short nDeltaWidth; - short nDeltaHeight; - SvLBoxEntry* pCurEntry; - void SetDeltas(); - void ImplCreate(); - void Create() { if( !pColumns ) ImplCreate(); } - - sal_uInt16 GetSortListPos( SvPtrarr* pList, long nValue, int bVertical); - SvLBoxEntry* SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom,sal_uInt16 nPref, - sal_Bool bDown, sal_Bool bSimple ); - SvLBoxEntry* SearchRow(sal_uInt16 nRow,sal_uInt16 nRight,sal_uInt16 nLeft,sal_uInt16 nPref, - sal_Bool bRight, sal_Bool bSimple ); - - void CreateGridMap(); - // Rueckgabe sal_False: Eintrag liegt nicht in der GridMap. rGridx,y werden - // dann an nGridCols, nGridRows geclippt - sal_Bool GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const; - void SetGridUsed( sal_uInt16 nDX, sal_uInt16 nDY, sal_Bool bUsed ) - { - pGridMap[ (nDY * nGridCols) + nDX ] = bUsed; - } -public: - ImpIcnCursor( SvImpIconView* pOwner ); - ~ImpIcnCursor(); - void Clear( sal_Bool bGridToo = sal_True ); - - // fuer Cursortravelling usw. - SvLBoxEntry* GoLeftRight( SvLBoxEntry*, sal_Bool bRight ); - SvLBoxEntry* GoUpDown( SvLBoxEntry*, sal_Bool bDown ); - - // Rueckgaebe: sal_False == Das leere Rect steht hinter dem letzten - // Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste - // leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann - // ausserhalb des View-Space liegen - sal_Bool FindEmptyGridRect( Rectangle& rRect ); - - // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left() - // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann - // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und - // muessen mit DestroyGridAdjustData geloescht werden - void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0); - static void DestroyGridAdjustData( SvPtrarr& rLists ); - void SetGridUsed( const Rectangle&, sal_Bool bUsed = sal_True ); -}; - - - - -SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree, - WinBits i_nWinStyle ) : - aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ), - aHorSBar( pCurView, WB_DRAG | WB_HSCROLL ) -{ - pView = pCurView; - pModel = pTree; - pCurParent = 0; - pZOrderList = new SvPtrarr; - SetStyle( i_nWinStyle ); - nHorDist = 0; - nVerDist = 0; - nFlags = 0; - nCurUserEvent = 0; - nMaxVirtWidth = 200; - pDDRefEntry = 0; - pDDDev = 0; - pDDBufDev = 0; - pDDTempDev = 0; - eTextMode = ShowTextShort; - pImpCursor = new ImpIcnCursor( this ); - - aVerSBar.SetScrollHdl( LINK( this, SvImpIconView, ScrollUpDownHdl ) ); - aHorSBar.SetScrollHdl( LINK( this, SvImpIconView, ScrollLeftRightHdl ) ); - nHorSBarHeight = aHorSBar.GetSizePixel().Height(); - nVerSBarWidth = aVerSBar.GetSizePixel().Width(); - - aMouseMoveTimer.SetTimeout( 20 ); - aMouseMoveTimer.SetTimeoutHdl(LINK(this,SvImpIconView,MouseMoveTimeoutHdl)); - - aEditTimer.SetTimeout( 800 ); - aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl)); - - Clear( sal_True ); -} - -SvImpIconView::~SvImpIconView() -{ - StopEditTimer(); - CancelUserEvent(); - delete pZOrderList; - delete pImpCursor; - delete pDDDev; - delete pDDBufDev; - delete pDDTempDev; - ClearSelectedRectList(); -} - -void SvImpIconView::Clear( sal_Bool bInCtor ) -{ - StopEditTimer(); - CancelUserEvent(); - nMaxBmpWidth = 0; - nMaxBmpHeight = 0; - nMaxTextWidth = 0; - bMustRecalcBoundingRects = sal_False; - nMaxBoundHeight = 0; - - //XXX - nFlags |= F_GRID_INSERT; - nFlags &= ~F_PAINTED; - SetNextEntryPos( Point( LROFFS_WINBORDER, TBOFFS_WINBORDER ) ); - pCursor = 0; - if( !bInCtor ) - { - pImpCursor->Clear(); - aVirtOutputSize.Width() = 0; - aVirtOutputSize.Height() = 0; - pZOrderList->Remove(0,pZOrderList->Count()); - MapMode aMapMode( pView->GetMapMode()); - aMapMode.SetOrigin( Point() ); - pView->SetMapMode( aMapMode ); - if( pView->IsUpdateMode() ) - pView->Invalidate(); - } - AdjustScrollBars(); -} - -void SvImpIconView::SetStyle( const WinBits i_nWinStyle ) -{ - nViewMode = VIEWMODE_TEXT; - if( i_nWinStyle & WB_NAME ) - nViewMode = VIEWMODE_NAME; - if( i_nWinStyle & WB_ICON ) - nViewMode = VIEWMODE_ICON; -} - - -IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar ) -{ - pView->EndEditing( sal_True ); - // Pfeil hoch: delta=-1; Pfeil runter: delta=+1 - Scroll( 0, pScrollBar->GetDelta(), sal_True ); - return 0; -} - -IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar ) -{ - pView->EndEditing( sal_True ); - // Pfeil links: delta=-1; Pfeil rechts: delta=+1 - Scroll( pScrollBar->GetDelta(), 0, sal_True ); - return 0; -} - -void SvImpIconView::ChangedFont() -{ - StopEditTimer(); - ImpArrange(); -} - - -void SvImpIconView::CheckAllSizes() -{ - nMaxTextWidth = 0; - nMaxBmpWidth = 0; - nMaxBmpHeight = 0; - SvLBoxEntry* pEntry = pModel->First(); - while( pEntry ) - { - CheckSizes( pEntry ); - pEntry = pModel->Next( pEntry ); - } -} - -void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) -{ - Size aSize; - - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - - SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if( pStringItem ) - { - aSize = GetItemSize( pView, pEntry, pStringItem, pViewData ); - if( aSize.Width() > nMaxTextWidth ) - { - nMaxTextWidth = aSize.Width(); - if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = sal_True; - } - } - SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if( pBmpItem ) - { - aSize = GetItemSize( pView, pEntry, pBmpItem, pViewData ); - if( aSize.Width() > nMaxBmpWidth ) - { - nMaxBmpWidth = aSize.Width(); - nMaxBmpWidth += (2*LROFFS_ICON); - if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = sal_True; - } - if( aSize.Height() > nMaxBmpHeight ) - { - nMaxBmpHeight = aSize.Height(); - nMaxBmpHeight += (2*TBOFFS_ICON);; - if( !(nFlags & F_GRIDMODE ) ) - bMustRecalcBoundingRects = sal_True; - } - } -} - -void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry ) -{ - if( pModel->GetParent(pEntry) == pCurParent ) - { - StopEditTimer(); - DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?"); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - if( nFlags & F_GRIDMODE ) - pImpCursor->Clear( sal_False ); - else - pImpCursor->Clear( sal_True ); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - CheckSizes( pEntry, pViewData ); - if( pView->IsUpdateMode() ) - { - FindBoundingRect( pEntry, pViewData ); - PaintEntry( pEntry, pViewData ); - } - else - InvalidateBoundingRect( pViewData->aRect ); - } -} - -void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry ) -{ - if( pModel->GetParent(pEntry) == pCurParent) - { - StopEditTimer(); - DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"RemovingEntry:ZOrder?"); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( IsBoundingRectValid( pViewData->aRect ) ) - { - // bei gueltigem Bounding-Rect muss in EntryRemoved eine - // Sonderbehandlung erfolgen - nFlags |= F_ENTRY_REMOVED; - pView->Invalidate( pViewData->aRect ); - } - if( pEntry == pCursor ) - { - SvLBoxEntry* pNewCursor = GetNewCursor(); - ShowCursor( sal_False ); - pCursor = 0; // damit er nicht deselektiert wird - SetCursor( pNewCursor ); - } - sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); - pZOrderList->Remove( nPos, 1 ); - pImpCursor->Clear(); - } -} - -void SvImpIconView::EntryRemoved() -{ - if( (nFlags & (F_ENTRY_REMOVED | F_PAINTED)) == (F_ENTRY_REMOVED | F_PAINTED)) - { - // Ein Eintrag mit gueltigem BoundRect wurde geloescht und wir - // haben schon mal gepaintet. In diesem Fall muessen wir die - // Position des naechsten Eintrags, der eingefuegt wird oder noch - // kein gueltiges BoundRect hat, "suchen" d.h. ein "Loch" in - // der View auffuellen. - nFlags &= ~( F_ENTRY_REMOVED | F_GRID_INSERT ); - } -} - - -void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry ) -{ - DBG_ASSERT(pEntry,"MovingEntry: 0!"); - pNextCursor = 0; - StopEditTimer(); - if( pModel->GetParent(pEntry) == pCurParent ) - { - DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"MovingEntry:ZOrder?"); - nFlags |= F_MOVING_SIBLING; - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( IsBoundingRectValid( pViewData->aRect ) ) - pView->Invalidate( pViewData->aRect ); - // falls Eintrag seinen Parent wechselt vorsichtshalber - // die neue Cursorposition berechnen - if( pEntry == pCursor ) - pNextCursor = GetNewCursor(); - pImpCursor->Clear(); - } -} - - -void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry ) -{ - ShowCursor( sal_False ); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( pModel->GetParent(pEntry)==pCurParent ) - { - if( nFlags & F_MOVING_SIBLING ) - { - // die Neu-Positionierung eines Eintrags bei D&D innerhalb - // einer IconView findet bereits in NotifyMoving statt - // (MovingEntry/EntryMoved wird dann nicht mehr gerufen) - ToTop( pEntry ); - } - else - { - pImpCursor->Clear(); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - DBG_ASSERT(pZOrderList->Count()==pModel->GetChildCount(pCurParent),"EntryMoved:Bad zorder count"); - FindBoundingRect( pEntry, pViewData ); - } - PaintEntry( pEntry, pViewData ); - } - else - { - if( pEntry == pCursor ) - { - DBG_ASSERT(pNextCursor,"EntryMoved: Next cursor bad"); - SetCursor( pNextCursor ); - } - pImpCursor->Clear(); - sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); - pZOrderList->Remove( nPos, 1 ); - pView->Select( pEntry, sal_False ); - // wenn er nochmal in dieser View auftaucht, muss sein - // Bounding-Rect neu berechnet werden - InvalidateBoundingRect( pViewData->aRect ); - } - nFlags &= (~F_MOVING_SIBLING); -} - -void SvImpIconView::TreeInserted( SvLBoxEntry* pEntry ) -{ - EntryMoved( pEntry ); // vorlaeufig -} - -void SvImpIconView::EntryExpanded( SvLBoxEntry* ) -{ -} - -void SvImpIconView::EntryCollapsed( SvLBoxEntry*) -{ -} - -void SvImpIconView::CollapsingEntry( SvLBoxEntry* ) -{ -} - -void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) -{ - if( pModel->GetParent(pEntry) != pCurParent ) - return; - - // bei SingleSelection dafuer sorgen, dass der Cursor immer - // auf dem (einzigen) selektierten Eintrag steht - if( bSelect && pCursor && - pView->GetSelectionMode() == SINGLE_SELECTION && - pEntry != pCursor ) - { - SetCursor( pEntry ); - DBG_ASSERT(pView->GetSelectionCount()==1,"selection count?"); - } - // bei Gummibandselektion ist uns das zu teuer - if( !(nFlags & F_RUBBERING )) - ToTop( pEntry ); - if( pView->IsUpdateMode() ) - { - if( pEntry == pCursor ) - ShowCursor( sal_False ); - if( nFlags & F_RUBBERING ) - PaintEntry( pEntry ); - else - pView->Invalidate( GetBoundingRect( pEntry ) ); - if( pEntry == pCursor ) - ShowCursor( sal_True ); - } -} - -void SvImpIconView::SetNextEntryPos(const Point& rPos) -{ - aPrevBoundRect.SetPos( rPos ); - aPrevBoundRect.Right() = LONG_MAX; // dont know -} - -Point SvImpIconView::FindNextEntryPos( const Size& rBoundSize ) -{ - if( nFlags & F_GRIDMODE ) - { - if( nFlags & F_GRID_INSERT ) - { - if( aPrevBoundRect.Right() != LONG_MAX ) - { - // passt der naechste Entry noch in die Zeile ? - long nNextWidth = aPrevBoundRect.Right() + nGridDX + LROFFS_WINBORDER; - if( nNextWidth > aVirtOutputSize.Width() ) - { - // darf aVirtOutputSize verbreitert werden ? - if( nNextWidth < nMaxVirtWidth ) - { - // verbreitern & in Zeile aufnehmen - aPrevBoundRect.Left() += nGridDX; - } - else - { - // erhoehen & neue Zeile beginnen - aPrevBoundRect.Top() += nGridDY; - aPrevBoundRect.Left() = LROFFS_WINBORDER; - } - } - else - { - // in die Zeile aufnehmen - aPrevBoundRect.Left() += nGridDX; - } - } - aPrevBoundRect.SetSize( Size( nGridDX, nGridDY ) ); - } - else - { - if( !pImpCursor->FindEmptyGridRect( aPrevBoundRect ) ) - { - // mitten in den Entries gibts keine Loecher mehr, - // wir koennen also wieder ins "Fast Insert" springen - nFlags |= F_GRID_INSERT; - } - } - } - else - { - if( aPrevBoundRect.Right() != LONG_MAX ) - { - // passt der naechste Entry noch in die Zeile ? - long nNextWidth=aPrevBoundRect.Right()+rBoundSize.Width()+LROFFS_BOUND+nHorDist; - if( nNextWidth > aVirtOutputSize.Width() ) - { - // darf aVirtOutputSize verbreitert werden ? - if( nNextWidth < nMaxVirtWidth ) - { - // verbreitern & in Zeile aufnehmen - aPrevBoundRect.SetPos( aPrevBoundRect.TopRight() ); - aPrevBoundRect.Left() += nHorDist; - } - else - { - // erhoehen & neue Zeile beginnen - aPrevBoundRect.Top() += nMaxBoundHeight + nVerDist + TBOFFS_BOUND; - aPrevBoundRect.Left() = LROFFS_WINBORDER; - } - } - else - { - // in die Zeile aufnehmen - aPrevBoundRect.SetPos( aPrevBoundRect.TopRight() ); - aPrevBoundRect.Left() += nHorDist; - } - } - aPrevBoundRect.SetSize( rBoundSize ); - } - return aPrevBoundRect.TopLeft(); -} - -void SvImpIconView::ResetVirtSize() -{ - StopEditTimer(); - aVirtOutputSize.Width() = 0; - aVirtOutputSize.Height() = 0; - sal_Bool bLockedEntryFound = sal_False; - nFlags &= (~F_GRID_INSERT); - SvLBoxEntry* pCur = pModel->FirstChild( pCurParent ); - while( pCur ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); - if( pViewData->IsEntryPosLocked() ) - { - // VirtSize u.a. anpassen - if( !IsBoundingRectValid( pViewData->aRect ) ) - FindBoundingRect( pCur, pViewData ); - else - AdjustVirtSize( pViewData->aRect ); - bLockedEntryFound = sal_True; - } - else - InvalidateBoundingRect( pViewData->aRect ); - - pCur = pModel->NextSibling( pCur ); - } - if( !bLockedEntryFound ) - { - //XXX - nFlags |= F_GRID_INSERT; - } - - SetNextEntryPos( Point( LROFFS_WINBORDER, TBOFFS_WINBORDER ) ); - pImpCursor->Clear(); -} - - -void SvImpIconView::AdjustVirtSize( const Rectangle& rRect ) -{ - long nHeightOffs = 0; - long nWidthOffs = 0; - - if( aVirtOutputSize.Width() < (rRect.Right()+LROFFS_WINBORDER) ) - nWidthOffs = (rRect.Right()+LROFFS_WINBORDER) - aVirtOutputSize.Width(); - - if( aVirtOutputSize.Height() < (rRect.Bottom()+TBOFFS_WINBORDER) ) - nHeightOffs = (rRect.Bottom()+TBOFFS_WINBORDER) - aVirtOutputSize.Height(); - - if( nWidthOffs || nHeightOffs ) - { - Range aRange; - aVirtOutputSize.Width() += nWidthOffs; - aRange.Max() = aVirtOutputSize.Width(); - aHorSBar.SetRange( aRange ); - - aVirtOutputSize.Height() += nHeightOffs; - aRange.Max() = aVirtOutputSize.Height(); - aVerSBar.SetRange( aRange ); - - pImpCursor->Clear(); - AdjustScrollBars(); - } -} - -void SvImpIconView::Arrange() -{ - nMaxVirtWidth = aOutputSize.Width(); - ImpArrange(); -} - -void SvImpIconView::ImpArrange() -{ - StopEditTimer(); - ShowCursor( sal_False ); - ResetVirtSize(); - bMustRecalcBoundingRects = sal_False; - MapMode aMapMode( pView->GetMapMode()); - aMapMode.SetOrigin( Point() ); - pView->SetMapMode( aMapMode ); - CheckAllSizes(); - RecalcAllBoundingRectsSmart(); - pView->Invalidate(); - ShowCursor( sal_True ); -} - -void SvImpIconView::Paint( const Rectangle& rRect ) -{ - if( !pView->IsUpdateMode() ) - return; - -#if defined(DBG_UTIL) && defined(OV_DRAWGRID) - if( nFlags & F_GRIDMODE ) - { - Color aOldColor = pView->GetLineColor(); - Color aNewColor( COL_BLACK ); - pView->SetLineColor( aNewColor ); - Point aOffs( pView->GetMapMode().GetOrigin()); - Size aXSize( pView->GetOutputSizePixel() ); - for( long nDX = nGridDX; nDX <= aXSize.Width(); nDX += nGridDX ) - { - Point aStart( nDX+LROFFS_BOUND, 0 ); - Point aEnd( nDX+LROFFS_BOUND, aXSize.Height()); - aStart -= aOffs; - aEnd -= aOffs; - pView->DrawLine( aStart, aEnd ); - } - for( long nDY = nGridDY; nDY <= aXSize.Height(); nDY += nGridDY ) - { - Point aStart( 0, nDY+TBOFFS_BOUND ); - Point aEnd( aXSize.Width(), nDY+TBOFFS_BOUND ); - aStart -= aOffs; - aEnd -= aOffs; - pView->DrawLine( aStart, aEnd ); - } - pView->SetLineColor( aOldColor ); - } -#endif - nFlags |= F_PAINTED; - - if( !(pModel->HasChilds( pCurParent ) )) - return; - if( !pCursor ) - pCursor = pModel->FirstChild( pCurParent ); - - sal_uInt16 nCount = pZOrderList->Count(); - if( !nCount ) - return; - - SvPtrarr* pNewZOrderList = new SvPtrarr; - SvPtrarr* pPaintedEntries = new SvPtrarr; - - sal_uInt16 nPos = 0; - while( nCount ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - const Rectangle& rBoundRect = GetBoundingRect( pEntry, pViewData ); - if( rRect.IsOver( rBoundRect ) ) - { - PaintEntry( pEntry, rBoundRect.TopLeft(), pViewData ); - // Eintraege, die neu gezeichnet werden, auf Top setzen - pPaintedEntries->Insert( pEntry, pPaintedEntries->Count() ); - } - else - pNewZOrderList->Insert( pEntry, pNewZOrderList->Count() ); - - nCount--; - nPos++; - } - delete pZOrderList; - pZOrderList = pNewZOrderList; - nCount = pPaintedEntries->Count(); - if( nCount ) - { - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count()); - } - delete pPaintedEntries; - - Rectangle aRect; - if( GetResizeRect( aRect )) - PaintResizeRect( aRect ); -} - -sal_Bool SvImpIconView::GetResizeRect( Rectangle& rRect ) -{ - if( aHorSBar.IsVisible() && aVerSBar.IsVisible() ) - { - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin()); - aOrigin *= -1; - aOrigin.X() += aOutputSize.Width(); - aOrigin.Y() += aOutputSize.Height(); - rRect.SetPos( aOrigin ); - rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight)); - return sal_True; - } - return sal_False; -} - -void SvImpIconView::PaintResizeRect( const Rectangle& rRect ) -{ - const StyleSettings& rStyleSettings = pView->GetSettings().GetStyleSettings(); - Color aNewColor = rStyleSettings.GetFaceColor(); - Color aOldColor = pView->GetFillColor(); - pView->SetFillColor( aNewColor ); - pView->DrawRect( rRect ); - pView->SetFillColor( aOldColor ); -} - -void SvImpIconView::RepaintSelectionItems() -{ - OSL_FAIL("RepaintSelectionItems"); - pView->Invalidate(); // vorlaeufig -} - -SvLBoxItem* SvImpIconView::GetItem( SvLBoxEntry* pEntry, - const Point& rAbsPos ) -{ - Rectangle aRect; - SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if( pStringItem ) - { - aRect = CalcTextRect( pEntry, pStringItem ); - if( aRect.IsInside( rAbsPos ) ) - return pStringItem; - } - SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - if( pBmpItem ) - { - aRect = CalcBmpRect( pEntry ); - if( aRect.IsInside( rAbsPos ) ) - return pBmpItem; - } - return 0; -} - -void SvImpIconView::CalcDocPos( Point& aMaeuschenPos ) -{ - aMaeuschenPos -= pView->GetMapMode().GetOrigin(); -} - -void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt) -{ - StopEditTimer(); - pView->GrabFocus(); - Point aDocPos( rMEvt.GetPosPixel() ); - if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height()) - return; - CalcDocPos( aDocPos ); - SvLBoxEntry* pEntry = GetEntry( aDocPos ); - if( !pEntry ) - { - if( pView->GetSelectionMode() != SINGLE_SELECTION ) - { - if( !rMEvt.IsMod1() ) // Ctrl - { - pView->SelectAll( sal_False ); - ClearSelectedRectList(); - } - else - nFlags |= F_ADD_MODE; - nFlags |= F_RUBBERING; - aCurSelectionRect.SetPos( aDocPos ); - pView->CaptureMouse(); - } - return; - } - - sal_Bool bSelected = pView->IsSelected( pEntry ); - sal_Bool bEditingEnabled = pView->IsInplaceEditingEnabled(); - - if( rMEvt.GetClicks() == 2 ) - { - DeselectAllBut( pEntry ); - pView->pHdlEntry = pEntry; - pView->DoubleClickHdl(); - } - else - { - // Inplace-Editing ? - if( rMEvt.IsMod2() ) // Alt? - { - if( bEditingEnabled ) - { - SvLBoxItem* pItem = GetItem(pEntry,aDocPos); - if( pItem ) - pView->EditingRequest( pEntry, pItem, aDocPos); - } - } - else if( pView->GetSelectionMode() == SINGLE_SELECTION ) - { - DeselectAllBut( pEntry ); - SetCursor( pEntry ); - pView->Select( pEntry, sal_True ); - if( bEditingEnabled && bSelected && !rMEvt.GetModifier() && - rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) ) - { - nFlags |= F_START_EDITTIMER_IN_MOUSEUP; - } - } - else - { - if( !rMEvt.GetModifier() ) - { - if( !bSelected ) - { - DeselectAllBut( pEntry ); - SetCursor( pEntry ); - pView->Select( pEntry, sal_True ); - } - else - { - // erst im Up deselektieren, falls Move per D&D! - nFlags |= F_DOWN_DESELECT; - if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) && - rMEvt.IsLeft()) - { - nFlags |= F_START_EDITTIMER_IN_MOUSEUP; - } - } - } - else if( rMEvt.IsMod1() ) - nFlags |= F_DOWN_CTRL; - } - } -} - -void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt ) -{ - aMouseMoveTimer.Stop(); - pView->ReleaseMouse(); - // HACK, da Einar noch nicht PrepareCommandEvent aufruft - if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) )) - nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); - - if( nFlags & F_RUBBERING ) - { - aMouseMoveTimer.Stop(); - AddSelectedRect( aCurSelectionRect ); - HideSelectionRect(); - nFlags &= ~(F_RUBBERING | F_ADD_MODE); - } - - SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), sal_True ); - if( pEntry ) - { - if( nFlags & F_DOWN_CTRL ) - { - // Ctrl & MultiSelection - ToggleSelection( pEntry ); - SetCursor( pEntry ); - } - else if( nFlags & F_DOWN_DESELECT ) - { - DeselectAllBut( pEntry ); - SetCursor( pEntry ); - pView->Select( pEntry, sal_True ); - } - } - - nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); - if( nFlags & F_START_EDITTIMER_IN_MOUSEUP ) - { - StartEditTimer(); - nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP; - } -} - -void SvImpIconView::MouseMove( const MouseEvent& rMEvt ) -{ - if( nFlags & F_RUBBERING ) - { - const Point& rPosPixel = rMEvt.GetPosPixel(); - if( !aMouseMoveTimer.IsActive() ) - { - aMouseMoveEvent = rMEvt; - aMouseMoveTimer.Start(); - // ausserhalb des Fensters liegende Move-Events muessen - // vom Timer kommen, damit die Scrollgeschwindigkeit - // unabhaengig von Mausbewegungen ist. - if( rPosPixel.X() < 0 || rPosPixel.Y() < 0 ) - return; - const Size& rSize = pView->GetOutputSizePixel(); - if( rPosPixel.X() > rSize.Width() || rPosPixel.Y() > rSize.Height()) - return; - } - - if( &rMEvt != &aMouseMoveEvent ) - aMouseMoveEvent = rMEvt; - - long nScrollDX, nScrollDY; - - CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,sal_False ); - sal_Bool bSelRectHidden = sal_False; - if( nScrollDX || nScrollDY ) - { - HideSelectionRect(); - bSelRectHidden = sal_True; - pView->Scroll( nScrollDX, nScrollDY ); - } - Point aDocPos( rMEvt.GetPosPixel() ); - aDocPos = pView->PixelToLogic( aDocPos ); - Rectangle aRect( aCurSelectionRect.TopLeft(), aDocPos ); - if( aRect != aCurSelectionRect ) - { - HideSelectionRect(); - bSelRectHidden = sal_True; - sal_Bool bAdd = (nFlags & F_ADD_MODE) ? sal_True : sal_False; - SelectRect( aRect, bAdd, &aSelectedRectList ); - } - if( bSelRectHidden ) - DrawSelectionRect( aRect ); - } -} - -sal_Bool SvImpIconView::KeyInput( const KeyEvent& rKEvt ) -{ - StopEditTimer(); - sal_Bool bKeyUsed = sal_True; - sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); - sal_Bool bInAddMode = (sal_Bool)((nFlags & F_ADD_MODE) != 0); - int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) && - !bInAddMode; - SvLBoxEntry* pNewCursor; - sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); - switch( nCode ) - { - case KEY_UP: - if( pCursor ) - { - MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoUpDown(pCursor,sal_False); - if( pNewCursor ) - { - if( bDeselAll ) - pView->SelectAll( sal_False ); - ShowCursor( sal_False ); - MakeVisible( pNewCursor ); - SetCursor( pNewCursor ); - if( !bInAddMode ) - pView->Select( pCursor, sal_True ); - } - else - { - Rectangle aRect( GetBoundingRect( pCursor ) ); - if( aRect.Top()) - { - aRect.Bottom() -= aRect.Top(); - aRect.Top() = 0; - MakeVisible( aRect ); - } - } - } - break; - - case KEY_DOWN: - if( pCursor ) - { - pNewCursor=pImpCursor->GoUpDown( pCursor,sal_True ); - if( pNewCursor ) - { - MakeVisible( pCursor ); - if( bDeselAll ) - pView->SelectAll( sal_False ); - ShowCursor( sal_False ); - MakeVisible( pNewCursor ); - SetCursor( pNewCursor ); - if( !bInAddMode ) - pView->Select( pCursor, sal_True ); - } - } - break; - - case KEY_RIGHT: - if( pCursor ) - { - pNewCursor=pImpCursor->GoLeftRight(pCursor,sal_True ); - if( pNewCursor ) - { - MakeVisible( pCursor ); - if( bDeselAll ) - pView->SelectAll( sal_False ); - ShowCursor( sal_False ); - MakeVisible( pNewCursor ); - SetCursor( pNewCursor ); - if( !bInAddMode ) - pView->Select( pCursor, sal_True ); - } - } - break; - - case KEY_LEFT: - if( pCursor ) - { - MakeVisible( pCursor ); - pNewCursor = pImpCursor->GoLeftRight(pCursor,sal_False ); - if( pNewCursor ) - { - if( bDeselAll ) - pView->SelectAll( sal_False ); - ShowCursor( sal_False ); - MakeVisible( pNewCursor ); - SetCursor( pNewCursor ); - if( !bInAddMode ) - pView->Select( pCursor, sal_True ); - } - else - { - Rectangle aRect( GetBoundingRect(pCursor)); - if( aRect.Left() ) - { - aRect.Right() -= aRect.Left(); - aRect.Left() = 0; - MakeVisible( aRect ); - } - } - } - break; - - case KEY_ESCAPE: - if( nFlags & F_RUBBERING ) - { - HideSelectionRect(); - pView->SelectAll( sal_False ); - nFlags &= ~F_RUBBERING; - } - break; - - case KEY_F8: - if( rKEvt.GetKeyCode().IsShift() ) - { - if( nFlags & F_ADD_MODE ) - nFlags &= (~F_ADD_MODE); - else - nFlags |= F_ADD_MODE; - } - break; - - case KEY_SPACE: - if( pCursor ) - { - ToggleSelection( pCursor ); - } - break; - - - case KEY_PAGEDOWN: - break; - case KEY_PAGEUP: - break; - - case KEY_ADD: - case KEY_DIVIDE : - if( bMod1 ) - pView->SelectAll( sal_True ); - break; - - case KEY_SUBTRACT: - case KEY_COMMA : - if( bMod1 ) - pView->SelectAll( sal_False ); - break; - - case KEY_RETURN: - if( bMod1 ) - { - if( pCursor && pView->IsInplaceEditingEnabled() ) - pView->EditEntry( pCursor ); - } - break; - - default: - bKeyUsed = sal_False; - - } - return bKeyUsed; -} - - -void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight ) -{ - // hor scrollbar - Point aPos( 0, nRealHeight ); - aPos.Y() -= nHorSBarHeight; - - if( aHorSBar.GetPosPixel() != aPos ) - aHorSBar.SetPosPixel( aPos ); - - // ver scrollbar - aPos.X() = nRealWidth; aPos.Y() = 0; - aPos.X() -= nVerSBarWidth; - -#if defined(WNT) - aPos.X()++; - aPos.Y()--; -#endif - - if( aVerSBar.GetPosPixel() != aPos ) - aVerSBar.SetPosPixel( aPos ); -} - - - -void SvImpIconView::AdjustScrollBars() -{ - long nVirtHeight = aVirtOutputSize.Height(); - long nVirtWidth = aVirtOutputSize.Width(); - - Size aOSize( pView->Control::GetOutputSizePixel() ); - long nRealHeight = aOSize.Height(); - long nRealWidth = aOSize.Width(); - - PositionScrollBars( nRealWidth, nRealHeight ); - - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin() ); - - long nVisibleWidth; - if( nRealWidth > nVirtWidth ) - nVisibleWidth = nVirtWidth + aOrigin.X(); - else - nVisibleWidth = nRealWidth; - - long nVisibleHeight; - if( nRealHeight > nVirtHeight ) - nVisibleHeight = nVirtHeight + aOrigin.Y(); - else - nVisibleHeight = nRealHeight; - - bool bVerSBar = (pView->GetStyle() & WB_VSCROLL) ? true : false; - bool bHorSBar = (pView->GetStyle() & WB_HSCROLL) ? true : false; - - sal_uInt16 nResult = 0; - if( nVirtHeight ) - { - // activate ver scrollbar ? - if( bVerSBar || ( nVirtHeight > nVisibleHeight) ) - { - nResult = 0x0001; - nRealWidth -= nVerSBarWidth; - - if( nRealWidth > nVirtWidth ) - nVisibleWidth = nVirtWidth + aOrigin.X(); - else - nVisibleWidth = nRealWidth; - - nFlags |= F_HOR_SBARSIZE_WITH_VBAR; - } - // activate hor scrollbar ? - if( bHorSBar || (nVirtWidth > nVisibleWidth) ) - { - nResult |= 0x0002; - nRealHeight -= nHorSBarHeight; - - if( nRealHeight > nVirtHeight ) - nVisibleHeight = nVirtHeight + aOrigin.Y(); - else - nVisibleHeight = nRealHeight; - - // brauchen wir jetzt doch eine senkrechte Scrollbar ? - if( !(nResult & 0x0001) && // nur wenn nicht schon da - ( (nVirtHeight > nVisibleHeight) || bVerSBar) ) - { - nResult = 3; // both are active - nRealWidth -= nVerSBarWidth; - - if( nRealWidth > nVirtWidth ) - nVisibleWidth = nVirtWidth + aOrigin.X(); - else - nVisibleWidth = nRealWidth; - - nFlags |= F_VER_SBARSIZE_WITH_HBAR; - } - } - } - - // size ver scrollbar - long nThumb = aVerSBar.GetThumbPos(); - Size aSize( nVerSBarWidth, nRealHeight ); -#if defined(WNT) - aSize.Height() += 2; -#endif - if( aSize != aVerSBar.GetSizePixel() ) - aVerSBar.SetSizePixel( aSize ); - aVerSBar.SetVisibleSize( nVisibleHeight ); - aVerSBar.SetPageSize( (nVisibleHeight*75)/100 ); - if( nResult & 0x0001 ) - { - aVerSBar.SetThumbPos( nThumb ); - aVerSBar.Show(); - } - else - { - aVerSBar.SetThumbPos( 0 ); - aVerSBar.Hide(); - } - - // size hor scrollbar - nThumb = aHorSBar.GetThumbPos(); - aSize.Width() = nRealWidth; - aSize.Height() = nHorSBarHeight; -#if defined(WNT) - aSize.Width()++; -#endif -#if defined(WNT) - if( nResult & 0x0001 ) // vertikale Scrollbar ? - { - aSize.Width()++; - nRealWidth++; - } -#endif - if( aSize != aHorSBar.GetSizePixel() ) - aHorSBar.SetSizePixel( aSize ); - aHorSBar.SetVisibleSize( nVisibleWidth ); //nRealWidth ); - aHorSBar.SetPageSize( (nVisibleWidth*75)/100 ); - if( nResult & 0x0002 ) - { - aHorSBar.SetThumbPos( nThumb ); - aHorSBar.Show(); - } - else - { - aHorSBar.SetThumbPos( 0 ); - aHorSBar.Hide(); - } - - aOutputSize.Width() = nRealWidth; -#if defined(WNT) - if( nResult & 0x0002 ) // hor scrollbar ? - nRealHeight++; // weil unterer Rand geclippt wird -#endif - aOutputSize.Height() = nRealHeight; -} - -void SvImpIconView::Resize() -{ - StopEditTimer(); - Rectangle aRect; - if( GetResizeRect(aRect) ) - pView->Invalidate( aRect ); - aOutputSize = pView->GetOutputSizePixel(); - pImpCursor->Clear(); - -#if 1 - const Size& rSize = pView->Control::GetOutputSizePixel(); - PositionScrollBars( rSize.Width(), rSize.Height() ); - // Die ScrollBars werden asynchron ein/ausgeblendet, damit abgeleitete - // Klassen im Resize ein Arrange durchfuehren koennen, ohne dass - // die ScrollBars aufblitzen (SfxExplorerIconView!) - nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpIconView,UserEventHdl),0); -#else - AdjustScrollBars(); - if( GetResizeRect(aRect) ) - PaintResizeRect( aRect ); -#endif -} - -sal_Bool SvImpIconView::CheckHorScrollBar() -{ - if( !pZOrderList || !aHorSBar.IsVisible() ) - return sal_False; - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->GetStyle() & WB_HSCROLL) && !aOrigin.X() ) - { - long nWidth = aOutputSize.Width(); - sal_uInt16 nCount = pZOrderList->Count(); - long nMostRight = 0; - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); - long nRight = GetBoundingRect(pEntry).Right(); - if( nRight > nWidth ) - return sal_False; - if( nRight > nMostRight ) - nMostRight = nRight; - } - aHorSBar.Hide(); - aOutputSize.Height() += nHorSBarHeight; - aVirtOutputSize.Width() = nMostRight; - aHorSBar.SetThumbPos( 0 ); - Range aRange; - aRange.Max() = nMostRight - 1; - aHorSBar.SetRange( aRange ); - if( aVerSBar.IsVisible() ) - { - Size aSize( aVerSBar.GetSizePixel()); - aSize.Height() += nHorSBarHeight; - aVerSBar.SetSizePixel( aSize ); - } - return sal_True; - } - return sal_False; -} - -sal_Bool SvImpIconView::CheckVerScrollBar() -{ - if( !pZOrderList || !aVerSBar.IsVisible() ) - return sal_False; - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin() ); - if(!(pView->GetStyle() & WB_VSCROLL) && !aOrigin.Y() ) - { - long nDeepest = 0; - long nHeight = aOutputSize.Height(); - sal_uInt16 nCount = pZOrderList->Count(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur); - long nBottom = GetBoundingRect(pEntry).Bottom(); - if( nBottom > nHeight ) - return sal_False; - if( nBottom > nDeepest ) - nDeepest = nBottom; - } - aVerSBar.Hide(); - aOutputSize.Width() += nVerSBarWidth; - aVirtOutputSize.Height() = nDeepest; - aVerSBar.SetThumbPos( 0 ); - Range aRange; - aRange.Max() = nDeepest - 1; - aVerSBar.SetRange( aRange ); - if( aHorSBar.IsVisible() ) - { - Size aSize( aHorSBar.GetSizePixel()); - aSize.Width() += nVerSBarWidth; - aHorSBar.SetSizePixel( aSize ); - } - return sal_True; - } - return sal_False; -} - - -// blendet Scrollbars aus, wenn sie nicht mehr benoetigt werden -void SvImpIconView::CheckScrollBars() -{ - CheckVerScrollBar(); - if( CheckHorScrollBar() ) - CheckVerScrollBar(); -} - - -void SvImpIconView::GetFocus() -{ - if( pCursor ) - { - pView->SetEntryFocus( pCursor, sal_True ); - ShowCursor( sal_True ); - } -} - -void SvImpIconView::LoseFocus() -{ - StopEditTimer(); - if( pCursor ) - pView->SetEntryFocus( pCursor,sal_False ); - ShowCursor( sal_False ); -} - -void SvImpIconView::UpdateAll() -{ - AdjustScrollBars(); - pImpCursor->Clear(); - pView->Invalidate(); -} - -void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData ) -{ - Point aPos( GetEntryPosition( pEntry ) ); - PaintEntry( pEntry, aPos, pViewData ); -} - -void SvImpIconView::PaintEmphasis( const Rectangle& rRect, sal_Bool bSelected, - sal_Bool bCursored, OutputDevice* pOut ) -{ - // HACK fuer D&D - if( nFlags & F_NO_EMPHASIS ) - return; - - if( !pOut ) - pOut = pView; - - // Selektion painten - Color aOldFillColor = pOut->GetFillColor(); - Color aOldLineColor = pOut->GetLineColor(); - Color aNewColor; - const StyleSettings& rStyleSettings = pOut->GetSettings().GetStyleSettings(); - if( bSelected ) - { - aNewColor = rStyleSettings.GetHighlightColor(); - } - else - { - aNewColor =rStyleSettings.GetFieldColor(); - } - - if( bCursored ) - { - pOut->SetLineColor( Color( COL_BLACK ) ); - } - pOut->SetFillColor( aNewColor ); - pOut->DrawRect( rRect ); - pOut->SetFillColor( aOldFillColor ); - pOut->SetLineColor( aOldLineColor ); -} - -void SvImpIconView::PaintItem( const Rectangle& rRect, - SvLBoxItem* pItem, SvLBoxEntry* pEntry, sal_uInt16 nPaintFlags, - OutputDevice* pOut ) -{ - if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING ) - { - const String& rStr = ((SvLBoxString*)pItem)->GetText(); - DrawText( pOut, rRect, rStr, DRAWTEXT_FLAGS ); - } - else - { - Point aPos( rRect.TopLeft() ); - const Size& rSize = GetItemSize( pView, pEntry, pItem ); - if( nPaintFlags & PAINTFLAG_HOR_CENTERED ) - aPos.X() += (rRect.GetWidth() - rSize.Width() ) / 2; - if( nPaintFlags & PAINTFLAG_VER_CENTERED ) - aPos.Y() += (rRect.GetHeight() - rSize.Height() ) / 2; - pItem->Paint( aPos, *(SvLBox*)pOut, 0, pEntry ); - } -} - -void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos, - SvIcnVwDataEntry* pViewData, OutputDevice* pOut ) -{ - if( !pView->IsUpdateMode() ) - return; - - if( !pOut ) - pOut = pView; - - SvLBoxContextBmp* pBmpItem; - - pView->PreparePaint( pEntry ); - - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - - SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - - sal_Bool bSelected = pViewData->IsSelected(); - sal_Bool bCursored = pViewData->IsCursored(); - - Font aTempFont( pOut->GetFont() ); - // waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die - // Emphasis gezeichnet werden muss! (weisser Adler auf weissem Grund) - if( bSelected && !(nFlags & F_NO_EMPHASIS) ) - { - const StyleSettings& rStyleSettings = pOut->GetSettings().GetStyleSettings(); - Font aNewFont( aTempFont ); - aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() ); - pOut->SetFont( aNewFont ); - } - Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,sal_False,pViewData)); - Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) ); - - switch( nViewMode ) - { - case VIEWMODE_ICON: - pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); - PaintItem( aBmpRect, pBmpItem, pEntry, - PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); - PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut ); - break; - - case VIEWMODE_NAME: - pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)); - PaintEmphasis( aBmpRect, bSelected, bCursored, pOut ); - PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut ); - PaintEmphasis( aTextRect, bSelected, sal_False, pOut ); - PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut ); - break; - - case VIEWMODE_TEXT: - PaintEmphasis( aTextRect, bSelected, bCursored, pOut ); - PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_VER_CENTERED, pOut ); - break; - } - pOut->SetFont( aTempFont ); -} - -void SvImpIconView::SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, - sal_Bool bAdjustAtGrid, sal_Bool bCheckScrollBars ) -{ - if( pModel->GetParent(pEntry) == pCurParent ) - { - ShowCursor( sal_False ); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData )); - pView->Invalidate( aBoundRect ); - ToTop( pEntry ); - if( rPos != aBoundRect.TopLeft() ) - { - Point aGridOffs = pViewData->aGridRect.TopLeft() - - pViewData->aRect.TopLeft(); - pImpCursor->Clear(); - nFlags &= ~F_GRID_INSERT; - aBoundRect.SetPos( rPos ); - pViewData->aRect = aBoundRect; - pViewData->aGridRect.SetPos( rPos + aGridOffs ); - AdjustVirtSize( aBoundRect ); - } - //HACK(Billigloesung, die noch verbessert werden muss) - if( bAdjustAtGrid ) - { - AdjustAtGrid( pEntry ); - ToTop( pEntry ); - } - if( bCheckScrollBars && pView->IsUpdateMode() ) - CheckScrollBars(); - - PaintEntry( pEntry, pViewData ); - ShowCursor( sal_True ); - } -} - -void SvImpIconView::ViewDataInitialized( SvLBoxEntry*) -{ -} - -void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry ) -{ - if( pEntry == pCursor ) - ShowCursor( sal_False ); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - pView->Invalidate( pViewData->aRect ); - - if( nFlags & F_GRIDMODE ) - Center( (SvLBoxEntry*)pEntry, pViewData ); - else - pViewData->aRect.SetSize( CalcBoundingSize( - (SvLBoxEntry*)pEntry, pViewData ) ); - - ViewDataInitialized( (SvLBoxEntry*)pEntry ); - pView->Invalidate( pViewData->aRect ); - if( pEntry == pCursor ) - ShowCursor( sal_True ); -} - - -void SvImpIconView::InvalidateEntry( SvLBoxEntry* pEntry ) -{ - const Rectangle& rRect = GetBoundingRect( pEntry ); - pView->Invalidate( rRect ); -} - -void SvImpIconView::SetNoSelection() -{ -} - -void SvImpIconView::SetDragDropMode( DragDropMode ) -{ -} - -void SvImpIconView::SetSelectionMode( SelectionMode ) -{ -} - -sal_Bool SvImpIconView::IsEntryInView( SvLBoxEntry* ) -{ - return sal_False; -} - -SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos ) -{ - Point aDocPos( rPos ); - CalcDocPos( aDocPos ); - SvLBoxEntry* pTarget = GetEntry( aDocPos ); - if( !pTarget || !pTarget->HasChilds() ) - pTarget = pCurParent; - return pTarget; -} - -SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos ) -{ - CheckBoundingRects(); - SvLBoxEntry* pTarget = 0; - // Z-Order-Liste vom Ende her absuchen - sal_uInt16 nCount = pZOrderList->Count(); - while( nCount ) - { - nCount--; - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCount)); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( pViewData->aRect.IsInside( rDocPos ) ) - { - pTarget = pEntry; - break; - } - } - return pTarget; -} - -SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ) -{ - CheckBoundingRects(); - SvLBoxEntry* pTarget = 0; - sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); - if( nStartPos != USHRT_MAX ) - { - sal_uInt16 nCount = pZOrderList->Count(); - for( sal_uInt16 nCur = nStartPos+1; nCur < nCount; nCur++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur)); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( pViewData->aRect.IsInside( rDocPos ) ) - { - pTarget = pEntry; - break; - } - } - } - return pTarget; -} - -SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ) -{ - CheckBoundingRects(); - SvLBoxEntry* pTarget = 0; - sal_uInt16 nStartPos = pZOrderList->GetPos( (void*)pCurEntry ); - if( nStartPos != USHRT_MAX && nStartPos != 0 ) - { - nStartPos--; - do - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nStartPos)); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( pViewData->aRect.IsInside( rDocPos ) ) - { - pTarget = pEntry; - break; - } - } while( nStartPos > 0 ); - } - return pTarget; -} - - -Point SvImpIconView::GetEntryPosition( SvLBoxEntry* pEntry ) -{ - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - DBG_ASSERT(pViewData,"Entry not in model"); - return pViewData->aRect.TopLeft(); -} - -const Rectangle& SvImpIconView::GetBoundingRect( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData ) -{ - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - DBG_ASSERT(pViewData,"Entry not in model"); - if( !IsBoundingRectValid( pViewData->aRect )) - FindBoundingRect( pEntry, pViewData ); - return pViewData->aRect; -} - -void SvImpIconView::SetSpaceBetweenEntries( long nHor, long nVer ) -{ - nHorDist = nHor; - nVerDist = nVer; -} - -Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos, - SvIcnVwDataEntry* pViewData ) -{ - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - - Rectangle aBound = GetBoundingRect( pEntry, pViewData ); - if( pPos ) - aBound.SetPos( *pPos ); - Point aPos( aBound.TopLeft() ); - - switch( nViewMode ) - { - case VIEWMODE_ICON: - { - aPos.X() += ( aBound.GetWidth() - nMaxBmpWidth ) / 2; - Size aSize( nMaxBmpWidth, nMaxBmpHeight ); - // das Bitmap-Rechteck soll nicht das TextRect beruehren - aSize.Height() -= 3; - return Rectangle( aPos, aSize ); - } - - case VIEWMODE_NAME: - return Rectangle( aPos, - Size( nMaxBmpWidth, aBound.GetHeight() )); - - case VIEWMODE_TEXT: - return Rectangle( aPos, aBound.GetSize() ); - - default: - { - Rectangle aRect; - return aRect; - } - } -} - -Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry, - SvLBoxString* pItem, const Point* pPos, sal_Bool bForInplaceEdit, - SvIcnVwDataEntry* pViewData ) -{ - long nBmpHeight, nBmpWidth; - - if( !pItem ) - pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - - Size aTextSize( GetItemSize( pView, pEntry, pItem, pViewData )); - aTextSize.Width() += 2*LROFFS_TEXT; - - Size aContextBmpSize(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry)); - Rectangle aBound = GetBoundingRect( pEntry, pViewData ); - if( pPos ) - aBound.SetPos( *pPos ); - Point aPos( aBound.TopLeft() ); - - switch( nViewMode ) - { - case VIEWMODE_ICON: - nBmpHeight = aContextBmpSize.Height(); - if( nBmpHeight < nMaxBmpHeight ) - nBmpHeight = nMaxBmpHeight; - aPos.Y() += nBmpHeight; - - // beim Inplace-Editieren, spendieren wir ein bisschen mehr Platz - if( bForInplaceEdit ) - { - // 20% rauf - long nMinWidth = (( (aContextBmpSize.Width()*10) / 100 ) * 2 ) + - aContextBmpSize.Width(); - if( nMinWidth > aBound.GetWidth() ) - nMinWidth = aBound.GetWidth(); - - if( aTextSize.Width() < nMinWidth ) - aTextSize.Width() = nMinWidth; - - // beim Inplace-Ed. darfs auch untere Eintraege ueberlappen - Rectangle aMaxGridTextRect = CalcMaxTextRect(pEntry, pViewData); - Size aOptSize = aMaxGridTextRect.GetSize(); - if( aOptSize.Height() > aTextSize.Height() ) - aTextSize.Height() = aOptSize.Height(); - } - - - aPos.X() += ( aBound.GetWidth() - aTextSize.Width() ) / 2; - break; - - case VIEWMODE_NAME: - nBmpWidth = aContextBmpSize.Width(); - if( nBmpWidth < nMaxBmpWidth ) - nBmpWidth = nMaxBmpWidth; - aPos.X() += nBmpWidth; - // vertikal ausrichten - aPos.Y() += ( nBmpWidth - aTextSize.Height() ) / 2; - break; - } - - Rectangle aRect( aPos, aTextSize ); -// KNALLT BEIM D&D, WENN GECLIPPT WIRD (In DrawText von Thomas) -// ClipAtVirtOutRect( aRect ); - return aRect; -} - - -long SvImpIconView::CalcBoundingWidth( SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) const -{ - DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP),"No Bitmaps"); - DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),"No Text"); - long nStringWidth = GetItemSize( pView, pEntry, pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),pViewData).Width(); - nStringWidth += 2*LROFFS_TEXT; - long nBmpWidth = pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry).Width(); - long nWidth = 0; - - switch( nViewMode ) - { - case VIEWMODE_ICON: - nWidth = Max( nStringWidth, nBmpWidth ); - nWidth = Max( nWidth, nMaxBmpWidth ); - break; - - case VIEWMODE_NAME: - nWidth = Max( nBmpWidth, nMaxBmpWidth ); - nWidth += NAMEVIEW_OFFS_BMP_STRING; // Abstand Bitmap String - nWidth += nStringWidth; - break; - - case VIEWMODE_TEXT: - nWidth = nStringWidth; - break; - } - return nWidth; -} - -long SvImpIconView::CalcBoundingHeight( SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) const -{ - DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP),"No Bitmaps"); - DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),"No Text"); - long nStringHeight = GetItemSize(pView,pEntry,pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),pViewData).Height(); - long nBmpHeight = pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry).Height(); - long nHeight = 0; - - switch( nViewMode ) - { - case VIEWMODE_ICON: - nHeight = Max( nBmpHeight, nMaxBmpHeight ); - nHeight += ICONVIEW_OFFS_BMP_STRING; // Abstand Bitmap String - nHeight += nStringHeight; - break; - - case VIEWMODE_NAME: - nHeight = Max( nBmpHeight, nMaxBmpHeight ); - nHeight = Max( nHeight, nStringHeight ); - break; - - case VIEWMODE_TEXT: - nHeight = nStringHeight; - break; - } - if( nHeight > nMaxBoundHeight ) - { - ((SvImpIconView*)this)->nMaxBoundHeight = nHeight; - ((SvImpIconView*)this)->aHorSBar.SetLineSize( nHeight / 2 ); - ((SvImpIconView*)this)->aVerSBar.SetLineSize( nHeight / 2 ); - } - return nHeight; -} - -Size SvImpIconView::CalcBoundingSize( SvLBoxEntry* pEntry, - SvIcnVwDataEntry* pViewData ) const -{ - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - return Size( CalcBoundingWidth(pEntry,pViewData), - CalcBoundingHeight(pEntry,pViewData) ); -} - -void SvImpIconView::RecalcAllBoundingRects() -{ - nMaxBoundHeight = 0; - pZOrderList->Remove(0, pZOrderList->Count() ); - SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent ); - while( pEntry ) - { - FindBoundingRect( pEntry ); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - pEntry = pModel->NextSibling( pEntry ); - } - bMustRecalcBoundingRects = sal_False; - AdjustScrollBars(); -} - -void SvImpIconView::RecalcAllBoundingRectsSmart() -{ - nMaxBoundHeight = 0; - pZOrderList->Remove(0, pZOrderList->Count() ); - SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent ); - while( pEntry ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( IsBoundingRectValid( pViewData->aRect )) - { - Size aBoundSize( pViewData->aRect.GetSize() ); - if( aBoundSize.Height() > nMaxBoundHeight ) - nMaxBoundHeight = aBoundSize.Height(); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - } - else - { - FindBoundingRect( pEntry, pViewData ); - } - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - pEntry = pModel->NextSibling( pEntry ); - } - AdjustScrollBars(); -} - -void SvImpIconView::UpdateBoundingRects() -{ - SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent ); - while( pEntry ) - { - GetBoundingRect( pEntry ); - pEntry = pModel->NextSibling( pEntry ); - } -} - -void SvImpIconView::FindBoundingRect( SvLBoxEntry* pEntry, - SvIcnVwDataEntry* pViewData ) -{ - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - - Size aSize( CalcBoundingSize( pEntry, pViewData ) ); - Point aPos; - - DBG_ASSERT(!pViewData->IsEntryPosLocked(),"Locked entry pos in FindBoundingRect"); - // damits in der IconView nicht drunter & drueber geht - if( pViewData->IsEntryPosLocked() && IsBoundingRectValid(pViewData->aRect) ) - { - AdjustVirtSize( pViewData->aRect ); - return; - } - - aPos = FindNextEntryPos( aSize ); - - if( nFlags & F_GRIDMODE ) - { - Rectangle aGridRect( aPos, Size(nGridDX, nGridDY) ); - pViewData->aGridRect = aGridRect; - Center( pEntry, pViewData ); - AdjustVirtSize( pViewData->aRect ); - pImpCursor->SetGridUsed( pViewData->aRect ); - } - else - { - pViewData->aRect = Rectangle( aPos, aSize ); - AdjustVirtSize( pViewData->aRect ); - } -} - - -void SvImpIconView::SetCursor( SvLBoxEntry* pEntry ) -{ - if( pEntry == pCursor ) - return; - - ShowCursor( sal_False ); - if( pCursor ) - { - pView->SetEntryFocus( pCursor, sal_False ); - if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, sal_False ); - } - pCursor = pEntry; - ToTop( pCursor ); - if( pCursor ) - { - pView->SetEntryFocus(pCursor, sal_True ); - if( pView->GetSelectionMode() == SINGLE_SELECTION ) - pView->Select( pCursor, sal_True ); - ShowCursor( sal_True ); - } -} - - -void SvImpIconView::ShowCursor( sal_Bool bShow ) -{ - if( !pCursor || !bShow || !pView->HasFocus() ) - { - pView->HideFocus(); - return; - } - Rectangle aRect ( CalcFocusRect( pCursor ) ); - pView->ShowFocus( aRect ); -} - - -void SvImpIconView::HideDDIcon() -{ - pView->Update(); - ImpHideDDIcon(); - pDDBufDev = pDDDev; - pDDDev = 0; -} - -void SvImpIconView::ImpHideDDIcon() -{ - if( pDDDev ) - { - Size aSize( pDDDev->GetOutputSizePixel() ); - // pView restaurieren - pView->DrawOutDev( aDDLastRectPos, aSize, Point(), aSize, *pDDDev ); - } -} - - -void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) -{ - pView->Update(); - if( pRefEntry != pDDRefEntry ) - { - DELETEZ(pDDDev); - DELETEZ(pDDBufDev); - } - sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); - if( !pDDDev ) - { - if( pDDBufDev ) - { - // nicht bei jedem Move ein Device anlegen, da dies besonders - // auf Remote-Clients zu langsam ist - pDDDev = pDDBufDev; - pDDBufDev = 0; - } - else - { - pDDDev = new VirtualDevice( *pView ); - pDDDev->SetFont( pView->GetFont() ); - } - } - else - { - ImpHideDDIcon(); - } - const Rectangle& rRect = GetBoundingRect( pRefEntry ); - pDDDev->SetOutputSizePixel( rRect.GetSize() ); - - Point aPos( rPosPix ); - CalcDocPos( aPos ); - - Size aSize( pDDDev->GetOutputSizePixel() ); - pDDRefEntry = pRefEntry; - aDDLastEntryPos = aPos; - aDDLastRectPos = aPos; - - // Hintergrund sichern - pDDDev->DrawOutDev( Point(), aSize, aPos, aSize, *pView ); - // Icon in pView malen - nFlags |= F_NO_EMPHASIS; - PaintEntry( pRefEntry, aPos ); - nFlags &= ~F_NO_EMPHASIS; - if( bSelected ) - pView->SvListView::Select( pRefEntry, sal_True ); -} - -void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix ) -{ -/* In Notfaellen folgenden flackernden Code aktivieren: - - HideDDIcon(); - ShowDDIcon( pRefEntry, rPosPix ); - return; -*/ - if( !pDDDev ) - { - ShowDDIcon( pRefEntry, rPosPix ); - return; - } - - if( pRefEntry != pDDRefEntry ) - { - HideDDIcon(); - ShowDDIcon( pRefEntry, rPosPix ); - return; - } - - Point aEmptyPoint; - - Point aCurEntryPos( rPosPix ); - CalcDocPos( aCurEntryPos ); - - const Rectangle& rRect = GetBoundingRect( pRefEntry ); - Size aEntrySize( rRect.GetSize() ); - Rectangle aPrevEntryRect( aDDLastEntryPos, aEntrySize ); - Rectangle aCurEntryRect( aCurEntryPos, aEntrySize ); - - if( !aPrevEntryRect.IsOver( aCurEntryRect ) ) - { - HideDDIcon(); - ShowDDIcon( pRefEntry, rPosPix ); - return; - } - - // Ueberlappung des neuen und alten D&D-Pointers! - - Rectangle aFullRect( aPrevEntryRect.Union( aCurEntryRect ) ); - if( !pDDTempDev ) - { - pDDTempDev = new VirtualDevice( *pView ); - pDDTempDev->SetFont( pView->GetFont() ); - } - - Size aFullSize( aFullRect.GetSize() ); - Point aFullPos( aFullRect.TopLeft() ); - - pDDTempDev->SetOutputSizePixel( aFullSize ); - - // Hintergrund (mit dem alten D&D-Pointer!) sichern - pDDTempDev->DrawOutDev( aEmptyPoint, aFullSize, aFullPos, aFullSize, *pView ); - // den alten Buffer in den neuen Buffer pasten - aDDLastRectPos = aDDLastRectPos - aFullPos; - - pDDTempDev->DrawOutDev( - aDDLastRectPos, - pDDDev->GetOutputSizePixel(), - aEmptyPoint, - pDDDev->GetOutputSizePixel(), - *pDDDev ); - - // Swap - VirtualDevice* pTemp = pDDDev; - pDDDev = pDDTempDev; - pDDTempDev = pTemp; - - // in den restaurierten Hintergrund den neuen D&D-Pointer zeichnen - pDDTempDev->SetOutputSizePixel( pDDDev->GetOutputSizePixel() ); - pDDTempDev->DrawOutDev( - aEmptyPoint, aFullSize, aEmptyPoint, aFullSize, *pDDDev ); - Point aRelPos = aCurEntryPos - aFullPos; - nFlags |= F_NO_EMPHASIS; - PaintEntry( pRefEntry, aRelPos, 0, pDDTempDev ); - nFlags &= ~F_NO_EMPHASIS; - - aDDLastRectPos = aFullPos; - aDDLastEntryPos = aCurEntryPos; - - pView->DrawOutDev( - aDDLastRectPos, - pDDDev->GetOutputSizePixel(), - aEmptyPoint, - pDDDev->GetOutputSizePixel(), - *pDDTempDev ); - - sal_Bool bSelected = pView->SvListView::Select( pRefEntry, sal_False ); - if( bSelected ) - pView->SvListView::Select( pRefEntry, sal_True ); -} - -void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, sal_Bool ) -{ - CheckBoundingRects(); - Rectangle aRect; - if( pEntry != pCurParent && - (pEntry->HasChilds() || pEntry->HasChildsOnDemand()) ) - aRect = CalcBmpRect( pEntry ); - else - { - aRect.SetSize( aOutputSize ); - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin()); - aOrigin *= -1; // in Doc-Koord wandeln - aRect.SetPos( aOrigin ); - aRect.Left()++; aRect.Top()++; - aRect.Right()--; aRect.Bottom()--; - } - ImpDrawXORRect( aRect ); -} - -sal_Bool SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewPar, sal_uLong& rNewChildPos ) -{ - if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent ) - { - // D&D innerhalb einer Childlist - StopEditTimer(); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - Size aSize( pViewData->aRect.GetSize() ); - Point aNewPos = FindNextEntryPos( aSize ); - AdjustVirtSize( Rectangle( aNewPos, aSize ) ); - SetEntryPosition( pEntry, aNewPos, sal_False, sal_True ); - return sal_False; - } - return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos); -} - -sal_Bool SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, - SvLBoxEntry*& rpNewParent, sal_uLong& rNewChildPos ) -{ - return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos); -} - -void SvImpIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo) -{ - SvLBoxEntry* pCurEntry = GetCurEntry(); - Point aEntryPos; - if( pCurEntry ) - { - aEntryPos = rPos; - aEntryPos -= GetEntryPosition( pCurEntry ); - } - pInfo->nMouseRelX = aEntryPos.X(); - pInfo->nMouseRelY = aEntryPos.Y(); -} - -void SvImpIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo ) -{ - Point aDropPos( rPos ); - aDropPos.X() -= pInfo->nMouseRelX; - aDropPos.Y() -= pInfo->nMouseRelY; - SetNextEntryPos( aDropPos ); -} - -void SvImpIconView::InvalidateBoundingRect( SvLBoxEntry* pEntry ) -{ - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - InvalidateBoundingRect( pViewData->aRect ); -} - -void SvImpIconView::PrepareCommandEvent( const Point& rPt ) -{ - aMouseMoveTimer.Stop(); - StopEditTimer(); - nFlags |= F_CMD_ARRIVED; - SvLBoxEntry* pEntry = pView->GetEntry( rPt, sal_True ); - if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) ) - pView->Select( pEntry, sal_True ); - nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); -} - -void SvImpIconView::SttDrag( const Point& rPos ) -{ - PrepareCommandEvent( rPos ); - - nFlags |= F_DRAG_SOURCE; - ShowCursor( sal_False ); -} - -void SvImpIconView::EndDrag() -{ - ShowCursor( sal_True ); - nFlags &= (~F_DRAG_SOURCE); -} - -void SvImpIconView::ToTop( SvLBoxEntry* pEntry ) -{ - DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?"); - if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry ) - { - sal_uInt16 nPos = pZOrderList->GetPos( (void*)pEntry ); - pZOrderList->Remove( nPos, 1 ); - pZOrderList->Insert( pEntry, pZOrderList->Count() ); - } -} - -void SvImpIconView::SetCurParent( SvLBoxEntry* pNewParent ) -{ - Clear(); - pCurParent = pNewParent; - ImpArrange(); -} - -void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const -{ - if( rRect.Bottom() >= aVirtOutputSize.Height() ) - rRect.Bottom() = aVirtOutputSize.Height() - 1; - if( rRect.Right() >= aVirtOutputSize.Width() ) - rRect.Right() = aVirtOutputSize.Width() - 1; - if( rRect.Top() < 0 ) - rRect.Top() = 0; - if( rRect.Left() < 0 ) - rRect.Left() = 0; -} - -// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der -// sichtbar gemacht werden soll. -// bScrBar == sal_True: Das Rect wurde aufgrund eines ScrollBar-Events berechnet - -void SvImpIconView::MakeVisible( const Rectangle& rRect, sal_Bool bScrBar ) -{ - Rectangle aRect( rRect ); - ClipAtVirtOutRect( aRect ); - MapMode aMapMode( pView->GetMapMode() ); - Point aOrigin( aMapMode.GetOrigin() ); - // in Dokumentkoordinate umwandeln - aOrigin *= -1; - - Rectangle aOutputArea( aOrigin, aOutputSize ); - if( aOutputArea.IsInside( aRect ) ) - return; // ist schon sichtbar - - long nDy; - if( aRect.Top() < aOutputArea.Top() ) - { - // nach oben scrollen (nDy < 0) - nDy = aRect.Top() - aOutputArea.Top(); - } - else if( aRect.Bottom() > aOutputArea.Bottom() ) - { - // nach unten scrollen (nDy > 0) - nDy = aRect.Bottom() - aOutputArea.Bottom(); - } - else - nDy = 0; - - long nDx; - if( aRect.Left() < aOutputArea.Left() ) - { - // nach links scrollen (nDx < 0) - nDx = aRect.Left() - aOutputArea.Left(); - } - else if( aRect.Right() > aOutputArea.Right() ) - { - // nach rechts scrollen (nDx > 0) - nDx = aRect.Right() - aOutputArea.Right(); - } - else - nDx = 0; - - aOrigin.X() += nDx; - aOrigin.Y() += nDy; - aOutputArea.SetPos( aOrigin ); - - pView->Update(); - - // Origin fuer SV invertieren (damit wir in - // Dokumentkoordinaten scrollen/painten koennen) - aOrigin *= -1; - aMapMode.SetOrigin( aOrigin ); - pView->SetMapMode( aMapMode ); - - // in umgekehrte Richtung scrollen! - pView->Control::Scroll( -nDx, -nDy, aOutputArea, sal_True ); - if( aHorSBar.IsVisible() || aVerSBar.IsVisible() ) - { - if( !bScrBar ) - { - aOrigin *= -1; - // Thumbs korrigieren - if(aHorSBar.IsVisible() && aHorSBar.GetThumbPos() != aOrigin.X()) - aHorSBar.SetThumbPos( aOrigin.X() ); - if(aVerSBar.IsVisible() && aVerSBar.GetThumbPos() != aOrigin.Y()) - aVerSBar.SetThumbPos( aOrigin.Y() ); - } - } - // pruefen, ob ScrollBars noch benoetigt werden - CheckScrollBars(); - pView->Update(); -} - - -SvLBoxEntry* SvImpIconView::GetNewCursor() -{ - SvLBoxEntry* pNewCursor; - if( pCursor ) - { - pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_False ); - if( !pNewCursor ) - { - pNewCursor = pImpCursor->GoLeftRight( pCursor, sal_True ); - if( !pNewCursor ) - { - pNewCursor = pImpCursor->GoUpDown( pCursor, sal_False ); - if( !pNewCursor ) - pNewCursor = pImpCursor->GoUpDown( pCursor, sal_True ); - } - } - } - else - pNewCursor = pModel->FirstChild( pCurParent ); - DBG_ASSERT(!pNewCursor|| (pCursor&&pCursor!=pNewCursor),"GetNewCursor failed"); - return pNewCursor; -} - - -sal_uInt16 SvImpIconView:: GetSelectionCount() const -{ - sal_uInt16 nSelected = 0; - SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent); - while( pEntry ) - { - if( pView->IsSelected( pEntry ) ) - nSelected++; - pEntry = pModel->NextSibling( pEntry ); - } - return nSelected; -} - - -void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry ) -{ - sal_Bool bSel; - if( pView->IsSelected( pEntry ) ) - bSel = sal_False; - else - bSel = sal_True; - pView->Select( pEntry, bSel ); -} - -void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot ) -{ - ClearSelectedRectList(); - SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent ); - while( pEntry ) - { - if( pEntry != pThisEntryNot && pView->IsSelected( pEntry )) - pView->Select( pEntry, sal_False ); - pEntry = pModel->NextSibling( pEntry ); - } -} - -#define ICN_ROWS 50 -#define ICN_COLS 30 - -ImpIcnCursor::ImpIcnCursor( SvImpIconView* pOwner ) -{ - pView = pOwner; - pColumns = 0; - pRows = 0; - pCurEntry = 0; - nDeltaWidth = 0; - nDeltaHeight= 0; - nCols = 0; - nRows = 0; - nGridCols = 0; - nGridRows = 0; - pGridMap = 0; -} - -ImpIcnCursor::~ImpIcnCursor() -{ - delete[] pColumns; - delete[] pRows; - delete pGridMap; -} - -sal_uInt16 ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue, - int bVertical ) -{ - sal_uInt16 nCount = (sal_uInt16)pList->Count(); - if( !nCount ) - return 0; - - sal_uInt16 nCurPos = 0; - long nPrevValue = LONG_MIN; - while( nCount ) - { - const Rectangle& rRect= - pView->GetBoundingRect((SvLBoxEntry*)(pList->GetObject(nCurPos))); - long nCurValue; - if( bVertical ) - nCurValue = rRect.Top(); - else - nCurValue = rRect.Left(); - if( nValue >= nPrevValue && nValue <= nCurValue ) - return (sal_uInt16)nCurPos; - nPrevValue = nCurValue; - nCount--; - nCurPos++; - } - return pList->Count(); -} - -void ImpIcnCursor::ImplCreate() -{ - pView->CheckBoundingRects(); - DBG_ASSERT(pColumns==0&&pRows==0,"ImplCreate: Not cleared"); - - SetDeltas(); - - pColumns = new SvPtrarr[ nCols ]; - pRows = new SvPtrarr[ nRows ]; - - DELETEZ(pGridMap); - - SvLBoxTreeList* pModel = pView->pModel; - SvLBoxEntry* pEntry = pModel->FirstChild( pView->pCurParent ); - while( pEntry ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - // const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - Rectangle rRect( pView->CalcBmpRect( pEntry,0,pViewData ) ); - short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / nDeltaHeight ); - short nX = (short)( ((rRect.Left()+rRect.Right())/2) / nDeltaWidth ); - - // Rundungsfehler abfangen - if( nY >= nRows ) - nY = sal::static_int_cast< short >(nRows - 1); - if( nX >= nCols ) - nX = sal::static_int_cast< short >(nCols - 1); - - sal_uInt16 nIns = GetSortListPos( &pColumns[nX], rRect.Top(), sal_True ); - pColumns[ nX ].Insert( pEntry, nIns ); - - nIns = GetSortListPos( &pRows[nY], rRect.Left(), sal_False ); - pRows[ nY ].Insert( pEntry, nIns ); - - pViewData->nX = nX; - pViewData->nY = nY; - - pEntry = pModel->NextSibling( pEntry ); - } -} - -void ImpIcnCursor::CreateGridMap() -{ - if( pGridMap ) - return; - - const Size& rSize = pView->aVirtOutputSize; - long nWidth = rSize.Width(); - if( nWidth < pView->nMaxVirtWidth ) - nWidth = pView->nMaxVirtWidth; - nWidth -= 2*LROFFS_WINBORDER; - if( nWidth <= 0 ) - nWidth = 1; - - nGridDX = pView->nGridDX; - nGridDY = pView->nGridDY; - - // Hinweis: Wegen der Abrundung bei Berechnung von nGridCols - // ist es moeglich, dass Eintrage nicht im Grid liegen. Diese - // wurden typischerweise manuell verschoben und gelockt - nGridCols = nWidth / nGridDX; - if( !nGridCols ) nGridCols = 1; - - nGridRows = rSize.Height() / nGridDY; - // nRows nicht abrunden, da zur Vermeidung von Ueberlappungen - // das gesamte BoundingRect des Eintrags zur Markierung im Grid - // herangezogen wird. - if( (nGridRows * nGridDY) < rSize.Height() ) - nGridRows++; - else if( !nGridRows ) - nGridRows = 1; - - //XXX - //nGridRows += 50; // in fuenfziger-Schritten - - pGridMap = new sal_Bool[ nGridRows*nGridCols]; - memset( (void*)pGridMap, 0, nGridRows*nGridCols ); - - SvLBoxTreeList* pModel = pView->pModel; - SvLBoxEntry* pEntry = pModel->FirstChild( pView->pCurParent ); - while( pEntry ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - const Rectangle& rRect = pViewData->aRect; - // nur, wenn der Entry schon plaziert ist - if( pView->IsBoundingRectValid( rRect )) - { - // Alle vom Eintrag beruehrten Grids kennzeichnen - SetGridUsed( pView->GetBoundingRect( pEntry, pViewData ) ); - } - pEntry = pModel->NextSibling( pEntry ); - } -} - -sal_Bool ImpIcnCursor::GetGrid( const Point& rDocPos, sal_uInt16& rGridX, sal_uInt16& rGridY ) const -{ - Point aPos( rDocPos ); - aPos.X() -= LROFFS_WINBORDER; - aPos.Y() -= TBOFFS_WINBORDER; - rGridX = (sal_uInt16)(aPos.X() / nGridDX); - rGridY = (sal_uInt16)(aPos.Y() / nGridDY); - sal_Bool bInGrid = sal_True; - if( rGridX >= nGridCols ) - { - rGridX = sal::static_int_cast< sal_uInt16 >(nGridCols - 1); - bInGrid = sal_False; - } - if( rGridY >= nGridRows ) - { - rGridY = sal::static_int_cast< sal_uInt16 >(nGridRows - 1); - if( !bInGrid ) - return sal_False; // beide Koordinaten nicht im Grid - } - return sal_True; -} - -void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, sal_Bool bUsed ) -{ - CreateGridMap(); - sal_uInt16 nTLX, nTLY, nBRX, nBRY; - - sal_Bool bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY ); - sal_Bool bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY ); - - if( !bTLInGrid && !bBRInGrid ) - return; - - for( sal_uInt16 nCurY = nTLY; nCurY <= nBRY; nCurY++ ) - { - for( sal_uInt16 nCurX = nTLX; nCurX <= nBRX; nCurX++ ) - { - SetGridUsed( nCurX, nCurY, bUsed ); - } - } -} - -void ImpIcnCursor::Clear( sal_Bool bGridToo ) -{ - if( pColumns ) - { - delete[] pColumns; - delete[] pRows; - pColumns = 0; - pRows = 0; - pCurEntry = 0; - nDeltaWidth = 0; - nDeltaHeight = 0; - } - if( bGridToo && pGridMap ) - { - DELETEZ(pGridMap); - nGridRows = 0; - nGridCols = 0; - } -} - -SvLBoxEntry* ImpIcnCursor::SearchCol(sal_uInt16 nCol,sal_uInt16 nTop,sal_uInt16 nBottom, - sal_uInt16, sal_Bool bDown, sal_Bool bSimple ) -{ - DBG_ASSERT(pCurEntry,"SearchCol: No reference entry"); - SvPtrarr* pList = &(pColumns[ nCol ]); - sal_uInt16 nCount = pList->Count(); - if( !nCount ) - return 0; - - const Rectangle& rRefRect = pView->GetBoundingRect(pCurEntry); - - if( bSimple ) - { - sal_uInt16 nListPos = pList->GetPos( pCurEntry ); - DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List"); - if( bDown ) - { - while( nListPos < nCount-1 ) - { - nListPos++; - SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos ); - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - if( rRect.Top() > rRefRect.Top() ) - return pEntry; - } - return 0; - } - else - { - while( nListPos ) - { - nListPos--; - if( nListPos < nCount ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos ); - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - if( rRect.Top() < rRefRect.Top() ) - return pEntry; - } - } - return 0; - } - } - - if( nTop > nBottom ) - { - sal_uInt16 nTemp = nTop; - nTop = nBottom; - nBottom = nTemp; - } - long nMinDistance = LONG_MAX; - SvLBoxEntry* pResult = 0; - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); - if( pEntry != pCurEntry ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - sal_uInt16 nY = pViewData->nY; - if( nY >= nTop && nY <= nBottom ) - { - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - long nDistance = rRect.Top() - rRefRect.Top(); - if( nDistance < 0 ) - nDistance *= -1; - if( nDistance && nDistance < nMinDistance ) - { - nMinDistance = nDistance; - pResult = pEntry; - } - } - } - } - return pResult; -} - -SvLBoxEntry* ImpIcnCursor::SearchRow(sal_uInt16 nRow,sal_uInt16 nLeft,sal_uInt16 nRight, - sal_uInt16, sal_Bool bRight, sal_Bool bSimple ) -{ - DBG_ASSERT(pCurEntry,"SearchRow: No reference entry"); - SvPtrarr* pList = &(pRows[ nRow ]); - sal_uInt16 nCount = pList->Count(); - if( !nCount ) - return 0; - - const Rectangle& rRefRect = pView->GetBoundingRect(pCurEntry); - - if( bSimple ) - { - sal_uInt16 nListPos = pList->GetPos( pCurEntry ); - DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List"); - if( bRight ) - { - while( nListPos < nCount-1 ) - { - nListPos++; - SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos ); - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - if( rRect.Left() > rRefRect.Left() ) - return pEntry; - } - return 0; - } - else - { - while( nListPos ) - { - nListPos--; - if( nListPos < nCount ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos ); - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - if( rRect.Left() < rRefRect.Left() ) - return pEntry; - } - } - return 0; - } - - } - if( nRight < nLeft ) - { - sal_uInt16 nTemp = nRight; - nRight = nLeft; - nLeft = nTemp; - } - long nMinDistance = LONG_MAX; - SvLBoxEntry* pResult = 0; - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur )); - if( pEntry != pCurEntry ) - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry); - sal_uInt16 nX = pViewData->nX; - if( nX >= nLeft && nX <= nRight ) - { - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - long nDistance = rRect.Left() - rRefRect.Left(); - if( nDistance < 0 ) - nDistance *= -1; - if( nDistance && nDistance < nMinDistance ) - { - nMinDistance = nDistance; - pResult = pEntry; - } - } - } - } - return pResult; -} - - - -/* - Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw. - linksstehenden. Suchverfahren am Beispiel bRight = sal_True: - - c - b c - a b c - S 1 1 1 ====> Suchrichtung - a b c - b c - c - - S : Startposition - 1 : erstes Suchrechteck - a,b,c : 2., 3., 4. Suchrechteck -*/ - -SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pIcnEntry, sal_Bool bRight ) -{ - SvLBoxEntry* pResult; - pCurEntry = pIcnEntry; - Create(); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - sal_uInt16 nY = pViewData->nY; - sal_uInt16 nX = pViewData->nX; - DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column"); - DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row"); - // Nachbar auf gleicher Zeile ? - if( bRight ) - pResult = SearchRow( - nY, nX, sal::static_int_cast< sal_uInt16 >(nCols-1), nX, sal_True, sal_True ); - else - pResult = SearchRow( nY, nX ,0, nX, sal_False, sal_True ); - if( pResult ) - return pResult; - - long nCurCol = nX; - - long nColOffs, nLastCol; - if( bRight ) - { - nColOffs = 1; - nLastCol = nCols; - } - else - { - nColOffs = -1; - nLastCol = -1; // 0-1 - } - - sal_uInt16 nRowMin = nY; - sal_uInt16 nRowMax = nY; - do - { - SvLBoxEntry* pEntry = SearchCol((sal_uInt16)nCurCol,nRowMin,nRowMax,nY,sal_True, sal_False); - if( pEntry ) - return pEntry; - if( nRowMin ) - nRowMin--; - if( nRowMax < (nRows-1)) - nRowMax++; - nCurCol += nColOffs; - } while( nCurCol != nLastCol ); - return 0; -} - -SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pIcnEntry, sal_Bool bDown) -{ - SvLBoxEntry* pResult; - pCurEntry = pIcnEntry; - Create(); - SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pIcnEntry); - sal_uInt16 nY = pViewData->nY; - sal_uInt16 nX = pViewData->nX; - DBG_ASSERT(nY(nRows-1), nY, sal_True, sal_True ); - else - pResult = SearchCol( nX, nY ,0, nY, sal_False, sal_True ); - if( pResult ) - return pResult; - - long nCurRow = nY; - - long nRowOffs, nLastRow; - if( bDown ) - { - nRowOffs = 1; - nLastRow = nRows; - } - else - { - nRowOffs = -1; - nLastRow = -1; // 0-1 - } - - sal_uInt16 nColMin = nX; - sal_uInt16 nColMax = nX; - do - { - SvLBoxEntry* pEntry = SearchRow((sal_uInt16)nCurRow,nColMin,nColMax,nX,sal_True, sal_False); - if( pEntry ) - return pEntry; - if( nColMin ) - nColMin--; - if( nColMax < (nCols-1)) - nColMax++; - nCurRow += nRowOffs; - } while( nCurRow != nLastRow ); - return 0; -} - -void ImpIcnCursor::SetDeltas() -{ - const Size& rSize = pView->aVirtOutputSize; - if( pView->nFlags & F_GRIDMODE ) - { - nGridDX = pView->nGridDX; - nGridDY = pView->nGridDY; - } - else - { - nGridDX = 20; - nGridDY = 20; - } - nCols = rSize.Width() / nGridDX; - if( !nCols ) - nCols = 1; - nRows = rSize.Height() / nGridDY; - if( (nRows * nGridDY) < rSize.Height() ) - nRows++; - if( !nRows ) - nRows = 1; - - nDeltaWidth = (short)(rSize.Width() / nCols); - nDeltaHeight = (short)(rSize.Height() / nRows); - if( !nDeltaHeight ) - { - nDeltaHeight = 1; - DBG_WARNING("SetDeltas:Bad height"); - } - if( !nDeltaWidth ) - { - nDeltaWidth = 1; - DBG_WARNING("SetDeltas:Bad width"); - } -} - -sal_Bool ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect ) -{ - CreateGridMap(); - sal_uInt16 nCount = (sal_uInt16)(nGridCols * nGridRows); - if( !nCount ) - return sal_False; - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - if( !pGridMap[ nCur ] ) - { - sal_uInt16 nCol = (sal_uInt16)(nCur % nGridCols); - sal_uInt16 nRow = (sal_uInt16)(nCur / nGridCols); - rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER; - rRect.Bottom() = rRect.Top() + nGridDY; - rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER; - rRect.Right() = rRect.Left() + nGridDX; - SetGridUsed( nCol, nRow, sal_True ); - - DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed"); - return sal_True; - } - } - // Gridmap ist voll: Um eine Zeile erweitern - rRect.Top() = nGridRows * nGridDY + TBOFFS_WINBORDER; - rRect.Bottom() = rRect.Top() + nGridDY; - rRect.Left() = LROFFS_WINBORDER; - rRect.Right() = rRect.Left() + nGridDX; - return sal_False; -} - -void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry) -{ - if( !pRefEntry ) - { - sal_uInt16 nAdjustRows = (sal_uInt16)(pView->aVirtOutputSize.Height() / pView->nGridDY); - nAdjustRows++; // wg. Abrundung! - - if( !nAdjustRows ) - return; - for( sal_uInt16 nCurList = 0; nCurList < nAdjustRows; nCurList++ ) - { - SvPtrarr* pRow = new SvPtrarr; - rLists.Insert( (void*)pRow, nCurList ); - } - SvLBoxEntry* pEntry = pView->pModel->FirstChild( pView->pCurParent ); - while( pEntry ) - { - const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - sal_uInt16 nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),sal_False); - ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns ); - pEntry = pView->pModel->NextSibling( pEntry ); - } - } - else - { - // Aufbau eines hor. "Schlauchs" auf der RefEntry-Zeile - - // UEBERLEGEN: BoundingRect nehmen wg. Ueberlappungen??? - - Rectangle rRefRect( pView->CalcBmpRect( pRefEntry ) ); - //const Rectangle& rRefRect = pView->GetBoundingRect( pRefEntry ); - short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY ); - SvPtrarr* pRow = new SvPtrarr; - rLists.Insert( (void*)pRow, 0 ); - SvLBoxEntry* pEntry = pView->pModel->FirstChild( pView->pCurParent ); - while( pEntry ) - { - Rectangle rRect( pView->CalcBmpRect(pEntry) ); - //const Rectangle& rRect = pView->GetBoundingRect( pEntry ); - short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY ); - if( nY == nRefRow ) - { - sal_uInt16 nIns = GetSortListPos( pRow, rRect.Left(), sal_False ); - pRow->Insert( pEntry, nIns ); - } - pEntry = pView->pModel->NextSibling( pEntry ); - } - } -} - -//static -void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists ) -{ - sal_uInt16 nCount = rLists.Count(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ]; - delete pArr; - } - rLists.Remove( 0, rLists.Count() ); -} - -void SvImpIconView::SetGrid( long nDX, long nDY ) -{ - nGridDX = nDX; - nGridDY = nDY; - nFlags |= F_GRIDMODE; -} - -Rectangle SvImpIconView::CalcMaxTextRect( const SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) const -{ - Rectangle aRect = pViewData->aGridRect; - long nBmpHeight = ((SvLBoxEntry*)pEntry)->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,(SvLBoxEntry*)pEntry).Height(); - aRect.Top() += nBmpHeight; - aRect.Top() += ICONVIEW_OFFS_BMP_STRING; - if( aRect.Top() > aRect.Bottom()) - aRect.Top() = aRect.Bottom(); - aRect.Left() += LROFFS_BOUND; - aRect.Left()++; - aRect.Right() -= LROFFS_BOUND; - aRect.Right()--; - if( aRect.Left() > aRect.Right()) - aRect.Left() = aRect.Right(); - if( GetTextMode( pEntry, pViewData ) == ShowTextFull ) - aRect.Bottom() = LONG_MAX; - return aRect; -} - -void SvImpIconView::Center( SvLBoxEntry* pEntry, - SvIcnVwDataEntry* pViewData ) const -{ - SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - const String& rEntryText = pStringItem->GetText(); - - Rectangle aTextRect = CalcMaxTextRect(pEntry,pViewData); - aTextRect = GetTextRect( pView, aTextRect, rEntryText, DRAWTEXT_FLAGS ); - pViewData->aTextSize = aTextRect.GetSize(); - - pViewData->aRect = pViewData->aGridRect; - Size aSize( CalcBoundingSize( pEntry, pViewData ) ); - long nBorder = pViewData->aGridRect.GetWidth() - aSize.Width(); - pViewData->aRect.Left() += nBorder / 2; - pViewData->aRect.Right() -= nBorder / 2; - pViewData->aRect.Bottom() = pViewData->aRect.Top() + aSize.Height(); -} - - -// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird -// links, hoch: Offsets < 0 -// rechts, runter: Offsets > 0 -void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, sal_Bool bScrollBar ) -{ - const MapMode& rMapMode = pView->GetMapMode(); - Point aOrigin( rMapMode.GetOrigin() ); - // in Dokumentkoordinate umwandeln - aOrigin *= -1; - aOrigin.Y() += nDeltaY; - aOrigin.X() += nDeltaX; - Rectangle aRect( aOrigin, aOutputSize ); - MakeVisible( aRect, bScrollBar ); -} - - -const Size& SvImpIconView::GetItemSize( SvIconView* pIconView, - SvLBoxEntry* pEntry, SvLBoxItem* pItem, const SvIcnVwDataEntry* pViewData) const -{ - if( (nFlags & F_GRIDMODE) && pItem->IsA() == SV_ITEM_ID_LBOXSTRING ) - { - if( !pViewData ) - pViewData = ICNVIEWDATA(pEntry); - return pViewData->aTextSize; - } - else - return pItem->GetSize( pIconView, pEntry ); -} - -Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry ) -{ - SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pStringItem,"Text not set"); - return CalcTextRect( pEntry, pStringItem ); -} - - -void SvImpIconView::SelectRect( const Rectangle& rRect, sal_Bool bAdd, - SvPtrarr* pOtherRects, short nBorderOffs ) -{ - if( !pZOrderList || !pZOrderList->Count() ) - return; - - CheckBoundingRects(); - pView->Update(); - sal_uInt16 nCount = pZOrderList->Count(); - - Rectangle aRect( rRect ); - aRect.Justify(); - if( nBorderOffs ) - { - aRect.Left() -= nBorderOffs; - aRect.Right() += nBorderOffs; - aRect.Top() -= nBorderOffs; - aRect.Bottom() += nBorderOffs; - } - sal_Bool bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? sal_True : sal_False; - - for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ ) - { - SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos )); - - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - DBG_ASSERT(pViewData,"Entry not in model"); - if( !IsBoundingRectValid( pViewData->aRect )) - FindBoundingRect( pEntry, pViewData ); - const Rectangle& rBoundRect = pViewData->aRect; - sal_Bool bSelected = pViewData->IsSelected(); - - sal_Bool bOverlaps; - if( bCalcOverlap ) - bOverlaps = IsOver( pOtherRects, rBoundRect ); - else - bOverlaps = sal_False; - sal_Bool bOver = aRect.IsOver( rBoundRect ); - - if( bOver && !bOverlaps ) - { - // Ist im neuen Selektionsrechteck und in keinem alten - // => selektieren - if( !bSelected ) - pView->Select( pEntry, sal_True ); - } - else if( !bAdd ) - { - // ist ausserhalb des Selektionsrechtecks - // => Selektion entfernen - if( bSelected ) - pView->Select( pEntry, sal_False ); - } - else if( bAdd && bOverlaps ) - { - // Der Eintrag befindet sich in einem alten (=>Aufspannen - // mehrerer Rechtecke mit Ctrl!) Selektionsrechteck - - // Hier ist noch ein Bug! Der Selektionsstatus eines Eintrags - // in einem vorherigen Rechteck, muss restauriert werden, wenn - // er vom aktuellen Selektionsrechteck beruehrt wurde, jetzt aber - // nicht mehr in ihm liegt. Ich gehe hier der Einfachheit halber - // pauschal davon aus, dass die Eintraege in den alten Rechtecken - // alle selektiert sind. Ebenso ist es falsch, die Schnittmenge - // nur zu deselektieren. - // Loesungsmoeglichkeit: Snapshot der Selektion vor dem Auf- - // spannen des Rechtecks merken - if( rBoundRect.IsOver( rRect)) - { - // Schnittmenge zwischen alten Rects & aktuellem Rect desel. - if( bSelected ) - pView->Select( pEntry, sal_False ); - } - else - { - // Eintrag eines alten Rects selektieren - if( !bSelected ) - pView->Select( pEntry, sal_True ); - } - } - else if( !bOver && bSelected ) - { - // Der Eintrag liegt voellig ausserhalb und wird deshalb desel. - pView->Select( pEntry, sal_False ); - } - } - pView->Update(); -} - -sal_Bool SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const -{ - sal_uInt16 nCount = pRectList->Count(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur ); - if( rBoundRect.IsOver( *pRect )) - return sal_True; - } - return sal_False; -} - -void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs ) -{ - Rectangle* pRect = new Rectangle( rRect ); - pRect->Justify(); - if( nBorderOffs ) - { - pRect->Left() -= nBorderOffs; - pRect->Right() += nBorderOffs; - pRect->Top() -= nBorderOffs; - pRect->Bottom() += nBorderOffs; - } - aSelectedRectList.Insert( (void*)pRect, aSelectedRectList.Count() ); -} - -void SvImpIconView::ClearSelectedRectList() -{ - sal_uInt16 nCount = aSelectedRectList.Count(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur ); - delete pRect; - } - aSelectedRectList.Remove( 0, aSelectedRectList.Count() ); -} - - -void SvImpIconView::DrawSelectionRect( const Rectangle& rRect ) -{ - pView->HideTracking(); - nFlags |= F_SELRECT_VISIBLE; - pView->ShowTracking( rRect, SHOWTRACK_SMALL | SHOWTRACK_WINDOW ); - aCurSelectionRect = rRect; -} - -void SvImpIconView::HideSelectionRect() -{ - if( nFlags & F_SELRECT_VISIBLE ) - { - pView->HideTracking(); - nFlags &= ~F_SELRECT_VISIBLE; - } -} - -void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect ) -{ - RasterOp eOldOp = pView->GetRasterOp(); - pView->SetRasterOp( ROP_XOR ); - Color aOldColor = pView->GetFillColor(); - pView->SetFillColor(); - pView->DrawRect( rRect ); - pView->SetFillColor( aOldColor ); - pView->SetRasterOp( eOldOp ); -} - -void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel, - long& rX, long& rY, sal_Bool bInDragDrop, sal_uInt16 nBorderWidth) -{ - // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des - // Fensters befindet - long nPixelToScrollX = 0; - long nPixelToScrollY = 0; - Size aWndSize = aOutputSize; - - nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth )); - nBorderWidth = (sal_uInt16)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth )); - - if ( rPosPixel.X() < nBorderWidth ) - { - if( bInDragDrop ) - nPixelToScrollX = -DD_SCROLL_PIXEL; - else - nPixelToScrollX = rPosPixel.X()- nBorderWidth; - } - else if ( rPosPixel.X() > aWndSize.Width() - nBorderWidth ) - { - if( bInDragDrop ) - nPixelToScrollX = DD_SCROLL_PIXEL; - else - nPixelToScrollX = rPosPixel.X() - (aWndSize.Width() - nBorderWidth); - } - if ( rPosPixel.Y() < nBorderWidth ) - { - if( bInDragDrop ) - nPixelToScrollY = -DD_SCROLL_PIXEL; - else - nPixelToScrollY = rPosPixel.Y() - nBorderWidth; - } - else if ( rPosPixel.Y() > aWndSize.Height() - nBorderWidth ) - { - if( bInDragDrop ) - nPixelToScrollY = DD_SCROLL_PIXEL; - else - nPixelToScrollY = rPosPixel.Y() - (aWndSize.Height() - nBorderWidth); - } - - rX = nPixelToScrollX; - rY = nPixelToScrollY; -} - -IMPL_LINK(SvImpIconView, MouseMoveTimeoutHdl, Timer*, pTimer ) -{ - pTimer->Start(); - MouseMove( aMouseMoveEvent ); - return 0; -} - -void SvImpIconView::EndTracking() -{ - pView->ReleaseMouse(); - if( nFlags & F_RUBBERING ) - { - aMouseMoveTimer.Stop(); - nFlags &= ~(F_RUBBERING | F_ADD_MODE); - } -} - -sal_Bool SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ) -{ - SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - if( pItem ) - { - Rectangle aRect( CalcTextRect( pEntry, pItem )); - if( aRect.IsInside( rDocPos ) ) - return sal_True; - } - return sal_False; -} - -IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, EMPTYARG ) -{ - SvLBoxEntry* pEntry = GetCurEntry(); - if( pView->IsInplaceEditingEnabled() && pEntry && - pView->IsSelected( pEntry )) - { - pView->EditEntry( pEntry ); - } - return 0; -} - - -// -// Funktionen zum Ausrichten der Eintraege am Grid -// - -// pStart == 0: Alle Eintraege werden ausgerichtet -// sonst: Alle Eintraege der Zeile ab einschliesslich pStart werden ausgerichtet -void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart ) -{ - SvPtrarr aLists; - pImpCursor->CreateGridAjustData( aLists, pStart ); - sal_uInt16 nCount = aLists.Count(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) - { - AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart ); - } - ImpIcnCursor::DestroyGridAdjustData( aLists ); - CheckScrollBars(); -} - -// Richtet eine Zeile aus, erweitert ggf. die Breite; Bricht die Zeile nicht um -void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart ) -{ - if( !rRow.Count() ) - return; - - sal_Bool bGo; - if( !pStart ) - bGo = sal_True; - else - bGo = sal_False; - - long nCurRight = 0; - for( sal_uInt16 nCur = 0; nCur < rRow.Count(); nCur++ ) - { - SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ]; - if( !bGo && pCur == pStart ) - bGo = sal_True; - - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur); - // Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst - // durch lange Texte der Eintrag stark springen kann - const Rectangle& rBoundRect = GetBoundingRect( pCur, pViewData ); - Rectangle aCenterRect( CalcBmpRect( pCur, 0, pViewData )); - if( bGo && !pViewData->IsEntryPosLocked() ) - { - long nWidth = aCenterRect.GetSize().Width(); - Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) ); - while( aNewPos.X() < nCurRight ) - aNewPos.X() += nGridDX; - if( aNewPos != rBoundRect.TopLeft() ) - SetEntryPosition( pCur, aNewPos ); - nCurRight = aNewPos.X() + nWidth; - } - else - { - nCurRight = rBoundRect.Right(); - } - } -} - -// Richtet Rect am Grid aus, garantiert jedoch nicht, dass die -// neue Pos. frei ist. Die Pos. kann fuer SetEntryPos verwendet werden. -// Das CenterRect beschreibt den Teil des BoundRects, der fuer -// die Berechnung des Ziel-Rechtecks verwendet wird. -Point SvImpIconView::AdjustAtGrid( const Rectangle& rCenterRect, - const Rectangle& rBoundRect ) const -{ - Point aPos( rCenterRect.TopLeft() ); - Size aSize( rCenterRect.GetSize() ); - - aPos.X() -= LROFFS_WINBORDER; - aPos.Y() -= TBOFFS_WINBORDER; - - // align (ref ist mitte des rects) - short nGridX = (short)((aPos.X()+(aSize.Width()/2)) / nGridDX); - short nGridY = (short)((aPos.Y()+(aSize.Height()/2)) / nGridDY); - aPos.X() = nGridX * nGridDX; - aPos.Y() = nGridY * nGridDY; - // hor. center - aPos.X() += (nGridDX - rBoundRect.GetSize().Width() ) / 2; - - aPos.X() += LROFFS_WINBORDER; - aPos.Y() += TBOFFS_WINBORDER; - - return aPos; -} - - -void SvImpIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry ) -{ - if( !pEntry ) - { - if( eTextMode != eMode ) - { - if( eTextMode == ShowTextDontKnow ) - eTextMode = ShowTextShort; - eTextMode = eMode; - pView->Arrange(); - } - } - else - { - SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry); - if( pViewData->eTextMode != eMode ) - { - pViewData->eTextMode = eMode; - pModel->InvalidateEntry( pEntry ); - AdjustVirtSize( pViewData->aRect ); - } - } -} - -SvIconViewTextMode SvImpIconView::GetTextMode( const SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) const -{ - if( !pEntry ) - return eTextMode; - else - { - if( !pViewData ) - pViewData = ICNVIEWDATA(((SvLBoxEntry*)pEntry)); - return pViewData->GetTextMode(); - } -} - -SvIconViewTextMode SvImpIconView::GetEntryTextModeSmart( const SvLBoxEntry* pEntry, - const SvIcnVwDataEntry* pViewData ) const -{ - DBG_ASSERT(pEntry,"GetEntryTextModeSmart: Entry not set"); - if( !pViewData ) - pViewData = ICNVIEWDATA(((SvLBoxEntry*)pEntry)); - SvIconViewTextMode eMode = pViewData->GetTextMode(); - if( eMode == ShowTextDontKnow ) - return eTextMode; - return eMode; -} - -void SvImpIconView::ShowFocusRect( const SvLBoxEntry* pEntry ) -{ - if( !pEntry ) - pView->HideFocus(); - else - { - Rectangle aRect ( CalcFocusRect( (SvLBoxEntry*)pEntry ) ); - pView->ShowFocus( aRect ); - } -} - -IMPL_LINK(SvImpIconView, UserEventHdl, void*, EMPTYARG ) -{ - nCurUserEvent = 0; - AdjustScrollBars(); - Rectangle aRect; - if( GetResizeRect(aRect) ) - PaintResizeRect( aRect ); - return 0; -} - -void SvImpIconView::CancelUserEvent() -{ - if( nCurUserEvent ) - { - Application::RemoveUserEvent( nCurUserEvent ); - nCurUserEvent = 0; - } -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3 From e5647de7dd26775e45af24f11ac4f82a5518bd9e Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Thu, 21 Jul 2011 10:50:29 +0200 Subject: callcatcher: clean up Dir and DirEntry --- tools/inc/tools/fsys.hxx | 6 ------ tools/source/fsys/dirent.cxx | 50 -------------------------------------------- tools/source/fsys/tdir.cxx | 39 ---------------------------------- 3 files changed, 95 deletions(-) diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx index fbcafefacd6b..a0a494f538ad 100644 --- a/tools/inc/tools/fsys.hxx +++ b/tools/inc/tools/fsys.hxx @@ -290,7 +290,6 @@ public: void SetExtension( const String& rExt, char cSep = '.' ); String GetExtension( char cSep = '.' ) const; - String CutExtension( char cSep = '.' ); void SetName( const String& rName, FSysPathStyle eFormatter = FSYS_STYLE_HOST ); inline const String GetNameDirect() const { return String(aName, osl_getThreadTextEncoding()); } String GetName( FSysPathStyle eFormatter = FSYS_STYLE_HOST ) const; @@ -336,7 +335,6 @@ public: sal_Bool operator !=( const DirEntry& rAnotherDir ) const { return !(DirEntry::operator==( rAnotherDir )); } - StringCompare NameCompare( const DirEntry &rWith ) const; inline StringCompare NameCompareDirect( const DirEntry &rWith ) const { #ifdef UNX @@ -447,12 +445,8 @@ protected: #endif public: - Dir(); Dir( const DirEntry& rDirEntry, DirEntryKind nKind = FSYS_KIND_ALL ); - Dir( const DirEntry& rDirEntry, - DirEntryKind nKind, - FSysSort nSort, ... ); ~Dir(); void Reset(); diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 0e8f37ef623d..ea3db76c5c07 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -1133,31 +1133,6 @@ String DirEntry::CutName( FSysPathStyle eStyle ) return aOldName; } -/************************************************************************* -|* -|* DirEntry::NameCompare -|* -|* Beschreibung Vergleich nur die Namen (ohne Pfad, aber mit Gross/Klein) -|* -*************************************************************************/ - -StringCompare DirEntry::NameCompare( const DirEntry &rWith ) const -{ - ByteString aThisName; - ByteString aParameterName; - -#ifdef UNX - aThisName = aName; - aParameterName = rWith.aName; -#else - aThisName = ByteString(aName).ToLowerAscii(); - aParameterName = ByteString(rWith.aName).ToLowerAscii(); -#endif - - return aThisName.CompareTo( aParameterName ); -} - - /************************************************************************* |* |* DirEntry::operator==() @@ -1373,31 +1348,6 @@ void DirEntry::SetExtension( const String& rExtension, char cSep ) } } -/************************************************************************* -|* -|* DirEntry::CutExtension() -|* -*************************************************************************/ - -String DirEntry::CutExtension( char cSep ) -{ - DBG_CHKTHIS( DirEntry, ImpCheckDirEntry ); - - const char *p0 = ( aName.GetBuffer() ); - const char *p1 = p0 + aName.Len() - 1; - while ( p1 >= p0 && *p1 != cSep ) - p1--; - - if ( p1 >= p0 ) - { - // es wurde ein cSep an der Position p1 gefunden - aName.Erase( static_cast< xub_StrLen >(p1-p0) ); - return String(p1 + 1, osl_getThreadTextEncoding()); - } - - return String(); -} - /************************************************************************* |* |* DirEntry::SetName() diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx index 4fb46f201f15..db811f35e76b 100644 --- a/tools/source/fsys/tdir.cxx +++ b/tools/source/fsys/tdir.cxx @@ -386,27 +386,6 @@ sal_uInt16 Dir::Scan( sal_uInt16 nCount ) |* *************************************************************************/ -Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags, FSysSort nSort, ... ): - DirEntry( rDirEntry ), - pReader( 0 ) -{ - DBG_CTOR( Dir, NULL ); - - Construct( nKindFlags ); - - std::va_list pArgs; - va_start( pArgs, nSort ); - ImpSetSort( pArgs, nSort ); - - Reset(); -} - -/************************************************************************* -|* -|* Dir::Dir() -|* -*************************************************************************/ - Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags ): DirEntry( rDirEntry ), pReader( 0 ) @@ -417,24 +396,6 @@ Dir::Dir( const DirEntry& rDirEntry, DirEntryKind nKindFlags ): Reset(); } -/************************************************************************* -|* -|* Dir::Dir() -|* -*************************************************************************/ - -Dir::Dir(): - pReader( 0 ) -{ - DBG_CTOR( Dir, NULL ); - - pLst = NULL; - pSortLst = NULL; - pStatLst = NULL; - eAttrMask = FSYS_KIND_ALL; - aNameMask = String("*", osl_getThreadTextEncoding()); -} - /************************************************************************* |* |* Dir::~Dir() -- cgit v1.2.3