loplugin:staticmethods

Change-Id: I33a8ca28b0c3bf1c31758d93238e74927bebde9c
This commit is contained in:
Noel Grandin 2015-04-09 08:45:51 +02:00
parent b5f5a38650
commit 26ec80f47d
36 changed files with 128 additions and 179 deletions

View File

@ -589,7 +589,7 @@ private:
// Must be called with both the external (Solar) and internal mutex // Must be called with both the external (Solar) and internal mutex
// locked, and after init has been called: // locked, and after init has been called:
::rtl::Reference< Paragraph > static ::rtl::Reference< Paragraph >
getParagraph(Paragraphs::iterator const & rIt); getParagraph(Paragraphs::iterator const & rIt);
// Must be called with both the external (Solar) and internal mutex // Must be called with both the external (Solar) and internal mutex
@ -633,7 +633,7 @@ private:
static ::FontWeight mapFontWeight(css::uno::Any const & rWeight); static ::FontWeight mapFontWeight(css::uno::Any const & rWeight);
void retrieveDefaultAttributesImpl( static void retrieveDefaultAttributesImpl(
Paragraph const * pParagraph, Paragraph const * pParagraph,
const css::uno::Sequence< OUString >& RequestedAttributes, const css::uno::Sequence< OUString >& RequestedAttributes,
tPropValMap& rDefAttrSeq); tPropValMap& rDefAttrSeq);

View File

@ -135,7 +135,7 @@ public:
void UpdateSelection_Impl_Acc (bool b_IsDropDownList); void UpdateSelection_Impl_Acc (bool b_IsDropDownList);
void UpdateFocus_Impl_Acc ( sal_uInt16 nPos, bool b_IsDropDownList) ; void UpdateFocus_Impl_Acc ( sal_uInt16 nPos, bool b_IsDropDownList) ;
void NotifyListItem(::com::sun::star::uno::Any& val); static void NotifyListItem(::com::sun::star::uno::Any& val);
protected: protected:
BoxType m_aBoxType; BoxType m_aBoxType;
::accessibility::IComboListBoxHelper* m_pListBoxHelper; ::accessibility::IComboListBoxHelper* m_pListBoxHelper;

View File

@ -3124,7 +3124,7 @@ OUString ChartView::dump() throw (uno::RuntimeException, std::exception)
if(xShape.is()) if(xShape.is())
{ {
XShapeDumper dumper; XShapeDumper dumper;
OUString aString = dumper.dump(mxRootShape); OUString aString = XShapeDumper::dump(mxRootShape);
aBuffer.append(aString); aBuffer.append(aString);
} }
else else
@ -3133,7 +3133,7 @@ OUString ChartView::dump() throw (uno::RuntimeException, std::exception)
if(!xSingleShape.is()) if(!xSingleShape.is())
continue; continue;
XShapeDumper dumper; XShapeDumper dumper;
OUString aString = dumper.dump(xSingleShape); OUString aString = XShapeDumper::dump(xSingleShape);
aBuffer.append(aString); aBuffer.append(aString);
} }
aBuffer.append("\n\n"); aBuffer.append("\n\n");

View File

@ -142,7 +142,12 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
{ {
return true; return true;
} }
std::string fqn = aParentName + "::" + pCXXMethodDecl->getNameAsString();
// only empty on Linux, not on windows
if (fqn == "OleEmbeddedObject::GetVisualRepresentationInNativeFormat_Impl"
|| fqn == "OleEmbeddedObject::GetRidOfComponent") {
return true;
}
bVisitedThis = false; bVisitedThis = false;
TraverseStmt(pCXXMethodDecl->getBody()); TraverseStmt(pCXXMethodDecl->getBody());
@ -152,7 +157,7 @@ bool StaticMethods::TraverseCXXMethodDecl(const CXXMethodDecl * pCXXMethodDecl)
report( report(
DiagnosticsEngine::Warning, DiagnosticsEngine::Warning,
"this method can be declared static " + aParentName, "this method can be declared static " + fqn,
pCXXMethodDecl->getCanonicalDecl()->getLocStart()) pCXXMethodDecl->getCanonicalDecl()->getLocStart())
<< pCXXMethodDecl->getCanonicalDecl()->getSourceRange(); << pCXXMethodDecl->getCanonicalDecl()->getSourceRange();
return true; return true;

View File

