[Libreoffice-commits] core.git: Branch 'feature/go2' - 2 commits - basic/source canvas/source chart2/inc chart2/source cui/inc cui/source dbaccess/source drawinglayer/inc drawinglayer/source editeng/source filter/source include/drawinglayer include/editeng include/filter include/sfx2 include/svtools include/svx oox/inc oox/source sc/inc sc/source sd/source sfx2/source slideshow/inc slideshow/source svtools/Library_svt.mk svtools/source svx/inc svx/source sw/inc sw/source writerfilter/inc writerfilter/source
Norbert Thiebaud
nthiebaud at gmail.com
Tue Oct 8 05:28:07 PDT 2013
basic/source/uno/dlgcont.cxx | 2
canvas/source/vcl/cachedbitmap.cxx | 8
canvas/source/vcl/cachedbitmap.hxx | 7
canvas/source/vcl/canvas.cxx | 2
canvas/source/vcl/canvas.hxx | 2
canvas/source/vcl/canvasbitmap.cxx | 2
canvas/source/vcl/canvasbitmap.hxx | 2
canvas/source/vcl/canvascustomsprite.cxx | 2
canvas/source/vcl/canvascustomsprite.hxx | 2
canvas/source/vcl/canvashelper.cxx | 19
canvas/source/vcl/canvashelper.hxx | 2
canvas/source/vcl/canvashelper_texturefill.cxx | 20
canvas/source/vcl/repainttarget.hxx | 2
canvas/source/vcl/spritecanvas.cxx | 2
canvas/source/vcl/spritecanvas.hxx | 2
chart2/inc/pch/precompiled_chartcontroller.hxx | 2
chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx | 10
chart2/source/model/main/ChartModel.hxx | 4
chart2/source/model/main/ChartModel_Persistence.cxx | 2
cui/inc/pch/precompiled_cui.hxx | 2
cui/source/inc/cuigaldlg.hxx | 2
cui/source/inc/cuigrfflt.hxx | 2
cui/source/options/optgdlg.cxx | 2
cui/source/options/optmemory.cxx | 3
cui/source/tabpages/backgrnd.cxx | 16
cui/source/tabpages/tpbitmap.cxx | 41
cui/source/tabpages/tpcolor.cxx | 2
cui/source/tabpages/tpgradnt.cxx | 2
cui/source/tabpages/tphatch.cxx | 2
cui/source/tabpages/tplnedef.cxx | 2
cui/source/tabpages/tplneend.cxx | 2
dbaccess/source/core/dataaccess/databasedocument.cxx | 2
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 12
dbaccess/source/ui/app/AppDetailPageHelper.hxx | 15
drawinglayer/inc/pch/precompiled_drawinglayer.hxx | 2
drawinglayer/source/primitive2d/graphicprimitive2d.cxx | 10
drawinglayer/source/primitive2d/mediaprimitive2d.cxx | 4
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 8
editeng/source/items/bulitem.cxx | 56
editeng/source/items/frmitems.cxx | 161
editeng/source/items/numitem.cxx | 164
editeng/source/outliner/outliner.cxx | 10
editeng/source/uno/unonrule.cxx | 15
filter/source/msfilter/escherex.cxx | 64
filter/source/msfilter/msdffimp.cxx | 16
filter/source/msfilter/svdfppt.cxx | 2
filter/source/svg/svgfilter.hxx | 2
include/drawinglayer/primitive2d/graphicprimitive2d.hxx | 10
include/editeng/brushitem.hxx | 53
include/editeng/bulletitem.hxx | 42
include/editeng/numitem.hxx | 28
include/editeng/outliner.hxx | 17
include/filter/msfilter/escherex.hxx | 6
include/sfx2/frmhtmlw.hxx | 45
include/svtools/GraphicManager.hxx | 27
include/svtools/GraphicObject.hxx | 542 +++
include/svtools/grfmgr.hxx | 503 --
include/svtools/htmlout.hxx | 30
include/svx/extedit.hxx | 6
include/svx/galctrl.hxx | 6
include/svx/galmisc.hxx | 44
include/svx/galtheme.hxx | 16
include/svx/grfflt.hxx | 4
include/svx/sdgmoitm.hxx | 2
include/svx/sdr/primitive2d/sdrgrafprimitive2d.hxx | 8
include/svx/svdograf.hxx | 17
include/svx/unoapi.hxx | 2
include/svx/xbitmap.hxx | 6
include/svx/xbtmpit.hxx | 12
include/svx/xmlgrhlp.hxx | 4
include/svx/xoutbmp.hxx | 10
include/svx/xtable.hxx | 74
oox/inc/pch/precompiled_oox.hxx | 2
oox/source/export/drawingml.cxx | 6
oox/source/export/shapes.cxx | 2
sc/inc/filter.hxx | 4
sc/source/filter/excel/xiescher.cxx | 2
sc/source/filter/html/htmlexp.cxx | 97
sc/source/filter/html/htmlexp2.cxx | 24
sc/source/filter/inc/ftools.hxx | 4
sc/source/filter/inc/htmlexp.hxx | 28
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/docshell/impex.cxx | 4
sc/source/ui/drawfunc/graphsh.cxx | 12
sc/source/ui/inc/impex.hxx | 4
sc/source/ui/view/printfun.cxx | 8
sc/source/ui/view/viewfun7.cxx | 2
sd/source/core/drawdoc4.cxx | 2
sd/source/filter/eppt/epptso.cxx | 8
sd/source/ui/func/fupage.cxx | 2
sd/source/ui/view/GraphicObjectBar.cxx | 6
sd/source/ui/view/drviews2.cxx | 10
sd/source/ui/view/sdview3.cxx | 2
sd/source/ui/view/sdview4.cxx | 2
sfx2/source/bastyp/frmhtmlw.cxx | 91
slideshow/inc/pch/precompiled_slideshow.hxx | 2
slideshow/source/engine/shapes/shapeimporter.cxx | 27
svtools/Library_svt.mk | 2
svtools/source/graphic/GraphicManager.cxx | 68
svtools/source/graphic/GraphicObject.cxx | 1737 ++++++++++
svtools/source/graphic/graphicunofactory.cxx | 22
svtools/source/graphic/grfattr.cxx | 13
svtools/source/graphic/grfcache.cxx | 949 +++--
svtools/source/graphic/grfcache.hxx | 159
svtools/source/graphic/grfmgr.cxx | 1684 ---------
svtools/source/graphic/provider.cxx | 6
svtools/source/graphic/renderer.cxx | 6
svtools/source/svhtml/htmlout.cxx | 63
svx/inc/galbrws2.hxx | 6
svx/inc/galobj.hxx | 22
svx/inc/pch/precompiled_svxcore.hxx | 2
svx/source/core/extedit.cxx | 12
svx/source/core/graphichelper.cxx | 6
svx/source/customshapes/EnhancedCustomShape2d.cxx | 4
svx/source/customshapes/EnhancedCustomShape3d.cxx | 10
svx/source/dialog/compressgraphicdialog.cxx | 2
svx/source/dialog/dlgctrl.cxx | 8
svx/source/dialog/grfflt.cxx | 6
svx/source/gallery2/galbrws1.cxx | 36
svx/source/gallery2/galbrws1.hxx | 6
svx/source/gallery2/galbrws2.cxx | 59
svx/source/gallery2/galctrl.cxx | 26
svx/source/gallery2/galmisc.cxx | 69
svx/source/gallery2/galobj.cxx | 43
svx/source/gallery2/galtheme.cxx | 94
svx/source/sdr/contact/viewcontactofgraphic.cxx | 14
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 2
svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 6
svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx | 6
svx/source/sidebar/nbdtmg.cxx | 32
svx/source/svdraw/svddrgmt.cxx | 8
svx/source/svdraw/svdetc.cxx | 2
svx/source/svdraw/svdfmtf.cxx | 2
svx/source/svdraw/svdhdl.cxx | 2
svx/source/svdraw/svdmrkv.cxx | 4
svx/source/svdraw/svdoashp.cxx | 12
svx/source/svdraw/svdograf.cxx | 178 -
svx/source/svdraw/svdoole2.cxx | 37
svx/source/svdraw/svdpntv.cxx | 2
svx/source/unodraw/XPropertyTable.cxx | 9
svx/source/unodraw/unobtabl.cxx | 2
svx/source/unodraw/unoshap2.cxx | 14
svx/source/unodraw/unoshap4.cxx | 15
svx/source/xml/xmlgrhlp.cxx | 158
svx/source/xoutdev/_xoutbmp.cxx | 26
svx/source/xoutdev/xattr.cxx | 4
svx/source/xoutdev/xattrbmp.cxx | 78
svx/source/xoutdev/xpool.cxx | 50
svx/source/xoutdev/xtabbtmp.cxx | 22
svx/source/xoutdev/xtabdash.cxx | 28
svx/source/xoutdev/xtabgrdt.cxx | 2
svx/source/xoutdev/xtabhtch.cxx | 2
svx/source/xoutdev/xtable.cxx | 39
svx/source/xoutdev/xtablend.cxx | 2
sw/inc/IDocumentContentOperations.hxx | 7
sw/inc/doc.hxx | 4
sw/inc/editsh.hxx | 7
sw/inc/ndarr.hxx | 3
sw/inc/ndgrf.hxx | 35
sw/inc/numrule.hxx | 4
sw/inc/pch/precompiled_sw.hxx | 2
sw/source/core/doc/doc.cxx | 6
sw/source/core/doc/notxtfrm.cxx | 25
sw/source/core/doc/number.cxx | 6
sw/source/core/docnode/swbaslnk.cxx | 8
sw/source/core/edit/editsh.cxx | 21
sw/source/core/frmedt/fecopy.cxx | 4
sw/source/core/graphic/grfatr.cxx | 2
sw/source/core/graphic/ndgrf.cxx | 227 -
sw/source/core/layout/atrfrm.cxx | 12
sw/source/core/layout/fly.cxx | 21
sw/source/core/layout/paintfrm.cxx | 61
sw/source/core/text/frmpaint.cxx | 2
sw/source/core/unocore/unoframe.cxx | 41
sw/source/filter/html/htmlbas.cxx | 4
sw/source/filter/html/htmlforw.cxx | 8
sw/source/filter/html/wrthtml.cxx | 2
sw/source/filter/html/wrthtml.hxx | 2
sw/source/filter/ww8/rtfsdrexport.cxx | 2
sw/source/filter/ww8/writerhelper.cxx | 2
sw/source/filter/ww8/wrtw8esh.cxx | 21
sw/source/filter/ww8/ww8graf.cxx | 8
sw/source/filter/xml/xmlbrsh.cxx | 13
sw/source/ui/shells/grfsh.cxx | 35
sw/source/ui/shells/txtnum.cxx | 14
sw/source/ui/utlui/attrdesc.cxx | 2
writerfilter/inc/pch/precompiled_writerfilter.hxx | 2
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 4
188 files changed, 4659 insertions(+), 4418 deletions(-)
New commits:
commit 6e2f5bce80ff9008a8fcda7ad434033d46da17a3
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Tue Oct 8 14:26:21 2013 +0200
wrap GraphicObject in a rtl::Reference
Change-Id: I07842c2920202f39cae054cba866f0d02d767e61
diff --git a/canvas/source/vcl/cachedbitmap.cxx b/canvas/source/vcl/cachedbitmap.cxx
index bdbbcab..c3941c2 100644
--- a/canvas/source/vcl/cachedbitmap.cxx
+++ b/canvas/source/vcl/cachedbitmap.cxx
@@ -35,7 +35,7 @@ using namespace ::com::sun::star;
namespace vclcanvas
{
- CachedBitmap::CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject,
+ CachedBitmap::CachedBitmap( const rtl::Reference<GraphicObject>& rGraphicObject,
const ::Point& rPoint,
const ::Size& rSize,
const GraphicAttr& rAttr,
@@ -43,7 +43,7 @@ namespace vclcanvas
const rendering::RenderState& rUsedRenderState,
const uno::Reference< rendering::XCanvas >& rTarget ) :
CachedPrimitiveBase( rUsedViewState, rTarget, true ),
- mpGraphicObject( rGraphicObject ),
+ m_rGraphicObject( rGraphicObject ),
maRenderState(rUsedRenderState),
maPoint( rPoint ),
maSize( rSize ),
@@ -55,7 +55,7 @@ namespace vclcanvas
{
::osl::MutexGuard aGuard( m_aMutex );
- mpGraphicObject.reset();
+ m_rGraphicObject = rtl::Reference<GraphicObject>();
CachedPrimitiveBase::disposing();
}
@@ -78,7 +78,7 @@ namespace vclcanvas
ENSURE_OR_THROW( pTarget,
"CachedBitmap::redraw(): cannot cast target to RepaintTarget" );
- if( !pTarget->repaint( mpGraphicObject,
+ if( !pTarget->repaint( m_rGraphicObject,
rNewState,
maRenderState,
maPoint,
diff --git a/canvas/source/vcl/cachedbitmap.hxx b/canvas/source/vcl/cachedbitmap.hxx
index 4065fdc..255aeb6 100644
--- a/canvas/source/vcl/cachedbitmap.hxx
+++ b/canvas/source/vcl/cachedbitmap.hxx
@@ -31,7 +31,6 @@
namespace vclcanvas
{
- typedef ::boost::shared_ptr< GraphicObject > GraphicObjectSharedPtr;
class CachedBitmap : public ::canvas::CachedPrimitiveBase
{
@@ -39,7 +38,7 @@ namespace vclcanvas
/** Create an XCachedPrimitive for given GraphicObject
*/
- CachedBitmap( const GraphicObjectSharedPtr& rGraphicObject,
+ CachedBitmap( const rtl::Reference<GraphicObject>& rGraphicObject,
const ::Point& rPoint,
const ::Size& rSize,
const GraphicAttr& rAttr,
@@ -59,7 +58,7 @@ namespace vclcanvas
bool bSameViewTransform );
- GraphicObjectSharedPtr mpGraphicObject;
+ rtl::Reference<GraphicObject> m_rGraphicObject;
const ::com::sun::star::rendering::RenderState maRenderState;
const ::Point maPoint;
const ::Size maSize;
diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx
index 5a44e40..9f3df18 100644
--- a/canvas/source/vcl/canvas.cxx
+++ b/canvas/source/vcl/canvas.cxx
@@ -135,7 +135,7 @@ namespace vclcanvas
return OUString( CANVAS_SERVICE_NAME );
}
- bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf,
+ bool Canvas::repaint( const rtl::Reference<GraphicObject>& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvas.hxx b/canvas/source/vcl/canvas.hxx
index 10bee3b..3706efa 100644
--- a/canvas/source/vcl/canvas.hxx
+++ b/canvas/source/vcl/canvas.hxx
@@ -101,7 +101,7 @@ namespace vclcanvas
virtual OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException);
// RepaintTarget
- virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
+ virtual bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const com::sun::star::rendering::ViewState& viewState,
const com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx
index a469e44..e145379 100644
--- a/canvas/source/vcl/canvasbitmap.cxx
+++ b/canvas/source/vcl/canvasbitmap.cxx
@@ -101,7 +101,7 @@ namespace vclcanvas
return maCanvasHelper.getBitmap();
}
- bool CanvasBitmap::repaint( const GraphicObjectSharedPtr& rGrf,
+ bool CanvasBitmap::repaint( const rtl::Reference<GraphicObject>& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx
index 176d4fa..826582f 100644
--- a/canvas/source/vcl/canvasbitmap.hxx
+++ b/canvas/source/vcl/canvasbitmap.hxx
@@ -84,7 +84,7 @@ namespace vclcanvas
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
// RepaintTarget interface
- virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
+ virtual bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx
index 9dead83..17d0a2d 100644
--- a/canvas/source/vcl/canvascustomsprite.cxx
+++ b/canvas/source/vcl/canvascustomsprite.cxx
@@ -161,7 +161,7 @@ namespace vclcanvas
mbSurfaceDirty = false;
}
- bool CanvasCustomSprite::repaint( const GraphicObjectSharedPtr& rGrf,
+ bool CanvasCustomSprite::repaint( const rtl::Reference<GraphicObject>& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvascustomsprite.hxx b/canvas/source/vcl/canvascustomsprite.hxx
index 0014c3f..5ca7fc6 100644
--- a/canvas/source/vcl/canvascustomsprite.hxx
+++ b/canvas/source/vcl/canvascustomsprite.hxx
@@ -111,7 +111,7 @@ namespace vclcanvas
bool bBufferedUpdate ) const;
// RepaintTarget
- virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
+ virtual bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 54fff82..c1a28df 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -763,7 +763,7 @@ namespace vclcanvas
aMatrix.decompose( aScale, aOutputPos, nRotate, nShearX );
GraphicAttr aGrfAttr;
- GraphicObjectSharedPtr pGrfObj;
+ rtl::Reference<GraphicObject> rGrfObj;
::Size aBmpSize( aBmpEx.GetSizePixel() );
@@ -803,7 +803,7 @@ namespace vclcanvas
const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI));
aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) );
- pGrfObj.reset( new GraphicObject( aBmpEx ) );
+ rGrfObj = GraphicObject::Create( aBmpEx );
}
else
{
@@ -828,7 +828,7 @@ namespace vclcanvas
renderState.DeviceColor,
tools::MODULATE_NONE );
- pGrfObj.reset( new GraphicObject( aBmpEx ) );
+ rGrfObj = GraphicObject::Create( aBmpEx );
// clear scale values, generated bitmap already
// contains scaling
@@ -843,22 +843,23 @@ namespace vclcanvas
const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width() ),
::basegfx::fround( aScale.getY() * aBmpSize.Height() ) );
- pGrfObj->Draw( &mpOutDev->getOutDev(),
+ rGrfObj->Draw( &mpOutDev->getOutDev(),
aPt,
aSz,
&aGrfAttr );
if( mp2ndOutDev )
- pGrfObj->Draw( &mp2ndOutDev->getOutDev(),
+ {
+ rGrfObj->Draw( &mp2ndOutDev->getOutDev(),
aPt,
aSz,
&aGrfAttr );
-
+ }
// created GraphicObject, which possibly cached
// display bitmap - return cache object, to retain
// that information.
return uno::Reference< rendering::XCachedPrimitive >(
- new CachedBitmap( pGrfObj,
+ new CachedBitmap( rGrfObj,
aPt,
aSz,
aGrfAttr,
@@ -1410,14 +1411,14 @@ namespace vclcanvas
return true;
}
- bool CanvasHelper::repaint( const GraphicObjectSharedPtr& rGrf,
+bool CanvasHelper::repaint( const rtl::Reference<GraphicObject>& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const
{
- ENSURE_OR_RETURN_FALSE( rGrf,
+ ENSURE_OR_RETURN_FALSE( rGrf.is(),
"Invalid Graphic" );
if( !mpOutDev )
diff --git a/canvas/source/vcl/canvashelper.hxx b/canvas/source/vcl/canvashelper.hxx
index 5729d60..a374961 100644
--- a/canvas/source/vcl/canvashelper.hxx
+++ b/canvas/source/vcl/canvashelper.hxx
@@ -264,7 +264,7 @@ namespace vclcanvas
::com::sun::star::rendering::IntegerBitmapLayout getMemoryLayout();
/// Repaint a cached bitmap
- bool repaint( const GraphicObjectSharedPtr& rGrf,
+ bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 2da3dc6..a235b7b 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -69,7 +69,7 @@ namespace vclcanvas
namespace
{
bool textureFill( OutputDevice& rOutDev,
- GraphicObject& rGraphic,
+ rtl::Reference<GraphicObject>& rGraphicObject,
const ::Point& rPosPixel,
const ::Size& rNextTileX,
const ::Size& rNextTileY,
@@ -91,7 +91,7 @@ namespace vclcanvas
{
// update return value. This method should return true, if
// at least one of the looped Draws succeeded.
- bRet |= ( sal_True == rGraphic.Draw( &rOutDev,
+ bRet |= ( sal_True == rGraphicObject->Draw( &rOutDev,
aCurrPos,
rTileSize,
&rAttr ) );
@@ -842,7 +842,7 @@ namespace vclcanvas
aTotalTransform.decompose( aScale, aOutputPos, nRotate, nShearX );
GraphicAttr aGrfAttr;
- GraphicObjectSharedPtr pGrfObj;
+ rtl::Reference<GraphicObject> rGrfObj;
if( ::basegfx::fTools::equalZero( nShearX ) )
{
@@ -856,7 +856,7 @@ namespace vclcanvas
( aScale.getY() < 0.0 ? BMP_MIRROR_VERT : 0 ) );
aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround( nRotate*10.0 )) );
- pGrfObj.reset( new GraphicObject( aBmpEx ) );
+ rGrfObj = GraphicObject::Create( aBmpEx );
}
else
{
@@ -867,7 +867,7 @@ namespace vclcanvas
uno::Sequence< double >(),
tools::MODULATE_NONE);
- pGrfObj.reset( new GraphicObject( aBmpEx ) );
+ rGrfObj = GraphicObject::Create( aBmpEx );
// clear scale values, generated bitmap already
// contains scaling
@@ -989,7 +989,7 @@ namespace vclcanvas
rOutDev.IntersectClipRegion( aPolygonDeviceRect );
textureFill( rOutDev,
- *pGrfObj,
+ rGrfObj,
aPt,
aIntegerNextTileX,
aIntegerNextTileY,
@@ -1003,7 +1003,7 @@ namespace vclcanvas
OutputDevice& r2ndOutDev( mp2ndOutDev->getOutDev() );
r2ndOutDev.IntersectClipRegion( aPolygonDeviceRect );
textureFill( r2ndOutDev,
- *pGrfObj,
+ rGrfObj,
aPt,
aIntegerNextTileX,
aIntegerNextTileY,
@@ -1038,7 +1038,7 @@ namespace vclcanvas
aVDev.SetClipRegion( aPolyClipRegion );
textureFill( aVDev,
- *pGrfObj,
+ rGrfObj,
aOutPos,
aIntegerNextTileX,
aIntegerNextTileY,
@@ -1075,7 +1075,7 @@ namespace vclcanvas
rOutDev.SetClipRegion( aPolyClipRegion );
textureFill( rOutDev,
- *pGrfObj,
+ rGrfObj,
aPt,
aIntegerNextTileX,
aIntegerNextTileY,
@@ -1092,7 +1092,7 @@ namespace vclcanvas
r2ndOutDev.SetClipRegion( aPolyClipRegion );
textureFill( r2ndOutDev,
- *pGrfObj,
+ rGrfObj,
aPt,
aIntegerNextTileX,
aIntegerNextTileY,
diff --git a/canvas/source/vcl/repainttarget.hxx b/canvas/source/vcl/repainttarget.hxx
index 84363da..89a4952 100644
--- a/canvas/source/vcl/repainttarget.hxx
+++ b/canvas/source/vcl/repainttarget.hxx
@@ -43,7 +43,7 @@ namespace vclcanvas
virtual ~RepaintTarget() {}
// call this when a bitmap is repainted
- virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
+ virtual bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index c18a7f9..b0ea725 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -154,7 +154,7 @@ namespace vclcanvas
return OUString( SPRITECANVAS_SERVICE_NAME );
}
- bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf,
+ bool SpriteCanvas::repaint( const rtl::Reference<GraphicObject>& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx
index 5ca1f77..83c9654 100644
--- a/canvas/source/vcl/spritecanvas.hxx
+++ b/canvas/source/vcl/spritecanvas.hxx
@@ -135,7 +135,7 @@ namespace vclcanvas
virtual OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException);
// RepaintTarget
- virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
+ virtual bool repaint( const rtl::Reference<GraphicObject>& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
index 4eb6f0b..0c9a83f 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx
@@ -334,9 +334,9 @@ OUString WrappedSymbolBitmapURLProperty::getValueFromSeries( const Reference< be
if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Symbol") >>= aSymbol )
&& aSymbol.Graphic.is())
{
- GraphicObject aGrObj( Graphic( aSymbol.Graphic ));
+ rtl::Reference<GraphicObject> rGrObj = GraphicObject::Create( Graphic( aSymbol.Graphic ));
aRet = UNO_NAME_GRAPHOBJ_URLPREFIX +
- OStringToOUString(aGrObj.GetUniqueID(),
+ OStringToOUString(rGrObj->GetUniqueID(),
RTL_TEXTENCODING_ASCII_US);
}
return aRet;
@@ -355,9 +355,9 @@ void WrappedSymbolBitmapURLProperty::setValueToSeries(
bool bMatchesPrefix = aNewGraphicURL.match( UNO_NAME_GRAPHOBJ_URLPREFIX );
if( bMatchesPrefix )
{
- GraphicObject aGrObj = GraphicObject(
+ rtl::Reference<GraphicObject> rGrObj = GraphicObject::Create(
OUStringToOString(aNewGraphicURL.copy( RTL_CONSTASCII_LENGTH(UNO_NAME_GRAPHOBJ_URLPREFIX) ), RTL_TEXTENCODING_ASCII_US));
- aSymbol.Graphic.set( aGrObj.GetGraphic().GetXGraphic());
+ aSymbol.Graphic.set( rGrObj->GetGraphic().GetXGraphic());
xSeriesPropertySet->setPropertyValue( "Symbol", uno::makeAny( aSymbol ) );
}
else
diff --git a/chart2/source/model/main/ChartModel.hxx b/chart2/source/model/main/ChartModel.hxx
index 480efe8..84273b9 100644
--- a/chart2/source/model/main/ChartModel.hxx
+++ b/chart2/source/model/main/ChartModel.hxx
@@ -137,7 +137,7 @@ private:
::com::sun::star::awt::Size m_aVisualAreaSize;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xParent;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XRangeHighlighter > m_xRangeHighlighter;
- ::std::vector< GraphicObject > m_aGraphicObjectVector;
+ ::std::vector< rtl::Reference<GraphicObject> > m_aGraphicObjectVector;
::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > m_xDataProvider;
/** is only valid if m_xDataProvider is set. If m_xDataProvider is set to an
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index b8e37ef..a3779c5 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -635,7 +635,7 @@ void ChartModel::impl_loadGraphics(
*apIStm.get(),
aGraphic ) )
{
- m_aGraphicObjectVector.push_back( aGraphic );
+ m_aGraphicObjectVector.push_back( GraphicObject::Create(aGraphic) );
}
}
}
diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx
index 3b97b21..7270c20 100644
--- a/cui/source/options/optmemory.cxx
+++ b/cui/source/options/optmemory.cxx
@@ -182,7 +182,6 @@ sal_Bool OfaMemoryOptionsPage::FillItemSet( SfxItemSet& rSet )
objectReleaseTime, batch);
// create a dummy graphic object to get access to the common GraphicManager
- GraphicObject aDummyObject;
GraphicManager* rGrfMgr = GraphicManager::GetGlobalManager();
rGrfMgr->SetMaxCacheSize(totalCacheSize);
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index aad927e..2c97482 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1849,8 +1849,8 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
}
else
{
- const String* pStrLink = rBgdAttr.GetGraphicLink();
- const String* pStrFilter = rBgdAttr.GetGraphicFilter();
+ const OUString* pStrLink = rBgdAttr.GetGraphicLink();
+ const OUString* pStrFilter = rBgdAttr.GetGraphicFilter();
lcl_setFillStyle(m_pLbSelect, XFILL_BITMAP);
ShowBitmapUI_Impl();
@@ -1874,11 +1874,15 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
if(bGraphTransparency)
{
- const GraphicObject* pObject = rBgdAttr.GetGraphicObject();
- if(pObject)
- m_pGraphTransMF->SetValue(lcl_TransparencyToPercent(pObject->GetAttr().GetTransparency()));
+ const rtl::Reference<GraphicObject> rObject = rBgdAttr.GetGraphicObject();
+ if(rObject.is())
+ {
+ m_pGraphTransMF->SetValue(lcl_TransparencyToPercent(rObject->GetAttr().GetTransparency()));
+ }
else
+ {
m_pGraphTransMF->SetValue(0);
+ }
m_pGraphTransMF->SaveValue();
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 160af95..50ee846 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -65,7 +65,7 @@ SvxBitmapTabPage::SvxBitmapTabPage( Window* pParent, const SfxItemSet& rInAttrs
pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
aXFStyleItem ( XFILL_BITMAP ),
- aXBitmapItem ( String(), Graphic() ),
+ aXBitmapItem ( OUString(), GraphicObject::Create() ),
aXFillAttr ( pXPool ),
rXFSet ( aXFillAttr.GetItemSet() )
{
@@ -235,7 +235,7 @@ sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos);
- const String aString(m_pLbBitmaps->GetSelectEntry());
+ const OUString aString(m_pLbBitmaps->GetSelectEntry());
_rOutAttrs.Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
}
@@ -243,7 +243,7 @@ sal_Bool SvxBitmapTabPage::FillItemSet( SfxItemSet& _rOutAttrs )
{
const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx());
- _rOutAttrs.Put(XFillBitmapItem(String(), Graphic(aBitmapEx)));
+ _rOutAttrs.Put(XFillBitmapItem(OUString(), GraphicObject::Create(Graphic(aBitmapEx))));
}
}
}
@@ -263,7 +263,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet& )
m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() );
// get bitmap and display it
- const XFillBitmapItem aBmpItem(OUString(), Graphic(m_pBitmapCtl->GetBitmapEx()));
+ const XFillBitmapItem aBmpItem(OUString(), GraphicObject::Create(Graphic(m_pBitmapCtl->GetBitmapEx())));
rXFSet.Put( aBmpItem );
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
@@ -298,12 +298,12 @@ SfxTabPage* SvxBitmapTabPage::Create( Window* pWindow,
IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl)
{
- GraphicObject* pGraphicObject = 0;
+ rtl::Reference<GraphicObject> rGraphicObject;
int nPos(m_pLbBitmaps->GetSelectEntryPos());
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
- pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
+ rGraphicObject = GraphicObject::Create(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
}
else
{
@@ -315,27 +315,27 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl)
if((XFILL_BITMAP == eXFS) && (SFX_ITEM_SET == rOutAttrs.GetItemState(GetWhich(XATTR_FILLBITMAP), true, &pPoolItem)))
{
- pGraphicObject = new GraphicObject(((const XFillBitmapItem*)pPoolItem)->GetGraphicObject());
+ rGraphicObject = GraphicObject::Create(((const XFillBitmapItem*)pPoolItem)->GetGraphicObject());
}
}
- if(!pGraphicObject)
+ if(!rGraphicObject.is())
{
m_pLbBitmaps->SelectEntryPos(0);
nPos = m_pLbBitmaps->GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
- pGraphicObject = new GraphicObject(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
+ rGraphicObject = GraphicObject::Create(pBitmapList->GetBitmap(nPos)->GetGraphicObject());
}
}
}
- if(pGraphicObject)
+ if(rGraphicObject.is())
{
BitmapColor aBack;
BitmapColor aFront;
- bool bIs8x8(isHistorical8x8(pGraphicObject->GetGraphic().GetBitmap(), aBack, aFront));
+ bool bIs8x8(isHistorical8x8(rGraphicObject->GetGraphic().GetBitmap(), aBack, aFront));
m_pLbColor->SetNoSelection();
m_pLbBackgroundColor->SetNoSelection();
@@ -349,7 +349,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl)
// setting the pixel control
- m_pCtlPixel->SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
+ m_pCtlPixel->SetXBitmap(rGraphicObject->GetGraphic().GetBitmapEx());
Color aPixelColor = aFront;
Color aBackColor = aBack;
@@ -390,14 +390,13 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBitmapHdl_Impl)
m_pCtlPixel->Invalidate();
// display bitmap
- const XFillBitmapItem aXBmpItem(String(), *pGraphicObject);
+ const XFillBitmapItem aXBmpItem(OUString(), rGraphicObject);
rXFSet.Put( aXBmpItem );
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
bBmpChanged = sal_False;
- delete pGraphicObject;
}
return 0;
@@ -520,7 +519,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
{
const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx());
- pEntry = new XBitmapEntry(Graphic(aBitmapEx), aName);
+ pEntry = new XBitmapEntry(GraphicObject::Create(Graphic(aBitmapEx)), aName);
}
else // it must be a not existing imported bitmap
{
@@ -627,7 +626,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
if( !nError )
{
- XBitmapEntry* pEntry = new XBitmapEntry( aGraphic, aName );
+ XBitmapEntry* pEntry = new XBitmapEntry( GraphicObject::Create(aGraphic), aName );
pBitmapList->Insert( pEntry );
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
@@ -689,7 +688,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
bLoop = sal_False;
const BitmapEx aBitmapEx(m_pBitmapCtl->GetBitmapEx());
- const XBitmapEntry aEntry(Graphic(aBitmapEx), aName);
+ const XBitmapEntry aEntry(GraphicObject::Create(Graphic(aBitmapEx)), aName);
m_pLbBitmaps->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), aEntry, nPos );
m_pLbBitmaps->SelectEntryPos( nPos );
@@ -849,7 +848,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl)
INetURLObject aFile( SvtPathOptions().GetPalettePath() );
DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- if( pBitmapList->GetName().Len() )
+ if( !pBitmapList->GetName().isEmpty() )
{
aFile.Append( pBitmapList->GetName() );
@@ -907,7 +906,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangePixelColorHdl_Impl)
m_pBitmapCtl->SetPixelColor( m_pLbColor->GetSelectEntryColor() );
// get bitmap and display it
- rXFSet.Put(XFillBitmapItem(String(), Graphic(m_pBitmapCtl->GetBitmapEx())));
+ rXFSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(Graphic(m_pBitmapCtl->GetBitmapEx()))));
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
@@ -926,7 +925,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ChangeBackgrndColorHdl_Impl)
m_pBitmapCtl->SetBackgroundColor( m_pLbBackgroundColor->GetSelectEntryColor() );
// get bitmap and display it
- rXFSet.Put(XFillBitmapItem(String(), Graphic(m_pBitmapCtl->GetBitmapEx())));
+ rXFSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(Graphic(m_pBitmapCtl->GetBitmapEx()))));
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
@@ -944,7 +943,7 @@ void SvxBitmapTabPage::PointChanged( Window* pWindow, RECT_POINT )
m_pBitmapCtl->SetBmpArray( m_pCtlPixel->GetBitmapPixelPtr() );
// get bitmap and display it
- rXFSet.Put(XFillBitmapItem(String(), Graphic(m_pBitmapCtl->GetBitmapEx())));
+ rXFSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(Graphic(m_pBitmapCtl->GetBitmapEx()))));
m_pCtlPreview->SetAttributes( aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index f14ab76..9f0e5f1 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -214,7 +214,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl)
XPropertyListRef pList = GetList();
- if( pList->GetName().Len() )
+ if( !pList->GetName().isEmpty() )
{
aFile.Append( pList->GetName() );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index e84c892..674254f 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -718,7 +718,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl)
INetURLObject aFile( SvtPathOptions().GetPalettePath() );
DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- if( pGradientList->GetName().Len() )
+ if( !pGradientList->GetName().isEmpty() )
{
aFile.Append( pGradientList->GetName() );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 95b64f5..9d30982 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -752,7 +752,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl)
INetURLObject aFile( SvtPathOptions().GetPalettePath() );
DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- if( pHatchingList->GetName().Len() )
+ if( !pHatchingList->GetName().isEmpty() )
{
aFile.Append( pHatchingList->GetName() );
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 46ded4b..a4264f2 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -824,7 +824,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl)
INetURLObject aFile( SvtPathOptions().GetPalettePath() );
DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- if( pDashList->GetName().Len() )
+ if( !pDashList->GetName().isEmpty() )
{
aFile.Append( pDashList->GetName() );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 6756aec..1f4774e 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -617,7 +617,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl)
INetURLObject aFile( SvtPathOptions().GetPalettePath() );
DBG_ASSERT( aFile.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- if( pLineEndList->GetName().Len() )
+ if( !pLineEndList->GetName().isEmpty() )
{
aFile.Append( pLineEndList->GetName() );
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 79a0aff..9e4cb34 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1351,15 +1351,19 @@ void OPreviewWindow::Paint( const Rectangle& rRect )
{
Window::Paint( rRect );
- if( ImplGetGraphicCenterRect( m_aGraphicObj.GetGraphic(), m_aPreviewRect ) )
+ if( ImplGetGraphicCenterRect( m_rGraphicObj->GetGraphic(), m_aPreviewRect ) )
{
const Point aPos( m_aPreviewRect.TopLeft() );
const Size aSize( m_aPreviewRect.GetSize() );
- if( m_aGraphicObj.IsAnimated() )
- m_aGraphicObj.StartAnimation( this, aPos, aSize );
+ if( m_rGraphicObj->IsAnimated() )
+ {
+ m_rGraphicObj->StartAnimation( this, aPos, aSize );
+ }
else
- m_aGraphicObj.Draw( this, aPos, aSize );
+ {
+ m_rGraphicObj->Draw( this, aPos, aSize );
+ }
}
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index 82cb7ce..348676d 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -49,7 +49,7 @@ namespace dbaui
class OPreviewWindow : public Window
{
- GraphicObject m_aGraphicObj;
+ rtl::Reference<GraphicObject> m_rGraphicObj;
Rectangle m_aPreviewRect;
/** gets the graphic cnter rect
@@ -71,7 +71,7 @@ namespace dbaui
// window overloads
virtual void Paint(const Rectangle& rRect);
- void setGraphic(const Graphic& _rGraphic ) { m_aGraphicObj.SetGraphic(_rGraphic); }
+ void setGraphic(const Graphic& _rGraphic ) { m_rGraphicObj = GraphicObject::Create(m_rGraphicObj, _rGraphic); }
};
//==================================================================
// A helper class for the controls in the detail page.
@@ -90,12 +90,9 @@ namespace dbaui
Window* m_pTablePreview;
::std::auto_ptr<PopupMenu> m_aMenu;
PreviewMode m_ePreviewMode;
- ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame2 >
- m_xFrame;
- ::com::sun::star::uno::Reference < ::com::sun::star::io::XPersist >
- m_xDocInfo;
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >
- m_xWindow;
+ ::css::uno::Reference < ::com::sun::star::frame::XFrame2 > m_xFrame;
+ ::css::uno::Reference < ::com::sun::star::io::XPersist > m_xDocInfo;
+ ::css::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
/// returns the index of the visible control
int getVisibleControlIndex() const;
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index df69a36..349d2d7 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -71,8 +71,8 @@ namespace drawinglayer
aSuppressGraphicAttr.SetRotation(0);
aSuppressGraphicAttr.SetMirrorFlags(0);
- const GraphicObject& rGraphicObject = getGraphicObject();
- const Graphic aTransformedGraphic(rGraphicObject.GetTransformedGraphic(&aSuppressGraphicAttr));
+ const rtl::Reference<GraphicObject>& rGraphicObject = getGraphicObject();
+ const Graphic aTransformedGraphic(rGraphicObject->GetTransformedGraphic(&aSuppressGraphicAttr));
aRetval = create2DDecompositionOfGraphic(
aTransformedGraphic,
@@ -87,7 +87,7 @@ namespace drawinglayer
// is necessary since the crop values are relative to original bitmap size
const basegfx::B2DVector aObjectScale(aTransform * basegfx::B2DVector(1.0, 1.0));
const basegfx::B2DVector aCropScaleFactor(
- rGraphicObject.calculateCropScaling(
+ rGraphicObject->calculateCropScaling(
aObjectScale.getX(),
aObjectScale.getY(),
getGraphicAttr().GetLeftCrop(),
@@ -115,7 +115,7 @@ namespace drawinglayer
GraphicPrimitive2D::GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject,
+ const rtl::Reference<GraphicObject>& rGraphicObject,
const GraphicAttr& rGraphicAttr)
: BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
@@ -126,7 +126,7 @@ namespace drawinglayer
GraphicPrimitive2D::GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject)
+ const rtl::Reference<GraphicObject>& rGraphicObject)
: BufferedDecompositionPrimitive2D(),
maTransform(rTransform),
maGraphicObject(rGraphicObject),
diff --git a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
index 7720353..1aeff83 100644
--- a/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/mediaprimitive2d.cxx
@@ -49,7 +49,7 @@ namespace drawinglayer
if(GRAPHIC_BITMAP == maSnapshot.GetType() || GRAPHIC_GDIMETAFILE == maSnapshot.GetType())
{
- const GraphicObject aGraphicObject(maSnapshot);
+ const rtl::Reference<GraphicObject> aGraphicObject = GraphicObject::Create(maSnapshot);
const GraphicAttr aGraphicAttr;
xRetval.realloc(2);
xRetval[0] = xRefBackground;
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index c9f4af1..9ed958f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -789,7 +789,7 @@ namespace drawinglayer
{
// emulate data handling from UnoControlPDFExportContact, original see
// svtools/source/graphic/grfmgr.cxx
- const Graphic& rGraphic = rGraphicPrimitive.getGraphicObject().GetGraphic();
+ const Graphic& rGraphic = rGraphicPrimitive.getGraphicObject()->GetGraphic();
if(rGraphic.IsLink())
{
@@ -836,8 +836,8 @@ namespace drawinglayer
{
const MapMode aMapMode100thmm(MAP_100TH_MM);
const Size aBitmapSize(Application::GetDefaultDevice()->LogicToLogic(
- rGraphicPrimitive.getGraphicObject().GetPrefSize(),
- rGraphicPrimitive.getGraphicObject().GetPrefMapMode(), aMapMode100thmm));
+ rGraphicPrimitive.getGraphicObject()->GetPrefSize(),
+ rGraphicPrimitive.getGraphicObject()->GetPrefMapMode(), aMapMode100thmm));
const double fDivX(aBitmapSize.Width() - rAttr.GetLeftCrop() - rAttr.GetRightCrop());
const double fDivY(aBitmapSize.Height() - rAttr.GetTopCrop() - rAttr.GetBottomCrop());
@@ -862,7 +862,7 @@ namespace drawinglayer
sal_Int32(ceil(aCropRange.getMaxX())), sal_Int32(ceil(aCropRange.getMaxY())));
}
- mpPDFExtOutDevData->EndGroup(rGraphicPrimitive.getGraphicObject().GetGraphic(),
+ mpPDFExtOutDevData->EndGroup(rGraphicPrimitive.getGraphicObject()->GetGraphic(),
rAttr.GetTransparency(),
aCurrentRect,
aCropRect);
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index e76869e..a7deb33 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -113,7 +113,7 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich )
SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
- pGraphicObject( NULL )
+ m_rGraphicObject(NULL)
{
rStrm >> nStyle;
@@ -140,7 +140,9 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
nStyle = BS_NONE;
}
else
- pGraphicObject = new GraphicObject( aBmp );
+ {
+ m_rGraphicObject = GraphicObject::Create( aBmp );
+ }
}
//#fdo39428 SvStream no longer supports operator>>(long&)
@@ -170,7 +172,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
{
aFont = rItem.aFont;
- pGraphicObject = ( rItem.pGraphicObject ? new GraphicObject( *rItem.pGraphicObject ) : NULL );
+ m_rGraphicObject = GraphicObject::Create( rItem.m_rGraphicObject);
aPrevText = rItem.aPrevText;
aFollowText = rItem.aFollowText;
nStart = rItem.nStart;
@@ -186,8 +188,6 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
SvxBulletItem::~SvxBulletItem()
{
- if( pGraphicObject )
- delete pGraphicObject;
}
// -----------------------------------------------------------------------
@@ -217,7 +217,7 @@ void SvxBulletItem::SetDefaultFont_Impl()
void SvxBulletItem::SetDefaults_Impl()
{
- pGraphicObject = NULL;
+ m_rGraphicObject = rtl::Reference<GraphicObject>();
nWidth = 1200; // 1.2cm
nStart = 1;
nStyle = BS_123;
@@ -290,12 +290,12 @@ int SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
if( nStyle == BS_BMP )
{
- if( ( pGraphicObject && !rBullet.pGraphicObject ) || ( !pGraphicObject && rBullet.pGraphicObject ) )
+ if( ( m_rGraphicObject.is() && !rBullet.m_rGraphicObject.is() ) || ( !m_rGraphicObject.is() && rBullet.m_rGraphicObject.is() ) )
return 0;
- if( ( pGraphicObject && rBullet.pGraphicObject ) &&
- ( ( *pGraphicObject != *rBullet.pGraphicObject ) ||
- ( pGraphicObject->GetPrefSize() != rBullet.pGraphicObject->GetPrefSize() ) ) )
+ if( ( m_rGraphicObject.is() && rBullet.m_rGraphicObject.is() ) &&
+ ( ( *(m_rGraphicObject.get()) != *(rBullet.m_rGraphicObject.get() ) ||
+ ( m_rGraphicObject->GetPrefSize() != rBullet.m_rGraphicObject->GetPrefSize() ) ) ))
{
return 0;
}
@@ -310,28 +310,25 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c
{
// Correction for empty bitmap
if( ( nStyle == BS_BMP ) &&
- ( !pGraphicObject || ( GRAPHIC_NONE == pGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == pGraphicObject->GetType() ) ) )
+ ( !m_rGraphicObject.is() || ( GRAPHIC_NONE == m_rGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == m_rGraphicObject->GetType() ) ) )
{
- if( pGraphicObject )
- {
- delete( const_cast< SvxBulletItem* >( this )->pGraphicObject );
- const_cast< SvxBulletItem* >( this )->pGraphicObject = NULL;
- }
-
+ const_cast< SvxBulletItem* >( this )->m_rGraphicObject = rtl::Reference<GraphicObject>();
const_cast< SvxBulletItem* >( this )->nStyle = BS_NONE;
}
rStrm << nStyle;
if( nStyle != BS_BMP )
+ {
StoreFont( rStrm, aFont );
+ }
else
{
sal_uLong _nStart = rStrm.Tell();
// Small preliminary estimate of the size ...
sal_uInt16 nFac = ( rStrm.GetCompressMode() != COMPRESSMODE_NONE ) ? 3 : 1;
- const Bitmap aBmp( pGraphicObject->GetGraphic().GetBitmap() );
+ const Bitmap aBmp( m_rGraphicObject->GetGraphic().GetBitmap() );
sal_uLong nBytes = aBmp.GetSizeBytes();
if ( nBytes < sal_uLong(0xFF00*nFac) )
{
@@ -406,33 +403,22 @@ SfxItemPresentation SvxBulletItem::GetPresentation
//------------------------------------------------------------------------
-const GraphicObject& SvxBulletItem::GetGraphicObject() const
+const rtl::Reference<GraphicObject> SvxBulletItem::GetGraphicObject() const
{
- if( pGraphicObject )
- return *pGraphicObject;
- else
- {
- static const GraphicObject aDefaultObject;
- return aDefaultObject;
- }
+ return m_rGraphicObject;
}
//------------------------------------------------------------------------
-void SvxBulletItem::SetGraphicObject( const GraphicObject& rGraphicObject )
+void SvxBulletItem::SetGraphicObject( const rtl::Reference<GraphicObject>& rGraphicObject )
{
- if( ( GRAPHIC_NONE == rGraphicObject.GetType() ) || ( GRAPHIC_DEFAULT == rGraphicObject.GetType() ) )
+ if( ( GRAPHIC_NONE == rGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == rGraphicObject->GetType() ) )
{
- if( pGraphicObject )
- {
- delete pGraphicObject;
- pGraphicObject = NULL;
- }
+ m_rGraphicObject = rtl::Reference<GraphicObject>();
}
else
{
- delete pGraphicObject;
- pGraphicObject = new GraphicObject( rGraphicObject );
+ m_rGraphicObject = GraphicObject::Create( rGraphicObject );
}
}
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 44606be..fab8617 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3302,13 +3302,13 @@ void SvxLineItem::SetLine( const SvxBorderLine* pNew )
class SvxBrushItem_Impl
{
public:
- GraphicObject* pGraphicObject;
+ rtl::Reference<GraphicObject> rGraphicObject;
sal_Int8 nGraphicTransparency; //contains a percentage value which is
//copied to the GraphicObject when necessary
Link aDoneLink;
SvStream* pStream;
- SvxBrushItem_Impl( GraphicObject* p ) : pGraphicObject( p ), nGraphicTransparency(0), pStream(0) {}
+ SvxBrushItem_Impl( rtl::Reference<GraphicObject> r ) : rGraphicObject( r ), nGraphicTransparency(0), pStream(0) {}
};
// -----------------------------------------------------------------------
@@ -3361,7 +3361,7 @@ SvxBrushItem::SvxBrushItem( const Graphic& rGraphic, SvxGraphicPosition ePos,
aColor ( COL_TRANSPARENT ),
nShadingValue ( ShadingPattern::CLEAR ),
- pImpl ( new SvxBrushItem_Impl( new GraphicObject( rGraphic ) ) ),
+ pImpl ( new SvxBrushItem_Impl( GraphicObject::Create( rGraphic ) ) ),
pStrLink ( NULL ),
pStrFilter ( NULL ),
eGraphicPos ( ( GPOS_NONE != ePos ) ? ePos : GPOS_MM ),
@@ -3373,14 +3373,14 @@ SvxBrushItem::SvxBrushItem( const Graphic& rGraphic, SvxGraphicPosition ePos,
// -----------------------------------------------------------------------
-SvxBrushItem::SvxBrushItem( const GraphicObject& rGraphicObj,
+SvxBrushItem::SvxBrushItem( const rtl::Reference<GraphicObject>& rGraphicObj,
SvxGraphicPosition ePos, sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
aColor ( COL_TRANSPARENT ),
nShadingValue ( ShadingPattern::CLEAR ),
- pImpl ( new SvxBrushItem_Impl( new GraphicObject( rGraphicObj ) ) ),
+ pImpl ( new SvxBrushItem_Impl( GraphicObject::Create( rGraphicObj ) ) ),
pStrLink ( NULL ),
pStrFilter ( NULL ),
eGraphicPos ( ( GPOS_NONE != ePos ) ? ePos : GPOS_MM ),
@@ -3392,17 +3392,16 @@ SvxBrushItem::SvxBrushItem( const GraphicObject& rGraphicObj,
// -----------------------------------------------------------------------
-SvxBrushItem::SvxBrushItem(
- const String& rLink, const String& rFilter,
- SvxGraphicPosition ePos, sal_uInt16 _nWhich ) :
+SvxBrushItem::SvxBrushItem( const OUString& rLink, const OUString& rFilter,
+ SvxGraphicPosition ePos, sal_uInt16 _nWhich ) :
SfxPoolItem( _nWhich ),
aColor ( COL_TRANSPARENT ),
nShadingValue ( ShadingPattern::CLEAR ),
pImpl ( new SvxBrushItem_Impl( NULL ) ),
- pStrLink ( new String( rLink ) ),
- pStrFilter ( new String( rFilter ) ),
+ pStrLink ( new OUString( rLink ) ),
+ pStrFilter ( new OUString( rFilter ) ),
eGraphicPos ( ( GPOS_NONE != ePos ) ? ePos : GPOS_MM ),
bLoadAgain ( sal_True )
@@ -3493,7 +3492,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
Graphic aGraphic;
rStream >> aGraphic;
- pImpl->pGraphicObject = new GraphicObject( aGraphic );
+ pImpl->rGraphicObject = GraphicObject::Create( aGraphic );
if( SVSTREAM_FILEFORMAT_ERROR == rStream.GetError() )
{
@@ -3506,18 +3505,18 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
if ( nDoLoad & LOAD_LINK )
{
// UNICODE: rStream >> aRel;
- String aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
+ OUString aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
// TODO/MBA: how can we get a BaseURL here?!
OSL_FAIL("No BaseURL!");
- String aAbs = INetURLObject::GetAbsURL( String(), aRel );
- DBG_ASSERT( aAbs.Len(), "Invalid URL!" );
- pStrLink = new String( aAbs );
+ OUString aAbs = INetURLObject::GetAbsURL( String(), aRel );
+ DBG_ASSERT( !aAbs.isEmpty(), "Invalid URL!" );
+ pStrLink = new OUString( aAbs );
}
if ( nDoLoad & LOAD_FILTER )
{
- pStrFilter = new String;
+ pStrFilter = new OUString;
// UNICODE: rStream >> *pStrFilter;
*pStrFilter = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
}
@@ -3548,7 +3547,6 @@ SvxBrushItem::SvxBrushItem( const SvxBrushItem& rItem ) :
SvxBrushItem::~SvxBrushItem()
{
- delete pImpl->pGraphicObject;
delete pImpl;
delete pStrLink;
delete pStrFilter;
@@ -3603,12 +3601,12 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
OUString sLink;
if ( pStrLink )
sLink = *pStrLink;
- else if( pImpl->pGraphicObject )
+ else if( pImpl->rGraphicObject.is() )
{
OUString sPrefix(
UNO_NAME_GRAPHOBJ_URLPREFIX);
OUString sId(OStringToOUString(
- pImpl->pGraphicObject->GetUniqueID(),
+ pImpl->rGraphicObject->GetUniqueID(),
RTL_TEXTENCODING_ASCII_US));
sLink = sPrefix + sId;
}
@@ -3704,14 +3702,12 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
else if( sLink.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
{
DELETEZ( pStrLink );
- String sTmp( sLink );
- OString sId(OUStringToOString(sTmp.Copy(
+ OString sId(OUStringToOString(sLink.copy(
sizeof(UNO_NAME_GRAPHOBJ_URLPREFIX)-1),
RTL_TEXTENCODING_ASCII_US));
- GraphicObject *pOldGrfObj = pImpl->pGraphicObject;
- pImpl->pGraphicObject = new GraphicObject( sId );
+ rtl::Reference<GraphicObject> rOldGrfObj = pImpl->rGraphicObject;
+ pImpl->rGraphicObject = GraphicObject::Create( sId );
ApplyGraphicTransparency_Impl();
- delete pOldGrfObj;
}
else
{
@@ -3742,7 +3738,7 @@ bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
if(nTmp >= 0 && nTmp <= 100)
{
pImpl->nGraphicTransparency = sal_Int8(nTmp);
- if(pImpl->pGraphicObject)
+ if(pImpl->rGraphicObject.is())
ApplyGraphicTransparency_Impl();
}
}
@@ -3810,21 +3806,28 @@ SvxBrushItem& SvxBrushItem::operator=( const SvxBrushItem& rItem )
aColor = rItem.aColor;
eGraphicPos = rItem.eGraphicPos;
- DELETEZ( pImpl->pGraphicObject );
DELETEZ( pStrLink );
DELETEZ( pStrFilter );
if ( GPOS_NONE != eGraphicPos )
{
if ( rItem.pStrLink )
- pStrLink = new String( *rItem.pStrLink );
+ {
+ pStrLink = new OUString( *rItem.pStrLink );
+ }
if ( rItem.pStrFilter )
- pStrFilter = new String( *rItem.pStrFilter );
- if ( rItem.pImpl->pGraphicObject )
{
- pImpl->pGraphicObject = new GraphicObject( *rItem.pImpl->pGraphicObject );
+ pStrFilter = new OUString( *rItem.pStrFilter );
+ }
+ if ( rItem.pImpl->rGraphicObject.is() )
+ {
+ pImpl->rGraphicObject = GraphicObject::Create( rItem.pImpl->rGraphicObject );
}
}
+ else
+ {
+ pImpl->rGraphicObject = rtl::Reference<GraphicObject>();
+ }
nShadingValue = rItem.nShadingValue;
@@ -3861,11 +3864,15 @@ int SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
if ( bEqual && !rCmp.pStrLink )
{
- if ( !rCmp.pImpl->pGraphicObject )
- bEqual = !pImpl->pGraphicObject;
+ if ( !rCmp.pImpl->rGraphicObject.is() )
+ {
+ bEqual = !pImpl->rGraphicObject.is();
+ }
else
- bEqual = pImpl->pGraphicObject &&
- ( *pImpl->pGraphicObject == *rCmp.pImpl->pGraphicObject );
+ {
+ bEqual = pImpl->rGraphicObject.is() &&
+ ( *(pImpl->rGraphicObject.get()) == *(rCmp.pImpl->rGraphicObject.get()) );
+ }
}
}
@@ -3903,21 +3910,29 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
sal_uInt16 nDoLoad = 0;
- if ( pImpl->pGraphicObject && !pStrLink )
+ if ( pImpl->rGraphicObject.is() && !pStrLink )
+ {
nDoLoad |= LOAD_GRAPHIC;
+ }
if ( pStrLink )
+ {
nDoLoad |= LOAD_LINK;
+ }
if ( pStrFilter )
+ {
nDoLoad |= LOAD_FILTER;
+ }
rStream << nDoLoad;
- if ( pImpl->pGraphicObject && !pStrLink )
- rStream << pImpl->pGraphicObject->GetGraphic();
+ if ( pImpl->rGraphicObject.is() && !pStrLink )
+ {
+ rStream << pImpl->rGraphicObject->GetGraphic();
+ }
if ( pStrLink )
{
OSL_FAIL("No BaseURL!");
// TODO/MBA: how to get a BaseURL?!
- String aRel = INetURLObject::GetRelURL( String(), *pStrLink );
+ OUString aRel = INetURLObject::GetRelURL( OUString(), *pStrLink );
// UNICODE: rStream << aRel;
rStream.WriteUniOrByteString(aRel, rStream.GetStreamCharSet());
}
@@ -3938,13 +3953,13 @@ void SvxBrushItem::PurgeMedium() const
}
// -----------------------------------------------------------------------
-const GraphicObject* SvxBrushItem::GetGraphicObject() const
+const rtl::Reference<GraphicObject> SvxBrushItem::GetGraphicObject() const
{
- if ( bLoadAgain && pStrLink && !pImpl->pGraphicObject )
+ if ( bLoadAgain && pStrLink && !pImpl->rGraphicObject.is() )
// when graphics already loaded, use as a cache
{
// only with "valid" names - empty names now allowed
- if( pStrLink->Len() )
+ if( !pStrLink->isEmpty() )
{
pImpl->pStream = utl::UcbStreamHelper::CreateStream( *pStrLink, STREAM_STD_READ );
if( pImpl->pStream && !pImpl->pStream->GetError() )
@@ -3962,8 +3977,7 @@ const GraphicObject* SvxBrushItem::GetGraphicObject() const
}
else
{
- pImpl->pGraphicObject = new GraphicObject;
- pImpl->pGraphicObject->SetGraphic( aGraphic );
+ pImpl->rGraphicObject = GraphicObject::Create(aGraphic);
const_cast < SvxBrushItem*> (this)->ApplyGraphicTransparency_Impl();
}
}
@@ -3974,15 +3988,15 @@ const GraphicObject* SvxBrushItem::GetGraphicObject() const
}
}
- return pImpl->pGraphicObject;
+ return pImpl->rGraphicObject;
}
// -----------------------------------------------------------------------
const Graphic* SvxBrushItem::GetGraphic() const
{
- const GraphicObject* pGrafObj = GetGraphicObject();
- return( pGrafObj ? &( pGrafObj->GetGraphic() ) : NULL );
+ const rtl::Reference<GraphicObject> rGrafObj = GetGraphicObject();
+ return( rGrafObj.is() ? &( rGrafObj->GetGraphic() ) : NULL );
}
// -----------------------------------------------------------------------
@@ -3993,15 +4007,15 @@ void SvxBrushItem::SetGraphicPos( SvxGraphicPosition eNew )
if ( GPOS_NONE == eGraphicPos )
{
- DELETEZ( pImpl->pGraphicObject );
+ pImpl->rGraphicObject = rtl::Reference<GraphicObject>();
DELETEZ( pStrLink );
DELETEZ( pStrFilter );
}
else
{
- if ( !pImpl->pGraphicObject && !pStrLink )
+ if ( !pImpl->rGraphicObject.is() && !pStrLink )
{
- pImpl->pGraphicObject = new GraphicObject; // Creating a dummy
+ pImpl->rGraphicObject = GraphicObject::Create(); // Creating a dummy
}
}
}
@@ -4012,11 +4026,14 @@ void SvxBrushItem::SetGraphic( const Graphic& rNew )
{
if ( !pStrLink )
{
- if ( pImpl->pGraphicObject )
- pImpl->pGraphicObject->SetGraphic( rNew );
+ if ( pImpl->rGraphicObject.is() )
+ {
+ pImpl->rGraphicObject = GraphicObject::Create(pImpl->rGraphicObject, rNew );
+ }
else
- pImpl->pGraphicObject = new GraphicObject( rNew );
-
+ {
+ pImpl->rGraphicObject = GraphicObject::Create( rNew );
+ }
ApplyGraphicTransparency_Impl();
if ( GPOS_NONE == eGraphicPos )
@@ -4030,14 +4047,11 @@ void SvxBrushItem::SetGraphic( const Graphic& rNew )
// -----------------------------------------------------------------------
-void SvxBrushItem::SetGraphicObject( const GraphicObject& rNewObj )
+void SvxBrushItem::SetGraphicObject( const rtl::Reference<GraphicObject>& rNewObj )
{
if ( !pStrLink )
{
- if ( pImpl->pGraphicObject )
- *pImpl->pGraphicObject = rNewObj;
- else
- pImpl->pGraphicObject = new GraphicObject( rNewObj );
+ pImpl->rGraphicObject = rNewObj;
ApplyGraphicTransparency_Impl();
@@ -4052,33 +4066,36 @@ void SvxBrushItem::SetGraphicObject( const GraphicObject& rNewObj )
// -----------------------------------------------------------------------
-void SvxBrushItem::SetGraphicLink( const String& rNew )
+void SvxBrushItem::SetGraphicLink( const OUString& rNew )
{
- if ( !rNew.Len() )
+ if ( rNew.isEmpty() )
DELETEZ( pStrLink );
else
{
if ( pStrLink )
+ {
*pStrLink = rNew;
+ }
else
- pStrLink = new String( rNew );
-
- DELETEZ( pImpl->pGraphicObject );
+ {
+ pStrLink = new OUString( rNew );
+ }
+ pImpl->rGraphicObject = rtl::Reference<GraphicObject>();
}
}
// -----------------------------------------------------------------------
-void SvxBrushItem::SetGraphicFilter( const String& rNew )
+void SvxBrushItem::SetGraphicFilter( const OUString& rNew )
{
- if ( !rNew.Len() )
+ if ( rNew.isEmpty() )
DELETEZ( pStrFilter );
else
{
if ( pStrFilter )
*pStrFilter = rNew;
else
- pStrFilter = new String( rNew );
+ pStrFilter = new OUString( rNew );
}
}
@@ -4146,20 +4163,20 @@ SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich )
if (!rItem.GetBitmapURL().isEmpty())
{
- pStrLink = new String( rItem.GetBitmapURL() );
+ pStrLink = new OUString( rItem.GetBitmapURL() );
SetGraphicPos( WallpaperStyle2GraphicPos((WallpaperStyle)rItem.GetStyle() ) );
}
}
void SvxBrushItem::ApplyGraphicTransparency_Impl()
{
- DBG_ASSERT(pImpl->pGraphicObject, "no GraphicObject available" );
- if(pImpl->pGraphicObject)
+ DBG_ASSERT(pImpl->rGraphicObject.is(), "no GraphicObject available" );
+ if(pImpl->rGraphicObject.is())
{
- GraphicAttr aAttr(pImpl->pGraphicObject->GetAttr());
+ GraphicAttr aAttr(pImpl->rGraphicObject->GetAttr());
aAttr.SetTransparency(lcl_PercentToTransparency(
pImpl->nGraphicTransparency));
- pImpl->pGraphicObject->SetAttr(aAttr);
+ pImpl->rGraphicObject->SetAttr(aAttr);
}
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 973dd63..efcc461 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -97,16 +97,16 @@ SvxNumberType::~SvxNumberType()
xFormatter = 0;
}
-String SvxNumberType::GetNumStr( sal_uLong nNo ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const
{
const LanguageTag& rLang = Application::GetSettings().GetLanguageTag();
return GetNumStr( nNo, rLang.getLocale() );
}
-String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
{
lcl_getFormatter(xFormatter);
- String aTmpStr;
+ OUString aTmpStr;
if(!xFormatter.is())
return aTmpStr;
@@ -114,32 +114,32 @@ String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
{
switch(nNumType)
{
- case NumberingType::CHAR_SPECIAL:
- case NumberingType::BITMAP:
+ case NumberingType::CHAR_SPECIAL:
+ case NumberingType::BITMAP:
break;
- default:
+ default:
+ // '0' allowed for ARABIC numberings
+ if(NumberingType::ARABIC == nNumType && 0 == nNo )
+ {
+ aTmpStr = "0";
+ }
+ else
+ {
+ Sequence< PropertyValue > aProperties(2);
+ PropertyValue* pValues = aProperties.getArray();
+ pValues[0].Name = OUString("NumberingType");
+ pValues[0].Value <<= nNumType;
+ pValues[1].Name = OUString("Value");
+ pValues[1].Value <<= (sal_Int32)nNo;
+
+ try
+ {
+ aTmpStr = xFormatter->makeNumberingString( aProperties, rLocale );
+ }
+ catch(const Exception&)
{
- // '0' allowed for ARABIC numberings
- if(NumberingType::ARABIC == nNumType && 0 == nNo )
- aTmpStr = '0';
- else
- {
- Sequence< PropertyValue > aProperties(2);
- PropertyValue* pValues = aProperties.getArray();
- pValues[0].Name = OUString("NumberingType");
- pValues[0].Value <<= nNumType;
- pValues[1].Name = OUString("Value");
- pValues[1].Value <<= (sal_Int32)nNo;
-
- try
- {
- aTmpStr = xFormatter->makeNumberingString( aProperties, rLocale );
- }
- catch(const Exception&)
- {
- }
- }
}
+ }
}
}
return aTmpStr;
@@ -196,9 +196,9 @@ SvxNumberFormat::SvxNumberFormat( SvStream &rStream )
rStream >> nCharTextDistance;
- sPrefix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
- sSuffix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
- sCharStyleName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
+ m_sPrefix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
+ m_sSuffix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
+ m_sCharStyleName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
sal_uInt16 hasGraphicBrush = 0;
rStream >> hasGraphicBrush;
@@ -242,7 +242,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
if(pConverter && pBulletFont)
{
cBullet = ConvertFontToSubsFontChar(pConverter, cBullet);
- String sFontName = GetFontToSubsFontName(pConverter);
+ OUString sFontName = GetFontToSubsFontName(pConverter);
pBulletFont->SetName(sFontName);
}
@@ -260,9 +260,9 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
rStream << nCharTextDistance;
rtl_TextEncoding eEnc = osl_getThreadTextEncoding();
- rStream.WriteUniOrByteString(sPrefix, eEnc);
- rStream.WriteUniOrByteString(sSuffix, eEnc);
- rStream.WriteUniOrByteString(sCharStyleName, eEnc);
+ rStream.WriteUniOrByteString(m_sPrefix, eEnc);
+ rStream.WriteUniOrByteString(m_sSuffix, eEnc);
+ rStream.WriteUniOrByteString(m_sCharStyleName, eEnc);
if(pGraphicBrush)
{
rStream << (sal_uInt16)1;
@@ -272,7 +272,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
// are present, so Brush save is forced
if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic())
{
- String aEmpty;
+ OUString aEmpty;
pGraphicBrush->SetGraphicLink(aEmpty);
}
@@ -331,13 +331,13 @@ SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
mnFirstLineIndent = rFormat.mnFirstLineIndent;
mnIndentAt = rFormat.mnIndentAt;
eVertOrient = rFormat.eVertOrient ;
- sPrefix = rFormat.sPrefix ;
- sSuffix = rFormat.sSuffix ;
- aGraphicSize = rFormat.aGraphicSize ;
- nBulletColor = rFormat.nBulletColor ;
+ m_sPrefix = rFormat.m_sPrefix ;
+ m_sSuffix = rFormat.m_sSuffix ;
+ aGraphicSize = rFormat.aGraphicSize ;
+ nBulletColor = rFormat.nBulletColor ;
nBulletRelSize = rFormat.nBulletRelSize;
SetShowSymbol(rFormat.IsShowSymbol());
- sCharStyleName = rFormat.sCharStyleName;
+ m_sCharStyleName = rFormat.m_sCharStyleName;
DELETEZ(pGraphicBrush);
if(rFormat.pGraphicBrush)
{
@@ -367,13 +367,13 @@ sal_Bool SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const
mnFirstLineIndent != rFormat.mnFirstLineIndent ||
mnIndentAt != rFormat.mnIndentAt ||
eVertOrient != rFormat.eVertOrient ||
- sPrefix != rFormat.sPrefix ||
- sSuffix != rFormat.sSuffix ||
- aGraphicSize != rFormat.aGraphicSize ||
- nBulletColor != rFormat.nBulletColor ||
+ m_sPrefix != rFormat.m_sPrefix ||
+ m_sSuffix != rFormat.m_sSuffix ||
+ aGraphicSize != rFormat.aGraphicSize ||
+ nBulletColor != rFormat.nBulletColor ||
nBulletRelSize != rFormat.nBulletRelSize ||
IsShowSymbol() != rFormat.IsShowSymbol() ||
- sCharStyleName != rFormat.sCharStyleName
+ m_sCharStyleName != rFormat.m_sCharStyleName
)
return sal_False;
if (
@@ -420,16 +420,16 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
aGraphicSize.Width() = aGraphicSize.Height() = 0;
}
-void SvxNumberFormat::SetGraphic( const String& rName )
+void SvxNumberFormat::SetGraphic( const OUString& rName )
{
- const String* pName;
+ const OUString* pName;
if( pGraphicBrush &&
0 != (pName = pGraphicBrush->GetGraphicLink())
&& *pName == rName )
return ;
delete pGraphicBrush;
- String sTmp;
+ OUString sTmp;
pGraphicBrush = new SvxBrushItem( rName, sTmp, GPOS_AREA, 0 );
pGraphicBrush->SetDoneLink( STATIC_LINK( this, SvxNumberFormat, GraphicArrived) );
if( eVertOrient == text::VertOrientation::NONE )
@@ -552,7 +552,7 @@ Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* pGraphic)
return aRetSize;
}
-String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
+OUString SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
{
nNo %= 4000; // more can not be displayed
// i, ii, iii, iv, v, vi, vii, vii, viii, ix
@@ -561,7 +561,7 @@ String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
? "MDCLXVI--" // +2 Dummy entries!
: "mdclxvi--"; // +2 Dummy entries!
- String sRet;
+ OUStringBuffer sRet;
sal_uInt16 nMask = 1000;
while( nMask )
{
@@ -572,35 +572,39 @@ String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper )
if( 5 < nZahl )
{
if( nZahl < 9 )
- sRet += sal_Unicode(*(cRomanArr-1));
+ sRet.append(sal_Unicode(*(cRomanArr-1)));
++nDiff;
nZahl -= 5;
}
switch( nZahl )
{
- case 3: { sRet += sal_Unicode(*cRomanArr); }
- case 2: { sRet += sal_Unicode(*cRomanArr); }
- case 1: { sRet += sal_Unicode(*cRomanArr); }
- break;
-
- case 4: {
- sRet += sal_Unicode(*cRomanArr);
- sRet += sal_Unicode(*(cRomanArr-nDiff));
- }
- break;
- case 5: { sRet += sal_Unicode(*(cRomanArr-nDiff)); }
- break;
+ case 3:
+ sRet.append(sal_Unicode(*cRomanArr));
+ // Fall-trough
+ case 2:
+ sRet.append(sal_Unicode(*cRomanArr));
+ // Fall-trough
+ case 1:
+ sRet.append(sal_Unicode(*cRomanArr));
+ break;
+ case 4:
+ sRet.append(sal_Unicode(*cRomanArr));
+ sRet.append(sal_Unicode(*(cRomanArr-nDiff)));
+ break;
+ case 5:
+ sRet.append(sal_Unicode(*(cRomanArr-nDiff)));
+ break;
}
nMask /= 10; // for the next decade
cRomanArr += 2;
}
- return sRet;
+ return sRet.toString();
}
-const String& SvxNumberFormat::GetCharFmtName()const
+OUString SvxNumberFormat::GetCharFmtName()const
{
- return sCharStyleName;
+ return m_sCharStyleName;
}
sal_Int32 SvxNumRule::nRefCount = 0;
@@ -853,9 +857,9 @@ void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt)
}
}
-String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings ) const
+OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings ) const
{
- String aStr;
+ OUStringBuffer aStr;
if( SVX_NO_NUM > rNum.GetLevel() && !( SVX_NO_NUMLEVEL & rNum.GetLevel() ) )
{
const SvxNumberFormat& rMyNFmt = GetLevel( rNum.GetLevel() );
@@ -870,9 +874,13 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings
if( 1 < n )
{
if( i+1 >= n )
+ {
i -= n - 1;
+ }
else
+ {
i = 0;
+ }
}
}
@@ -888,24 +896,28 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings
if( rNum.GetLevelVal()[ i ] )
{
if(SVX_NUM_BITMAP != rNFmt.GetNumberingType())
- aStr += rNFmt.GetNumStr( rNum.GetLevelVal()[ i ], aLocale );
+ aStr.append(rNFmt.GetNumStr( rNum.GetLevelVal()[ i ], aLocale ));
else
bDot = sal_False;
}
else
- aStr += sal_Unicode('0'); // all 0-levels are a 0
+ {
+ aStr.append(sal_Unicode('0')); // all 0-levels are a 0
+ }
if( i != rNum.GetLevel() && bDot)
- aStr += sal_Unicode('.');
+ {
+ aStr.append(sal_Unicode('.'));
+ }
}
}
if( bInclStrings )
{
- aStr.Insert( rMyNFmt.GetPrefix(), 0 );
- aStr += rMyNFmt.GetSuffix();
+ aStr.insert( 0, rMyNFmt.GetPrefix());
+ aStr.append(rMyNFmt.GetSuffix());
}
}
- return aStr;
+ return aStr.toString();
}
// changes linked to embedded bitmaps
@@ -916,17 +928,17 @@ sal_Bool SvxNumRule::UnLinkGraphics()
{
SvxNumberFormat aFmt(GetLevel(i));
const SvxBrushItem* pBrush = aFmt.GetBrush();
- const String* pLinkStr;
+ const OUString* pLinkStr;
const Graphic* pGraphic;
if(SVX_NUM_BITMAP == aFmt.GetNumberingType())
{
if(pBrush &&
0 != (pLinkStr = pBrush->GetGraphicLink()) &&
- pLinkStr->Len() &&
+ !pLinkStr->isEmpty() &&
0 !=(pGraphic = pBrush->GetGraphic()))
{
SvxBrushItem aTempItem(*pBrush);
- aTempItem.SetGraphicLink( String());
+ aTempItem.SetGraphicLink( OUString());
aTempItem.SetGraphic(*pGraphic);
sal_Int16 eOrient = aFmt.GetVertOrient();
aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), &eOrient );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 61e9b74..c25e31e 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1054,7 +1054,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
}
else
{
- if ( pFmt->GetBrush()->GetGraphicObject() )
+ if ( pFmt->GetBrush()->GetGraphicObject().is() )
{
Point aBulletPos;
if ( !bVertical )
@@ -1080,7 +1080,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
// created aDrawBulletHdl, Set/GetDrawBulletHdl.
// created DrawBulletInfo and added handling to sdrtextdecomposition.cxx
DrawBulletInfo aDrawBulletInfo(
- *pFmt->GetBrush()->GetGraphicObject(),
+ pFmt->GetBrush()->GetGraphicObject(),
aBulletPos,
pPara->aBulSize);
@@ -1090,7 +1090,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
else
{
// Remove CAST when KA made the Draw-Method const
- ((GraphicObject*)pFmt->GetBrush()->GetGraphicObject())->Draw( pOutDev, aBulletPos, pPara->aBulSize );
+ pFmt->GetBrush()->GetGraphicObject()->Draw( pOutDev, aBulletPos, pPara->aBulSize );
}
}
}
@@ -1735,7 +1735,7 @@ EBulletInfo Outliner::GetBulletInfo( sal_Int32 nPara )
if( pFmt->GetBulletFont() )
aInfo.aFont = *pFmt->GetBulletFont();
}
- else if ( pFmt->GetBrush()->GetGraphicObject() )
+ else if ( pFmt->GetBrush()->GetGraphicObject().is() )
{
aInfo.aGraphic = pFmt->GetBrush()->GetGraphicObject()->GetGraphic();
}
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 78cb014..a15df44 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -225,12 +225,11 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex( sa
{
const SvxBrushItem* pBrush = rFmt.GetBrush();
- if(pBrush && pBrush->GetGraphicObject())
+ if(pBrush && pBrush->GetGraphicObject().is())
{
- const GraphicObject* pGrafObj = pBrush->GetGraphicObject();
+ const rtl::Reference<GraphicObject> rGrafObj = pBrush->GetGraphicObject();
OUString aURL( UNO_NAME_GRAPHOBJ_URLPREFIX);
- aURL += OStringToOUString(pGrafObj->GetUniqueID(),
- RTL_TEXTENCODING_ASCII_US);
+ aURL += OStringToOUString(rGrafObj->GetUniqueID(), RTL_TEXTENCODING_ASCII_US);
aVal <<= aURL;
const beans::PropertyValue aGraphicProp( OUString("GraphicURL"), -1, aVal, beans::PropertyState_DIRECT_VALUE);
@@ -375,8 +374,8 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope
OUString aURL;
if( aVal >>= aURL )
{
- GraphicObject aGrafObj( GraphicObject::CreateGraphicObjectFromURL( aURL ) );
- SvxBrushItem aBrushItem( aGrafObj, GPOS_AREA, SID_ATTR_BRUSH );
+ rtl::Reference<GraphicObject> rGrafObj = GraphicObject::CreateGraphicObjectFromURL( aURL );
+ SvxBrushItem aBrushItem( rGrafObj, GPOS_AREA, SID_ATTR_BRUSH );
aFmt.SetGraphicBrush( &aBrushItem );
continue;
}
@@ -463,7 +462,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope
{
if( NULL == aFmt.GetBrush() )
{
- GraphicObject aGrafObj;
+ rtl::Reference<GraphicObject> aGrafObj(NULL);
SvxBrushItem aBrushItem( aGrafObj, GPOS_AREA, SID_ATTR_BRUSH );
aFmt.SetGraphicBrush( &aBrushItem );
}
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index d6edcb7..c140141 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1279,18 +1279,18 @@ sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
const Graphic* pGraphic = static_cast<SdrOle2Obj*>(pSdrOLE2)->GetGraphic();
if ( pGraphic )
{
- GraphicObject aGraphicObject( *pGraphic );
- bRetValue = CreateGraphicProperties( rXShape,aGraphicObject );
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create( *pGraphic );
+ bRetValue = CreateGraphicProperties( rXShape, rGraphicObject );
}
}
}
return bRetValue;
}
-sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, const GraphicObject& rGraphicObj )
+sal_Bool EscherPropertyContainer::CreateGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape, const rtl::Reference<GraphicObject>& rGraphicObj )
{
sal_Bool bRetValue = sal_False;
- OString aUniqueId( rGraphicObj.GetUniqueID() );
+ OString aUniqueId( rGraphicObj->GetUniqueID() );
if ( !aUniqueId.isEmpty() )
{
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
@@ -1328,8 +1328,8 @@ sal_Bool EscherPropertyContainer::CreateMediaGraphicProperties(
SdrObject* pSdrMedia( GetSdrObjectFromXShape( rXShape ) ); // SJ: leaving unoapi, because currently there is
if ( pSdrMedia && pSdrMedia->ISA( SdrMediaObj ) ) // no access to the native graphic object
{
- GraphicObject aGraphicObject( ((SdrMediaObj*)pSdrMedia)->getSnapshot() );
- bRetValue = CreateGraphicProperties( rXShape, aGraphicObject );
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create( ((SdrMediaObj*)pSdrMedia)->getSnapshot() );
+ bRetValue = CreateGraphicProperties( rXShape, rGraphicObject );
}
}
return bRetValue;
@@ -1385,7 +1385,7 @@ sal_Bool EscherPropertyContainer::CreateEmbeddedBitmapProperties(
namespace {
-GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground, const Rectangle& rRect )
+rtl::Reference<GraphicObject> lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground, const Rectangle& rRect )
{
// #i121183# For hatch, do no longer create a bitmap with the fixed size of 28x28 pixels. Also
// do not create a bitmap in page size, that would explode file sizes (and have no good quality).
@@ -1408,7 +1408,7 @@ GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, cons
aMtf.SetPrefMapMode(MapMode(MAP_100TH_MM));
aMtf.SetPrefSize(rRect.GetSize());
- return GraphicObject(Graphic(aMtf));
+ return GraphicObject::Create(Graphic(aMtf));
}
} // namespace
@@ -1417,8 +1417,8 @@ GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, cons
sal_Bool EscherPropertyContainer::CreateEmbeddedHatchProperties( const ::com::sun::star::drawing::Hatch& rHatch, const Color& rBackColor, bool bFillBackground )
{
const Rectangle aRect(pShapeBoundRect ? *pShapeBoundRect : Rectangle(Point(0,0), Size(28000, 21000)));
- GraphicObject aGraphicObject = lclDrawHatch( rHatch, rBackColor, bFillBackground, aRect );
- OString aUniqueId = aGraphicObject.GetUniqueID();
+ rtl::Reference<GraphicObject> rGraphicObject = lclDrawHatch( rHatch, rBackColor, bFillBackground, aRect );
+ OString aUniqueId = rGraphicObject->GetUniqueID();
sal_Bool bRetValue = ImplCreateEmbeddedBmp( aUniqueId );
if ( bRetValue )
AddOpt( ESCHER_Prop_fillType, ESCHER_FillTexture );
@@ -1437,7 +1437,7 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
sal_Bool bMirrored = sal_False;
sal_Bool bRotate = sal_True;
GraphicAttr* pGraphicAttr = NULL;
- GraphicObject aGraphicObject;
+ rtl::Reference<GraphicObject> rGraphicObject;
OUString aGraphicUrl;
OString aUniqueId;
bool bIsGraphicMtf(false);
@@ -1470,9 +1470,9 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
sal_uInt32 nErrCode = GraphicConverter::Import( aTemp, aGraphic, CVT_WMF );
if ( nErrCode == ERRCODE_NONE )
{
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
+ rGraphicObject = GraphicObject::Create(aGraphic);
+ aUniqueId = rGraphicObject->GetUniqueID();
+ bIsGraphicMtf = rGraphicObject->GetType() == GRAPHIC_GDIMETAFILE;
}
}
}
@@ -1486,9 +1486,9 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
{
BitmapEx aBitmapEx( VCLUnoHelper::GetBitmap( xBmp ) );
Graphic aGraphic( aBitmapEx );
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
+ rGraphicObject = GraphicObject::Create(aGraphic);
+ aUniqueId = rGraphicObject->GetUniqueID();
+ bIsGraphicMtf = rGraphicObject->GetType() == GRAPHIC_GDIMETAFILE;
}
}
}
@@ -1518,10 +1518,10 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
}
const Rectangle aRect(Point(0, 0), pShapeBoundRect ? pShapeBoundRect->GetSize() : Size(28000, 21000));
- aGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground, aRect );
- aUniqueId = aGraphicObject.GetUniqueID();
+ rGraphicObject = lclDrawHatch( aHatch, aBackColor, bFillBackground, aRect );
+ aUniqueId = rGraphicObject->GetUniqueID();
eBitmapMode = ::com::sun::star::drawing::BitmapMode_REPEAT;
- bIsGraphicMtf = aGraphicObject.GetType() == GRAPHIC_GDIMETAFILE;
+ bIsGraphicMtf = rGraphicObject->GetType() == GRAPHIC_GDIMETAFILE;
}
}
@@ -1611,8 +1611,8 @@ sal_Bool EscherPropertyContainer::CreateGraphicProperties(
if ( nErrCode == ERRCODE_NONE )
{
// no.
- aGraphicObject = aGraphic;
- aUniqueId = aGraphicObject.GetUniqueID();
+ rGraphicObject = GraphicObject::Create(aGraphic);
+ aUniqueId = rGraphicObject->GetUniqueID();
}
// else: simply keep the graphic link
delete pIn;
@@ -3822,8 +3822,8 @@ sal_Bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const ::co
SdrModel* pMod = pShape->GetModel();
Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape));
- GraphicObject aGraphicObject = aGraphic;
- OString aUniqueId = aGraphicObject.GetUniqueID();
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create(aGraphic);
+ OString aUniqueId = rGraphicObject->GetUniqueID();
if ( aUniqueId.getLength() )
{
if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
@@ -3979,13 +3979,13 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
return eRetValue;
}
-EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject& rObject, const OString& rId,
- const GraphicAttr* pGraphicAttr ) :
+EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const rtl::Reference<GraphicObject>& rObject, const OString& rId,
+ const GraphicAttr* pGraphicAttr ) :
mnPictureOffset ( nPictureOffset ),
mnRefCount ( 1 ),
mnSizeExtra ( 0 ),
- maPrefSize ( rObject.GetPrefSize() ),
- maPrefMapMode ( rObject.GetPrefMapMode() ),
+ maPrefSize ( rObject->GetPrefSize() ),
+ maPrefMapMode ( rObject->GetPrefMapMode() ),
mbIsEmpty ( sal_True )
{
mbIsNativeGraphicPossible = ( pGraphicAttr == NULL );
@@ -3994,7 +3994,7 @@ EscherBlibEntry::EscherBlibEntry( sal_uInt32 nPictureOffset, const GraphicObject
sal_uInt32 nLen = static_cast<sal_uInt32>(rId.getLength());
const sal_Char* pData = rId.getStr();
- GraphicType eType( rObject.GetType() );
+ GraphicType eType( rObject->GetType() );
if ( nLen && pData && ( eType != GRAPHIC_NONE ) )
{
mnIdentifier[ 0 ] = rtl_crc32( 0,pData, nLen );
@@ -4221,9 +4221,9 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin
const Rectangle& /* rBoundRect */, const com::sun::star::awt::Rectangle* pVisArea, const GraphicAttr* pGraphicAttr )
{
sal_uInt32 nBlibId = 0;
- GraphicObject aGraphicObject( rId );
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create( rId );
- EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), aGraphicObject, rId, pGraphicAttr );
+ EscherBlibEntry* p_EscherBlibEntry = new EscherBlibEntry( rPicOutStrm.Tell(), rGraphicObject, rId, pGraphicAttr );
if ( !p_EscherBlibEntry->IsEmpty() )
{
for ( sal_uInt32 i = 0; i < mnBlibEntrys; i++ )
@@ -4238,7 +4238,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin
sal_Bool bUseNativeGraphic( sal_False );
- Graphic aGraphic( aGraphicObject.GetTransformedGraphic( pGraphicAttr ) );
+ Graphic aGraphic( rGraphicObject->GetTransformedGraphic( pGraphicAttr ) );
GfxLink aGraphicLink;
SvMemoryStream aStream;
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index c7b24da..6c63ac0 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1234,7 +1234,7 @@ void ApplyRectangularGradientAsBitmap( const SvxMSDffManager& rManager, SvStream
}
rSet.Put(XFillBmpTileItem(false));
- rSet.Put(XFillBitmapItem(OUString(), Graphic(aBitmap)));
+ rSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(Graphic(aBitmap))));
}
}
}
@@ -1356,19 +1356,19 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
aGraf = Graphic( aXOBitmap.GetBitmap() );
}
- rSet.Put(XFillBitmapItem(OUString(), aGraf));
+ rSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(aGraf)));
}
else if ( eMSO_FillType == mso_fillTexture )
{
rSet.Put(XFillBmpTileItem(true));
- rSet.Put(XFillBitmapItem(OUString(), aGraf));
+ rSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(aGraf)));
rSet.Put(XFillBmpSizeXItem(GetPropertyValue(DFF_Prop_fillWidth, 0) / 360));
rSet.Put(XFillBmpSizeYItem(GetPropertyValue(DFF_Prop_fillHeight, 0) / 360));
rSet.Put(XFillBmpSizeLogItem(true));
}
else
{
- rSet.Put(XFillBitmapItem(OUString(), aGraf));
+ rSet.Put(XFillBitmapItem(OUString(), GraphicObject::Create(aGraf)));
rSet.Put(XFillBmpTileItem(false));
}
}
@@ -6132,8 +6132,8 @@ sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* p
{
/* if this entry is available, then it should be possible
to get the Graphic via GraphicObject */
- GraphicObject aGraphicObject( iter->second );
- rData = aGraphicObject.GetGraphic();
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create( iter->second );
+ rData = rGraphicObject->GetGraphic();
if ( rData.GetType() != GRAPHIC_NONE )
bOk = sal_True;
else
@@ -6190,8 +6190,8 @@ sal_Bool SvxMSDffManager::GetBLIP( sal_uLong nIdx_, Graphic& rData, Rectangle* p
if ( bOk )
{
// create new BlipCacheEntry for this graphic
- GraphicObject aGraphicObject( rData );
- aEscherBlipCache.insert(std::make_pair(nIdx_,aGraphicObject.GetUniqueID()));
+ rtl::Reference<GraphicObject> rGraphicObject = GraphicObject::Create( rData );
+ aEscherBlipCache.insert(std::make_pair(nIdx_, rGraphicObject->GetUniqueID()));
}
}
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 41307b7..9ef91fd 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -7355,7 +7355,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
const XFillBitmapItem aXFillBitmapItem((const XFillBitmapItem&)pObj->GetMergedItem( XATTR_FILLBITMAP ));
OUString aURL( UNO_NAME_GRAPHOBJ_URLPREFIX);
aURL += OStringToOUString(
- aXFillBitmapItem.GetGraphicObject().GetUniqueID(),
+ aXFillBitmapItem.GetGraphicObject()->GetUniqueID(),
RTL_TEXTENCODING_ASCII_US);
xPropSet->setPropertyValue("FillBitmapURL", Any( aURL ) );
diff --git a/include/drawinglayer/primitive2d/graphicprimitive2d.hxx b/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
index 9948a84..aba444a 100644
--- a/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/graphicprimitive2d.hxx
@@ -54,7 +54,7 @@ namespace drawinglayer
basegfx::B2DHomMatrix maTransform;
/// the GraphicObject with all it's content possibilities
- GraphicObject maGraphicObject;
+ rtl::Reference<GraphicObject> maGraphicObject;
/// The GraphicAttr with all it's modification possibilities
GraphicAttr maGraphicAttr;
@@ -67,15 +67,15 @@ namespace drawinglayer
/// constructor(s)
GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject,
+ const rtl::Reference<GraphicObject>& rGraphicObject,
const GraphicAttr& rGraphicAttr);
GraphicPrimitive2D(
const basegfx::B2DHomMatrix& rTransform,
- const GraphicObject& rGraphicObject);
+ const rtl::Reference<GraphicObject>& rGraphicObject);
/// data read access
const basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
- const GraphicObject& getGraphicObject() const { return maGraphicObject; }
+ const rtl::Reference<GraphicObject>& getGraphicObject() const { return maGraphicObject; }
const GraphicAttr& getGraphicAttr() const { return maGraphicAttr; }
bool isTransparent() const;
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index d05ee3b..d0ea64d 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -19,6 +19,7 @@
#ifndef _SVX_BRSHITEM_HXX
#define _SVX_BRSHITEM_HXX
+#include <rtl/ref.hxx>
#include <svl/poolitem.hxx>
#include <vcl/wall.hxx>
#include <tools/link.hxx>
@@ -51,10 +52,10 @@ class EDITENG_DLLPUBLIC SvxBrushItem : public SfxPoolItem
Color aColor;
sal_Int32 nShadingValue;
SvxBrushItem_Impl* pImpl;
- String* pStrLink;
- String* pStrFilter;
+ OUString* pStrLink;
+ OUString* pStrFilter;
SvxGraphicPosition eGraphicPos;
- sal_Bool bLoadAgain;
+ sal_Bool bLoadAgain;
void ApplyGraphicTransparency_Impl();
DECL_STATIC_LINK( SvxBrushItem, DoneHdl_Impl, void *);
@@ -70,9 +71,9 @@ public:
SvxBrushItem( const Graphic& rGraphic,
SvxGraphicPosition ePos, sal_uInt16 nWhich );
- SvxBrushItem( const GraphicObject& rGraphicObj,
+ SvxBrushItem( const rtl::Reference<GraphicObject>& rGraphicObj,
SvxGraphicPosition ePos, sal_uInt16 nWhich );
- SvxBrushItem( const String& rLink, const String& rFilter,
+ SvxBrushItem( const OUString& rLink, const OUString& rFilter,
SvxGraphicPosition ePos, sal_uInt16 nWhich );
SvxBrushItem( const SvxBrushItem& );
SvxBrushItem( const CntWallpaperItem&, sal_uInt16 nWhich );
@@ -86,18 +87,18 @@ public:
SfxMapUnit ePresMetric,
OUString &rText, const IntlWrapper * = 0 ) const;
- virtual int operator==( const SfxPoolItem& ) const;
- virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list