@ -219,8 +219,8 @@ static float GetSwapFloat( SvStream& rSt )
typedef ::std::vector< MtfAction > ActionVector; typedef ::std::vector< MtfAction > ActionVector;
/* EMF+ */ /* EMF+ */
void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); static void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false);
void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags); static void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags);
void MapToDevice (double &x, double &y); void MapToDevice (double &x, double &y);
::basegfx::B2DPoint Map (double ix, double iy); ::basegfx::B2DPoint Map (double ix, double iy);
::basegfx::B2DSize MapSize (double iwidth, double iheight); ::basegfx::B2DSize MapSize (double iwidth, double iheight);
@ -231,18 +231,18 @@ static float GetSwapFloat( SvStream& rSt )
ImplRenderer(const ImplRenderer&) SAL_DELETED_FUNCTION; ImplRenderer(const ImplRenderer&) SAL_DELETED_FUNCTION;
ImplRenderer& operator=( const ImplRenderer& ) SAL_DELETED_FUNCTION; ImplRenderer& operator=( const ImplRenderer& ) SAL_DELETED_FUNCTION;
void updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly, static void updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly,
const ActionFactoryParameters& rParms, const ActionFactoryParameters& rParms,
bool bIntersect ); bool bIntersect );
void updateClipping( const ::Rectangle& rClipRect, static void updateClipping( const ::Rectangle& rClipRect,
const ActionFactoryParameters& rParms, const ActionFactoryParameters& rParms,
bool bIntersect ); bool bIntersect );
::com::sun::star::uno::Reference< static ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCanvasFont > createFont( double& o_rFontRotation, ::com::sun::star::rendering::XCanvasFont > createFont( double& o_rFontRotation,
const ::vcl::Font& rFont, const ::vcl::Font& rFont,
const ActionFactoryParameters& rParms ) const; const ActionFactoryParameters& rParms );
bool createActions( GDIMetaFile& rMtf, bool createActions( GDIMetaFile& rMtf,
const ActionFactoryParameters& rParms, const ActionFactoryParameters& rParms,
bool bSubsettableActions ); bool bSubsettableActions );
@ -250,13 +250,13 @@ static float GetSwapFloat( SvStream& rSt )
const ActionFactoryParameters& rParms ); const ActionFactoryParameters& rParms );
bool createFillAndStroke( const ::basegfx::B2DPolygon& rPoly, bool createFillAndStroke( const ::basegfx::B2DPolygon& rPoly,
const ActionFactoryParameters& rParms ); const ActionFactoryParameters& rParms );
void skipContent( GDIMetaFile& rMtf, static void skipContent( GDIMetaFile& rMtf,
const char* pCommentString, const char* pCommentString,
sal_Int32& io_rCurrActionIndex ) const; sal_Int32& io_rCurrActionIndex );
bool isActionContained( GDIMetaFile& rMtf, static bool isActionContained( GDIMetaFile& rMtf,
const char* pCommentString, const char* pCommentString,
sal_uInt16 nType ) const; sal_uInt16 nType );
void createGradientAction( const ::tools::PolyPolygon& rPoly, void createGradientAction( const ::tools::PolyPolygon& rPoly,
const ::Gradient& rGradient, const ::Gradient& rGradient,

View File

@ -1880,7 +1880,7 @@ namespace cppcanvas
float dx, dy, dw, dh; float dx, dy, dw, dh;
ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000));
SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh); SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh);
@ -1939,7 +1939,7 @@ namespace cppcanvas
float dx, dy, dw, dh; float dx, dy, dw, dh;
ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000));
SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh); SAL_INFO("cppcanvas.emf", "EMF+ RectData: " << dx << "," << dy << " " << dw << "x" << dh);
@ -2098,7 +2098,7 @@ namespace cppcanvas
} else if (type == EmfPlusRecordTypeDrawImage) { } else if (type == EmfPlusRecordTypeDrawImage) {
float dx, dy, dw, dh; float dx, dy, dw, dh;
ReadRectangle (rMF, dx, dy, dw, dh, flags & 0x4000); ReadRectangle (rMF, dx, dy, dw, dh, bool(flags & 0x4000));
SAL_INFO("cppcanvas.emf", "EMF+ destination rectangle: " << dx << "," << dy << " " << dw << "x" << dh); SAL_INFO("cppcanvas.emf", "EMF+ destination rectangle: " << dx << "," << dy << " " << dw << "x" << dh);

View File

@ -419,7 +419,7 @@ namespace cppcanvas
void ImplRenderer::skipContent( GDIMetaFile& rMtf, void ImplRenderer::skipContent( GDIMetaFile& rMtf,
const char* pCommentString, const char* pCommentString,
sal_Int32& io_rCurrActionIndex ) const sal_Int32& io_rCurrActionIndex )
{ {
ENSURE_OR_THROW( pCommentString, ENSURE_OR_THROW( pCommentString,
"ImplRenderer::skipContent(): NULL string given" ); "ImplRenderer::skipContent(): NULL string given" );
@ -445,7 +445,7 @@ namespace cppcanvas
bool ImplRenderer::isActionContained( GDIMetaFile& rMtf, bool ImplRenderer::isActionContained( GDIMetaFile& rMtf,
const char* pCommentString, const char* pCommentString,
sal_uInt16 nType ) const sal_uInt16 nType )
{ {
ENSURE_OR_THROW( pCommentString, ENSURE_OR_THROW( pCommentString,
"ImplRenderer::isActionContained(): NULL string given" ); "ImplRenderer::isActionContained(): NULL string given" );
@ -754,7 +754,7 @@ namespace cppcanvas
uno::Reference< rendering::XCanvasFont > ImplRenderer::createFont( double& o_rFontRotation, uno::Reference< rendering::XCanvasFont > ImplRenderer::createFont( double& o_rFontRotation,
const vcl::Font& rFont, const vcl::Font& rFont,
const ActionFactoryParameters& rParms ) const const ActionFactoryParameters& rParms )
{ {
rendering::FontRequest aFontRequest; rendering::FontRequest aFontRequest;
@ -2688,7 +2688,7 @@ namespace cppcanvas
{ {
} }
bool result() const static bool result()
{ {
return true; // nothing can fail here return true; // nothing can fail here
} }

View File

@ -350,7 +350,7 @@ namespace cppcanvas
// update buffered bitmap and transformation // update buffered bitmap and transformation
BitmapSharedPtr aBmp( VCLFactory::getInstance().createBitmap( BitmapSharedPtr aBmp( VCLFactory::createBitmap(
mpCanvas, mpCanvas,
aVDev.GetBitmapEx( aVDev.GetBitmapEx(
aEmptyPoint, aEmptyPoint,

View File

@ -22,9 +22,8 @@ void MtfRenderer::setMetafile (const uno::Sequence< sal_Int8 >& /*rMtf*/) throw
void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeException, std::exception) void MtfRenderer::draw (double fScaleX, double fScaleY) throw (uno::RuntimeException, std::exception)
{ {
if (mpMetafile && mxCanvas.get()) { if (mpMetafile && mxCanvas.get()) {
cppcanvas::VCLFactory& factory = cppcanvas::VCLFactory::getInstance(); cppcanvas::BitmapCanvasSharedPtr canvas = cppcanvas::VCLFactory::createBitmapCanvas (mxCanvas);
cppcanvas::BitmapCanvasSharedPtr canvas = factory.createBitmapCanvas (mxCanvas); cppcanvas::RendererSharedPtr renderer = cppcanvas::VCLFactory::createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ());
cppcanvas::RendererSharedPtr renderer = factory.createRenderer (canvas, *mpMetafile, cppcanvas::Renderer::Parameters ());
::basegfx::B2DHomMatrix aMatrix; ::basegfx::B2DHomMatrix aMatrix;
aMatrix.scale( fScaleX, fScaleY ); aMatrix.scale( fScaleX, fScaleY );
canvas->setTransformation( aMatrix ); canvas->setTransformation( aMatrix );

View File

@ -44,28 +44,8 @@ using namespace ::com::sun::star;
namespace cppcanvas namespace cppcanvas
{ {
/* Singleton handling */
struct InitInstance2
{
BaseGfxFactory* operator()()
{
return new BaseGfxFactory();
}
};
BaseGfxFactory& BaseGfxFactory::getInstance()
{
return *rtl_Instance< BaseGfxFactory, InitInstance2, ::osl::MutexGuard,
::osl::GetGlobalMutex >::create(
InitInstance2(), ::osl::GetGlobalMutex());
}
BaseGfxFactory::BaseGfxFactory()
{
}
PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas, PolyPolygonSharedPtr BaseGfxFactory::createPolyPolygon( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2DPolygon& rPoly ) const const ::basegfx::B2DPolygon& rPoly )
{ {
OSL_ENSURE( rCanvas.get() != NULL && OSL_ENSURE( rCanvas.get() != NULL &&
rCanvas->getUNOCanvas().is(), rCanvas->getUNOCanvas().is(),
@ -86,7 +66,7 @@ namespace cppcanvas
} }
BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas, BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2ISize& rSize ) const const ::basegfx::B2ISize& rSize )
{ {
OSL_ENSURE( rCanvas.get() != NULL && OSL_ENSURE( rCanvas.get() != NULL &&
rCanvas->getUNOCanvas().is(), rCanvas->getUNOCanvas().is(),
@ -106,7 +86,7 @@ namespace cppcanvas
} }
BitmapSharedPtr BaseGfxFactory::createAlphaBitmap( const CanvasSharedPtr& rCanvas, BitmapSharedPtr BaseGfxFactory::createAlphaBitmap( const CanvasSharedPtr& rCanvas,
const ::basegfx::B2ISize& rSize ) const const ::basegfx::B2ISize& rSize )
{ {
OSL_ENSURE( rCanvas.get() != NULL && OSL_ENSURE( rCanvas.get() != NULL &&
rCanvas->getUNOCanvas().is(), rCanvas->getUNOCanvas().is(),

View File

@ -39,26 +39,6 @@ using namespace ::com::sun::star;
namespace cppcanvas namespace cppcanvas
{ {
/* Singleton handling */
struct InitInstance
{
VCLFactory* operator()()
{
return new VCLFactory();
}
};
VCLFactory& VCLFactory::getInstance()
{
return *rtl_Instance< VCLFactory, InitInstance, ::osl::MutexGuard,
::osl::GetGlobalMutex >::create(
InitInstance(), ::osl::GetGlobalMutex());
}
VCLFactory::VCLFactory()
{
}
CanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XCanvas >& xCanvas ) CanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XCanvas >& xCanvas )
{ {
return CanvasSharedPtr( return CanvasSharedPtr(
@ -71,7 +51,7 @@ namespace cppcanvas
new internal::ImplBitmapCanvas( xCanvas ) ); new internal::ImplBitmapCanvas( xCanvas ) );
} }
SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const vcl::Window& rVCLWindow ) const SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const vcl::Window& rVCLWindow )
{ {
return SpriteCanvasSharedPtr( return SpriteCanvasSharedPtr(
new internal::ImplSpriteCanvas( new internal::ImplSpriteCanvas(
@ -80,14 +60,14 @@ namespace cppcanvas
uno::UNO_QUERY) ) ); uno::UNO_QUERY) ) );
} }
SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& xCanvas ) const SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& xCanvas )
{ {
return SpriteCanvasSharedPtr( return SpriteCanvasSharedPtr(
new internal::ImplSpriteCanvas( xCanvas ) ); new internal::ImplSpriteCanvas( xCanvas ) );
} }
BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr& rCanvas, BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr& rCanvas,
const ::BitmapEx& rBmpEx ) const const ::BitmapEx& rBmpEx )
{ {
OSL_ENSURE( rCanvas.get() != NULL && OSL_ENSURE( rCanvas.get() != NULL &&
rCanvas->getUNOCanvas().is(), rCanvas->getUNOCanvas().is(),
@ -108,7 +88,7 @@ namespace cppcanvas
RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr& rCanvas, RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr& rCanvas,
const ::GDIMetaFile& rMtf, const ::GDIMetaFile& rMtf,
const Renderer::Parameters& rParms ) const const Renderer::Parameters& rParms )
{ {
return RendererSharedPtr( new internal::ImplRenderer( rCanvas, return RendererSharedPtr( new internal::ImplRenderer( rCanvas,
rMtf, rMtf,

View File

@ -223,7 +223,7 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl(); ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > CreateTempDocFromLink_Impl();
OUString GetBaseURL_Impl() const; OUString GetBaseURL_Impl() const;
OUString GetBaseURLFrom_Impl( static OUString GetBaseURLFrom_Impl(
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ); const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs );

View File

@ -141,7 +141,7 @@ public:
void PlaceFrame( const ::com::sun::star::awt::Rectangle& aNewRect ); void PlaceFrame( const ::com::sun::star::awt::Rectangle& aNewRect );
bool SetFrameLMVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, static bool SetFrameLMVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
bool bVisible ); bool bVisible );
bool ShowInplace( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent, bool ShowInplace( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent,

View File

@ -126,8 +126,8 @@ void PeriodicSpline (int N, double* x, double* a, double*& b, double*& c,
h[i] = x[i+1]-x[i]; h[i] = x[i+1]-x[i];
mgcLinearSystemD sys; mgcLinearSystemD sys;
double** mat = sys.NewMatrix(N+1); // guaranteed to be zeroed memory double** mat = mgcLinearSystemD::NewMatrix(N+1); // guaranteed to be zeroed memory
c = sys.NewVector(N+1); // guaranteed to be zeroed memory c = mgcLinearSystemD::NewVector(N+1); // guaranteed to be zeroed memory
// c[0] - c[N] = 0 // c[0] - c[N] = 0
mat[0][0] = +1.0f; mat[0][0] = +1.0f;
@ -152,7 +152,7 @@ void PeriodicSpline (int N, double* x, double* a, double*& b, double*& c,
c[N] = 3.0f*((a[1]-a[0])/h[0] - (a[0]-a[N-1])/h[N-1]); c[N] = 3.0f*((a[1]-a[0])/h[0] - (a[0]-a[N-1])/h[N-1]);
// solve for c[0] through c[N] // solve for c[0] through c[N]
sys.Solve(N+1,mat,c); mgcLinearSystemD::Solve(N+1,mat,c);
const double oneThird = 1.0/3.0; const double oneThird = 1.0/3.0;
b = new double[N]; b = new double[N];
@ -164,7 +164,7 @@ void PeriodicSpline (int N, double* x, double* a, double*& b, double*& c,
} }
delete[] h; delete[] h;
sys.DeleteMatrix(N+1,mat); mgcLinearSystemD::DeleteMatrix(N+1,mat);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -147,8 +147,8 @@ private:
void makeTableStyle(Table *); void makeTableStyle(Table *);
void parseCharShape(CharShape *); void parseCharShape(CharShape *);
void parseParaShape(ParaShape *); void parseParaShape(ParaShape *);
char* getTStyleName(int, char *); static char* getTStyleName(int, char *);
char* getPStyleName(int, char *); static char* getPStyleName(int, char *);
}; };
class HwpImportFilter : public WeakImplHelper4< XFilter, XImporter, XServiceInfo, XExtendedFilterDetection > class HwpImportFilter : public WeakImplHelper4< XFilter, XImporter, XServiceInfo, XExtendedFilterDetection >

View File

@ -25,11 +25,11 @@ class mgcLinearSystemD
public: public:
mgcLinearSystemD() {;} mgcLinearSystemD() {;}
double** NewMatrix (int N); static double** NewMatrix (int N);
void DeleteMatrix (int N, double** A); static void DeleteMatrix (int N, double** A);
double* NewVector (int N); static double* NewVector (int N);
int Solve (int N, double** A, double* b); static int Solve (int N, double** A, double* b);
// Input: // Input:
// A[N][N] coefficient matrix, entries are A[row][col] // A[N][N] coefficient matrix, entries are A[row][col]
// b[N] vector, entries are b[row] // b[N] vector, entries are b[row]

View File

@ -53,29 +53,23 @@ namespace cppcanvas
class CPPCANVAS_DLLPUBLIC BaseGfxFactory class CPPCANVAS_DLLPUBLIC BaseGfxFactory
{ {
public: public:
static BaseGfxFactory& getInstance();
/** Create a polygon from a ::basegfx::B2DPolygon /** Create a polygon from a ::basegfx::B2DPolygon
The created polygon initially has the same size in user The created polygon initially has the same size in user
coordinate space as the source polygon coordinate space as the source polygon
*/ */
PolyPolygonSharedPtr createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolygon& rPoly ) const; static PolyPolygonSharedPtr createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolygon& rPoly );
/** Create an uninitialized bitmap with the given size /** Create an uninitialized bitmap with the given size
*/ */
BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const; static BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize );
/** Create an uninitialized alpha bitmap with the given size /** Create an uninitialized alpha bitmap with the given size
*/ */
BitmapSharedPtr createAlphaBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const; static BitmapSharedPtr createAlphaBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize );
private: private:
friend struct InitInstance2; BaseGfxFactory() SAL_DELETED_FUNCTION;
// singleton
BaseGfxFactory();
BaseGfxFactory(const BaseGfxFactory&) SAL_DELETED_FUNCTION; BaseGfxFactory(const BaseGfxFactory&) SAL_DELETED_FUNCTION;
BaseGfxFactory& operator=( const BaseGfxFactory& ) SAL_DELETED_FUNCTION; BaseGfxFactory& operator=( const BaseGfxFactory& ) SAL_DELETED_FUNCTION;
}; };

View File

@ -62,36 +62,30 @@ namespace cppcanvas
class CPPCANVAS_DLLPUBLIC VCLFactory class CPPCANVAS_DLLPUBLIC VCLFactory
{ {
public: public:
static VCLFactory& getInstance(); static CanvasSharedPtr createCanvas( const ::com::sun::star::uno::Reference<
CanvasSharedPtr createCanvas( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCanvas >& xCanvas ); ::com::sun::star::rendering::XCanvas >& xCanvas );
BitmapCanvasSharedPtr createBitmapCanvas( const ::com::sun::star::uno::Reference< static BitmapCanvasSharedPtr createBitmapCanvas( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XBitmapCanvas >& xCanvas ); ::com::sun::star::rendering::XBitmapCanvas >& xCanvas );
SpriteCanvasSharedPtr createSpriteCanvas( const vcl::Window& rVCLWindow ) const; static SpriteCanvasSharedPtr createSpriteCanvas( const vcl::Window& rVCLWindow );
SpriteCanvasSharedPtr createSpriteCanvas( const ::com::sun::star::uno::Reference< static SpriteCanvasSharedPtr createSpriteCanvas( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSpriteCanvas >& xCanvas ) const; ::com::sun::star::rendering::XSpriteCanvas >& xCanvas );
/** Create a bitmap from a VCL Bitmap /** Create a bitmap from a VCL Bitmap
*/ */
BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::BitmapEx& rBmpEx ) const; static BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::BitmapEx& rBmpEx );
/** Create a renderer object from a Metafile /** Create a renderer object from a Metafile
The created renderer initially draws the metafile The created renderer initially draws the metafile
one-by-one units large, in user coordinate space one-by-one units large, in user coordinate space
*/ */
RendererSharedPtr createRenderer( const CanvasSharedPtr& rCanvas, static RendererSharedPtr createRenderer( const CanvasSharedPtr& rCanvas,
const ::GDIMetaFile& rMtf, const ::GDIMetaFile& rMtf,
const Renderer::Parameters& rParms ) const; const Renderer::Parameters& rParms );
private: private:
friend struct InitInstance; VCLFactory() SAL_DELETED_FUNCTION;
// singleton
VCLFactory();
VCLFactory(const VCLFactory&) SAL_DELETED_FUNCTION; VCLFactory(const VCLFactory&) SAL_DELETED_FUNCTION;
VCLFactory& operator=( const VCLFactory& ) SAL_DELETED_FUNCTION; VCLFactory& operator=( const VCLFactory& ) SAL_DELETED_FUNCTION;
}; };

View File

@ -46,8 +46,8 @@ class DRAWINGLAYER_DLLPUBLIC XShapeDumper
public: public:
XShapeDumper(); XShapeDumper();
OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> xPageShapes, bool bDumpInteropProperties=false); static OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> xPageShapes, bool bDumpInteropProperties=false);
OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xPageShapes, bool bDumpInteropProperties=false); static OUString dump(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> xPageShapes, bool bDumpInteropProperties=false);
}; };
#endif #endif

View File

@ -218,7 +218,7 @@ protected:
uno::Any aAny = xDrawPages->getByIndex(i); uno::Any aAny = xDrawPages->getByIndex(i);
aAny >>= xDrawPage; aAny >>= xDrawPage;
uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW); uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY_THROW);
OUString aString = xShapeDumper.dump(xShapes); OUString aString = XShapeDumper::dump(xShapes);
OStringBuffer aFileNameBuf( OUStringToOString( rShapesDumpFileNameBase, RTL_TEXTENCODING_UTF8 ) ); OStringBuffer aFileNameBuf( OUStringToOString( rShapesDumpFileNameBase, RTL_TEXTENCODING_UTF8 ) );
aFileNameBuf.append(i); aFileNameBuf.append(i);

View File

@ -178,7 +178,7 @@ Reference<rendering::XCanvas> Pane::CreateCanvas (void)
if (mpWindow != NULL) if (mpWindow != NULL)
{ {
::cppcanvas::SpriteCanvasSharedPtr pCanvas ( ::cppcanvas::SpriteCanvasSharedPtr pCanvas (
::cppcanvas::VCLFactory::getInstance().createSpriteCanvas(*mpWindow)); cppcanvas::VCLFactory::createSpriteCanvas(*mpWindow));
if (pCanvas.get() != NULL) if (pCanvas.get() != NULL)
xCanvas = Reference<rendering::XCanvas>(pCanvas->getUNOSpriteCanvas(), UNO_QUERY); xCanvas = Reference<rendering::XCanvas>(pCanvas->getUNOSpriteCanvas(), UNO_QUERY);
} }

View File

@ -398,14 +398,14 @@ Reference<rendering::XBitmap> SAL_CALL PresenterHelper::loadBitmap (
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex()); ::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
const cppcanvas::CanvasSharedPtr pCanvas ( const cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::getInstance().createCanvas( cppcanvas::VCLFactory::createCanvas(
Reference<css::rendering::XCanvas>(rxCanvas,UNO_QUERY))); Reference<css::rendering::XCanvas>(rxCanvas,UNO_QUERY)));
if (pCanvas.get() != NULL) if (pCanvas.get() != NULL)
{ {
BitmapEx aBitmapEx = SdResId(nid); BitmapEx aBitmapEx = SdResId(nid);
cppcanvas::BitmapSharedPtr xBitmap( cppcanvas::BitmapSharedPtr xBitmap(
cppcanvas::VCLFactory::getInstance().createBitmap(pCanvas, cppcanvas::VCLFactory::createBitmap(pCanvas,
aBitmapEx)); aBitmapEx));
if (xBitmap.get() == NULL) if (xBitmap.get() == NULL)
return NULL; return NULL;

View File

@ -138,7 +138,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview (
OSL_ASSERT(mpCacheContext.get()!=NULL); OSL_ASSERT(mpCacheContext.get()!=NULL);
cppcanvas::CanvasSharedPtr pCanvas ( cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::getInstance().createCanvas(rxCanvas)); cppcanvas::VCLFactory::createCanvas(rxCanvas));
const SdrPage* pPage = mpCacheContext->GetPage(nSlideIndex); const SdrPage* pPage = mpCacheContext->GetPage(nSlideIndex);
if (pPage == NULL) if (pPage == NULL)
@ -148,7 +148,7 @@ Reference<rendering::XBitmap> SAL_CALL PresenterPreviewCache::getSlidePreview (
if (aPreview.IsEmpty()) if (aPreview.IsEmpty())
return NULL; return NULL;
else else
return cppcanvas::VCLFactory::getInstance().createBitmap( return cppcanvas::VCLFactory::createBitmap(
pCanvas, pCanvas,
aPreview)->getUNOBitmap(); aPreview)->getUNOBitmap();
} }

View File

@ -128,7 +128,7 @@ void SAL_CALL PresenterTextView::initialize (const Sequence<Any>& rArguments)
if (xCanvas.is()) if (xCanvas.is())
{ {
mpImplementation->SetCanvas( mpImplementation->SetCanvas(
cppcanvas::VCLFactory::getInstance().createCanvas(xCanvas)); cppcanvas::VCLFactory::createCanvas(xCanvas));
} }
} }
catch (RuntimeException&) catch (RuntimeException&)
@ -476,7 +476,7 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void
mpEditEngine->Draw(mpOutputDevice, aWindowBox, Point(0,mnTop)); mpEditEngine->Draw(mpOutputDevice, aWindowBox, Point(0,mnTop));
const BitmapEx aBitmap (mpOutputDevice->GetBitmapEx(Point(0,0), maSize)); const BitmapEx aBitmap (mpOutputDevice->GetBitmapEx(Point(0,0), maSize));
mxBitmap = cppcanvas::VCLFactory::getInstance().createBitmap( mxBitmap = cppcanvas::VCLFactory::createBitmap(
mpCanvas, mpCanvas,
aBitmap aBitmap
)->getUNOBitmap(); )->getUNOBitmap();

View File

@ -107,9 +107,9 @@ Reference<rendering::XBitmap> SlideRenderer::createPreviewForCanvas (
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
cppcanvas::CanvasSharedPtr pCanvas ( cppcanvas::CanvasSharedPtr pCanvas (
cppcanvas::VCLFactory::getInstance().createCanvas(rxCanvas)); cppcanvas::VCLFactory::createCanvas(rxCanvas));
if (pCanvas.get() != NULL) if (pCanvas.get() != NULL)
return cppcanvas::VCLFactory::getInstance().createBitmap( return cppcanvas::VCLFactory::createBitmap(
pCanvas, pCanvas,
CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap(); CreatePreview(rxSlide, rMaximalSize, nSuperSampleFactor))->getUNOBitmap();
else else

View File

@ -183,7 +183,7 @@ SlideShowView::SlideShowView( ShowWindow& rOutputWindow,
SlideshowImpl* pSlideShow, SlideshowImpl* pSlideShow,
bool bFullScreen ) bool bFullScreen )
: SlideShowView_Base( m_aMutex ), : SlideShowView_Base( m_aMutex ),
mpCanvas( ::cppcanvas::VCLFactory::getInstance().createSpriteCanvas( rOutputWindow ) ), mpCanvas( ::cppcanvas::VCLFactory::createSpriteCanvas( rOutputWindow ) ),
mxWindow( VCLUnoHelper::GetInterface( &rOutputWindow ), uno::UNO_QUERY_THROW ), mxWindow( VCLUnoHelper::GetInterface( &rOutputWindow ), uno::UNO_QUERY_THROW ),
mxWindowPeer( mxWindow, uno::UNO_QUERY_THROW ), mxWindowPeer( mxWindow, uno::UNO_QUERY_THROW ),
mxPointer(), mxPointer(),
@ -305,7 +305,7 @@ void SAL_CALL SlideShowView::clear() throw (::com::sun::star::uno::RuntimeExcept
aWindowSize.Width(), aWindowSize.Width(),
aWindowSize.Height() ) ) ); aWindowSize.Height() ) ) );
::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( mpCanvas, aPoly ) ); ::cppcanvas::BaseGfxFactory::createPolyPolygon( mpCanvas, aPoly ) );
if( pPolyPoly.get() ) if( pPolyPoly.get() )
{ {

View File

@ -475,7 +475,7 @@ void RehearseTimingsActivity::paint( cppcanvas::CanvasSharedPtr const & canvas )
metaFile.WindStart(); metaFile.WindStart();
cppcanvas::RendererSharedPtr renderer( cppcanvas::RendererSharedPtr renderer(
cppcanvas::VCLFactory::getInstance().createRenderer( cppcanvas::VCLFactory::createRenderer(
canvas, metaFile, cppcanvas::Renderer::Parameters() ) ); canvas, metaFile, cppcanvas::Renderer::Parameters() ) );
const bool succ = renderer->draw(); const bool succ = renderer->draw();
OSL_ASSERT( succ ); OSL_ASSERT( succ );

View File

@ -497,8 +497,8 @@ void ShapeImporter::importPolygons(uno::Reference<beans::XPropertySet> const& xP
while(aIter != aEnd) while(aIter != aEnd)
{ {
::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(), ::cppcanvas::BaseGfxFactory::createPolyPolygon( (*aIter)->getCanvas(),
aPoly ) ); aPoly ) );
if( pPolyPoly ) if( pPolyPoly )
{ {
pPolyPoly->setRGBALineColor( unoColor2RGBColor( nLineColor ).getIntegerColor() ); pPolyPoly->setRGBALineColor( unoColor2RGBColor( nLineColor ).getIntegerColor() );

View File

@ -84,7 +84,7 @@ namespace slideshow
// create a bitmap of appropriate size // create a bitmap of appropriate size
::cppcanvas::BitmapSharedPtr pBitmap( ::cppcanvas::BitmapSharedPtr pBitmap(
::cppcanvas::BaseGfxFactory::getInstance().createBitmap( ::cppcanvas::BaseGfxFactory::createBitmap(
rDestinationCanvas, rDestinationCanvas,
aBmpSizePixel ) ); aBmpSizePixel ) );
@ -112,7 +112,7 @@ namespace slideshow
maBounds.getMinX(), maBounds.getMinY())); maBounds.getMinX(), maBounds.getMinY()));
::cppcanvas::RendererSharedPtr pRenderer( ::cppcanvas::RendererSharedPtr pRenderer(
::cppcanvas::VCLFactory::getInstance().createRenderer( ::cppcanvas::VCLFactory::createRenderer(
pBitmapCanvas, pBitmapCanvas,
*rMtf.get(), *rMtf.get(),
::cppcanvas::Renderer::Parameters() ) ); ::cppcanvas::Renderer::Parameters() ) );

View File

@ -158,9 +158,9 @@ namespace slideshow
} }
} }
io_rCacheEntry.mpRenderer = ::cppcanvas::VCLFactory::getInstance().createRenderer( rDestinationCanvas, io_rCacheEntry.mpRenderer = ::cppcanvas::VCLFactory::createRenderer( rDestinationCanvas,
*rMtf.get(), *rMtf.get(),
aParms ); aParms );
io_rCacheEntry.mpMtf = rMtf; io_rCacheEntry.mpMtf = rMtf;
io_rCacheEntry.mpDestinationCanvas = rDestinationCanvas; io_rCacheEntry.mpDestinationCanvas = rDestinationCanvas;
@ -619,7 +619,7 @@ namespace slideshow
{ {
// create a bitmap of appropriate size // create a bitmap of appropriate size
::cppcanvas::BitmapSharedPtr pBitmap( ::cppcanvas::BitmapSharedPtr pBitmap(
::cppcanvas::BaseGfxFactory::getInstance().createAlphaBitmap( ::cppcanvas::BaseGfxFactory::createAlphaBitmap(
rDestinationCanvas, rDestinationCanvas,
aBmpSize ) ); aBmpSize ) );

View File

@ -717,7 +717,7 @@ SlideBitmapSharedPtr SlideImpl::createCurrentSlideBitmap( const UnoViewSharedPtr
// create a bitmap of appropriate size // create a bitmap of appropriate size
::cppcanvas::BitmapSharedPtr pBitmap( ::cppcanvas::BitmapSharedPtr pBitmap(
::cppcanvas::BaseGfxFactory::getInstance().createBitmap( ::cppcanvas::BaseGfxFactory::createBitmap(
pCanvas, pCanvas,
rBmpSize ) ); rBmpSize ) );

View File

@ -418,8 +418,8 @@ namespace slideshow
++aIter ) ++aIter )
{ {
::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(), ::cppcanvas::BaseGfxFactory::createPolyPolygon( (*aIter)->getCanvas(),
aPoly ) ); aPoly ) );
if( pPolyPoly ) if( pPolyPoly )
{ {

View File

@ -180,8 +180,7 @@ void clearRect( ::cppcanvas::CanvasSharedPtr const& pCanvas,
basegfx::B2DRange(rArea))); basegfx::B2DRange(rArea)));
::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( pCanvas, ::cppcanvas::BaseGfxFactory::createPolyPolygon( pCanvas, aPoly ) );
aPoly ) );
if( pPolyPoly ) if( pPolyPoly )
{ {
@ -782,7 +781,7 @@ SlideView::SlideView( const uno::Reference<presentation::XSlideShowView>& xView,
ENSURE_OR_THROW( mxView.is(), ENSURE_OR_THROW( mxView.is(),
"SlideView::SlideView(): Invalid view" ); "SlideView::SlideView(): Invalid view" );
mpCanvas = cppcanvas::VCLFactory::getInstance().createSpriteCanvas( mpCanvas = cppcanvas::VCLFactory::createSpriteCanvas(
xView->getCanvas() ); xView->getCanvas() );
ENSURE_OR_THROW( mpCanvas, ENSURE_OR_THROW( mpCanvas,
"Could not create cppcanvas" ); "Could not create cppcanvas" );

View File

@ -677,8 +677,7 @@ namespace slideshow
::basegfx::tools::createPolygonFromRect( rRect )); ::basegfx::tools::createPolygonFromRect( rRect ));
::cppcanvas::PolyPolygonSharedPtr pPolyPoly( ::cppcanvas::PolyPolygonSharedPtr pPolyPoly(
::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( rCanvas, ::cppcanvas::BaseGfxFactory::createPolyPolygon( rCanvas, aPoly ) );
aPoly ) );
if( pPolyPoly ) if( pPolyPoly )
{ {

View File

@ -105,7 +105,7 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr&
// create a bitmap of appropriate size // create a bitmap of appropriate size
cppcanvas::BitmapSharedPtr pBitmap( cppcanvas::BitmapSharedPtr pBitmap(
cppcanvas::BaseGfxFactory::getInstance().createBitmap( cppcanvas::BaseGfxFactory::createBitmap(
pCanvas, pCanvas,
slideSizePixel ) ); slideSizePixel ) );

View File

@ -235,22 +235,22 @@ public:
librdf_storage *createStorage_Lock(librdf_world *i_pWorld) const; librdf_storage *createStorage_Lock(librdf_world *i_pWorld) const;
librdf_model *createModel_Lock(librdf_world *i_pWorld, librdf_model *createModel_Lock(librdf_world *i_pWorld,
librdf_storage * i_pStorage) const; librdf_storage * i_pStorage) const;
librdf_uri* mkURI_Lock(librdf_world* i_pWorld, static librdf_uri* mkURI_Lock(librdf_world* i_pWorld,
const OString & i_rURI) const; const OString & i_rURI);
librdf_node* mkResource_Lock(librdf_world* i_pWorld, static librdf_node* mkResource_Lock(librdf_world* i_pWorld,
const Resource * i_pResource) const; const Resource * i_pResource);
librdf_node* mkNode_Lock(librdf_world* i_pWorld, static librdf_node* mkNode_Lock(librdf_world* i_pWorld,
const Node * i_pNode) const; const Node * i_pNode);
librdf_statement* mkStatement_Lock(librdf_world* i_pWorld, static librdf_statement* mkStatement_Lock(librdf_world* i_pWorld,
Statement const& i_rStatement) const; Statement const& i_rStatement);
::boost::shared_ptr<Resource> extractResource_NoLock( static ::boost::shared_ptr<Resource> extractResource_NoLock(
const uno::Reference< rdf::XResource > & i_xResource) const; const uno::Reference< rdf::XResource > & i_xResource);
::boost::shared_ptr<Node> extractNode_NoLock( static ::boost::shared_ptr<Node> extractNode_NoLock(
const uno::Reference< rdf::XNode > & i_xNode) const; const uno::Reference< rdf::XNode > & i_xNode);
Statement extractStatement_NoLock( static Statement extractStatement_NoLock(
const uno::Reference< rdf::XResource > & i_xSubject, const uno::Reference< rdf::XResource > & i_xSubject,
const uno::Reference< rdf::XURI > & i_xPredicate, const uno::Reference< rdf::XURI > & i_xPredicate,
const uno::Reference< rdf::XNode > & i_xObject) const; const uno::Reference< rdf::XNode > & i_xObject);
uno::Reference<rdf::XURI> convertToXURI(librdf_uri* i_pURI) const; uno::Reference<rdf::XURI> convertToXURI(librdf_uri* i_pURI) const;
uno::Reference<rdf::XURI> convertToXURI(librdf_node* i_pURI) const; uno::Reference<rdf::XURI> convertToXURI(librdf_node* i_pURI) const;
uno::Reference<rdf::XResource> uno::Reference<rdf::XResource>
@ -1355,13 +1355,13 @@ throw (uno::RuntimeException, rdf::RepositoryException, std::exception)
} }
librdf_TypeConverter::Statement const stmt( librdf_TypeConverter::Statement const stmt(
m_TypeConverter.extractStatement_NoLock( librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject)); i_xSubject, i_xPredicate, i_xObject));
::osl::MutexGuard g(m_aMutex); // don't call i_x* with mutex locked ::osl::MutexGuard g(m_aMutex); // don't call i_x* with mutex locked
const boost::shared_ptr<librdf_statement> pStatement( const boost::shared_ptr<librdf_statement> pStatement(
m_TypeConverter.mkStatement_Lock(m_pWorld.get(), stmt), librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
safe_librdf_free_statement); safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed"); OSL_ENSURE(pStatement, "mkStatement failed");
@ -1581,15 +1581,14 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
} }
::boost::shared_ptr<librdf_TypeConverter::Resource> const pSubject( ::boost::shared_ptr<librdf_TypeConverter::Resource> const pSubject(
m_TypeConverter.extractResource_NoLock(i_xSubject)); librdf_TypeConverter::extractResource_NoLock(i_xSubject));
::boost::shared_ptr<librdf_TypeConverter::Node> const pContent( ::boost::shared_ptr<librdf_TypeConverter::Node> const pContent(
m_TypeConverter.extractNode_NoLock(xContent)); librdf_TypeConverter::extractNode_NoLock(xContent));
::std::vector< ::boost::shared_ptr<librdf_TypeConverter::Resource> > ::std::vector< ::boost::shared_ptr<librdf_TypeConverter::Resource> >
predicates; predicates;
::std::transform(i_rPredicates.begin(), i_rPredicates.end(), ::std::transform(i_rPredicates.begin(), i_rPredicates.end(),
::std::back_inserter(predicates), ::std::back_inserter(predicates),
::boost::bind(&librdf_TypeConverter::extractResource_NoLock, ::boost::bind(&librdf_TypeConverter::extractResource_NoLock, _1));
m_TypeConverter, _1));
removeStatementRDFa(i_xObject); // not atomic with insertion? removeStatementRDFa(i_xObject); // not atomic with insertion?
@ -1733,13 +1732,13 @@ throw (uno::RuntimeException, rdf::RepositoryException, std::exception)
} }
librdf_TypeConverter::Statement const stmt( librdf_TypeConverter::Statement const stmt(
m_TypeConverter.extractStatement_NoLock( librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject)); i_xSubject, i_xPredicate, i_xObject));
::osl::MutexGuard g(m_aMutex); // don't call i_x* with mutex locked ::osl::MutexGuard g(m_aMutex); // don't call i_x* with mutex locked
const boost::shared_ptr<librdf_statement> pStatement( const boost::shared_ptr<librdf_statement> pStatement(
m_TypeConverter.mkStatement_Lock(m_pWorld.get(), stmt), librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
safe_librdf_free_statement); safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed"); OSL_ENSURE(pStatement, "mkStatement failed");
@ -1844,7 +1843,7 @@ void librdf_Repository::addStatementGraph_NoLock(
} }
librdf_TypeConverter::Statement const stmt( librdf_TypeConverter::Statement const stmt(
m_TypeConverter.extractStatement_NoLock( librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject)); i_xSubject, i_xPredicate, i_xObject));
const OUString contextU( i_xGraphName->getStringValue() ); const OUString contextU( i_xGraphName->getStringValue() );
@ -1879,7 +1878,7 @@ void librdf_Repository::addStatementGraph_Lock(
"librdf_new_node_from_uri_string failed", *this); "librdf_new_node_from_uri_string failed", *this);
} }
const boost::shared_ptr<librdf_statement> pStatement( const boost::shared_ptr<librdf_statement> pStatement(
m_TypeConverter.mkStatement_Lock(m_pWorld.get(), i_rStatement), librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), i_rStatement),
safe_librdf_free_statement); safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed"); OSL_ENSURE(pStatement, "mkStatement failed");
@ -1919,7 +1918,7 @@ void librdf_Repository::removeStatementsGraph_NoLock(
} }
librdf_TypeConverter::Statement const stmt( librdf_TypeConverter::Statement const stmt(
m_TypeConverter.extractStatement_NoLock( librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject)); i_xSubject, i_xPredicate, i_xObject));
const OUString contextU( i_xGraphName->getStringValue() ); const OUString contextU( i_xGraphName->getStringValue() );
@ -1943,7 +1942,7 @@ void librdf_Repository::removeStatementsGraph_NoLock(
"librdf_new_node_from_uri_string failed", *this); "librdf_new_node_from_uri_string failed", *this);
} }
const boost::shared_ptr<librdf_statement> pStatement( const boost::shared_ptr<librdf_statement> pStatement(
m_TypeConverter.mkStatement_Lock(m_pWorld.get(), stmt), librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
safe_librdf_free_statement); safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed"); OSL_ENSURE(pStatement, "mkStatement failed");
@ -1999,7 +1998,7 @@ librdf_Repository::getStatementsGraph_NoLock(
} }
librdf_TypeConverter::Statement const stmt( librdf_TypeConverter::Statement const stmt(
m_TypeConverter.extractStatement_NoLock( librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject)); i_xSubject, i_xPredicate, i_xObject));
const OUString contextU( i_xGraphName->getStringValue() ); const OUString contextU( i_xGraphName->getStringValue() );
@ -2023,7 +2022,7 @@ librdf_Repository::getStatementsGraph_NoLock(
"librdf_new_node_from_uri_string failed", *this); "librdf_new_node_from_uri_string failed", *this);
} }
const boost::shared_ptr<librdf_statement> pStatement( const boost::shared_ptr<librdf_statement> pStatement(
m_TypeConverter.mkStatement_Lock(m_pWorld.get(), stmt), librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
safe_librdf_free_statement); safe_librdf_free_statement);
OSL_ENSURE(pStatement, "mkStatement failed"); OSL_ENSURE(pStatement, "mkStatement failed");
@ -2119,7 +2118,7 @@ librdf_model *librdf_TypeConverter::createModel_Lock(
// this does NOT create a node, only URI // this does NOT create a node, only URI
librdf_uri* librdf_TypeConverter::mkURI_Lock( librdf_world* i_pWorld, librdf_uri* librdf_TypeConverter::mkURI_Lock( librdf_world* i_pWorld,
OString const& i_rURI) const OString const& i_rURI)
{ {
librdf_uri *pURI( librdf_new_uri(i_pWorld, librdf_uri *pURI( librdf_new_uri(i_pWorld,
reinterpret_cast<const unsigned char *>(i_rURI.getStr()))); reinterpret_cast<const unsigned char *>(i_rURI.getStr())));
@ -2133,7 +2132,7 @@ librdf_uri* librdf_TypeConverter::mkURI_Lock( librdf_world* i_pWorld,
// extract blank or URI node - call without Mutex locked // extract blank or URI node - call without Mutex locked
::boost::shared_ptr<librdf_TypeConverter::Resource> ::boost::shared_ptr<librdf_TypeConverter::Resource>
librdf_TypeConverter::extractResource_NoLock( librdf_TypeConverter::extractResource_NoLock(
const uno::Reference< rdf::XResource > & i_xResource) const const uno::Reference< rdf::XResource > & i_xResource)
{ {
if (!i_xResource.is()) { if (!i_xResource.is()) {
return ::boost::shared_ptr<Resource>(); return ::boost::shared_ptr<Resource>();
@ -2154,7 +2153,7 @@ librdf_TypeConverter::extractResource_NoLock(
// create blank or URI node // create blank or URI node
librdf_node* librdf_TypeConverter::mkResource_Lock( librdf_world* i_pWorld, librdf_node* librdf_TypeConverter::mkResource_Lock( librdf_world* i_pWorld,
Resource const*const i_pResource) const Resource const*const i_pResource)
{ {
if (!i_pResource) return 0; if (!i_pResource) return 0;
BlankNode const*const pBlankNode( BlankNode const*const pBlankNode(
@ -2188,7 +2187,7 @@ librdf_node* librdf_TypeConverter::mkResource_Lock( librdf_world* i_pWorld,
// extract blank or URI or literal node - call without Mutex locked // extract blank or URI or literal node - call without Mutex locked
::boost::shared_ptr<librdf_TypeConverter::Node> ::boost::shared_ptr<librdf_TypeConverter::Node>
librdf_TypeConverter::extractNode_NoLock( librdf_TypeConverter::extractNode_NoLock(
const uno::Reference< rdf::XNode > & i_xNode) const const uno::Reference< rdf::XNode > & i_xNode)
{ {
if (!i_xNode.is()) { if (!i_xNode.is()) {
return ::boost::shared_ptr<Node>(); return ::boost::shared_ptr<Node>();
@ -2221,7 +2220,7 @@ librdf_TypeConverter::extractNode_NoLock(
// create blank or URI or literal node // create blank or URI or literal node
librdf_node* librdf_TypeConverter::mkNode_Lock( librdf_world* i_pWorld, librdf_node* librdf_TypeConverter::mkNode_Lock( librdf_world* i_pWorld,
Node const*const i_pNode) const Node const*const i_pNode)
{ {
if (!i_pNode) return 0; if (!i_pNode) return 0;
Resource const*const pResource(dynamic_cast<Resource const*>(i_pNode)); Resource const*const pResource(dynamic_cast<Resource const*>(i_pNode));
@ -2266,7 +2265,7 @@ librdf_node* librdf_TypeConverter::mkNode_Lock( librdf_world* i_pWorld,
librdf_TypeConverter::Statement librdf_TypeConverter::extractStatement_NoLock( librdf_TypeConverter::Statement librdf_TypeConverter::extractStatement_NoLock(
const uno::Reference< rdf::XResource > & i_xSubject, const uno::Reference< rdf::XResource > & i_xSubject,
const uno::Reference< rdf::XURI > & i_xPredicate, const uno::Reference< rdf::XURI > & i_xPredicate,
const uno::Reference< rdf::XNode > & i_xObject) const const uno::Reference< rdf::XNode > & i_xObject)
{ {
::boost::shared_ptr<Resource> const pSubject( ::boost::shared_ptr<Resource> const pSubject(
extractResource_NoLock(i_xSubject)); extractResource_NoLock(i_xSubject));
@ -2279,7 +2278,7 @@ librdf_TypeConverter::Statement librdf_TypeConverter::extractStatement_NoLock(
} }
librdf_statement* librdf_TypeConverter::mkStatement_Lock(librdf_world* i_pWorld, librdf_statement* librdf_TypeConverter::mkStatement_Lock(librdf_world* i_pWorld,
Statement const& i_rStatement) const Statement const& i_rStatement)
{ {
librdf_node *const pSubject( librdf_node *const pSubject(
mkResource_Lock(i_pWorld, i_rStatement.pSubject.get()) ); mkResource_Lock(i_pWorld, i_rStatement.pSubject.get()) );