From fcee26267f09e01e126a72236b494525109e955a Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 12 Nov 2009 12:44:18 +0100 Subject: #i106852# fix because of solaris missing grep fuctionality --- sysui/desktop/cleanversion/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysui/desktop/cleanversion/makefile.mk b/sysui/desktop/cleanversion/makefile.mk index 71a0d7e3dfd9..d89b192b4995 100644 --- a/sysui/desktop/cleanversion/makefile.mk +++ b/sysui/desktop/cleanversion/makefile.mk @@ -43,7 +43,7 @@ ALLTAR: $(MISC)$/cleanup.flag # version changed - bin previous trees $(MISC)$/cleanup.flag : ..$/productversion.mk - rm -rf `ls $(MISC) | grep -v -x $(MISC)$/logs` && $(TOUCH) $@ + rm -rf `ls -d ../../unxsols4.pro/misc/* | sed '/\/logs$/d'` && $(TOUCH) $@ .ENDIF # "$(MISC)"!="" -- cgit From ab41fc59820938df287c369362ea25fa7a91ef96 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 30 Mar 2010 17:54:56 +0200 Subject: renaissance1 #i110498# All needed changes for SoftShadow for DRawPage visualisation --- .../primitive2d/discreteshadowprimitive2d.hxx | 128 ++++++++ .../primitive2d/drawinglayer_primitivetypes2d.hxx | 1 + drawinglayer/prj/d.lst | 2 + .../primitive2d/discreteshadowprimitive2d.cxx | 339 +++++++++++++++++++++ drawinglayer/source/primitive2d/makefile.mk | 1 + .../source/processor2d/vclhelperbitmaprender.cxx | 34 ++- svx/inc/svdstr.hrc | 1 + svx/source/sdr/contact/viewcontactofsdrpage.cxx | 84 +++-- .../sdr/contact/viewobjectcontactofsdrpage.cxx | 6 + svx/source/svdraw/svdstr.src | 5 + 10 files changed, 566 insertions(+), 35 deletions(-) create mode 100644 drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx create mode 100644 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx diff --git a/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx new file mode 100644 index 000000000000..c30bff545ddb --- /dev/null +++ b/drawinglayer/inc/drawinglayer/primitive2d/discreteshadowprimitive2d.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX +#define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX + +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// +// DiscreteShadowPrimitive2D class + +namespace drawinglayer +{ + namespace primitive2d + { + /** DiscreteShadow data class + + */ + class DiscreteShadow + { + private: + /// the original shadow BitmapEx in a special form + BitmapEx maBitmapEx; + + /// buffered extracted parts of CombinedShadow for easier usage + BitmapEx maTopLeft; + BitmapEx maTop; + BitmapEx maTopRight; + BitmapEx maRight; + BitmapEx maBottomRight; + BitmapEx maBottom; + BitmapEx maBottomLeft; + BitmapEx maLeft; + + public: + /// constructor + DiscreteShadow(const BitmapEx& rBitmapEx); + + /// data read access + const BitmapEx& getBitmapEx() const { return maBitmapEx; } + + /// compare operator + bool operator==(const DiscreteShadow& rCompare) const + { + return getBitmapEx() == rCompare.getBitmapEx(); + } + + /// helper accesses which create on-demand needed segments + const BitmapEx& getTopLeft() const; + const BitmapEx& getTop() const; + const BitmapEx& getTopRight() const; + const BitmapEx& getRight() const; + const BitmapEx& getBottomRight() const; + const BitmapEx& getBottom() const; + const BitmapEx& getBottomLeft() const; + const BitmapEx& getLeft() const; + }; + + /** DiscreteShadowPrimitive2D class + + */ + class DiscreteShadowPrimitive2D : public DiscreteMetricDependentPrimitive2D + { + private: + // the object transformation of the rectangular object + basegfx::B2DHomMatrix maTransform; + + // the bitmap shadow data + DiscreteShadow maDiscreteShadow; + + protected: + /// create local decomposition + virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const; + + public: + /// constructor + DiscreteShadowPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const DiscreteShadow& rDiscreteShadow); + + /// data read access + const basegfx::B2DHomMatrix& getTransform() const { return maTransform; } + const DiscreteShadow& getDiscreteShadow() const { return maDiscreteShadow; } + + /// compare operator + virtual bool operator==(const BasePrimitive2D& rPrimitive) const; + + /// get range + virtual basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& rViewInformation) const; + + /// provide unique ID + DeclPrimitrive2DIDBlock() + }; + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +#endif // INCLUDED_DRAWINGLAYER_PRIMITIVE2D_QUADRATICSHADOWPRIMITIVE2D_HXX + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index fb4463977a01..0561bf5e09cb 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -101,6 +101,7 @@ #define PRIMITIVE2D_ID_TEXTCHARACTERSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 58) #define PRIMITIVE2D_ID_TEXTGEOMETRYSTRIKEOUTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 59) #define PRIMITIVE2D_ID_EPSPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 60) +#define PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 61) ////////////////////////////////////////////////////////////////////////////// diff --git a/drawinglayer/prj/d.lst b/drawinglayer/prj/d.lst index ee5b96d98a03..748ac0ac750b 100644 --- a/drawinglayer/prj/d.lst +++ b/drawinglayer/prj/d.lst @@ -16,6 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\drawinglayer\primitive2d ..\inc\drawinglayer\primitive2d\borderlineprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\borderlineprimitive2d.hxx ..\inc\drawinglayer\primitive2d\chartprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\chartprimitive2d.hxx ..\inc\drawinglayer\primitive2d\controlprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\controlprimitive2d.hxx +..\inc\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discretebitmapprimitive2d.hxx +..\inc\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\discreteshadowprimitive2d.hxx ..\inc\drawinglayer\primitive2d\embedded3dprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\embedded3dprimitive2d.hxx ..\inc\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillbitmapprimitive2d.hxx ..\inc\drawinglayer\primitive2d\fillgradientprimitive2d.hxx %_DEST%\inc%_EXT%\drawinglayer\primitive2d\fillgradientprimitive2d.hxx diff --git a/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx new file mode 100644 index 000000000000..a4afd501728b --- /dev/null +++ b/drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx @@ -0,0 +1,339 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_drawinglayer.hxx" + +#include +#include +#include +#include +#include +#include + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + DiscreteShadow::DiscreteShadow(const BitmapEx& rBitmapEx) + : maBitmapEx(rBitmapEx), + maTopLeft(), + maTop(), + maTopRight(), + maRight(), + maBottomRight(), + maBottom(), + maBottomLeft(), + maLeft() + { + const Size& rBitmapSize = getBitmapEx().GetSizePixel(); + + if(rBitmapSize.Width() != rBitmapSize.Height() || rBitmapSize.Width() < 7) + { + OSL_ENSURE(false, "DiscreteShadowPrimitive2D: wrong bitmap format (!)"); + maBitmapEx = BitmapEx(); + } + } + + const BitmapEx& DiscreteShadow::getTopLeft() const + { + if(maTopLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTopLeft.Crop( + Rectangle(Point(0,0),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maTopLeft; + } + + const BitmapEx& DiscreteShadow::getTop() const + { + if(maTop.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTop = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTop.Crop( + Rectangle(Point(nQuarter*2+1,0),Size(1,nQuarter+1))); + } + + return maTop; + } + + const BitmapEx& DiscreteShadow::getTopRight() const + { + if(maTopRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maTopRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maTopRight.Crop( + Rectangle(Point(nQuarter*2+2,0),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maTopRight; + } + + const BitmapEx& DiscreteShadow::getRight() const + { + if(maRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maRight.Crop( + Rectangle(Point(nQuarter*3+2,nQuarter*2+1),Size(nQuarter+1,1))); + } + + return maRight; + } + + const BitmapEx& DiscreteShadow::getBottomRight() const + { + if(maBottomRight.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomRight = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottomRight.Crop( + Rectangle(Point(nQuarter*2+2,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maBottomRight; + } + + const BitmapEx& DiscreteShadow::getBottom() const + { + if(maBottom.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottom = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottom.Crop( + Rectangle(Point(nQuarter*2+1,nQuarter*3+2),Size(1,nQuarter+1))); + } + + return maBottom; + } + + const BitmapEx& DiscreteShadow::getBottomLeft() const + { + if(maBottomLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maBottomLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maBottomLeft.Crop( + Rectangle(Point(0,nQuarter*2+2),Size(nQuarter*2+1,nQuarter*2+1))); + } + + return maBottomLeft; + } + + const BitmapEx& DiscreteShadow::getLeft() const + { + if(maLeft.IsEmpty()) + { + const sal_Int32 nQuarter((getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const_cast< DiscreteShadow* >(this)->maLeft = getBitmapEx(); + const_cast< DiscreteShadow* >(this)->maLeft.Crop( + Rectangle(Point(0,nQuarter*2+1),Size(nQuarter+1,1))); + } + + return maLeft; + } + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// + +namespace drawinglayer +{ + namespace primitive2d + { + Primitive2DSequence DiscreteShadowPrimitive2D::create2DDecomposition(const geometry::ViewInformation2D& /*rViewInformation*/) const + { + Primitive2DSequence xRetval; + + if(!getDiscreteShadow().getBitmapEx().IsEmpty()) + { + const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const basegfx::B2DVector aScale(getTransform() * basegfx::B2DVector(1.0, 1.0)); + const double fSingleX(getDiscreteUnit() / aScale.getX()); + const double fSingleY(getDiscreteUnit() / aScale.getY()); + const double fBorderX(fSingleX * nQuarter); + const double fBorderY(fSingleY * nQuarter); + const double fBigLenX((fBorderX * 2.0) + fSingleX); + const double fBigLenY((fBorderY * 2.0) + fSingleY); + + xRetval.realloc(8); + + // TopLeft + xRetval[0] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTopLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + -fBorderX, + -fBorderY))); + + // Top + xRetval[1] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTop(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + 1.0 - (2.0 * fBorderX) - fSingleX, + fBorderY + fSingleY, + fBorderX + fSingleX, + -fBorderY))); + + // TopRight + xRetval[2] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getTopRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + 1.0 - fBorderX, + -fBorderY))); + + // Right + xRetval[3] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBorderX + fSingleX, + 1.0 - (2.0 * fBorderY) - fSingleY, + 1.0, + fBorderY + fSingleY))); + + // BottomRight + xRetval[4] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottomRight(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + 1.0 - fBorderX, + 1.0 - fBorderY))); + + // Bottom + xRetval[5] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottom(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + 1.0 - (2.0 * fBorderX) - fSingleX, + fBorderY + fSingleY, + fBorderX + fSingleX, + 1.0))); + + // BottomLeft + xRetval[6] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getBottomLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBigLenX, + fBigLenY, + -fBorderX, + 1.0 - fBorderY))); + + // Left + xRetval[7] = Primitive2DReference( + new BitmapPrimitive2D( + getDiscreteShadow().getLeft(), + basegfx::tools::createScaleTranslateB2DHomMatrix( + fBorderX + fSingleX, + 1.0 - (2.0 * fBorderY) - fSingleY, + -fBorderX, + fBorderY + fSingleY))); + + // put all in object transformation to get to target positions + const Primitive2DReference xTransformed( + new TransformPrimitive2D( + getTransform(), + xRetval)); + + xRetval = Primitive2DSequence(&xTransformed, 1); + } + + return xRetval; + } + + DiscreteShadowPrimitive2D::DiscreteShadowPrimitive2D( + const basegfx::B2DHomMatrix& rTransform, + const DiscreteShadow& rDiscreteShadow) + : DiscreteMetricDependentPrimitive2D(), + maTransform(rTransform), + maDiscreteShadow(rDiscreteShadow) + { + } + + bool DiscreteShadowPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const + { + if(DiscreteMetricDependentPrimitive2D::operator==(rPrimitive)) + { + const DiscreteShadowPrimitive2D& rCompare = (DiscreteShadowPrimitive2D&)rPrimitive; + + return (getTransform() == rCompare.getTransform() + && getDiscreteShadow() == rCompare.getDiscreteShadow()); + } + + return false; + } + + basegfx::B2DRange DiscreteShadowPrimitive2D::getB2DRange(const geometry::ViewInformation2D& rViewInformation) const + { + if(getDiscreteShadow().getBitmapEx().IsEmpty()) + { + // no graphics without valid bitmap definition + return basegfx::B2DRange(); + } + else + { + // prepare normal objectrange + basegfx::B2DRange aRetval(0.0, 0.0, 1.0, 1.0); + aRetval.transform(getTransform()); + + // extract discrete shadow size and grow + const basegfx::B2DVector aScale(rViewInformation.getViewTransformation() * basegfx::B2DVector(1.0, 1.0)); + const sal_Int32 nQuarter((getDiscreteShadow().getBitmapEx().GetSizePixel().Width() - 3) >> 2); + const double fGrowX((1.0 / aScale.getX()) * nQuarter); + const double fGrowY((1.0 / aScale.getY()) * nQuarter); + aRetval.grow(std::max(fGrowX, fGrowY)); + + return aRetval; + } + } + + // provide unique ID + ImplPrimitrive2DIDBlock(DiscreteShadowPrimitive2D, PRIMITIVE2D_ID_DISCRETESHADOWPRIMITIVE2D) + + } // end of namespace primitive2d +} // end of namespace drawinglayer + +////////////////////////////////////////////////////////////////////////////// +// eof diff --git a/drawinglayer/source/primitive2d/makefile.mk b/drawinglayer/source/primitive2d/makefile.mk index 87c6c15437e2..bed3d6d7b0b2 100644 --- a/drawinglayer/source/primitive2d/makefile.mk +++ b/drawinglayer/source/primitive2d/makefile.mk @@ -46,6 +46,7 @@ SLOFILES= \ $(SLO)$/chartprimitive2d.obj \ $(SLO)$/controlprimitive2d.obj \ $(SLO)$/discretebitmapprimitive2d.obj \ + $(SLO)$/discreteshadowprimitive2d.obj \ $(SLO)$/embedded3dprimitive2d.obj \ $(SLO)$/epsprimitive2d.obj \ $(SLO)$/fillbitmapprimitive2d.obj \ diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index db61e0721ef0..a6772d806fbd 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -85,9 +85,13 @@ namespace drawinglayer } // prepare dest coor + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); // paint it using GraphicManager Graphic aGraphic(rBitmapEx); @@ -106,9 +110,13 @@ namespace drawinglayer // prepare dest coor. Necessary to expand since vcl's DrawBitmapEx draws one pix less basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectPixel( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); // decompose matrix to check for shear, rotate and mirroring basegfx::B2DVector aScale, aTranslate; @@ -145,9 +153,13 @@ namespace drawinglayer // process self with free transformation (containing shear and rotate). Get dest rect in pixels. basegfx::B2DRange aOutlineRange(0.0, 0.0, 1.0, 1.0); aOutlineRange.transform(rTransform); + const sal_uInt32 nDiscreteWidth(basegfx::fround(aOutlineRange.getMaxX())); + const sal_uInt32 nDiscreteHeight(basegfx::fround(aOutlineRange.getMaxY())); const Rectangle aDestRectLogic( - basegfx::fround(aOutlineRange.getMinX()), basegfx::fround(aOutlineRange.getMinY()), - basegfx::fround(aOutlineRange.getMaxX()), basegfx::fround(aOutlineRange.getMaxY())); + basegfx::fround(aOutlineRange.getMinX()), + basegfx::fround(aOutlineRange.getMinY()), + nDiscreteWidth > 0 ? nDiscreteWidth - 1 : 0, + nDiscreteHeight > 0 ? nDiscreteHeight - 1 : 0); const Rectangle aDestRectPixel(rOutDev.LogicToPixel(aDestRectLogic)); // #i96708# check if Metafile is recorded @@ -161,18 +173,19 @@ namespace drawinglayer if(!aCroppedRectPixel.IsEmpty()) { - // as maximum for destination, orientate at SourceSizePixel, but + // as maximum for destination, orientate at aOutputRectPixel, but // take a rotation of 45 degrees (sqrt(2)) as maximum expansion into account const Size aSourceSizePixel(rBitmapEx.GetSizePixel()); const double fMaximumArea( - (double)aSourceSizePixel.getWidth() * - (double)aSourceSizePixel.getHeight() * + (double)aOutputRectPixel.getWidth() * + (double)aOutputRectPixel.getHeight() * 1.4142136); // 1.4142136 taken as sqrt(2.0) // test if discrete view size (pixel) maybe too big and limit it const double fArea(aCroppedRectPixel.getWidth() * aCroppedRectPixel.getHeight()); const bool bNeedToReduce(fArea > fMaximumArea); double fReduceFactor(1.0); + const Size aDestSizePixel(aCroppedRectPixel.GetSize()); if(bNeedToReduce) { @@ -220,9 +233,6 @@ namespace drawinglayer { // paint in target size const double fFactor(1.0 / fReduceFactor); - const Size aDestSizePixel( - basegfx::fround(aCroppedRectPixel.getWidth() * fFactor), - basegfx::fround(aCroppedRectPixel.getHeight() * fFactor)); if(bRecordToMetaFile) { diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc index f1c19b4e0895..2a1b1df52dec 100644 --- a/svx/inc/svdstr.hrc +++ b/svx/inc/svdstr.hrc @@ -756,6 +756,7 @@ //BFS01#define SIP_SDRATTRSET_GRAF (SIP_Begin + 258) #define SIP_SA_MARKERS (SIP_Begin + 258) +#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259) #define SIP_SA_FINE_MARKERS (SIP_Begin + 260) // #100499# diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index c4a51200d5fc..be5d0de79cae 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -45,6 +45,10 @@ #include #include #include +#include +#include "svdstr.hrc" +#include "svdglob.hxx" +#include ////////////////////////////////////////////////////////////////////////////// @@ -130,31 +134,59 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const { + static bool bUseOldPageShadow(false); const SdrPage& rPage = getPage(); basegfx::B2DHomMatrix aPageMatrix; aPageMatrix.set(0, 0, (double)rPage.GetWdt()); aPageMatrix.set(1, 1, (double)rPage.GetHgt()); - // create page shadow polygon - const double fPageBorderFactor(1.0 / 256.0); - basegfx::B2DPolygon aPageShadowPolygon; - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); - aPageShadowPolygon.setClosed(true); - aPageShadowPolygon.transform(aPageMatrix); + if(bUseOldPageShadow) + { + // create page shadow polygon + const double fPageBorderFactor(1.0 / 256.0); + basegfx::B2DPolygon aPageShadowPolygon; + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); + aPageShadowPolygon.setClosed(true); + aPageShadowPolygon.transform(aPageMatrix); + + // We have only the page information, not the view information. Use the + // svtools::FONTCOLOR color for initialisation + const svtools::ColorConfig aColorConfig; + const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPageShadowPolygon), + aRGBShadowColor)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + static vcl::DeleteOnDeinit< BitmapEx > aPageShadow35x35( + new BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr()))); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageShadowPolygon), aRGBShadowColor)); + if(aPageShadow35x35.get()) + { + static drawinglayer::primitive2d::DiscreteShadow aDiscreteShadow(*aPageShadow35x35.get()); - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( + aPageMatrix, + aDiscreteShadow)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + return drawinglayer::primitive2d::Primitive2DSequence(); + } + } } ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage) @@ -315,11 +347,17 @@ namespace sdr const SdrPage& rPage = getPage(); const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt()); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor()); + // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. + // Added old case as fallback for HighContrast. + basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff); + + if(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) + { + const svtools::ColorConfig aColorConfig; + const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + + aRGBBorderColor = aBorderColor.getBColor(); + } if(rPage.getPageBorderOnlyLeftRight()) { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index c751ba2ada76..f7145dcd9d73 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -320,6 +320,12 @@ namespace sdr return false; } + // no page shadow for high contrast mode + if(GetObjectContact().isDrawModeHighContrast()) + { + return false; + } + return true; } } // end of namespace contact diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index ee6cbaea9632..3569aa35c6ff 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -2741,6 +2741,11 @@ String SIP_SA_GRAFRESERVE4 { Text = "" ; }; String SIP_SA_GRAFRESERVE5 { Text = "" ; }; String SIP_SA_GRAFRESERVE6 { Text = "" ; }; +Bitmap SIP_SA_PAGESHADOW35X35 +{ + File = "pageshadow35x35.png"; +}; + Bitmap SIP_SA_MARKERS { File = "markers.bmp"; -- cgit From 396d3e951004833cedb68d34edc1be6e65fd21d3 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 30 Mar 2010 18:08:32 +0200 Subject: renaissance1: corrected warning --- drawinglayer/source/processor2d/vclhelperbitmaprender.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index a6772d806fbd..80e34ba27701 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -232,8 +232,6 @@ namespace drawinglayer if(bNeedToReduce) { // paint in target size - const double fFactor(1.0 / fReduceFactor); - if(bRecordToMetaFile) { rOutDev.DrawBitmapEx( -- cgit From b0e177a0328fe46a08e0da9b4b468466c5bf4ba1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 27 Apr 2010 12:34:19 +0200 Subject: fs33a: #111181# ImplSign: proper check whether the doc can be signed (only bail out if the document is no new) --- sfx2/source/doc/objserv.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c063546da1c7..e06773f7f178 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1337,8 +1337,13 @@ sal_uInt16 SfxObjectShell::ImplGetSignatureState( sal_Bool bScriptingContent ) void SfxObjectShell::ImplSign( sal_Bool bScriptingContent ) { // Check if it is stored in OASIS format... - if ( GetMedium() && GetMedium()->GetFilter() - && ( !GetMedium()->GetFilter()->IsOwnFormat() || !GetMedium()->HasStorage_Impl() ) ) + if ( GetMedium() + && GetMedium()->GetFilter() + && GetMedium()->GetName().Len() + && ( !GetMedium()->GetFilter()->IsOwnFormat() + || !GetMedium()->HasStorage_Impl() + ) + ) { // Only OASIS and OOo6.x formats will be handled further InfoBox( NULL, SfxResId( RID_XMLSEC_INFO_WRONGDOCFORMAT ) ).Execute(); -- cgit From cd8bfb54fe09af501cec997b3f4879be480d31ed Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 14 May 2010 16:49:41 +0200 Subject: sb123: #i111602# adapted desktop/qa/deployment_misc to new test framework --- desktop/prj/build.lst | 3 ++- desktop/qa/deployment_misc/makefile.mk | 10 +++------- desktop/qa/deployment_misc/test_dp_version.cxx | 9 ++++++--- desktop/qa/deployment_misc/version.map | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 9253b4e82bc7..d5980567cb10 100644 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -1,4 +1,4 @@ -dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr NULL +dt desktop : l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg configmgr cppunit NULL dt desktop usr1 - all dt_mkout NULL dt desktop\inc nmake - all dt_inc NULL dt desktop\prj get - all dt_prj NULL @@ -42,3 +42,4 @@ dt desktop\registry\data\org\openoffice\Office nmake - a dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL dt desktop\source\registration\com\sun\star\servicetag nmake - all sn_svctag NULL dt desktop\source\registration\com\sun\star\registration nmake - all sn_regjob sn_svctag NULL +dt desktop\qa\deployment_misc nmake - all sn_qa_deployment_misc dt_dp_misc dt_inc NULL diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index 15faef0dc46e..b237a006783c 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -35,20 +35,16 @@ ENABLE_EXCEPTIONS := TRUE .INCLUDE: $(PRJ)$/source$/deployment$/inc$/dp_misc.mk CFLAGSCXX += $(CPPUNIT_CFLAGS) -DLLPRE = # no leading "lib" on .so files SHL1TARGET = $(TARGET) SHL1OBJS = $(SLO)$/test_dp_version.obj -SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB) $(TESTSHL2LIB) +SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB) SHL1VERSIONMAP = version.map +SHL1RPATH = NONE SHL1IMPLIB = i$(SHL1TARGET) DEF1NAME = $(SHL1TARGET) SLOFILES = $(SHL1OBJS) .INCLUDE: target.mk - -ALLTAR: test - -test .PHONY: $(SHL1TARGETN) - $(TESTSHL2) $(SHL1TARGETN) +.INCLUDE : _cppunit.mk diff --git a/desktop/qa/deployment_misc/test_dp_version.cxx b/desktop/qa/deployment_misc/test_dp_version.cxx index 7b974a8bae73..a5d50f4ac6be 100644 --- a/desktop/qa/deployment_misc/test_dp_version.cxx +++ b/desktop/qa/deployment_misc/test_dp_version.cxx @@ -32,7 +32,10 @@ #include -#include "testshl/simpleheader.hxx" +#include "cppunit/TestAssert.h" +#include "cppunit/TestFixture.h" +#include "cppunit/extensions/HelperMacros.h" +#include "cppunit/plugin/TestPlugIn.h" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -83,8 +86,8 @@ void Test::test() { } } -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests"); +CPPUNIT_TEST_SUITE_REGISTRATION(Test); } -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/desktop/qa/deployment_misc/version.map b/desktop/qa/deployment_misc/version.map index 7321bbca16ad..3308588ef6f8 100644 --- a/desktop/qa/deployment_misc/version.map +++ b/desktop/qa/deployment_misc/version.map @@ -27,7 +27,7 @@ UDK_3_0_0 { global: - registerAllTestFunction; + cppunitTestPlugIn; local: *; -- cgit From 50c6c0aaebeda0f131e35da61729479180184192 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 13:46:22 +0200 Subject: changehid: #i111874# remove SmartId, make HID of type rtl::OString, fill in dummies for all explicit help ids --- avmedia/source/framework/mediacontrol.cxx | 36 ++++++--- avmedia/source/framework/mediaplayer.cxx | 3 +- avmedia/source/viewer/mediawindow_impl.cxx | 3 +- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 18 +++-- .../source/deployment/gui/dp_gui_extlistbox.cxx | 3 +- desktop/source/deployment/gui/license_dialog.cxx | 3 +- desktop/source/migration/wizard.cxx | 12 ++- editeng/source/editeng/editview.cxx | 6 +- editeng/source/misc/svxacorr.cxx | 3 +- formula/inc/formula/formdata.hxx | 7 +- formula/inc/formula/formula.hxx | 14 ++-- formula/source/ui/dlg/formula.cxx | 93 ++++++++++++++-------- formula/source/ui/dlg/funcpage.cxx | 10 ++- formula/source/ui/dlg/funcpage.hxx | 3 +- formula/source/ui/dlg/funcutl.cxx | 6 +- formula/source/ui/dlg/parawin.cxx | 10 ++- fpicker/source/office/OfficeControlAccess.cxx | 17 ++-- fpicker/source/office/iodlg.cxx | 74 +++++++++++------ framework/source/layoutmanager/layoutmanager.cxx | 4 +- framework/source/services/backingcomp.cxx | 3 +- framework/source/services/backingwindow.cxx | 18 ++--- .../source/uielement/macrosmenucontroller.cxx | 6 +- framework/source/uielement/menubarmanager.cxx | 4 +- framework/source/uielement/statusbarmanager.cxx | 3 +- framework/source/uielement/statusbarwrapper.cxx | 3 +- framework/source/uielement/toolbarmanager.cxx | 16 ++-- framework/source/uielement/toolbarmerger.cxx | 4 +- .../source/uielement/toolbarsmenucontroller.cxx | 3 +- sfx2/inc/sfx2/passwd.hxx | 2 +- sfx2/inc/sfxhelp.hxx | 12 ++- sfx2/source/appl/appserv.cxx | 6 +- sfx2/source/appl/newhelp.cxx | 57 ++++++++----- sfx2/source/appl/sfxhelp.cxx | 24 +++++- sfx2/source/dialog/about.cxx | 3 +- sfx2/source/dialog/basedlgs.cxx | 30 +++---- sfx2/source/dialog/dockwin.cxx | 17 ++-- sfx2/source/dialog/filedlghelper.cxx | 3 +- sfx2/source/dialog/navigat.cxx | 3 +- sfx2/source/dialog/tabdlg.cxx | 12 ++- sfx2/source/dialog/templdlg.cxx | 21 +++-- sfx2/source/doc/docvor.cxx | 5 +- sfx2/source/doc/new.cxx | 3 +- sfx2/source/doc/querytemplate.cxx | 3 +- sfx2/source/menu/mnumgr.cxx | 6 +- sfx2/source/menu/virtmenu.cxx | 3 +- sfx2/source/toolbox/tbxitem.cxx | 3 +- sfx2/source/view/frame2.cxx | 3 +- svx/inc/svx/simptabl.hxx | 3 +- svx/source/dialog/ctredlin.cxx | 15 ++-- svx/source/dialog/dlgctl3d.cxx | 9 ++- svx/source/fmcomp/fmgridif.cxx | 4 +- svx/source/fmcomp/gridctrl.cxx | 21 +++-- svx/source/form/datanavi.cxx | 3 +- svx/source/form/filtnav.cxx | 6 +- svx/source/form/fmPropBrw.cxx | 3 +- svx/source/form/fmexpl.cxx | 3 +- svx/source/form/navigatortree.cxx | 3 +- svx/source/form/tabwin.cxx | 6 +- svx/source/form/tbxform.cxx | 3 +- svx/source/gallery2/galbrws1.cxx | 6 +- svx/source/gallery2/galbrws2.cxx | 6 +- svx/source/gallery2/galctrl.cxx | 12 ++- svx/source/stbctrls/insctrl.cxx | 3 +- svx/source/stbctrls/pszctrl.cxx | 3 +- svx/source/stbctrls/xmlsecctrl.cxx | 3 +- svx/source/tbxctrls/extrusioncontrols.cxx | 36 ++++++--- svx/source/tbxctrls/fillctrl.cxx | 6 +- svx/source/tbxctrls/fontworkgallery.cxx | 24 ++++-- svx/source/tbxctrls/grafctrl.cxx | 5 +- svx/source/tbxctrls/linectrl.cxx | 6 +- svx/source/tbxctrls/tbcontrl.cxx | 12 ++- .../chinese_dictionarydialog.cxx | 18 +++-- .../chinese_translationdialog.cxx | 9 ++- 73 files changed, 540 insertions(+), 289 deletions(-) diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index a71b5268abd7..781f2b7d290d 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -94,10 +94,12 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), String( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, ""/*HID_AVMEDIA_TOOLBOXITEM_OPEN*/ ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, implGetImage( AVMEDIA_IMG_INSERT ), String( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, ""/*HID_AVMEDIA_TOOLBOXITEM_INSERT*/ ); maPlayToolBox.InsertSeparator(); } @@ -117,18 +119,22 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : } maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, implGetImage( AVMEDIA_IMG_PLAY ), String( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), TIB_CHECKABLE ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, ""/*HID_AVMEDIA_TOOLBOXITEM_PLAY*/ ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, implGetImage( AVMEDIA_IMG_PAUSE ), String( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), TIB_CHECKABLE ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, ""/*HID_AVMEDIA_TOOLBOXITEM_PAUSE*/ ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_STOP, implGetImage( AVMEDIA_IMG_STOP ), String( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), TIB_CHECKABLE ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, ""/*HID_AVMEDIA_TOOLBOXITEM_STOP*/ ); maPlayToolBox.InsertSeparator(); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, implGetImage( AVMEDIA_IMG_ENDLESS ), String( AVMEDIA_RESID( AVMEDIA_STR_ENDLESS ) ) ); - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP ); + // FIXME: HELPID + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, ""/*HID_AVMEDIA_TOOLBOXITEM_LOOP*/ ); if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle ) maPlayToolBox.InsertSeparator(); @@ -141,7 +147,8 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maTimeSlider.SetSlideHdl( LINK( this, MediaControl, implTimeHdl ) ); maTimeSlider.SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) ); maTimeSlider.SetRange( Range( 0, AVMEDIA_TIME_RANGE ) ); - maTimeSlider.SetHelpId( HID_AVMEDIA_TIMESLIDER ); + // FIXME: HELPID + maTimeSlider.SetHelpId( ""/*HID_AVMEDIA_TIMESLIDER*/ ); maTimeSlider.SetUpdateMode( true ); maTimeSlider.SetSizePixel( Size( 128, maPlayToolBox.GetSizePixel().Height() ) ); maTimeSlider.Show(); @@ -151,7 +158,8 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maTimeEdit.SetUpdateMode( true ); maTimeEdit.SetSizePixel( Size( maTimeEdit.GetTextWidth( aTimeText ) + 8, maPlayToolBox.GetSizePixel().Height() ) ); maTimeEdit.SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() ); - maTimeEdit.SetHelpId( HID_AVMEDIA_TIMEEDIT ); + // FIXME: HELPID + maTimeEdit.SetHelpId( ""/*HID_AVMEDIA_TIMEEDIT*/ ); maTimeEdit.Disable(); maTimeEdit.Show(); maMinSize.Width() += maTimeEdit.GetSizePixel().Width(); @@ -160,7 +168,8 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maMuteToolBox.InsertSeparator(); maMuteToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, implGetImage( AVMEDIA_IMG_MUTE ), String( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) ); - maMuteToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE ); + // FIXME: HELPID + maMuteToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, ""/*HID_AVMEDIA_TOOLBOXITEM_MUTE*/ ); maMuteToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); maMuteToolBox.SetSizePixel( maMuteToolBox.CalcWindowSizePixel() ); @@ -171,7 +180,8 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maVolumeSlider.SetEndSlideHdl( LINK( this, MediaControl, implVolumeEndHdl ) ); maVolumeSlider.SetRange( Range( AVMEDIA_DB_RANGE, 0 ) ); maVolumeSlider.SetUpdateMode( true ); - maVolumeSlider.SetHelpId( HID_AVMEDIA_VOLUMESLIDER ); + // FIXME: HELPID + maVolumeSlider.SetHelpId( ""/*HID_AVMEDIA_VOLUMESLIDER*/ ); maVolumeSlider.SetSizePixel( Size( 48, maPlayToolBox.GetSizePixel().Height() ) ); maVolumeSlider.Show(); maMinSize.Width() += maVolumeSlider.GetSizePixel().Width(); @@ -182,10 +192,12 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : mpZoomListBox->InsertEntry( String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_200 ) ), AVMEDIA_ZOOMLEVEL_200 ); mpZoomListBox->InsertEntry( String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_FIT ) ), AVMEDIA_ZOOMLEVEL_FIT ); mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) ); - mpZoomListBox->SetHelpId( HID_AVMEDIA_ZOOMLISTBOX ); + // FIXME: HELPID + mpZoomListBox->SetHelpId( ""/*HID_AVMEDIA_ZOOMLISTBOX*/ ); maZoomToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM ) ) ); - maZoomToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, HID_AVMEDIA_ZOOMLISTBOX ); + // FIXME: HELPID + maZoomToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, ""/*HID_AVMEDIA_ZOOMLISTBOX*/ ); maZoomToolBox.SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, mpZoomListBox ); maZoomToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index caab783c6a7c..c66f88817fe3 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -124,7 +124,8 @@ void MediaFloater::ToggleFloatingMode() Window* pWindow = mpMediaWindow->getWindow(); if( pWindow ) - pWindow->SetHelpId( HID_AVMEDIA_PLAYERWINDOW ); + // FIXME: HELPID + pWindow->SetHelpId( ""/*HID_AVMEDIA_PLAYERWINDOW*/ ); mpMediaWindow->show(); } diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 553eea6196c1..14d174beec80 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -179,7 +179,8 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo mpEmptyBmpEx( NULL ), mpAudioBmpEx( NULL ) { - maChildWindow.SetHelpId( HID_AVMEDIA_PLAYERWINDOW ); + // FIXME: HELPID + maChildWindow.SetHelpId( ""/*HID_AVMEDIA_PLAYERWINDOW*/ ); maChildWindow.Hide(); if( mpMediaWindowControl ) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 2d0733dfbae3..fa61c437e1ba 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -183,10 +183,14 @@ ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionMan m_pEnableBtn = new PushButton( this, WB_TABSTOP ); m_pRemoveBtn = new PushButton( this, WB_TABSTOP ); - SetHelpId( HID_EXTENSION_MANAGER_LISTBOX ); - m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS ); - m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE ); - m_pRemoveBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_REMOVE ); + // FIXME: HELPID + SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX*/ ); + // FIXME: HELPID + m_pOptionsBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_OPTIONS*/ ); + // FIXME: HELPID + m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_DISABLE*/ ); + // FIXME: HELPID + m_pRemoveBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_REMOVE*/ ); m_pOptionsBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleOptionsBtn ) ); m_pEnableBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleEnableBtn ) ); @@ -294,12 +298,14 @@ void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry ) if ( ( pEntry->m_eState == REGISTERED ) || ( pEntry->m_eState == NOT_AVAILABLE ) ) { m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); - m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE ); + // FIXME: HELPID + m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_DISABLE*/ ); } else { m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); - m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_ENABLE ); + // FIXME: HELPID + m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_ENABLE*/ ); } if ( ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps ) diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 2e02a90f59fd..3e5db094d032 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -186,7 +186,8 @@ ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pMan m_pScrollBar( NULL ), m_pManager( pManager ) { - SetHelpId( HID_EXTENSION_MANAGER_LISTBOX ); + // FIXME: HELPID + SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX*/ ); m_pScrollBar = new ScrollBar( this, WB_VERT ); m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) ); diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 50992eb07a97..9e837f235db1 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -221,7 +221,8 @@ LicenseDialogImpl::LicenseDialogImpl( FreeResource(); - m_acceptButton.SetUniqueId(UID_BTN_LICENSE_ACCEPT); + // FIXME: HELPID + m_acceptButton.SetUniqueId(""/*UID_BTN_LICENSE_ACCEPT*/); m_fiArrow1.Show(true); m_fiArrow2.Show(false); m_mlLicense.SetText(sLicenseText); diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx index 48ee2abc71ca..3169386db192 100644 --- a/desktop/source/migration/wizard.cxx +++ b/desktop/source/migration/wizard.cxx @@ -191,10 +191,14 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT)); //set help id - m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV); - m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT); - m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL); - m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH); + // FIXME: HELPID + m_pPrevPage->SetHelpId(""/*HID_FIRSTSTART_PREV*/); + // FIXME: HELPID + m_pNextPage->SetHelpId(""/*HID_FIRSTSTART_NEXT*/); + // FIXME: HELPID + m_pCancel->SetHelpId(""/*HID_FIRSTSTART_CANCEL*/); + // FIXME: HELPID + m_pFinish->SetHelpId(""/*HID_FIRSTSTART_FINISH*/); // m_pHelp->SetUniqueId(UID_FIRSTSTART_HELP); m_pHelp->Hide(); m_pHelp->Disable(); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 766023a0038c..35c51b82d1fe 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1083,9 +1083,11 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) String aParaStr( EditResId( RID_STR_PARAGRAPH ) ); aParaStr.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%x" ) ), aTmpPara ); aPopupMenu.InsertItem( MN_WORDLANGUAGE, aWordStr ); - aPopupMenu.SetHelpId( MN_WORDLANGUAGE, HID_EDITENG_SPELLER_WORDLANGUAGE ); + // FIXME: HELPID + aPopupMenu.SetHelpId( MN_WORDLANGUAGE, ""/*HID_EDITENG_SPELLER_WORDLANGUAGE*/ ); aPopupMenu.InsertItem( MN_PARALANGUAGE, aParaStr ); - aPopupMenu.SetHelpId( MN_PARALANGUAGE, HID_EDITENG_SPELLER_PARALANGUAGE ); + // FIXME: HELPID + aPopupMenu.SetHelpId( MN_PARALANGUAGE, ""/*HID_EDITENG_SPELLER_PARALANGUAGE*/ ); } // ## Create mnemonics here diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 64343517c69f..3e875e0b0fdc 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1416,7 +1416,8 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( nHelpId ) { nHelpId += HID_AUTOCORR_HELP_START - 1; - Application::GetHelp()->OpenHelpAgent( nHelpId ); + // FIXME: HELPID + Application::GetHelp()->OpenHelpAgent( String()/*nHelpId*/ ); } } diff --git a/formula/inc/formula/formdata.hxx b/formula/inc/formula/formdata.hxx index da211d4f7449..780f95f8fdb5 100644 --- a/formula/inc/formula/formdata.hxx +++ b/formula/inc/formula/formdata.hxx @@ -53,7 +53,7 @@ public: inline USHORT GetEdFocus() const { return nEdFocus; } inline const String& GetUndoStr() const { return aUndoStr; } inline BOOL GetMatrixFlag()const{ return bMatrix;} - inline ULONG GetUniqueId()const { return nUniqueId;} + inline rtl::OString GetUniqueId()const { return aUniqueId;} inline const Selection& GetSelection()const { return aSelection;} inline void SetMode( USHORT nNew ) { nMode = nNew; } @@ -64,7 +64,7 @@ public: inline void SetEdFocus( USHORT nNew ) { nEdFocus = nNew; } inline void SetUndoStr( const String& rNew ) { aUndoStr = rNew; } inline void SetMatrixFlag(BOOL bNew) { bMatrix=bNew;} - inline void SetUniqueId(ULONG nNew) { nUniqueId=nNew;} + inline void SetUniqueId(const rtl::OString nNew) { aUniqueId=nNew;} inline void SetSelection(const Selection& aSel) { aSelection=aSel;} protected: void Reset(); @@ -81,7 +81,8 @@ private: USHORT nEdFocus; String aUndoStr; BOOL bMatrix; - ULONG nUniqueId; + // FIXME: HELPID + rtl::OString aUniqueId; Selection aSelection; }; diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx index d88d1fe62057..0039b66b4ae2 100644 --- a/formula/inc/formula/formula.hxx +++ b/formula/inc/formula/formula.hxx @@ -80,8 +80,10 @@ protected: ::std::pair RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputDoneAfter( BOOL bForced = FALSE ); - ULONG FindFocusWin(Window *pWin); - void SetFocusWin(Window *pWin,ULONG nUniqueId); + // FIXME: HELPID + rtl::OString FindFocusWin(Window *pWin); + // FIXME: HELPID + void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId); void HighlightFunctionParas(const String& aFormula); void SetMeText(const String& _sText); @@ -129,12 +131,14 @@ protected: ::std::pair RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputDoneAfter( BOOL bForced = FALSE ); - ULONG FindFocusWin(Window *pWin); - void SetFocusWin(Window *pWin,ULONG nUniqueId); + // FIXME: HELPID + rtl::OString FindFocusWin(Window *pWin); + // FIXME: HELPID + void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId); void HighlightFunctionParas(const String& aFormula); void SetMeText(const String& _sText); - FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate); + FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate); void Update(); BOOL CheckMatrix(String& aFormula /*IN/OUT*/); String GetMeText() const; diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index f1a97171fa11..8255aae371da 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -143,7 +143,7 @@ namespace formula void PreNotify( NotifyEvent& rNEvt ); RefEdit* GetCurrRefEdit(); - ULONG FindFocusWin(Window *pWin); + rtl::OString FindFocusWin(Window *pWin); const FormulaHelper& GetFormulaHelper() const; uno::Reference< sheet::XFormulaOpCodeMapper > GetFormulaOpCodeMapper() const; @@ -226,11 +226,15 @@ namespace formula FormulaHelper m_aFormulaHelper; - SmartId m_aSmartEditHelpId; + // FIXME: HELPID + rtl::OString m_aEditHelpId; - ULONG nOldHelp; - ULONG nOldUnique; - ULONG nActivWinId; + // FIXME: HELPID + rtl::OString aOldHelp; + // FIXME: HELPID + rtl::OString aOldUnique; + // FIXME: HELPID + rtl::OString aActivWinId; BOOL bIsShutDown; @@ -300,7 +304,6 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTxtOk ( aBtnEnd.GetText() ), m_aFormulaHelper(_pFunctionMgr), // - nActivWinId (0), bIsShutDown (FALSE), nEdFocus (0), pFuncDesc (NULL), @@ -314,8 +317,8 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aRefBtn.Hide(); pMEdit = aMEFormula.GetEdit(); - m_aSmartEditHelpId = pMEdit->GetSmartHelpId(); - pMEdit->SetSmartUniqueId(m_aSmartEditHelpId); + m_aEditHelpId = pMEdit->GetHelpId(); + pMEdit->SetUniqueId( m_aEditHelpId ); bEditFlag=FALSE; bStructUpdate=TRUE; @@ -331,8 +334,10 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTabCtrl.SetTabPage( TP_FUNCTION, pFuncPage); aTabCtrl.SetTabPage( TP_STRUCT, pStructPage); - nOldHelp = pParent->GetHelpId(); // HelpId aus Resource immer fuer "Seite 1" - nOldUnique = pParent->GetUniqueId(); + // FIXME: HELPID + aOldHelp = pParent->GetHelpId(); // HelpId aus Resource immer fuer "Seite 1" + // FIXME: HELPID + aOldUnique = pParent->GetUniqueId(); aFtResult.Show( _bSupportResult ); aWndResult.Show( _bSupportResult ); @@ -408,27 +413,30 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) Window* pWin=rNEvt.GetWindow(); if(pWin!=NULL) { - nActivWinId = pWin->GetUniqueId(); - if(nActivWinId==0) + aActivWinId = pWin->GetUniqueId(); + // FIXME: HELPID + if(aActivWinId.getLength()==0) { Window* pParent=pWin->GetParent(); while(pParent!=NULL) { - nActivWinId=pParent->GetUniqueId(); + aActivWinId=pParent->GetUniqueId(); - if(nActivWinId!=0) break; + // FIXME: HELPID + if(aActivWinId.getLength()!=0) break; pParent=pParent->GetParent(); } } - if(nActivWinId!=0) + // FIXME: HELPID + if(aActivWinId!=0) { FormEditData* pData = m_pHelper->getFormEditData(); if (pData && !aTimer.IsActive()) // wird nicht ueber Close zerstoert; { - pData->SetUniqueId(nActivWinId); + pData->SetUniqueId(aActivWinId); } } } @@ -825,8 +833,10 @@ void FormulaDlg_Impl::FillListboxes() aNewTitle = aTitle1; // HelpId fuer 1. Seite ist die aus der Resource - m_pParent->SetHelpId( nOldHelp ); - m_pParent->SetUniqueId( nOldUnique ); + // FIXME: HELPID + m_pParent->SetHelpId( aOldHelp ); + // FIXME: HELPID + m_pParent->SetUniqueId( aOldUnique ); } // ----------------------------------------------------------------------------- void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) @@ -862,9 +872,12 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) aFtEditName.SetText( pFuncDesc->getFunctionName() ); aFtEditName.Show(); pParaWin->Show(); + // FIXME: HELPID + #if 0 const long nHelpId = pFuncDesc->getHelpId(); if ( nHelpId ) pMEdit->SetSmartHelpId(SmartId(nHelpId)); + #endif } xub_StrLen nOldStart, nOldEnd; @@ -920,7 +933,8 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) else { aFtEditName.SetText(String()); - pMEdit->SetSmartHelpId(m_aSmartEditHelpId); + // FIXME: HELPID + pMEdit->SetHelpId( m_aEditHelpId ); } // Test, ob vorne/hinten noch mehr Funktionen sind @@ -1790,20 +1804,21 @@ BOOL FormulaDlg_Impl::UpdateParaWin(Selection& _rSelection) } return pTheRefEdit == NULL; } -ULONG FormulaDlg_Impl::FindFocusWin(Window *pWin) +rtl::OString FormulaDlg_Impl::FindFocusWin(Window *pWin) { - ULONG nUniqueId=0; + rtl::OString aUniqueId; if(pWin->HasFocus()) { - nUniqueId=pWin->GetUniqueId(); - if(nUniqueId==0) + // FIXME: HELPID + aUniqueId=pWin->GetUniqueId(); + if(aUniqueId.getLength()==0) { Window* pParent=pWin->GetParent(); while(pParent!=NULL) { - nUniqueId=pParent->GetUniqueId(); + aUniqueId=pParent->GetUniqueId(); - if(nUniqueId!=0) break; + if(aUniqueId.getLength()!=0) break; pParent=pParent->GetParent(); } @@ -1816,11 +1831,11 @@ ULONG FormulaDlg_Impl::FindFocusWin(Window *pWin) for(USHORT i=0;iGetChild(i); - nUniqueId=FindFocusWin(pChild); - if(nUniqueId>0) break; + aUniqueId=FindFocusWin(pChild); + if(aUniqueId.getLength()>0) break; } } - return nUniqueId; + return aUniqueId; } void FormulaDlg_Impl::SetEdSelection() @@ -1925,13 +1940,15 @@ void FormulaModalDialog::RefInputDoneAfter( BOOL bForced ) m_pImpl->RefInputDoneAfter( bForced ); } -ULONG FormulaModalDialog::FindFocusWin(Window *pWin) +rtl::OString FormulaModalDialog::FindFocusWin(Window *pWin) { + // FIXME: HELPID return m_pImpl->FindFocusWin( pWin ); } -void FormulaModalDialog::SetFocusWin(Window *pWin,ULONG nUniqueId) +void FormulaModalDialog::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { + // FIXME: HELPID if(pWin->GetUniqueId()==nUniqueId) { pWin->GrabFocus(); @@ -2007,10 +2024,13 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ,_pHelper,_pFunctionMgr,_pDlg)) { FreeResource(); + // FIXME: HELPID + #if 0 if(GetHelpId()==0) //Hack, da im SfxModelessDialog die HelpId SetHelpId(GetUniqueId()); //fuer einen ModelessDialog entfernt und //in eine UniqueId gewandelt wird, machen //wir das an dieser Stelle rueckgaengig. + #endif SetText(m_pImpl->aTitle1); } @@ -2080,13 +2100,15 @@ void FormulaDlg::RefInputDoneAfter( BOOL bForced ) m_pImpl->RefInputDoneAfter( bForced ); } -ULONG FormulaDlg::FindFocusWin(Window *pWin) +rtl::OString FormulaDlg::FindFocusWin(Window *pWin) { + // FIXME: HELPID return m_pImpl->FindFocusWin( pWin ); } -void FormulaDlg::SetFocusWin(Window *pWin,ULONG nUniqueId) +void FormulaDlg::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { + // FIXME: HELPID if(pWin->GetUniqueId()==nUniqueId) { pWin->GrabFocus(); @@ -2156,7 +2178,8 @@ IMPL_LINK( FormulaDlg, UpdateFocusHdl, Timer*, EMPTYARG ) if (pData) // wird nicht ueber Close zerstoert; { m_pImpl->m_pHelper->setReferenceInput(pData); - ULONG nUniqueId=pData->GetUniqueId(); + // FIXME: HELPID + rtl::OString nUniqueId(pData->GetUniqueId()); SetFocusWin(this,nUniqueId); } return 0; @@ -2182,7 +2205,7 @@ void FormEditData::Reset() nOffset = 0; nEdFocus = 0; bMatrix =FALSE; - nUniqueId=0; + aUniqueId=rtl::OString(); aSelection.Min()=0; aSelection.Max()=0; aUndoStr.Erase(); @@ -2211,7 +2234,7 @@ const FormEditData& FormEditData::operator=( const FormEditData& r ) nEdFocus = r.nEdFocus; aUndoStr = r.aUndoStr; bMatrix = r.bMatrix ; - nUniqueId = r.nUniqueId; + aUniqueId = r.aUniqueId; aSelection = r.aSelection; return *this; } diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 3633afa29316..a66b4b2137af 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -102,8 +102,8 @@ FuncPage::FuncPage(Window* pParent,const IFunctionManager* _pFunctionManager): m_pFunctionManager(_pFunctionManager) { FreeResource(); - m_aSmartHelpId = aLbFunction.GetSmartHelpId(); - aLbFunction.SetSmartUniqueId(m_aSmartHelpId); + m_aHelpId = aLbFunction.GetHelpId(); + aLbFunction.SetUniqueId(m_aHelpId); InitLRUList(); @@ -190,15 +190,19 @@ IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb ) const IFunctionDescription* pDesc = GetFuncDesc( GetFunction() ); if ( pDesc ) { + // FIXME: HELPID + #if 0 const long nHelpId = pDesc->getHelpId(); if ( nHelpId ) aLbFunction.SetSmartHelpId(SmartId(nHelpId)); + #endif } aSelectionLink.Call(this); } else { - aLbFunction.SetSmartHelpId(m_aSmartHelpId); + // FIXME: HELPID + aLbFunction.SetHelpId(m_aHelpId); UpdateFunctionList(); } return 0; diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 09f77cc81019..4d7dc5739d0f 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -82,7 +82,8 @@ private: m_pFunctionManager; ::std::vector< TFunctionDesc > aLRUList; - SmartId m_aSmartHelpId; + // FIXME: HELPID + rtl::OString m_aHelpId; void impl_addFunctions(const IFunctionCategory* _pCategory); diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 4ba8d87c139b..db8a4e136015 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -758,8 +758,10 @@ EditBox::EditBox( Window* pParent, const ResId& rResId ) // #105582# the HelpId from the resource must be set for the MultiLineEdit, // not for the control that contains it. - pMEdit->SetSmartHelpId( GetSmartHelpId() ); - SetSmartHelpId( SmartId() ); + // FIXME: HELPID + pMEdit->SetHelpId( GetHelpId() ); + // FIXME: HELPID + SetHelpId( "" ); } EditBox::~EditBox() diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 3876621a3ec0..9afa9fb20587 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -294,22 +294,28 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc) { SetEditDesc(aDefaultString); } - long nHelpId = pFuncDesc->getHelpId(); nArgs = pFuncDesc->getSuppressedArgumentCount(); pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping); aSlider.Hide(); + // FIXME: HELPID + #if 0 + long nHelpId = pFuncDesc->getHelpId(); SetHelpId( nHelpId ); aEdArg1.SetHelpId( nHelpId ); aEdArg2.SetHelpId( nHelpId ); aEdArg3.SetHelpId( nHelpId ); aEdArg4.SetHelpId( nHelpId ); + #endif // Unique-IDs muessen gleich bleiben fuer Automatisierung - SetUniqueId( HID_FORMULA_FAP_PAGE ); + // FIXME: HELPID + #if 0 + SetUniqueId( ""/*HID_FORMULA_FAP_PAGE*/ ); aEdArg1.SetUniqueId( HID_FORMULA_FAP_EDIT1 ); aEdArg2.SetUniqueId( HID_FORMULA_FAP_EDIT2 ); aEdArg3.SetUniqueId( HID_FORMULA_FAP_EDIT3 ); aEdArg4.SetUniqueId( HID_FORMULA_FAP_EDIT4 ); + #endif SetActiveLine(0); } else diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index e0b5d259302d..c51a326477fa 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -206,14 +206,13 @@ namespace svt String sHelpURL( _rURL ); if ( COMPARE_EQUAL == sHelpURL.CompareIgnoreCaseToAscii( "HID:", sizeof( "HID:" ) - 1 ) ) { - String sID = sHelpURL.Copy( sizeof( "HID:" ) - 1 ); - sal_Int32 nHelpId = sID.ToInt32(); - + // FIXME: HELPID + rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); if ( _bFileView ) // the file view "overloaded" the SetHelpId - static_cast< SvtFileView* >( _pControl )->SetHelpId( nHelpId ); + static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); else - _pControl->SetHelpId( nHelpId ); + _pControl->SetHelpId( sID ); } else { @@ -224,13 +223,13 @@ namespace svt //--------------------------------------------------------------------- ::rtl::OUString OControlAccess::getHelpURL( Window* _pControl, sal_Bool _bFileView ) { - sal_Int32 nHelpId = _pControl->GetHelpId(); + // FIXME: HELPID + rtl::OString aHelpId = _pControl->GetHelpId(); if ( _bFileView ) // the file view "overloaded" the SetHelpId - nHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); + aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); - ::rtl::OUString sHelpURL( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sHelpURL += ::rtl::OUString::valueOf( (sal_Int32)nHelpId ); + rtl::OUString sHelpURL( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); return sHelpURL; } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index c7a18050c3ff..87df9e404b6a 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -600,7 +600,8 @@ void SvtFileDialog::Init_Impl bool bSaveMode = ( FILEDLG_MODE_SAVE == _pImp->_eMode ); pURLBox->SetNoURLSelection( bSaveMode ); - _pImp->_pEdFileName->SetHelpId( HID_FILEDLG_AUTOCOMPLETEBOX ); + // FIXME: HELPID + _pImp->_pEdFileName->SetHelpId( ""/*HID_FILEDLG_AUTOCOMPLETEBOX*/ ); _pImp->_pFtFileType = new FixedText( this, SvtResId( FT_EXPLORERFILE_FILETYPE ) ); _pImp->CreateFilterListControl( this, SvtResId( LB_EXPLORERFILE_FILETYPE ) ); @@ -649,7 +650,8 @@ void SvtFileDialog::Init_Impl _pFileView->SetUrlFilter( &m_aURLFilter ); _pFileView->EnableAutoResize(); - _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); + // FIXME: HELPID + _pFileView->SetHelpId( ""/*HID_FILEDLG_STANDARD*/ ); _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); // Positionen und Groessen der Knoepfe bestimmen. @@ -701,7 +703,8 @@ void SvtFileDialog::Init_Impl if ( nStyle & SFXWB_READONLY ) { _pCbReadOnly = new CheckBox( this, SvtResId( CB_EXPLORERFILE_READONLY ) ); - _pCbReadOnly->SetHelpId( HID_FILEOPEN_READONLY ); + // FIXME: HELPID + _pCbReadOnly->SetHelpId( ""/*HID_FILEOPEN_READONLY*/ ); _pCbReadOnly->SetText( SvtResId( STR_SVT_FILEPICKER_READONLY ) ); AddControl( _pCbReadOnly ); ReleaseOwnerShip( _pCbReadOnly ); @@ -810,15 +813,23 @@ void SvtFileDialog::Init_Impl { // different help ids if in save-as mode // 90744 - 09.08.2001 - frank.schoenheit@sun.com - SetHelpId( HID_FILESAVE_DIALOG ); - - _pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL ); - _pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE ); - _pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY ); - _pImp->_pBtnStandard->SetHelpId( HID_FILESAVE_DEFAULTDIRECTORY ); - _pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP ); - _pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE ); - _pFileView->SetHelpId( HID_FILESAVE_FILEVIEW ); + // FIXME: HELPID + SetHelpId( ""/*HID_FILESAVE_DIALOG*/ ); + + // FIXME: HELPID + _pImp->_pEdFileName->SetHelpId( ""/*HID_FILESAVE_FILEURL*/ ); + // FIXME: HELPID + _pImp->_pBtnFileOpen->SetHelpId( ""/*HID_FILESAVE_DOSAVE*/ ); + // FIXME: HELPID + _pImp->_pBtnNewFolder->SetHelpId( ""/*HID_FILESAVE_CREATEDIRECTORY*/ ); + // FIXME: HELPID + _pImp->_pBtnStandard->SetHelpId( ""/*HID_FILESAVE_DEFAULTDIRECTORY*/ ); + // FIXME: HELPID + _pImp->_pBtnUp->SetHelpId( ""/*HID_FILESAVE_LEVELUP*/ ); + // FIXME: HELPID + _pImp->GetFilterListControl()->SetHelpId( ""/*HID_FILESAVE_FILETYPE*/ ); + // FIXME: HELPID + _pFileView->SetHelpId( ""/*HID_FILESAVE_FILEVIEW*/ ); // formerly, there was only _pLbFileVersion, which was used for 3 different // use cases. For reasons of maintainability, I introduced extra members (_pLbTemplates, _pLbImageTemplates) @@ -827,16 +838,23 @@ void SvtFileDialog::Init_Impl // tests I made lead to a dialog where _no_ of the three list boxes was present. // 96930 - 15.08.2002 - fs@openoffice.org if ( _pImp->_pLbFileVersion ) - _pImp->_pLbFileVersion->SetHelpId( HID_FILESAVE_TEMPLATE ); + // FIXME: HELPID + _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); if ( _pImp->_pLbTemplates ) - _pImp->_pLbTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); + // FIXME: HELPID + _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); if ( _pImp->_pLbImageTemplates ) - _pImp->_pLbImageTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); + // FIXME: HELPID + _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); - if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( HID_FILESAVE_SAVEWITHPASSWORD ); - if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( HID_FILESAVE_AUTOEXTENSION ); - if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( HID_FILESAVE_CUSTOMIZEFILTER ); - if ( _pCbSelection ) _pCbSelection->SetHelpId( HID_FILESAVE_SELECTION ); + // FIXME: HELPID + if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( ""/*HID_FILESAVE_SAVEWITHPASSWORD*/ ); + // FIXME: HELPID + if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( ""/*HID_FILESAVE_AUTOEXTENSION*/ ); + // FIXME: HELPID + if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( ""/*HID_FILESAVE_CUSTOMIZEFILTER*/ ); + // FIXME: HELPID + if ( _pCbSelection ) _pCbSelection->SetHelpId( ""/*HID_FILESAVE_SELECTION*/ ); } // correct the z-order of the controls @@ -2981,7 +2999,8 @@ void SvtFileDialog::AddControls_Impl( ) { _pCbLinkBox = new CheckBox( this ); _pCbLinkBox ->SetText( SvtResId( STR_SVT_FILEPICKER_INSERT_AS_LINK ) ); - _pCbLinkBox ->SetHelpId( HID_FILEDLG_LINK_CB ); + // FIXME: HELPID + _pCbLinkBox ->SetHelpId( ""/*HID_FILEDLG_LINK_CB*/ ); AddControl( _pCbLinkBox ); ReleaseOwnerShip( _pCbLinkBox ); _pCbLinkBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -2998,7 +3017,8 @@ void SvtFileDialog::AddControls_Impl( ) // "Vorschau" _pCbPreviewBox = new CheckBox( this ); _pCbPreviewBox->SetText( SvtResId( STR_SVT_FILEPICKER_SHOW_PREVIEW ) ); - _pCbPreviewBox->SetHelpId( HID_FILEDLG_PREVIEW_CB ); + // FIXME: HELPID + _pCbPreviewBox->SetHelpId( ""/*HID_FILEDLG_PREVIEW_CB*/ ); AddControl( _pCbPreviewBox ); ReleaseOwnerShip( _pCbPreviewBox ); _pCbPreviewBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -3046,7 +3066,8 @@ void SvtFileDialog::AddControls_Impl( ) { _pPbPlay = new PushButton( this ); _pPbPlay->SetText( SvtResId( STR_SVT_FILEPICKER_PLAY ) ); - _pPbPlay->SetHelpId( HID_FILESAVE_DOPLAY ); + // FIXME: HELPID + _pPbPlay->SetHelpId( ""/*HID_FILESAVE_DOPLAY*/ ); AddControl( _pPbPlay ); ReleaseOwnerShip( _pPbPlay ); _pPbPlay->SetClickHdl( LINK( this, SvtFileDialog, PlayButtonHdl_Impl ) ); @@ -3058,7 +3079,8 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtFileVersion->SetText( SvtResId( STR_SVT_FILEPICKER_VERSION ) ); _pImp->_pLbFileVersion = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - _pImp->_pLbFileVersion->SetHelpId( HID_FILEOPEN_VERSION ); + // FIXME: HELPID + _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); } else if ( _nExtraBits & SFX_EXTRA_TEMPLATES ) { @@ -3066,7 +3088,8 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_TEMPLATES ) ); _pImp->_pLbTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - _pImp->_pLbTemplates->SetHelpId( HID_FILEOPEN_VERSION ); + // FIXME: HELPID + _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); // This is strange. During the re-factoring during 96930, I discovered that this help id // is set in the "Templates mode". This was hidden in the previous implementation. // Shouldn't this be a more meaningfull help id. @@ -3078,7 +3101,8 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtImageTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_IMAGE_TEMPLATE ) ); _pImp->_pLbImageTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - _pImp->_pLbImageTemplates->SetHelpId( HID_FILEOPEN_IMAGE_TEMPLATE ); + // FIXME: HELPID + _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILEOPEN_IMAGE_TEMPLATE*/ ); } } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index 458368bd6581..9541c45689b1 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -4005,7 +4005,7 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent ) if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { pToolBox = (ToolBox *)pWindow; - aToolbarName = pToolBox->GetSmartHelpId().GetStr(); + aToolbarName = rtl::OStringToOUString( pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8 ); sal_Int32 i = aToolbarName.lastIndexOf( ':' ); if (( aToolbarName.getLength() > 0 ) && ( i > 0 ) && (( i+ 1 ) < aToolbarName.getLength() )) @@ -4066,7 +4066,7 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent ) if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { pToolBox = (ToolBox *)pWindow; - aToolbarName = pToolBox->GetSmartHelpId().GetStr(); + aToolbarName = rtl::OStringToOUString( pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8 ); if (( aToolbarName.getLength() > 0 ) && ( m_nLockCount == 0 )) m_aAsyncLayoutTimer.Start(); } diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index 13c5647341e6..c8cf5249dd9a 100644 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -528,7 +528,8 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f } // set help ID for our canvas - pWindow->SetHelpId(HID_BACKINGWINDOW); + // FIXME: HELPID + pWindow->SetHelpId(""/*HID_BACKINGWINDOW*/); // inform BackingWindow about frame BackingWindow* pBack = dynamic_cast(pWindow ); diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index e4d37d1fe059..6aa5e274b744 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -211,15 +211,15 @@ BackingWindow::BackingWindow( Window* i_pParent ) : if( mxDesktop.is() ) mxDesktopDispatchProvider = Reference< XDispatchProvider >( mxDesktop, UNO_QUERY ); - maWriterButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:WriterButton" ) ) ) ); - maCalcButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:CalcButton" ) ) ) ); - maImpressButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:ImpressButton" ) ) ) ); - maDrawButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:DrawButton" ) ) ) ); - maDBButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:DBButton" ) ) ) ); - maMathButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:MathButton" ) ) ) ); - maTemplateButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:TemplateButton" ) ) ) ); - maOpenButton.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:OpenButton" ) ) ) ); - maToolbox.SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Toolbox" ) ) ) ); + maWriterButton.SetHelpId( ".HelpId:StartCenter:WriterButton" ); + maCalcButton.SetHelpId( ".HelpId:StartCenter:CalcButton" ); + maImpressButton.SetHelpId( ".HelpId:StartCenter:ImpressButton" ); + maDrawButton.SetHelpId( ".HelpId:StartCenter:DrawButton" ); + maDBButton.SetHelpId( ".HelpId:StartCenter:DBButton" ); + maMathButton.SetHelpId( ".HelpId:StartCenter:MathButton" ); + maTemplateButton.SetHelpId( ".HelpId:StartCenter:TemplateButton" ); + maOpenButton.SetHelpId( ".HelpId:StartCenter:OpenButton" ); + maToolbox.SetHelpId( ".HelpId:StartCenter:Toolbox" ); // init background initBackground(); diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index f0f5d52a47d6..7be1516f1331 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -98,7 +98,8 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo pPopupMenu->InsertItem( 2, aDisplayName ); pPopupMenu->SetItemCommand( 2, aCommand ); //pPopupMenu->SetHelpId( 2, HID_SVX_BASIC_MACRO_ORGANIZER ); - pPopupMenu->SetHelpId( 2, 40012 ); + // FIXME: HELPID + pPopupMenu->SetHelpId( 2, ""/*40012*/ ); // insert providers but not basic or java addScriptItems( pPopupMenu, 4); @@ -219,7 +220,8 @@ void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, USHORT startIt pPopupMenu->InsertItem( itemId, aDisplayName ); pPopupMenu->SetItemCommand( itemId, aCommand ); //pPopupMenu->SetHelpId( itemId, HID_SVX_COMMON_MACRO_ORGANIZER ); - pPopupMenu->SetHelpId( itemId, 40014 ); + // FIXME: HELPID + pPopupMenu->SetHelpId( itemId, ""/*40014*/ ); itemId++; break; } diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 9fbdf87336cc..0a3295c1395e 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1797,7 +1797,9 @@ void MenuBarManager::FillMenu( sal_Int32 nHelpId = aHelpURL.toInt32(); if ( nHelpId > 0 ) - pMenu->SetHelpId( nId, (USHORT)nHelpId ); + // FIXME: HELPID + // (should set aHelpURL ? + pMenu->SetHelpId( nId, ""/*(USHORT)nHelpId*/ ); if ( nStyle ) { MenuItemBits nBits = pMenu->GetItemBits( nId ); diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index cb9cbb2896f7..d143b717366c 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -537,7 +537,8 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc rtl::OUString aId( aHelpURL.copy( HELPID_PREFIX_LENGTH )); sal_uInt16 nHelpId = (sal_uInt16)(aId.toInt32()); if ( nHelpId > 0 ) - m_pStatusBar->SetHelpId( nId, nHelpId ); + // FIXME: HELPID + m_pStatusBar->SetHelpId( nId, ""/*nHelpId*/ ); } ++nId; diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx index 030a790b35e3..ed506f5345e3 100644 --- a/framework/source/uielement/statusbarwrapper.cxx +++ b/framework/source/uielement/statusbarwrapper.cxx @@ -137,7 +137,8 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) pStatusBarManager = new StatusBarManager( m_xServiceFactory, xFrame, m_aResourceURL, pStatusBar ); ((FrameworkStatusBar*)pStatusBar)->SetStatusBarManager( pStatusBarManager ); m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY ); - pStatusBar->SetUniqueId( HID_STATUSBAR ); + // FIXME: HELPID + pStatusBar->SetUniqueId( ""/*HID_STATUSBAR*/ ); } } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index d89b81c0f9b6..19625d5e198b 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -303,10 +303,10 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic // set name for testtool, the useful part is after the last '/' sal_Int32 idx = rResourceName.lastIndexOf('/'); idx++; // will become 0 if '/' not found: use full string - ::rtl::OUString aHelpIdAsString( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX_TESTTOOL )); + ::rtl::OString aHelpIdAsString( HELPID_PREFIX_TESTTOOL ); ::rtl::OUString aToolbarName = rResourceName.copy( idx ); - aHelpIdAsString += aToolbarName; - m_pToolBar->SetSmartHelpId( SmartId( aHelpIdAsString ) ); + aHelpIdAsString += rtl::OUStringToOString( aToolbarName, RTL_TEXTENCODING_UTF8 );; + m_pToolBar->SetHelpId( aHelpIdAsString ); m_aAsyncUpdateControllersTimer.SetTimeout( 50 ); m_aAsyncUpdateControllersTimer.SetTimeoutHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) ); @@ -883,7 +883,10 @@ void ToolBarManager::CreateControllers() if ( nId == 0 ) continue; - sal_Int16 nWidth( sal_Int16( m_pToolBar->GetHelpId( nId ))); + // FIXME: HELPID + // What ? A width initalized with a help id ? Should we perhaps add two bananas and a coconut to it ? + // sal_Int16 nWidth( sal_Int16( m_pToolBar->GetHelpId( nId ))); + sal_Int16 nWidth( nId ); rtl::OUString aLoadURL( RTL_CONSTASCII_USTRINGPARAM( ".uno:OpenUrl" )); rtl::OUString aCommandURL( m_pToolBar->GetItemCommand( nId )); sal_Bool bInit( sal_True ); @@ -892,7 +895,7 @@ void ToolBarManager::CreateControllers() svt::ToolboxController* pController( 0 ); - m_pToolBar->SetHelpId( nId, 0 ); // reset value again + m_pToolBar->SetHelpId( nId, "" ); // reset value again if ( bHasDisabledEntries ) { aURL.Complete = aCommandURL; @@ -1282,7 +1285,8 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine } // Add additional information for the controller to the obsolete help id - m_pToolBar->SetHelpId( ULONG( nWidth )); + // FIXME: HELPID + m_pToolBar->SetHelpId( ""/*ULONG( nWidth )*/); if ( !bIsVisible ) m_pToolBar->HideItem( nId ); diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 83f280cb46a7..025ebea06a19 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -701,7 +701,9 @@ void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, sal_uInt16 nPos, sal_u pToolbar->SetItemState( nItemId, STATE_NOCHECK ); // Use obsolete help id to transport the width of the item - pToolbar->SetHelpId( nItemId, rItem.nWidth ); + // FIXME: HELPID + // this looks broken + pToolbar->SetHelpId( nItemId, ""/*rItem.nWidth*/ ); // Use the user data to store add-on specific data with the toolbar item AddonsParams* pAddonParams = new AddonsParams; diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 02402205bd1c..3d0cda946771 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -216,7 +216,8 @@ void ToolbarsMenuController::addCommand( PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); if ( !!aImage ) pVCLPopupMenu->SetItemImage( nItemId, aImage ); - pVCLPopupMenu->SetHelpId( nItemId, nHelpId ); + // FIXME: HELPID + pVCLPopupMenu->SetHelpId( nItemId, ""/*nHelpId*/ ); } m_aCommandVector.push_back( rCommandURL ); diff --git a/sfx2/inc/sfx2/passwd.hxx b/sfx2/inc/sfx2/passwd.hxx index 4f4a04834257..b0105553cd40 100644 --- a/sfx2/inc/sfx2/passwd.hxx +++ b/sfx2/inc/sfx2/passwd.hxx @@ -78,7 +78,7 @@ public: void SetMinLen( USHORT Len ); void SetMaxLen( USHORT Len ); - void SetEditHelpId( ULONG nId ) { maPasswordED.SetHelpId( nId ); } + void SetEditHelpId( const rtl::OString& rId ) { maPasswordED.SetHelpId( rId ); } void ShowExtras( USHORT nExtras ) { mnExtras = nExtras; } void AllowAsciiOnly( bool i_bAsciiOnly = true ) { mbAsciiOnly = i_bAsciiOnly; } diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx index 60ad04b2e9ab..6a87729e30e3 100644 --- a/sfx2/inc/sfxhelp.hxx +++ b/sfx2/inc/sfxhelp.hxx @@ -45,12 +45,14 @@ class SFX2_DLLPUBLIC SfxHelp : public Help SfxHelp_Impl* pImp; private: - SAL_DLLPRIVATE virtual BOOL Start( ULONG nHelpId, const Window* pWindow ); + // FIXME: HELPID + // SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); SAL_DLLPRIVATE virtual void OpenHelpAgent( ULONG nHelpId ); SAL_DLLPRIVATE String GetHelpModuleName_Impl(); - SAL_DLLPRIVATE String CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ); + // FIXME: HELPID + // SAL_DLLPRIVATE String CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ); SAL_DLLPRIVATE String CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ); public: @@ -60,10 +62,12 @@ public: inline void SetTicket( const String& rTicket ) { aTicket = rTicket; } inline void SetUser( const String& rUser ) { aUser = rUser; } - virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow ); + // FIXME: HELPID + //virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow ); virtual XubString GetHelpText( const String&, const Window* pWindow ); - static String CreateHelpURL( ULONG nHelpId, const String& rModuleName ); + // FIXME: HELPID + // static String CreateHelpURL( ULONG nHelpId, const String& rModuleName ); static String CreateHelpURL( const String& aCommandURL, const String& rModuleName ); static void OpenHelpAgent( SfxFrame* pFrame, ULONG nHelpId ); static String GetDefaultHelpModule(); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 14789100bb24..2abcdffe0169 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -354,7 +354,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) if ( 66056 == nHelpId ) { // show Support page with new URL - String sHelpURL = SfxHelp::CreateHelpURL( nHelpId, String() ); + // FIXME: HELPID + String sHelpURL = SfxHelp::CreateHelpURL( String()/*nHelpId*/, String() ); String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) ); sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp"); sHelpURL += sParams; @@ -362,7 +363,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) pHelp->Start( sHelpURL, NULL ); } else - pHelp->Start( nHelpId, NULL ); // show start page + // FIXME: HELPID + pHelp->Start( String()/*nHelpId*/, NULL ); // show start page bDone = TRUE; } break; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 597509cf34bd..6b8dfe3a023c 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -2105,24 +2105,32 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : xFrame->setName( DEFINE_CONST_UNICODE("OFFICE_HELP") ); lcl_disableLayoutOfFrame(xFrame); - aToolBox.SetHelpId( HID_HELP_TOOLBOX ); + // FIXME: HELPID + aToolBox.SetHelpId( ""/*HID_HELP_TOOLBOX*/ ); aToolBox.InsertItem( TBI_INDEX, aIndexOffText ); - aToolBox.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_INDEX, ""/*HID_HELP_TOOLBOXITEM_INDEX*/ ); aToolBox.InsertSeparator(); aToolBox.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ) ); - aToolBox.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_BACKWARD, ""/*HID_HELP_TOOLBOXITEM_BACKWARD*/ ); aToolBox.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ) ); - aToolBox.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_FORWARD, ""/*HID_HELP_TOOLBOXITEM_FORWARD*/ ); aToolBox.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ) ); - aToolBox.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_START, ""/*HID_HELP_TOOLBOXITEM_START*/ ); aToolBox.InsertSeparator(); aToolBox.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ) ); - aToolBox.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_PRINT, ""/*HID_HELP_TOOLBOXITEM_PRINT*/ ); aToolBox.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ) ); - aToolBox.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_BOOKMARKS, ""/*HID_HELP_TOOLBOXITEM_BOOKMARKS*/ ); aToolBox.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ) ); - aToolBox.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); + // FIXME: HELPID + aToolBox.SetHelpId( TBI_SEARCHDIALOG, ""/*HID_HELP_TOOLBOXITEM_SEARCHDIALOG*/ ); InitToolBoxImages(); aToolBox.Show(); @@ -2139,7 +2147,8 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); if ( aOnStartupCB.GetHelpId() == 0 ) - aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX ); + // FIXME: HELPID + aOnStartupCB.SetHelpId( ""/*HID_HELP_ONSTARTUP_BOX*/ ); } // ----------------------------------------------------------------------- @@ -2595,32 +2604,40 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) else aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ) ); - aMenu.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_INDEX, ""/*HID_HELP_TOOLBOXITEM_INDEX*/ ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) ); - aMenu.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_BACKWARD, ""/*HID_HELP_TOOLBOXITEM_BACKWARD*/ ); aMenu.EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() ); aMenu.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) ); - aMenu.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_FORWARD, ""/*HID_HELP_TOOLBOXITEM_FORWARD*/ ); aMenu.EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() ); aMenu.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) ); - aMenu.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_START, ""/*HID_HELP_TOOLBOXITEM_START*/ ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) ); - aMenu.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_PRINT, ""/*HID_HELP_TOOLBOXITEM_PRINT*/ ); aMenu.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) ); - aMenu.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_BOOKMARKS, ""/*HID_HELP_TOOLBOXITEM_BOOKMARKS*/ ); aMenu.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) ); - aMenu.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_SEARCHDIALOG, ""/*HID_HELP_TOOLBOXITEM_SEARCHDIALOG*/ ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_SELECTIONMODE, String( SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ) ) ); - aMenu.SetHelpId( TBI_SELECTIONMODE, HID_HELP_TEXT_SELECTION_MODE ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_SELECTIONMODE, ""/*HID_HELP_TEXT_SELECTION_MODE*/ ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); URL aURL; aURL.Complete = DEFINE_CONST_UNICODE(".uno:SelectTextMode"); @@ -2640,7 +2657,8 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.InsertSeparator(); aMenu.InsertItem( TBI_COPY, String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_COPY : IMG_HELP_TOOLBOX_COPY ) ) ); - aMenu.SetHelpId( TBI_COPY, SID_COPY ); + // FIXME: HELPID + aMenu.SetHelpId( TBI_COPY, ""/*SID_COPY*/ ); aMenu.EnableItem( TBI_COPY, HasSelection() ); if ( bIsDebug ) @@ -3225,7 +3243,8 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( aWinPos ( 0, 0 ), sTitle ( pParent->GetText() ) { - SetHelpId( HID_HELP_WINDOW ); + // FIXME: HELPID + SetHelpId( ""/*HID_HELP_WINDOW*/ ); SetStyle( GetStyle() | WB_DIALOGCONTROL ); pHelpInterceptor->InitWaiter( this ); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index b9ff344a1513..cd2f6b189fd1 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -326,7 +326,8 @@ public: ~SfxHelp_Impl(); SfxHelpOptions_Impl* GetOptions(); - String GetHelpText( ULONG nHelpId, const String& rModule ); // get "Active Help" + // FIXME: HELPID + // String GetHelpText( ULONG nHelpId, const String& rModule ); // get "Active Help" String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); sal_Bool HasModule( const ::rtl::OUString& rModule ); // module installed sal_Bool IsHelpInstalled(); // module list not empty @@ -370,6 +371,8 @@ void SfxHelp_Impl::Load() } } +#if 0 +// FIXME: HELPID String SfxHelp_Impl::GetHelpText( ULONG nHelpId, const String& rModule ) { // create help url @@ -379,6 +382,7 @@ String SfxHelp_Impl::GetHelpText( ULONG nHelpId, const String& rModule ) // load help string return SfxContentHelper::GetActiveHelpString( aHelpURL ); } +#endif String SfxHelp_Impl::GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ) { @@ -581,6 +585,8 @@ String SfxHelp::GetHelpModuleName_Impl() return sModuleName; } +#if 0 +// FIXME: HELPID String SfxHelp::CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ) { String aModuleName( rModuleName ); @@ -650,6 +656,7 @@ String SfxHelp::CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ) return aHelpURL; } +#endif String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ) { @@ -802,7 +809,8 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) } else { - aHelpURL = CreateHelpURL_Impl( 0, GetHelpModuleName_Impl( ) ); + // FIXME: HELPID + aHelpURL = CreateHelpURL_Impl( String()/*0*/, GetHelpModuleName_Impl( ) ); // pb i91715: strings begin with ".HelpId:" are not words of the basic ide // they are helpid-strings used by the testtool -> so we ignore them @@ -851,6 +859,8 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) return TRUE; } +#if 0 +// FIXME: HELPID BOOL SfxHelp::Start( ULONG nHelpId, const Window* pWindow ) { String aHelpModuleName( GetHelpModuleName_Impl() ); @@ -878,7 +888,10 @@ BOOL SfxHelp::Start( ULONG nHelpId, const Window* pWindow ) return Start( aHelpURL, pWindow ); } +#endif +#if 0 +// FIXME: HELPID XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow ) { String aModuleName = GetHelpModuleName_Impl(); @@ -919,6 +932,7 @@ XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow ) return aHelpText; } +#endif XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* ) { @@ -937,6 +951,8 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* ) return sHelpText; } +#if 0 +// FIXME: HELPID String SfxHelp::CreateHelpURL( ULONG nHelpId, const String& rModuleName ) { String aURL; @@ -945,6 +961,7 @@ String SfxHelp::CreateHelpURL( ULONG nHelpId, const String& rModuleName ) aURL = pHelp->CreateHelpURL_Impl( nHelpId, rModuleName ); return aURL; } +#endif String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleName ) { @@ -976,7 +993,8 @@ void SfxHelp::OpenHelpAgent( ULONG nHelpId ) try { URL aURL; - aURL.Complete = CreateHelpURL_Impl( nHelpId, GetHelpModuleName_Impl() ); + // FIXME: HELPID + aURL.Complete = CreateHelpURL_Impl( String()/*nHelpId*/, GetHelpModuleName_Impl() ); Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY ); xTrans->parseStrict(aURL); diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 4635733b934d..1d1ef73ad8cf 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -298,7 +298,8 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS FreeResource(); // explizite Help-Id - SetHelpId( SID_ABOUT ); + // FIXME: HELPID + SetHelpId( ""/*SID_ABOUT*/ ); //#112429# replace occurences of "StarOffice" in the "StarSuite" version String sCopyright( aCopyrightText.GetText() ); diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 2ea5ef5fe4b1..d85a01870074 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -373,9 +373,9 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - sal_uInt32 nId = GetHelpId(); - SetHelpId(0); - SetUniqueId( nId ); + // FIXME: HELPID + SetUniqueId( GetHelpId() ); + SetHelpId(""); if ( pBindinx ) pImp->StartListening( *pBindinx ); pImp->aMoveTimer.SetTimeout(50); @@ -393,9 +393,9 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - sal_uInt32 nId = GetHelpId(); - SetHelpId(0); - SetUniqueId( nId ); + // FIXME: HELPID + SetUniqueId( GetHelpId() ); + SetHelpId(""); if ( pBindinx ) pImp->StartListening( *pBindinx ); pImp->aMoveTimer.SetTimeout(50); @@ -421,7 +421,8 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt ) ULONG nHelpId = 0; while ( !nHelpId && pWindow ) { - nHelpId = pWindow->GetHelpId(); + // FIXME: HELPID + nHelpId = 0; // pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } @@ -523,7 +524,8 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt ) ULONG nHelpId = 0; while ( !nHelpId && pWindow ) { - nHelpId = pWindow->GetHelpId(); + // FIXME: HELPID + nHelpId = 0; //pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } @@ -561,9 +563,9 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - sal_uInt32 nId = GetHelpId(); - SetHelpId(0); - SetUniqueId( nId ); + // FIXME: HELPID + SetUniqueId( GetHelpId() ); + SetHelpId(""); if ( pBindinx ) pImp->StartListening( *pBindinx ); pImp->aMoveTimer.SetTimeout(50); @@ -582,9 +584,9 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - sal_uInt32 nId = GetHelpId(); - SetHelpId(0); - SetUniqueId( nId ); + // FIXME: HELPID + SetUniqueId( GetHelpId() ); + SetHelpId(""); if ( pBindinx ) pImp->StartListening( *pBindinx ); pImp->aMoveTimer.SetTimeout(50); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 7b4e4289a49c..8ad551278a27 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -918,11 +918,13 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - ULONG nId = GetHelpId(); + // FIXME: HELPID + ULONG nId = 0;// GetHelpId(); if ( !nId && pCW ) nId = pCW->GetType(); - SetHelpId( 0 ); - SetUniqueId( nId ); + SetHelpId( "" ); + // FIXME: HELPID + SetUniqueId( ""/*nId*/ ); pImp = new SfxDockingWindow_Impl; pImp->bConstructed = FALSE; @@ -960,9 +962,9 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - ULONG nId = GetHelpId(); - SetHelpId(0); - SetUniqueId( nId ); + // FIXME: HELPID + SetUniqueId( GetHelpId() ); + SetHelpId(""); pImp = new SfxDockingWindow_Impl; pImp->bConstructed = FALSE; @@ -1847,7 +1849,8 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt ) ULONG nHelpId = 0; while ( !nHelpId && pWindow ) { - nHelpId = pWindow->GetHelpId(); + // FIXME: HELPID + //nHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 5270eb5d4207..2785a38305cd 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -276,7 +276,8 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - aHelpText = String( pHelp->GetHelpText( nHelpId, NULL ) ); + // FIXME: HELPID + aHelpText = String( pHelp->GetHelpText( String()/*nHelpId*/, NULL ) ); return aHelpText; } diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index d7f258e7ccb3..b271d1e04dc7 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -51,7 +51,8 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd , WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); eChildAlignment = SFX_ALIGN_NOALIGNMENT; - pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW ); + // FIXME: HELPID + pWindow->SetHelpId ( ""/*HID_NAVIGATOR_WINDOW*/ ); pWindow->SetOutputSizePixel( Size( 270, 240 ) ); ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 93c2e0e09595..065b407c6769 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -664,7 +664,8 @@ void SfxTabDialog::Init_Impl( BOOL bFmtFlag, const String* pUserButtonText ) aCancelBtn.Show(); aHelpBtn.Show(); aResetBtn.Show(); - aResetBtn.SetHelpId( HID_TABDLG_RESET_BTN ); + // FIXME: HELPID + aResetBtn.SetHelpId( ""/*HID_TABDLG_RESET_BTN*/ ); if ( pUserBtn ) { @@ -680,7 +681,8 @@ void SfxTabDialog::Init_Impl( BOOL bFmtFlag, const String* pUserButtonText ) String aStd( SfxResId( STR_STANDARD_SHORTCUT ) ); aBaseFmtBtn.SetText( aStd ); aBaseFmtBtn.SetClickHdl( LINK( this, SfxTabDialog, BaseFmtHdl ) ); - aBaseFmtBtn.SetHelpId( HID_TABDLG_STANDARD_BTN ); + // FIXME: HELPID + aBaseFmtBtn.SetHelpId( ""/*HID_TABDLG_STANDARD_BTN*/ ); // bFmt = tempor"ares Flag im Ctor() "ubergeben, // wenn bFmt == 2, dann auch TRUE, @@ -787,7 +789,8 @@ void SfxTabDialog::EnableApplyButton(BOOL bEnable) pImpl->pApplyButton->SetText( String( SfxResId( STR_APPLY ) ) ); pImpl->pApplyButton->Show(); - pImpl->pApplyButton->SetHelpId( HID_TABDLG_APPLY_BTN ); + // FIXME: HELPID + pImpl->pApplyButton->SetHelpId( ""/*HID_TABDLG_APPLY_BTN*/ ); } else { @@ -1783,7 +1786,8 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) ULONG nHelpId = 0; while ( !nHelpId && pWindow ) { - nHelpId = pWindow->GetHelpId(); + // FIXME: HELPID + // nHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 9edeb05b43ac..4777798aef2b 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -778,8 +778,10 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx bHierarchical ( FALSE ), bBindingUpdate ( TRUE ) { - aFmtLb.SetHelpId( HID_TEMPLATE_FMT ); - aFilterLb.SetHelpId( HID_TEMPLATE_FILTER ); + // FIXME: HELPID + aFmtLb.SetHelpId( ""/*HID_TEMPLATE_FMT*/ ); + // FIXME: HELPID + aFilterLb.SetHelpId( ""/*HID_TEMPLATE_FILTER*/ ); aFmtLb.SetWindowBits( WB_SORT | WB_HIDESELECTION ); Font aFont = aFmtLb.GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); @@ -2359,7 +2361,8 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( Font aFont=aFilterLb.GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); aFilterLb.SetFont( aFont ); - m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT ); + // FIXME: HELPID + m_aActionTbL.SetHelpId( ""/*HID_TEMPLDLG_TOOLBOX_LEFT*/ ); } // ------------------------------------------------------------------------ @@ -2384,7 +2387,8 @@ void SfxTemplateDialog_Impl::InsertFamilyItem(USHORT nId,const SfxStyleFamilyIte default: DBG_ERROR("unbekannte StyleFamily"); break; } m_aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), 0, 0); - m_aActionTbL.SetHelpId( nId, nHelpId ); + // FIXME: HELPID + m_aActionTbL.SetHelpId( nId, ""/*nHelpId*/ ); } // ------------------------------------------------------------------------ @@ -2683,18 +2687,21 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) uno::Any aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleNewByExample")); ::rtl::OUString sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel ); - pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); + // FIXME: HELPID + pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, ""/*HID_TEMPLDLG_NEWBYEXAMPLE*/); aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleUpdateByExample")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel ); - pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); + // FIXME: HELPID + pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, ""/*HID_TEMPLDLG_UPDATEBYEXAMPLE*/); aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:LoadStyles")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel ); - pMenu->SetHelpId(SID_TEMPLATE_LOAD, SID_TEMPLATE_LOAD); + // FIXME: HELPID + pMenu->SetHelpId(SID_TEMPLATE_LOAD, ""/*SID_TEMPLATE_LOAD*/); pMenu->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, MenuSelectHdl)); pMenu->Execute( pBox, diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index 719dc5b8d223..1d57e0b9c761 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -245,8 +245,9 @@ SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent, // * always work with an own instance, even if we get only NULL in this ctor } - aLeftLb.SetHelpId( HID_CTL_ORGANIZER_LEFT ); - aRightLb.SetHelpId( HID_CTL_ORGANIZER_RIGHT ); + // FIXME: HELPID + aLeftLb.SetHelpId( ""/*HID_CTL_ORGANIZER_LEFT*/ ); + aRightLb.SetHelpId( ""/*HID_CTL_ORGANIZER_RIGHT*/ ); String aWorkPath = SvtPathOptions().GetWorkPath(); if ( aWorkPath.Len() ) diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index d3235b1c7a7f..3b1ebde3f1ae 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -177,7 +177,8 @@ SfxPreviewWin::SfxPreviewWin( Window* pParent, const ResId& rResId, SfxObjectShellLock &rDocSh ) : Window(pParent, rResId), rDocShell( rDocSh ) { - SetHelpId( HID_PREVIEW_FRAME ); + // FIXME: HELPID + SetHelpId( ""/*HID_PREVIEW_FRAME*/ ); // adjust contrast mode initially bool bUseContrast = UseHighContrastSetting(); diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index 8e006721351a..a254deb24c52 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -41,7 +41,8 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) : MessBox ( pParent, 0, Application::GetDisplayName(), rMessage ) { SetImage( QueryBox::GetStandardImage() ); - SetHelpId( MSG_QUERY_LOAD_TEMPLATE ); + // FIXME: HELPID + SetHelpId( ""/*MSG_QUERY_LOAD_TEMPLATE*/ ); AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index ec803718f457..9137abd04764 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -160,7 +160,8 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen // einf"ugen pMenu->InsertItem( nId, aVerbs[n].VerbName ); - pMenu->SetHelpId( nId, (ULONG) nId ); + // FIXME: HELPID + pMenu->SetHelpId( nId, ""/*(ULONG) nId*/ ); } } } @@ -378,7 +379,8 @@ void SfxPopupMenuManager::InsertSeparator( USHORT nPos ) void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, USHORT nPos ) { pSVMenu->InsertItem( nId, rName, nBits,nPos ); - pSVMenu->SetHelpId( nId, (ULONG) nId ); + // FIXME: HELPID + pSVMenu->SetHelpId( nId, ""/*(ULONG) nId*/ ); } //------------------------------------------------------------------------- diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 13c84bc531e2..e3d694eae747 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -464,7 +464,8 @@ void SfxVirtualMenu::CreateFromSVMenu() pSVMenu->SetPopupMenu( nSlotId, pPopup ); } */ - pSVMenu->SetHelpId( nSlotId, 0L ); + // FIXME: HELPID + pSVMenu->SetHelpId( nSlotId, ""/*0L*/ ); pMnuCtrl = pItems+nPos; // normalerweise jetzt erst im Activate-Handler diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index f5b38d5a8a18..fc26d0077161 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1520,7 +1520,8 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId , bBigImages( FALSE ) , pMenu( 0 ) { - rBox.SetHelpId( nId, HID_TBXCONTROL_FILENEW ); + // FIXME: HELPID + rBox.SetHelpId( nId, ""/*HID_TBXCONTROL_FILENEW*/ ); rBox.SetItemBits( nId, rBox.GetItemBits( nId ) | TIB_DROPDOWN); // Determine the current background color of the menus diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index d99ad8733e03..fea860f6a3ff 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -130,7 +130,8 @@ long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt ) ULONG nHelpId = 0; while ( !nHelpId && pWindow ) { - nHelpId = pWindow->GetHelpId(); + // FIXME: HELPID + // nHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } diff --git a/svx/inc/svx/simptabl.hxx b/svx/inc/svx/simptabl.hxx index 1f5543e9e484..a4718c80f099 100644 --- a/svx/inc/svx/simptabl.hxx +++ b/svx/inc/svx/simptabl.hxx @@ -172,7 +172,8 @@ public: void SetHeaderBarDblClickHdl( const Link& rLink ) { aHeaderBarDblClickLink = rLink; } const Link& GetHeaderBarDblClickHdl() const { return aHeaderBarDblClickLink; } - void SetHeaderBarHelpId(ULONG nHelpId) {aHeaderBar.SetHelpId(nHelpId);} + // FIXME: HELPID + void SetHeaderBarHelpId(ULONG nHelpId) {aHeaderBar.SetHelpId(""/*nHelpId*/);} }; diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 503814823467..124f7fdd2910 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -636,7 +636,8 @@ SvxTPView::SvxTPView( Window * pParent) { FreeResource(); - aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE); + // FIXME: HELPID + aViewData.SetHelpId(""/*HID_REDLINING_VIEW_DG_VIEW_TABLE*/); aViewData.SetHeaderBarHelpId(HID_REDLINING_VIEW_DG_VIEW_HEADER); aMinSize=GetSizePixel(); @@ -1177,13 +1178,15 @@ void SvxTPFilter::ShowAction(BOOL bShow) { aCbRange.Hide(); aLbAction.Hide(); - aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_RANGE); + // FIXME: HELPID + aCbRange.SetHelpId(""/*HID_REDLINING_FILTER_CB_RANGE*/); } else { HideRange(); aCbRange.SetText(aActionStr); - aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_ACTION); + // FIXME: HELPID + aCbRange.SetHelpId(""/*HID_REDLINING_FILTER_CB_ACTION*/); aCbRange.Show(); aLbAction.Show(); @@ -1399,7 +1402,8 @@ SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, WinBits nWinStyle) aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); aTCAccept.SetTabPage( TP_VIEW, pTPView); aTCAccept.SetTabPage( TP_FILTER, pTPFilter); - aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); + // FIXME: HELPID + aTCAccept.SetHelpId(""/*HID_REDLINING_TABCONTROL*/); aTCAccept.SetTabPageSizePixel(aMinSize); Size aSize=aTCAccept.GetSizePixel(); @@ -1426,7 +1430,8 @@ SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, const ResId& rResId ) aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); aTCAccept.SetTabPage( TP_VIEW, pTPView); aTCAccept.SetTabPage( TP_FILTER, pTPFilter); - aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); + // FIXME: HELPID + aTCAccept.SetHelpId(""/*HID_REDLINING_TABCONTROL*/); aTCAccept.SetTabPageSizePixel(aMinSize); Size aSize=aTCAccept.GetSizePixel(); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 95c27a5dcec8..6437b193a793 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -1009,9 +1009,12 @@ SvxLightCtl3D::SvxLightCtl3D( Window* pParent, WinBits nStyle ) void SvxLightCtl3D::Init() { // #i58240# set HelpIDs for scrollbars and switcher - maHorScroller.SetHelpId(HID_CTRL3D_HSCROLL); - maVerScroller.SetHelpId(HID_CTRL3D_VSCROLL); - maSwitcher.SetHelpId(HID_CTRL3D_SWITCHER); + // FIXME: HELPID + maHorScroller.SetHelpId(""/*HID_CTRL3D_HSCROLL*/); + // FIXME: HELPID + maVerScroller.SetHelpId(""/*HID_CTRL3D_VSCROLL*/); + // FIXME: HELPID + maSwitcher.SetHelpId(""/*HID_CTRL3D_SWITCHER*/); // Light preview maLightControl.Show(); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 2cc87eb9e648..fe6a2372b7a0 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1978,8 +1978,8 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V sPattern.AssignAscii("HID:"); if (sHelpURL.Equals(sPattern, 0, sPattern.Len())) { - String sID = sHelpURL.Copy(sPattern.Len()); - pGrid->SetHelpId(sID.ToInt32()); + // FIXME: HELPID + pGrid->SetHelpId(rtl::OUStringToOString(sHelpURL, RTL_TEXTENCODING_UTF8)); } } else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 8cc52e4c0b7d..2c63880afd05 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -366,13 +366,20 @@ DbGridControl::NavigationBar::NavigationBar(Window* pParent, WinBits nStyle) m_aLastBtn.SetSymbol(SYMBOL_LAST); m_aNewBtn.SetModeImage(((DbGridControl*)pParent)->GetImage(DbGridControl_Base::NEW)); - m_aFirstBtn.SetHelpId(HID_GRID_TRAVEL_FIRST); - m_aPrevBtn.SetHelpId(HID_GRID_TRAVEL_PREV); - m_aNextBtn.SetHelpId(HID_GRID_TRAVEL_NEXT); - m_aLastBtn.SetHelpId(HID_GRID_TRAVEL_LAST); - m_aNewBtn.SetHelpId(HID_GRID_TRAVEL_NEW); - m_aAbsolute.SetHelpId(HID_GRID_TRAVEL_ABSOLUTE); - m_aRecordCount.SetHelpId(HID_GRID_NUMBEROFRECORDS); + // FIXME: HELPID + m_aFirstBtn.SetHelpId(""/*HID_GRID_TRAVEL_FIRST*/); + // FIXME: HELPID + m_aPrevBtn.SetHelpId(""/*HID_GRID_TRAVEL_PREV*/); + // FIXME: HELPID + m_aNextBtn.SetHelpId(""/*HID_GRID_TRAVEL_NEXT*/); + // FIXME: HELPID + m_aLastBtn.SetHelpId(""/*HID_GRID_TRAVEL_LAST*/); + // FIXME: HELPID + m_aNewBtn.SetHelpId(""/*HID_GRID_TRAVEL_NEW*/); + // FIXME: HELPID + m_aAbsolute.SetHelpId(""/*HID_GRID_TRAVEL_ABSOLUTE*/); + // FIXME: HELPID + m_aRecordCount.SetHelpId(""/*HID_GRID_NUMBEROFRECORDS*/); // Handler fuer Buttons einrichten m_aFirstBtn.SetClickHdl(LINK(this,NavigationBar,OnClick)); diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index e02e8664c6ac..e3425c00b130 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2388,7 +2388,8 @@ namespace svxform { DBG_CTOR(DataNavigator,NULL); - SetHelpId( HID_DATA_NAVIGATOR_WIN ); + // FIXME: HELPID + SetHelpId( ""/*HID_DATA_NAVIGATOR_WIN*/ ); SetText( SVX_RES( RID_STR_DATANAVIGATOR ) ); Size aSize = m_aDataWin.GetOutputSizePixel(); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 9d1b65208fdf..c985c34f12f1 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1168,7 +1168,8 @@ FmFilterNavigator::FmFilterNavigator( Window* pParent ) ,m_aTimerCounter( 0 ) ,m_aDropActionType( DA_SCROLLUP ) { - SetHelpId( HID_FILTER_NAVIGATOR ); + // FIXME: HELPID + SetHelpId( ""/*HID_FILTER_NAVIGATOR*/ ); { { @@ -1941,7 +1942,8 @@ FmFilterNavigatorWin::FmFilterNavigatorWin( SfxBindings* _pBindings, SfxChildWin :SfxDockingWindow( _pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_ROLLABLE|WB_3DLOOK|WB_DOCKABLE) ) ,SfxControllerItem( SID_FM_FILTER_NAVIGATOR_CONTROL, *_pBindings ) { - SetHelpId( HID_FILTER_NAVIGATOR_WIN ); + // FIXME: HELPID + SetHelpId( ""/*HID_FILTER_NAVIGATOR_WIN*/ ); m_pNavigator = new FmFilterNavigator( this ); m_pNavigator->Show(); diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index bcc275896410..939253dec5bb 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -223,7 +223,8 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding ::Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y); SetMinOutputSizePixel(::Size(STD_MIN_SIZE_X,STD_MIN_SIZE_Y)); SetOutputSizePixel(aPropWinSize); - SetUniqueId(UID_FORMPROPBROWSER_FRAME); + // FIXME: HELPID + SetUniqueId(""/*UID_FORMPROPBROWSER_FRAME*/); try { diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index c27b5b69d075..a2e1469418f0 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -592,7 +592,8 @@ namespace svxform ,SfxControllerItem( SID_FM_FMEXPLORER_CONTROL, *_pBindings ) { DBG_CTOR(NavigatorFrame,NULL); - SetHelpId( HID_FORM_NAVIGATOR_WIN ); + // FIXME: HELPID + SetHelpId( ""/*HID_FORM_NAVIGATOR_WIN*/ ); m_pNavigatorTree = new NavigatorTree(comphelper::getProcessServiceFactory(), this ); m_pNavigatorTree->Show(); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 0c83655042d2..5e37d88126c3 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -200,7 +200,8 @@ namespace svxform ,m_bKeyboardCut( sal_False ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::NavigatorTree" ); - SetHelpId( HID_FORM_NAVIGATOR ); + // FIXME: HELPID + SetHelpId( ""/*HID_FORM_NAVIGATOR*/ ); m_aNavigatorImages = ImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); m_aNavigatorImagesHC = ImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL_HC ) ); diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 7a51348dfaa3..1a87a06010e1 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -104,7 +104,8 @@ FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent ) ,pTabWin( pParent ) { DBG_CTOR(FmFieldWinListBox,NULL); - SetHelpId( HID_FIELD_SEL ); + // FIXME: HELPID + SetHelpId( ""/*HID_FIELD_SEL*/ ); SetHighlightRange( ); } @@ -192,7 +193,8 @@ FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _ ,m_pChangeListener(NULL) { DBG_CTOR(FmFieldWin,NULL); - SetHelpId( HID_FIELD_SEL_WIN ); + // FIXME: HELPID + SetHelpId( ""/*HID_FIELD_SEL_WIN*/ ); SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); pListBox = new FmFieldWinListBox( this ); diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx index f275fd9efd72..85babb34a1a7 100644 --- a/svx/source/form/tbxform.cxx +++ b/svx/source/form/tbxform.cxx @@ -318,7 +318,8 @@ void SvxFmTbxCtlAbsRec::StateChanged( USHORT nSID, SfxItemState eState, const Sf Window* SvxFmTbxCtlAbsRec::CreateItemWindow( Window* pParent ) { SvxFmAbsRecWin* pWin = new SvxFmAbsRecWin( pParent, this ); - pWin->SetUniqueId( UID_ABSOLUTE_RECORD_WINDOW ); + // FIXME: HELPID + pWin->SetUniqueId( ""/*UID_ABSOLUTE_RECORD_WINDOW*/ ); return pWin; } diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index ccbcd40862de..29c38653b4ac 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -152,7 +152,8 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, { StartListening( *mpGallery ); - maNewTheme.SetHelpId( HID_GALLERY_NEWTHEME ); + // FIXME: HELPID + maNewTheme.SetHelpId( ""/*HID_GALLERY_NEWTHEME*/ ); maNewTheme.SetText( String( GAL_RESID( RID_SVXSTR_GALLERY_CREATETHEME ) ) ); maNewTheme.SetClickHdl( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) ); @@ -160,7 +161,8 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, if( mpGallery->GetUserURL().GetProtocol() == INET_PROT_NOT_VALID ) maNewTheme.Disable(); - mpThemes->SetHelpId( HID_GALLERY_THEMELIST ); + // FIXME: HELPID + mpThemes->SetHelpId( ""/*HID_GALLERY_THEMELIST*/ ); mpThemes->SetSelectHdl( LINK( this, GalleryBrowser1, SelectThemeHdl ) ); for( ULONG i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; i++ ) diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 0483a1bc1425..ae1fc2f0e086 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -325,12 +325,14 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, maViewBox.InsertItem( TBX_ID_ICON, aDummyImage ); maViewBox.SetItemBits( TBX_ID_ICON, TIB_RADIOCHECK | TIB_AUTOCHECK ); - maViewBox.SetHelpId( TBX_ID_ICON, HID_GALLERY_ICONVIEW ); + // FIXME: HELPID + maViewBox.SetHelpId( TBX_ID_ICON, ""/*HID_GALLERY_ICONVIEW*/ ); maViewBox.SetQuickHelpText( TBX_ID_ICON, String( GAL_RESID( RID_SVXSTR_GALLERY_ICONVIEW ) ) ); maViewBox.InsertItem( TBX_ID_LIST, aDummyImage ); maViewBox.SetItemBits( TBX_ID_LIST, TIB_RADIOCHECK | TIB_AUTOCHECK ); - maViewBox.SetHelpId( TBX_ID_LIST, HID_GALLERY_LISTVIEW ); + // FIXME: HELPID + maViewBox.SetHelpId( TBX_ID_LIST, ""/*HID_GALLERY_LISTVIEW*/ ); maViewBox.SetQuickHelpText( TBX_ID_LIST, String( GAL_RESID( RID_SVXSTR_GALLERY_LISTVIEW ) ) ); maViewBox.SetBorder( 0, 1 ); diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 8022cecc0fbe..ccfb931f2d29 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -61,7 +61,8 @@ GalleryPreview::GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme ) DragSourceHelper( this ), mpTheme( pTheme ) { - SetHelpId( HID_GALLERY_WINDOW ); + // FIXME: HELPID + SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); InitSettings(); } @@ -73,7 +74,8 @@ GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) : DragSourceHelper( this ), mpTheme( NULL ) { - SetHelpId( HID_GALLERY_PREVIEW ); + // FIXME: HELPID + SetHelpId( ""/*HID_GALLERY_PREVIEW*/ ); InitSettings(); } @@ -309,7 +311,8 @@ GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme { EnableFullItemMode( FALSE ); - SetHelpId( HID_GALLERY_WINDOW ); + // FIXME: HELPID + SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); InitSettings(); SetExtraSpacing( 2 ); SetItemWidth( S_THUMB + 6 ); @@ -475,7 +478,8 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme mnCurRow( 0 ), mbInit( FALSE ) { - SetHelpId( HID_GALLERY_WINDOW ); + // FIXME: HELPID + SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); InitSettings(); diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx index 241ffeb8bc36..676c8b0dc842 100644 --- a/svx/source/stbctrls/insctrl.cxx +++ b/svx/source/stbctrls/insctrl.cxx @@ -57,7 +57,8 @@ SvxInsertStatusBarControl::SvxInsertStatusBarControl( USHORT _nSlotId, SfxStatusBarControl( _nSlotId, _nId, rStb ), bInsert( TRUE ) { - rStb.SetHelpId( _nId, _nSlotId ); + // FIXME: HELPID + rStb.SetHelpId( _nId, ""/*_nSlotId*/ ); } // ----------------------------------------------------------------------- diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index edb72ab05eac..fbcb925fd579 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -233,7 +233,8 @@ void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, // da Kombi-Controller, immer die aktuelle Id als HelpId setzen // gecachten HelpText vorher l"oschen GetStatusBar().SetHelpText( GetId(), String() ); - GetStatusBar().SetHelpId( GetId(), nSID ); + // FIXME: HELPID + GetStatusBar().SetHelpId( GetId(), ""/*nSID*/ ); if ( nSID == SID_PSZ_FUNCTION ) { diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index 06d1e9642b9e..130817432e7f 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -111,7 +111,8 @@ void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, con { GetStatusBar().SetHelpText( GetId(), String() );// necessary ? - GetStatusBar().SetHelpId( GetId(), nSID ); // necessary ? + // FIXME: HELPID + GetStatusBar().SetHelpId( GetId(), ""/*nSID*/ ); // necessary ? if( SFX_ITEM_AVAILABLE != eState ) { diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index a4cab5f3ef16..c9374ab27fb6 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -111,7 +111,8 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( void ExtrusionDirectionWindow::implInit() { - SetHelpId( HID_POPUP_EXTRUSION_DIRECTION ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_EXTRUSION_DIRECTION*/ ); USHORT i; for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ ) @@ -124,12 +125,15 @@ void ExtrusionDirectionWindow::implInit() // mpProjectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_PROJECTION, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_DIRECTION*/ ); mpMenu->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) ); mpDirectionSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - mpDirectionSet->SetHelpId( HID_VALUESET_EXTRUSION_DIRECTION ); + // FIXME: HELPID + mpDirectionSet->SetHelpId( ""/*HID_VALUESET_EXTRUSION_DIRECTION*/ ); - mpDirectionSet->SetHelpId( HID_POPUP_LINEEND_CTRL ); + // FIXME: HELPID + mpDirectionSet->SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); mpDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) ); mpDirectionSet->SetColCount( 3 ); mpDirectionSet->EnableFullItemMode( FALSE ); @@ -501,13 +505,15 @@ ExtrusionDepthWindow::ExtrusionDepthWindow( USHORT nId, void ExtrusionDepthWindow::implInit() { - SetHelpId( HID_POPUP_EXTRUSION_DEPTH ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_EXTRUSION_DEPTH*/ ); // mpDepthForewarder = new SfxStatusForwarder( SID_EXTRUSION_DEPTH, *this ); // mpMetricForewarder = new SfxStatusForwarder( SID_ATTR_METRIC, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_MENU_EXTRUSION_DEPTH ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_DEPTH*/ ); mpMenu->SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) ); @@ -848,7 +854,8 @@ ExtrusionLightingWindow::ExtrusionLightingWindow( void ExtrusionLightingWindow::implInit() { - SetHelpId( HID_POPUP_EXTRUSION_LIGHTING ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_EXTRUSION_LIGHTING*/ ); USHORT i; for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ ) @@ -868,13 +875,16 @@ void ExtrusionLightingWindow::implInit() // mpLightingIntensityForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_INTENSITY, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_MENU_EXTRUSION_LIGHTING ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_LIGHTING*/ ); mpMenu->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) ); mpLightingSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - mpLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING ); + // FIXME: HELPID + mpLightingSet->SetHelpId( ""/*HID_VALUESET_EXTRUSION_LIGHTING*/ ); - mpLightingSet->SetHelpId( HID_POPUP_LINEEND_CTRL ); + // FIXME: HELPID + mpLightingSet->SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); mpLightingSet->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) ); mpLightingSet->SetColCount( 3 ); mpLightingSet->EnableFullItemMode( FALSE ); @@ -1226,14 +1236,16 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( void ExtrusionSurfaceWindow::implInit() { - SetHelpId( HID_POPUP_EXTRUSION_SURFACE ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_EXTRUSION_SURFACE*/ ); bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); // mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_MENU_EXTRUSION_SURFACE ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_SURFACE*/ ); mpMenu->SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 31c77e221d62..5a16fc41e90b 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -504,8 +504,10 @@ Window* SvxFillToolBoxControl::CreateItemWindow( Window *pParent ) pFillAttrLB = (SvxFillAttrBox*)pFillControl->pLbFillAttr; pFillTypeLB = (SvxFillTypeBox*)pFillControl->pLbFillType; - pFillAttrLB->SetUniqueId( HID_FILL_ATTR_LISTBOX ); - pFillTypeLB->SetUniqueId( HID_FILL_TYPE_LISTBOX ); + // FIXME: HELPID + pFillAttrLB->SetUniqueId( ""/*HID_FILL_ATTR_LISTBOX*/ ); + // FIXME: HELPID + pFillTypeLB->SetUniqueId( ""/*HID_FILL_TYPE_LISTBOX */); return pFillControl; } diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 1b4f89ca1e8c..dbd815ae3d14 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -361,7 +361,8 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow( mxFrame( rFrame ), mbPopupMode( true ) { - SetHelpId( HID_WIN_FONTWORK_ALIGN ); + // FIXME: HELPID + SetHelpId( ""/*HID_WIN_FONTWORK_ALIGN*/ ); implInit(); } @@ -386,18 +387,21 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow( mxFrame( rFrame ), mbPopupMode( true ) { - SetHelpId( HID_WIN_FONTWORK_ALIGN ); + // FIXME: HELPID + SetHelpId( ""/*HID_WIN_FONTWORK_ALIGN*/ ); implInit(); } void FontWorkAlignmentWindow::implInit() { - SetHelpId( HID_POPUP_FONTWORK_ALIGN ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_FONTWORK_ALIGN*/ ); bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_POPUP_FONTWORK_ALIGN ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_POPUP_FONTWORK_ALIGN*/ ); mpMenu->SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 ); @@ -610,7 +614,8 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( mxFrame( rFrame ), mbPopupMode( true ) { - SetHelpId( HID_WIN_FONTWORK_CHARSPACE ); + // FIXME: HELPID + SetHelpId( ""/*HID_WIN_FONTWORK_CHARSPACE*/ ); implInit(); } @@ -626,18 +631,21 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( mxFrame( rFrame ), mbPopupMode( true ) { - SetHelpId( HID_WIN_FONTWORK_CHARSPACE ); + // FIXME: HELPID + SetHelpId( ""/*HID_WIN_FONTWORK_CHARSPACE*/ ); implInit(); } void FontWorkCharacterSpacingWindow::implInit() { - SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_FONTWORK_CHARSPACE*/ ); // bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - mpMenu->SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); + // FIXME: HELPID + mpMenu->SetHelpId( ""/*HID_POPUP_FONTWORK_CHARSPACE*/ ); mpMenu->SetSelectHdl( LINK( this, FontWorkCharacterSpacingWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK ); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index fa5ddd579dee..f73e9b756ccf 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -353,8 +353,9 @@ ImplGrafControl::ImplGrafControl( Window* pParent, USHORT nSlotId, const rtl::OU maImage.Show(); - maField.SetHelpId( nSlotId ); - maField.SetSmartHelpId( SmartId( rCmd )); + // FIXME: HELPID + // maField.SetHelpId( nSlotId ); + maField.SetHelpId( rtl::OUStringToOString( rCmd, RTL_TEXTENCODING_UTF8 ) ); maField.Show(); } diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 6deab3eca30b..f3e208f3e6ce 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -423,8 +423,10 @@ void SvxLineEndWindow::implInit() SfxObjectShell* pDocSh = SfxObjectShell::Current(); const SfxPoolItem* pItem = NULL; - SetHelpId( HID_POPUP_LINEEND ); - aLineEndSet.SetHelpId( HID_POPUP_LINEEND_CTRL ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_LINEEND*/ ); + // FIXME: HELPID + aLineEndSet.SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); if ( pDocSh ) { diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5c99e84e6a47..6b5998a3f1b9 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -905,8 +905,10 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, lcl_CalcSizeValueSet( *this, aColorSet, aSize12 ); - SetHelpId( HID_POPUP_COLOR ); - aColorSet.SetHelpId( HID_POPUP_COLOR_CTRL ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_COLOR*/ ); + // FIXME: HELPID + aColorSet.SetHelpId( ""/*HID_POPUP_COLOR_CTRL*/ ); SetText( rWndTitle ); aColorSet.Show(); @@ -1090,7 +1092,8 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( USHORT nId, const Reference< XFrame >& lcl_CalcSizeValueSet( *this, aFrameSet,Size( 20, 20 )); - SetHelpId( HID_POPUP_FRAME ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_FRAME*/ ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME) ); aFrameSet.Show(); } @@ -1350,7 +1353,8 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r lcl_CalcSizeValueSet( *this, aLineSet, aBmpSize ); - SetHelpId( HID_POPUP_LINE ); + // FIXME: HELPID + SetHelpId( ""/*HID_POPUP_LINE*/ ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME_STYLE) ); aLineSet.Show(); } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index dda324cb98d1..97bcf74e6c10 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -485,13 +485,18 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) { FreeResource(); - m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED ); - m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL ); + // FIXME: HELPID + m_aRB_To_Simplified.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED*/ ); + // FIXME: HELPID + m_aRB_To_Traditional.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL*/ ); - m_aCB_Reverse.SetHelpId( HID_SVX_CHINESE_DICTIONARY_CB_REVERSE ); + // FIXME: HELPID + m_aCB_Reverse.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_CB_REVERSE*/ ); - m_aCT_DictionaryToSimplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED ); - m_aCT_DictionaryToTraditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL ); + // FIXME: HELPID + m_aCT_DictionaryToSimplified.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED*/ ); + // FIXME: HELPID + m_aCT_DictionaryToTraditional.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL*/ ); SvtLinguConfig aLngCfg; sal_Bool bValue = sal_Bool(); @@ -578,7 +583,8 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) m_pHeaderBar = m_aCT_DictionaryToSimplified.createHeaderBar( aColumn1, aColumn2, aColumn3, nWidth1, nWidth2, nWidth3 ); if(m_pHeaderBar) - m_pHeaderBar->SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_HEADER ); + // FIXME: HELPID + m_pHeaderBar->SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_HEADER*/ ); long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 }; m_aCT_DictionaryToSimplified.SetTabs( &pTabs[0], MAP_PIXEL ); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx index 213ddc22bace..a2f308248224 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx @@ -72,9 +72,12 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent ) { FreeResource(); - m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED ); - m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL ); - m_aCB_Use_Variants.SetHelpId( HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS ); + // FIXME: HELPID + m_aRB_To_Simplified.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED*/ ); + // FIXME: HELPID + m_aRB_To_Traditional.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL*/ ); + // FIXME: HELPID + m_aCB_Use_Variants.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS*/ ); SvtLinguConfig aLngCfg; sal_Bool bValue = sal_Bool(); -- cgit From db3bae48af6b96d853b204f065b5843c4f7f712e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 18:05:29 +0200 Subject: fix a warning --- framework/source/uielement/toolbarsmenucontroller.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 3d0cda946771..d3a616a76629 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -218,6 +218,7 @@ void ToolbarsMenuController::addCommand( pVCLPopupMenu->SetItemImage( nItemId, aImage ); // FIXME: HELPID pVCLPopupMenu->SetHelpId( nItemId, ""/*nHelpId*/ ); + (void)nHelpId; } m_aCommandVector.push_back( rCommandURL ); -- cgit From e2ad46c4d4bb61681caf69938ee0fc41f69d9de3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 20:01:36 +0200 Subject: fix warnings --- svx/inc/svx/simptabl.hxx | 2 +- svx/source/stbctrls/xmlsecctrl.cxx | 1 + svx/source/tbxctrls/grafctrl.cxx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/svx/inc/svx/simptabl.hxx b/svx/inc/svx/simptabl.hxx index a4718c80f099..c409ed5b63be 100644 --- a/svx/inc/svx/simptabl.hxx +++ b/svx/inc/svx/simptabl.hxx @@ -173,7 +173,7 @@ public: const Link& GetHeaderBarDblClickHdl() const { return aHeaderBarDblClickLink; } // FIXME: HELPID - void SetHeaderBarHelpId(ULONG nHelpId) {aHeaderBar.SetHelpId(""/*nHelpId*/);} + void SetHeaderBarHelpId(ULONG /*nHelpId*/) {aHeaderBar.SetHelpId(""/*nHelpId*/);} }; diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index 130817432e7f..3df835510ed6 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -112,6 +112,7 @@ void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, con GetStatusBar().SetHelpText( GetId(), String() );// necessary ? // FIXME: HELPID + (void)nSID; GetStatusBar().SetHelpId( GetId(), ""/*nSID*/ ); // necessary ? if( SFX_ITEM_AVAILABLE != eState ) diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index f73e9b756ccf..aae0bd4fc12b 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -354,6 +354,7 @@ ImplGrafControl::ImplGrafControl( Window* pParent, USHORT nSlotId, const rtl::OU maImage.Show(); // FIXME: HELPID + (void)nSlotId; // maField.SetHelpId( nSlotId ); maField.SetHelpId( rtl::OUStringToOString( rCmd, RTL_TEXTENCODING_UTF8 ) ); maField.Show(); -- cgit From f8a801d058e39e89a71c85afdb0b1c1718f36b45 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 20:20:37 +0200 Subject: fix windows compile --- sfx2/inc/sfxhelp.hxx | 4 +++- sfx2/source/appl/sfxhelp.cxx | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx index 6a87729e30e3..b19f78c6184b 100644 --- a/sfx2/inc/sfxhelp.hxx +++ b/sfx2/inc/sfxhelp.hxx @@ -48,7 +48,8 @@ private: // FIXME: HELPID // SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); - SAL_DLLPRIVATE virtual void OpenHelpAgent( ULONG nHelpId ); + // FIXME: HELPID + // SAL_DLLPRIVATE virtual void OpenHelpAgent( ULONG nHelpId ); SAL_DLLPRIVATE String GetHelpModuleName_Impl(); // FIXME: HELPID @@ -69,6 +70,7 @@ public: // FIXME: HELPID // static String CreateHelpURL( ULONG nHelpId, const String& rModuleName ); static String CreateHelpURL( const String& aCommandURL, const String& rModuleName ); + using Help::OpenHelpAgent; static void OpenHelpAgent( SfxFrame* pFrame, ULONG nHelpId ); static String GetDefaultHelpModule(); static ::rtl::OUString GetCurrentModuleIdentifier(); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index cd2f6b189fd1..9c246c592b82 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -974,11 +974,18 @@ String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleN void SfxHelp::OpenHelpAgent( SfxFrame*, ULONG nHelpId ) { +// FIXME HELPID +#if 0 SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); if ( pHelp ) pHelp->OpenHelpAgent( nHelpId ); +#else +(void)nHelpId; +#endif } +// FIXME: HELPID +#if 0 void SfxHelp::OpenHelpAgent( ULONG nHelpId ) { if ( SvtHelpOptions().IsHelpAgentAutoStartMode() ) @@ -1023,6 +1030,7 @@ void SfxHelp::OpenHelpAgent( ULONG nHelpId ) // } } } +#endif String SfxHelp::GetDefaultHelpModule() { -- cgit From b0a3032631003bfe5cf5e7c39773105fc50151cd Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 8 Jun 2010 08:35:09 +0200 Subject: sb123:#i111449# cleanups in ucb qa/complex tests --- ucb/prj/build.lst | 26 ++- ucb/qa/complex/tdoc/CheckContentProvider.java | 237 ++++++++++++--------- .../tdoc/CheckTransientDocumentsContent.java | 80 ++++--- .../CheckTransientDocumentsContentProvider.java | 80 ++++--- .../CheckTransientDocumentsDocumentContent.java | 93 ++++---- ucb/qa/complex/tdoc/TestDocument.java | 39 ++++ ucb/qa/complex/tdoc/interfaces/makefile.mk | 4 +- ucb/qa/complex/tdoc/makefile.mk | 73 +++---- ucb/qa/complex/tdoc/test_documents/Iterator.sxw | Bin 0 -> 5627 bytes ucb/qa/complex/tdoc/test_documents/chinese.sxw | Bin 0 -> 5757 bytes ucb/qa/complex/tdoc/test_documents/filter.sxw | Bin 0 -> 14359 bytes ucb/qa/complex/test_documents/Iterator.sxw | Bin 5627 -> 0 bytes ucb/qa/complex/test_documents/chinese.sxw | Bin 5757 -> 0 bytes ucb/qa/complex/test_documents/filter.sxw | Bin 14359 -> 0 bytes ucb/qa/complex/ucb/UCB.java | 169 +++++++++------ ucb/qa/complex/ucb/makefile.mk | 58 ++--- 16 files changed, 501 insertions(+), 358 deletions(-) create mode 100644 ucb/qa/complex/tdoc/TestDocument.java create mode 100644 ucb/qa/complex/tdoc/test_documents/Iterator.sxw create mode 100644 ucb/qa/complex/tdoc/test_documents/chinese.sxw create mode 100644 ucb/qa/complex/tdoc/test_documents/filter.sxw delete mode 100644 ucb/qa/complex/test_documents/Iterator.sxw delete mode 100644 ucb/qa/complex/test_documents/chinese.sxw delete mode 100644 ucb/qa/complex/test_documents/filter.sxw diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst index a4d7ef6b4f6b..b6994781ca57 100644 --- a/ucb/prj/build.lst +++ b/ucb/prj/build.lst @@ -1,17 +1,21 @@ uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper NULL -uc ucb usr1 - all uc_mkout NULL -uc ucb\inc nmake - all uc_inc NULL -uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL -uc ucb\source\core nmake - all uc_core uc_regexp uc_inc NULL -uc ucb\source\cacher nmake - all uc_cacher uc_inc NULL -uc ucb\source\sorter nmake - all uc_sorter uc_inc NULL -uc ucb\source\ucp\ftp nmake - all uc_ftp uc_inc NULL -uc ucb\source\ucp\file nmake - all uc_file uc_inc NULL -uc ucb\source\ucp\gvfs nmake - u uc_gvfs uc_inc NULL -uc ucb\source\ucp\gio nmake - u uc_gio uc_inc NULL +uc ucb usr1 - all uc_mkout NULL +uc ucb\inc nmake - all uc_inc NULL +uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL +uc ucb\source\core nmake - all uc_core uc_regexp uc_inc NULL +uc ucb\source\cacher nmake - all uc_cacher uc_inc NULL +uc ucb\source\sorter nmake - all uc_sorter uc_inc NULL +uc ucb\source\ucp\ftp nmake - all uc_ftp uc_inc NULL +uc ucb\source\ucp\file nmake - all uc_file uc_inc NULL +uc ucb\source\ucp\gvfs nmake - u uc_gvfs uc_inc NULL +uc ucb\source\ucp\gio nmake - u uc_gio uc_inc NULL uc ucb\source\ucp\hierarchy nmake - all uc_hierarchy uc_inc NULL uc ucb\source\ucp\webdav nmake - all uc_webdav uc_inc NULL uc ucb\source\ucp\package nmake - all uc_package uc_inc NULL -uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL +uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL + +uc ucb\qa\complex\ucb nmake - all uc_complex_ucb uc_inc NULL +# fails, please fix +# uc ucb\qa\complex\tdoc nmake - all uc_complex_tdoc uc_inc NULL diff --git a/ucb/qa/complex/tdoc/CheckContentProvider.java b/ucb/qa/complex/tdoc/CheckContentProvider.java index a20a96829e0b..d3dfd120611e 100755 --- a/ucb/qa/complex/tdoc/CheckContentProvider.java +++ b/ucb/qa/complex/tdoc/CheckContentProvider.java @@ -42,7 +42,6 @@ import com.sun.star.ucb.XContentIdentifier; import com.sun.star.ucb.XContentIdentifierFactory; import com.sun.star.ucb.XContentProvider; import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; import complex.tdoc.interfaces._XChild; import complex.tdoc.interfaces._XCommandInfoChangeNotifier; import complex.tdoc.interfaces._XComponent; @@ -53,9 +52,15 @@ import complex.tdoc.interfaces._XContent; import complex.tdoc.interfaces._XPropertiesChangeNotifier; import complex.tdoc.interfaces._XPropertyContainer; import complex.tdoc.interfaces._XPropertySetInfoChangeNotifier; -import lib.TestEnvironment; import util.WriterTools; -import util.utils; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * Check the TransientDocumentsContentProvider (TDOC). Three documents are @@ -66,7 +71,7 @@ import util.utils; * with an accept parameter (writer is initially opened). Otherwise loaded * documents are not found. */ -public class CheckContentProvider extends ComplexTestCase { +public class CheckContentProvider { private final String testDocuments[] = new String[]{"filter.sxw", "chinese.sxw", "Iterator.sxw"}; private final int countDocs = testDocuments.length; private XMultiServiceFactory xMSF = null; @@ -89,37 +94,38 @@ public class CheckContentProvider extends ComplexTestCase { * Important is, that the test of the element comes first, then the test of * its interfaces. **/ - public String[] getTestMethodNames() { - return new String[]{"checkTDOCRoot", - "checkTDOCRootInterfaces", - "checkTDOCDocument", - "checkTDOCDocumentInterfaces", - "checkTDOCFolder", - "checkTDOCFolderInterfaces", - "checkTDOCStream", - "checkTDOCStreamInterfaces", - }; - } +// public String[] getTestMethodNames() { +// return new String[]{"checkTDOCRoot", +// "checkTDOCRootInterfaces", +// "checkTDOCDocument", +// "checkTDOCDocumentInterfaces", +// "checkTDOCFolder", +// "checkTDOCFolderInterfaces", +// "checkTDOCStream", +// "checkTDOCStreamInterfaces", +// }; +// } /** * Open some documents before the test */ - public void before() { - xMSF = (XMultiServiceFactory)param.getMSF(); + @Before public void before() { + xMSF = getMSF(); xTextDoc = new XTextDocument[countDocs]; - log.println("Open some new documents."); + System.out.println("Open some new documents."); for (int i=0; i 1) - failed("Implementation has been changed. Check this test!"); - assure("The service name '" + serviceName + "' is not valid.", !serviceName.equals("com.sun.star.ucb.DynamicContentResultSet"), true); + { + fail("Implementation has been changed. Check this test!"); + } + assertTrue("The service name '" + serviceName + "' is not valid.", !serviceName.equals("com.sun.star.ucb.DynamicContentResultSet")); XResultSet xResultSet = xDynamicResultSet.getStaticResultSet(); - XContentAccess xContentAccess = (XContentAccess)UnoRuntime.queryInterface(XContentAccess.class, xResultSet); + XContentAccess xContentAccess = UnoRuntime.queryInterface(XContentAccess.class, xResultSet); // iterate over the result: three docs were opened, we should have at least three content identifier strings int countContentIdentifiers = 0; while(xResultSet.next()) { countContentIdentifiers++; String identifier = xContentAccess.queryContentIdentifierString(); - log.println("Identifier of row " + xResultSet.getRow() + ": " + identifier); + System.out.println("Identifier of row " + xResultSet.getRow() + ": " + identifier); } // some feeble test: if the amount >2, we're ok. // 2do: check better - assure("Did only find " + countContentIdentifiers + " open documents." + + assertTrue("Did only find " + countContentIdentifiers + " open documents." + " Should have been at least 3.", countContentIdentifiers>2); } catch (com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); - failed("Could not create test objects."); + e.printStackTrace(); + fail("Could not create test objects."); } } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java index 229f5d388697..ad0001161c49 100755 --- a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java +++ b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java @@ -34,49 +34,49 @@ import com.sun.star.embed.XStorage; import com.sun.star.frame.XModel; import com.sun.star.frame.XTransientDocumentsDocumentContentFactory; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XServiceInfo; import com.sun.star.sdbc.XResultSet; import com.sun.star.sdbc.XRow; import com.sun.star.text.XTextDocument; import com.sun.star.ucb.Command; import com.sun.star.ucb.ContentInfo; -import com.sun.star.ucb.InsertCommandArgument; import com.sun.star.ucb.OpenCommandArgument2; import com.sun.star.ucb.OpenMode; import com.sun.star.ucb.XCommandProcessor; import com.sun.star.ucb.XContent; -import com.sun.star.ucb.XContentAccess; -import com.sun.star.ucb.XContentIdentifier; -import com.sun.star.ucb.XContentIdentifierFactory; -import com.sun.star.ucb.XContentProvider; import com.sun.star.ucb.XDynamicResultSet; import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; import util.WriterTools; import util.utils; - +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; /** * */ -public class CheckTransientDocumentsDocumentContent extends ComplexTestCase { +public class CheckTransientDocumentsDocumentContent { private final String testDocuments = "sForm.sxw"; private final String folderName = "TestFolder"; private XMultiServiceFactory xMSF = null; private XTextDocument xTextDoc = null; - public String[] getTestMethodNames() { - return new String[]{"checkTransientDocumentsDocumentContent"}; - } +// public String[] getTestMethodNames() { +// return new String[]{"checkTransientDocumentsDocumentContent"}; +// } - public void before() { - xMSF = (XMultiServiceFactory)param.getMSF(); - log.println("Open a document."); - String fileName = utils.getFullTestURL(testDocuments); + @Before public void before() { + xMSF = getMSF(); + System.out.println("Open a document."); + String fileName = TestDocument.getUrl(testDocuments); xTextDoc = WriterTools.loadTextDoc(xMSF, fileName); + assertNotNull(xTextDoc); } - public void after() { - log.println("Close all documents."); + @After public void after() { + System.out.println("Close all documents."); xTextDoc.dispose(); } @@ -84,30 +84,28 @@ public class CheckTransientDocumentsDocumentContent extends ComplexTestCase { * Check the provider of document content: open some documents * and look if they are accessible. */ - public void checkTransientDocumentsDocumentContent() { + @Test public void checkTransientDocumentsDocumentContent() { try { // create a content provider Object o = xMSF.createInstance("com.sun.star.comp.ucb.TransientDocumentsDocumentContentFactory"); XTransientDocumentsDocumentContentFactory xTransientDocumentsDocumentContentFactory = - (XTransientDocumentsDocumentContentFactory)UnoRuntime.queryInterface( - XTransientDocumentsDocumentContentFactory.class, o); + UnoRuntime.queryInterface(XTransientDocumentsDocumentContentFactory.class, o); // get the model from the opened document XModel xModel = xTextDoc.getCurrentController().getModel(); // a little additional check for 114733 - XDocumentSubStorageSupplier xDocumentSubStorageSupplier = (XDocumentSubStorageSupplier) - UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class, xModel); + XDocumentSubStorageSupplier xDocumentSubStorageSupplier = UnoRuntime.queryInterface(XDocumentSubStorageSupplier.class, xModel); String[]names = xDocumentSubStorageSupplier.getDocumentSubStoragesNames(); for (int i=0; i +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.tdoc; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument { + public static String getUrl(String name) { + return OfficeFileUrl.getAbsolute(new File("test_documents", name)); + } + + private TestDocument() {} +} diff --git a/ucb/qa/complex/tdoc/interfaces/makefile.mk b/ucb/qa/complex/tdoc/interfaces/makefile.mk index 3a57d1501ca4..5399383f19e6 100755 --- a/ucb/qa/complex/tdoc/interfaces/makefile.mk +++ b/ucb/qa/complex/tdoc/interfaces/makefile.mk @@ -25,10 +25,10 @@ # #************************************************************************* -PRJ = ..$/..$/..$/.. +PRJ = ../../../.. TARGET = TransientDocument PRJNAME = $(TARGET) -PACKAGE = complex$/tdoc$/interfaces +PACKAGE = complex/tdoc/interfaces # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk diff --git a/ucb/qa/complex/tdoc/makefile.mk b/ucb/qa/complex/tdoc/makefile.mk index 175184de0f27..f5f2629f5592 100755 --- a/ucb/qa/complex/tdoc/makefile.mk +++ b/ucb/qa/complex/tdoc/makefile.mk @@ -25,62 +25,43 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = TransientDocument -PRJNAME = $(TARGET) -PACKAGE = complex.tdoc - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = CheckContentProvider.java \ - CheckTransientDocumentsContent.java \ - CheckTransientDocumentsContentProvider.java \ - CheckTransientDocumentsDocumentContent.java +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# CheckSimpleFileAccess.java \ -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = sc +TARGET = qa_complex_tdoc -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/tdoc -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +JAVATESTFILES = \ + CheckContentProvider.java \ + CheckTransientDocumentsContent.java \ + CheckTransientDocumentsContentProvider.java \ + CheckTransientDocumentsDocumentContent.java -# --- Parameters for the test -------------------------------------- +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand \ - "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test base is java complex -CT_TESTBASE = -TestBase java_complex -# replace $/ with . in package name -CT_PACKAGE = -o $(PACKAGE:s\$/\.\) +JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +SUBDIRS = interfaces -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# test document path -CT_TESTDOCS = -tdoc $(PWD)$/..$/test_documents +.END -# --- Targets ------------------------------------------------------ +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -run: ALLTAR - @echo . - @echo "The followig tests are available:" - @echo $(foreach,i,$(JAVAFILES) "dmake $(i:b) ") +ALLTAR : javatest -.INCLUDE : target.mk +.END -Check%: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_TESTDOCS) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).$@ diff --git a/ucb/qa/complex/tdoc/test_documents/Iterator.sxw b/ucb/qa/complex/tdoc/test_documents/Iterator.sxw new file mode 100644 index 000000000000..9a7f8961bb47 Binary files /dev/null and b/ucb/qa/complex/tdoc/test_documents/Iterator.sxw differ diff --git a/ucb/qa/complex/tdoc/test_documents/chinese.sxw b/ucb/qa/complex/tdoc/test_documents/chinese.sxw new file mode 100644 index 000000000000..53b242a292c3 Binary files /dev/null and b/ucb/qa/complex/tdoc/test_documents/chinese.sxw differ diff --git a/ucb/qa/complex/tdoc/test_documents/filter.sxw b/ucb/qa/complex/tdoc/test_documents/filter.sxw new file mode 100644 index 000000000000..e4b077c65f11 Binary files /dev/null and b/ucb/qa/complex/tdoc/test_documents/filter.sxw differ diff --git a/ucb/qa/complex/test_documents/Iterator.sxw b/ucb/qa/complex/test_documents/Iterator.sxw deleted file mode 100644 index 9a7f8961bb47..000000000000 Binary files a/ucb/qa/complex/test_documents/Iterator.sxw and /dev/null differ diff --git a/ucb/qa/complex/test_documents/chinese.sxw b/ucb/qa/complex/test_documents/chinese.sxw deleted file mode 100644 index 53b242a292c3..000000000000 Binary files a/ucb/qa/complex/test_documents/chinese.sxw and /dev/null differ diff --git a/ucb/qa/complex/test_documents/filter.sxw b/ucb/qa/complex/test_documents/filter.sxw deleted file mode 100644 index e4b077c65f11..000000000000 Binary files a/ucb/qa/complex/test_documents/filter.sxw and /dev/null differ diff --git a/ucb/qa/complex/ucb/UCB.java b/ucb/qa/complex/ucb/UCB.java index f7b1d2a8e918..c027dd95bb37 100755 --- a/ucb/qa/complex/ucb/UCB.java +++ b/ucb/qa/complex/ucb/UCB.java @@ -34,7 +34,6 @@ package complex.ucb; * Window>Preferences>Java>Code Generation>Code and Comments */ -import complexlib.ComplexTestCase; import java.util.List; import java.util.Vector; @@ -42,13 +41,22 @@ import com.sun.star.beans.Property; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sdbc.XResultSet; import com.sun.star.sdbc.XRow; -import com.sun.star.uno.XComponentContext; +// import com.sun.star.uno.XComponentContext; import com.sun.star.ucb.*; -import com.sun.star.bridge.XUnoUrlResolver; +// import com.sun.star.bridge.XUnoUrlResolver; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.beans.XPropertySet; +// import com.sun.star.uno.XComponentContext; +// import com.sun.star.lang.XMultiComponentFactory; +// import com.sun.star.beans.XPropertySet; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + /** * @author rpiterman * This class is used to copy the content of a folder to @@ -56,12 +64,12 @@ import com.sun.star.beans.XPropertySet; * There is an incosistency with argument order. * It should be always: dir,filename. */ -public class UCB extends ComplexTestCase { +public class UCB { private Object ucb; - public String[] getTestMethodNames() { - return new String[] {"checkWrongFtpConnection"}; - } +// public String[] getTestMethodNames() { +// return new String[] {"checkWrongFtpConnection"}; +// } public void init(XMultiServiceFactory xmsf) throws Exception { String[] keys = new String[2]; @@ -79,11 +87,13 @@ public class UCB extends ComplexTestCase { /** * target name can be "", in which case the name stays lige the source name - * @param sourceDir - * @param filename - * @param targetDir - * @param targetName - * @return + + * @param xContent + * @param aCommandName + * @param aArgument + * @return + * @throws com.sun.star.ucb.CommandAbortedException + * @throws com.sun.star.uno.Exception */ public Object executeCommand( @@ -92,9 +102,7 @@ public class UCB extends ComplexTestCase { Object aArgument) throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception { XCommandProcessor xCmdProcessor = - (XCommandProcessor) UnoRuntime.queryInterface( - XCommandProcessor.class, - xContent); + UnoRuntime.queryInterface(XCommandProcessor.class, xContent); Command aCommand = new Command(); aCommand.Name = aCommandName; aCommand.Handle = -1; // not available @@ -118,39 +126,44 @@ public class UCB extends ComplexTestCase { XDynamicResultSet xSet; xSet = - (XDynamicResultSet) UnoRuntime.queryInterface( - XDynamicResultSet.class, - executeCommand(xContent, "open", aArg)); + UnoRuntime.queryInterface(XDynamicResultSet.class, executeCommand(xContent, "open", aArg)); XResultSet xResultSet = xSet.getStaticResultSet(); List files = new Vector(); - if (xResultSet.first()) { + if (xResultSet.first()) + { // obtain XContentAccess interface for child content access and XRow for properties - XContentAccess xContentAccess = - (XContentAccess) UnoRuntime.queryInterface( - XContentAccess.class, - xResultSet); - XRow xRow = - (XRow) UnoRuntime.queryInterface(XRow.class, xResultSet); - do { + XContentAccess xContentAccess = UnoRuntime.queryInterface(XContentAccess.class, xResultSet); + XRow xRow = UnoRuntime.queryInterface(XRow.class, xResultSet); + do + { // Obtain URL of child. String aId = xContentAccess.queryContentIdentifierString(); // First column: Title (column numbers are 1-based!) String aTitle = xRow.getString(1); - if (aTitle.length() == 0 && xRow.wasNull()); - //ignore + if (aTitle.length() == 0 && xRow.wasNull()) + { + //ignore + } else - files.add(aTitle); + { + files.add(aTitle); + } } while (xResultSet.next()); // next child } if (verifier != null) - for (int i = 0; i < files.size(); i++) - if (!verifier.verify(files.get(i))) - files.remove(i--); - + { + for (int i = 0; i < files.size(); i++) + { + if (!verifier.verify(files.get(i))) + { + files.remove(i--); + } + } + } return files; } @@ -165,45 +178,46 @@ public class UCB extends ComplexTestCase { pv[0].Handle = -1; Object row = executeCommand(content, "getPropertyValues", pv); - XRow xrow = (XRow) UnoRuntime.queryInterface(XRow.class, row); + XRow xrow = UnoRuntime.queryInterface(XRow.class, row); if (type.equals(String.class)) - return xrow.getString(1); + { + return xrow.getString(1); + } else if (type.equals(Boolean.class)) - return xrow.getBoolean(1) ? Boolean.TRUE : Boolean.FALSE; + { + return xrow.getBoolean(1) ? Boolean.TRUE : Boolean.FALSE; + } else if (type.equals(Integer.class)) - return new Integer(xrow.getInt(1)); + { + return new Integer(xrow.getInt(1)); + } else if (type.equals(Short.class)) - return new Short(xrow.getShort(1)); + { + return new Short(xrow.getShort(1)); + } else - return null; + { + return null; + } } - public Object getContent(String path) throws Exception { - XContentIdentifier id = - ( - (XContentIdentifierFactory) UnoRuntime.queryInterface( - XContentIdentifierFactory.class, - ucb)).createContentIdentifier( - path); - - return ( - (XContentProvider) UnoRuntime.queryInterface( - XContentProvider.class, - ucb)).queryContent( - id); + public Object getContent(String path) throws Exception + { + XContentIdentifier id = (UnoRuntime.queryInterface(XContentIdentifierFactory.class, ucb)).createContentIdentifier(path); + return (UnoRuntime.queryInterface(XContentProvider.class, ucb)).queryContent(id); } public static interface Verifier { public boolean verify(Object object); } - public void checkWrongFtpConnection() { + @Test public void checkWrongFtpConnection() { //localhost ;Lo-1.Germany.sun.com; 10.16.65.155 try { - XMultiServiceFactory xLocMSF = (XMultiServiceFactory)param.getMSF(); + XMultiServiceFactory xLocMSF = getMSF(); String acountUrl = "ftp://noname:nopasswd@nohost"; - log.println(acountUrl); + System.out.println(acountUrl); init(xLocMSF); Object content = getContent(acountUrl); @@ -211,22 +225,45 @@ public class UCB extends ComplexTestCase { aArg.Mode = OpenMode.ALL; // FOLDER, DOCUMENTS -> simple filter aArg.Priority = 32768; // Ignored by most implementations - log.println("now executing open"); + System.out.println("now executing open"); executeCommand(content, "open", aArg); - failed("Expected 'IllegalArgumentException' was not thrown."); + fail("Expected 'IllegalArgumentException' was not thrown."); } catch (com.sun.star.lang.IllegalArgumentException ex) { //TODO error message; - log.println("Correct exception thrown: " + ex.getClass().toString()); + System.out.println("Correct exception thrown: " + ex.getClass().toString()); } catch(com.sun.star.ucb.InteractiveNetworkResolveNameException ex) { - log.println("This Exception is correctly thrown when no Proxy in StarOffice is used."); - log.println("To reproduce the bug behaviour, use a Proxy and try again."); + System.out.println("This Exception is correctly thrown when no Proxy in StarOffice is used."); + System.out.println("To reproduce the bug behaviour, use a Proxy and try again."); } catch (Exception ex) { - ex.printStackTrace((java.io.PrintWriter)log); + ex.printStackTrace(); String exceptionName = ex.toString(); - log.println("ExName: '"+exceptionName+"'"); - failed("Wrong exception thrown: " + exceptionName); + System.out.println("ExName: '"+exceptionName+"'"); + fail("Wrong exception thrown: " + exceptionName); } // System.exit(0); } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/ucb/qa/complex/ucb/makefile.mk b/ucb/qa/complex/ucb/makefile.mk index 4664bd3cfae7..4ac3928c9e5e 100755 --- a/ucb/qa/complex/ucb/makefile.mk +++ b/ucb/qa/complex/ucb/makefile.mk @@ -25,54 +25,38 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = UCB -PRJNAME = $(TARGET) -PACKAGE = complex$/ucb - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = UCB.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = UCB +TARGET = qa_complex_ucb -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/ucb +JAVATESTFILES = \ + UCB.java -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +JAVAFILES = $(JAVATESTFILES) -# --- Parameters for the test -------------------------------------- +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar jurt.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y +.END -# test base is java complex -CT_TESTBASE = -TestBase java_complex +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +ALLTAR : javatest -# start the runner application -CT_APP = org.openoffice.Runner +.END -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk -RUN: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_TEST) -run: RUN -- cgit From 18f021f924bddb5ad6f32f2d2bcfc42ae2b104df Mon Sep 17 00:00:00 2001 From: ka Date: Wed, 9 Jun 2010 07:07:59 +0200 Subject: avmedia101: added GStreamer backend for Unix --- avmedia/prj/build.lst | 4 +- avmedia/source/gstreamer/exports.dxp | 3 + avmedia/source/gstreamer/gstcommon.hxx | 71 ++ avmedia/source/gstreamer/gstframegrabber.cxx | 310 +++++++++ avmedia/source/gstreamer/gstframegrabber.hxx | 84 +++ avmedia/source/gstreamer/gstmanager.cxx | 88 +++ avmedia/source/gstreamer/gstmanager.hxx | 77 ++ avmedia/source/gstreamer/gstplayer.cxx | 929 +++++++++++++++++++++++++ avmedia/source/gstreamer/gstplayer.hxx | 224 ++++++ avmedia/source/gstreamer/gstuno.cxx | 109 +++ avmedia/source/gstreamer/gstwindow.cxx | 671 ++++++++++++++++++ avmedia/source/gstreamer/gstwindow.hxx | 200 ++++++ avmedia/source/gstreamer/makefile.mk | 75 ++ avmedia/source/inc/mediamisc.hxx | 9 +- avmedia/source/java/Manager.java | 2 +- avmedia/source/java/MediaUno.java | 2 +- avmedia/source/viewer/mediawindow.cxx | 42 +- avmedia/source/viewer/mediawindow_impl.cxx | 45 +- avmedia/source/viewer/mediawindow_impl.hxx | 9 +- avmedia/source/viewer/mediawindowbase_impl.cxx | 5 +- avmedia/source/win/winuno.cxx | 6 +- 21 files changed, 2900 insertions(+), 65 deletions(-) create mode 100644 avmedia/source/gstreamer/exports.dxp create mode 100644 avmedia/source/gstreamer/gstcommon.hxx create mode 100644 avmedia/source/gstreamer/gstframegrabber.cxx create mode 100644 avmedia/source/gstreamer/gstframegrabber.hxx create mode 100644 avmedia/source/gstreamer/gstmanager.cxx create mode 100644 avmedia/source/gstreamer/gstmanager.hxx create mode 100644 avmedia/source/gstreamer/gstplayer.cxx create mode 100644 avmedia/source/gstreamer/gstplayer.hxx create mode 100644 avmedia/source/gstreamer/gstuno.cxx create mode 100644 avmedia/source/gstreamer/gstwindow.cxx create mode 100644 avmedia/source/gstreamer/gstwindow.hxx create mode 100644 avmedia/source/gstreamer/makefile.mk diff --git a/avmedia/prj/build.lst b/avmedia/prj/build.lst index 1ef04ca0f7d5..6651d9d74f8f 100644 --- a/avmedia/prj/build.lst +++ b/avmedia/prj/build.lst @@ -6,6 +6,6 @@ av avmedia\source\viewer nmake - all av_viewer NULL av avmedia\source\framework nmake - all av_framework NULL av avmedia\source\win nmake - all av_win NULL av avmedia\source\java nmake - all av_java NULL -av avmedia\source\xine nmake - all av_xine NULL av avmedia\source\quicktime nmake - all av_quicktime NULL -av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_xine NULL +av avmedia\source\gstreamer nmake - all av_gstreamer NULL +av avmedia\util nmake - all av_util av_viewer av_framework av_win av_java av_quicktime av_gstreamer NULL diff --git a/avmedia/source/gstreamer/exports.dxp b/avmedia/source/gstreamer/exports.dxp new file mode 100644 index 000000000000..9630d7e06768 --- /dev/null +++ b/avmedia/source/gstreamer/exports.dxp @@ -0,0 +1,3 @@ +component_getImplementationEnvironment +component_writeInfo +component_getFactory diff --git a/avmedia/source/gstreamer/gstcommon.hxx b/avmedia/source/gstreamer/gstcommon.hxx new file mode 100644 index 000000000000..be8bf32bb436 --- /dev/null +++ b/avmedia/source/gstreamer/gstcommon.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GSTREAMERcommon.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSTCOMMON_HXX +#define _GSTCOMMON_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_GStreamer" +#define AVMEDIA_GSTREAMER_MANAGER_SERVICENAME "com.sun.star.media.Manager_GStreamer" + +#define AVMEDIA_GSTREAMER_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_GStreamer" +#define AVMEDIA_GSTREAMER_PLAYER_SERVICENAME "com.sun.star.media.Player_GStreamer" + +#define AVMEDIA_GSTREAMER_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_GStreamer" +#define AVMEDIA_GSTREAMER_WINDOW_SERVICENAME "com.sun.star.media.Window_GStreamer" + +#define AVMEDIA_GSTREAMER_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_GStreamer" +#define AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_GStreamer" + +#endif // _GSTCOMMOM_HXX diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx new file mode 100644 index 000000000000..71e720987d52 --- /dev/null +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -0,0 +1,310 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: framegrabber.cxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstframegrabber.hxx" +#include "gstplayer.hxx" + +#include +#include + +using namespace ::com::sun::star; + +namespace avmedia { namespace gst { + +const gulong GRAB_TIMEOUT = 10000000; + +// ---------------- +// - FrameGrabber - +// ---------------- + +FrameGrabber::FrameGrabber( GString* pURI ) : + Player( pURI ), + mpFrameMutex( g_mutex_new() ), + mpFrameCond( g_cond_new() ), + mpLastPixbuf( NULL ), + mbIsInGrabMode( false ) +{ +} + +// ------------------------------------------------------------------------------ + +FrameGrabber::~FrameGrabber() +{ + if( g_atomic_pointer_get( &mpPlayer ) ) + { + implQuitThread(); + } + + // thread has ended, so that no more synchronization is necessary + if( mpLastPixbuf ) + { + g_object_unref( mpLastPixbuf ); + mpLastPixbuf = NULL; + } + + g_cond_free( mpFrameCond ); + g_mutex_free( mpFrameMutex ); +} + +// ------------------------------------------------------------------------------ + +FrameGrabber* FrameGrabber::create( const GString* pURI ) +{ + FrameGrabber* pFrameGrabber = NULL; + + if( pURI && pURI->len ) + { + // safely initialize GLib threading framework + try + { + if( !g_thread_supported() ) + { + g_thread_init( NULL ); + } + } + catch( ... ) + {} + + if( g_thread_supported() ) + { + pFrameGrabber = new FrameGrabber( g_string_new( pURI->str ) ); + + // wait until thread signals that it has finished initialization + if( pFrameGrabber->mpThread ) + { + g_mutex_lock( pFrameGrabber->mpMutex ); + + while( !pFrameGrabber->implIsInitialized() ) + { + g_cond_wait( pFrameGrabber->mpCond, pFrameGrabber->mpMutex ); + } + + g_mutex_unlock( pFrameGrabber->mpMutex ); + } + + GstElement* pPixbufSink = gst_element_factory_make( "gdkpixbufsink", NULL ); + + // check if player pipeline and GdkPixbufSink could be initialized + if( !pFrameGrabber->mpPlayer || !pPixbufSink ) + { + delete pFrameGrabber; + pFrameGrabber = NULL; + } + else + { + g_object_set( pFrameGrabber->mpPlayer, "audio-sink", gst_element_factory_make( "fakesink", NULL ), NULL ); + g_object_set( pFrameGrabber->mpPlayer, "video-sink", pPixbufSink, NULL ); + } + } + } + + return( pFrameGrabber ); +} + +// ------------------------------------------------------------------------------ + +gboolean FrameGrabber::busCallback( GstBus* pBus, GstMessage* pMsg ) +{ + bool bDone = false; + + if( pMsg && pMsg->structure ) + { + GstStructure* pStruct = pMsg->structure; + const gchar* pStructName = gst_structure_get_name( pStruct ); + + if( ( ::std::string( pStructName ).find( "pixbuf" ) != ::std::string::npos ) && + gst_structure_has_field ( pStruct, "pixbuf") ) + { + bool bFrameGrabbed = false; + + g_mutex_lock( mpFrameMutex ); + + if( mbIsInGrabMode && ( getMediaTime() >= mfGrabTime ) ) + { + OSL_TRACE( "Grabbing frame at %fs", getMediaTime() ); + + if( mpLastPixbuf ) + { + g_object_unref( mpLastPixbuf ); + mpLastPixbuf = NULL; + } + + mpLastPixbuf = GDK_PIXBUF( g_value_dup_object( gst_structure_get_value( pStruct, "pixbuf" ) ) ); + bFrameGrabbed = true; + } + + g_mutex_unlock( mpFrameMutex ); + + if( bFrameGrabbed ) + { + g_cond_signal( mpFrameCond ); + } + + bDone = true; + } + } + + return( bDone || Player::busCallback( pBus, pMsg ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime ) + throw (uno::RuntimeException) +{ + uno::Reference< graphic::XGraphic > xRet; + + if( implInitPlayer() ) + { + OSL_TRACE( "Trying to grab frame at %fs", fMediaTime ); + + GTimeVal aTimeoutTime; + + g_get_current_time( &aTimeoutTime ); + g_time_val_add( &aTimeoutTime, GRAB_TIMEOUT ); + setMediaTime( fMediaTime ); + start(); + + if( isPlaying() ) + { + g_mutex_lock( mpFrameMutex ); + + mbIsInGrabMode = true; + mfGrabTime = fMediaTime; + g_cond_timed_wait( mpFrameCond, mpFrameMutex, &aTimeoutTime ); + mbIsInGrabMode = false; + + g_mutex_unlock( mpFrameMutex ); + + stop(); + } + + OSL_ENSURE( g_atomic_pointer_get( &mpLastPixbuf ), "FrameGrabber timed out without receiving a Pixbuf" ); + + if( g_atomic_pointer_get( &mpLastPixbuf ) ) + { + OSL_TRACE( "FrameGrabber received a GdkPixbuf"); + + g_mutex_lock( mpFrameMutex ); + + const int nWidth = gdk_pixbuf_get_width( mpLastPixbuf ); + const int nHeight = gdk_pixbuf_get_height( mpLastPixbuf ); + const int nChannels = gdk_pixbuf_get_n_channels( mpLastPixbuf ); + const guchar* pBuffer = gdk_pixbuf_get_pixels( mpLastPixbuf ); + + if( pBuffer && ( nWidth > 0 ) && ( nHeight > 0 ) ) + { + Bitmap aFrame( Size( nWidth, nHeight), 24 ); + bool bInit = false; + + if( ( gdk_pixbuf_get_colorspace( mpLastPixbuf ) == GDK_COLORSPACE_RGB ) && + ( nChannels >= 3 ) && ( nChannels <= 4 ) && + ( gdk_pixbuf_get_bits_per_sample( mpLastPixbuf ) == 8 ) ) + { + BitmapWriteAccess* pAcc = aFrame.AcquireWriteAccess(); + + if( pAcc ) + { + BitmapColor aPixel( 0, 0, 0 ); + const int nRowStride = gdk_pixbuf_get_rowstride( mpLastPixbuf ); + const bool bAlpha = ( nChannels == 4 ); + + for( int nRow = 0; nRow < nHeight; ++nRow ) + { + guchar* pCur = const_cast< guchar* >( pBuffer + nRow * nRowStride ); + + for( int nCol = 0; nCol < nWidth; ++nCol ) + { + aPixel.SetRed( *pCur++ ); + aPixel.SetGreen( *pCur++ ); + aPixel.SetBlue( *pCur++ ); + + // ignore alpha channel + if( bAlpha ) + { + ++pCur; + } + + pAcc->SetPixel( nRow, nCol, aPixel ); + } + } + + aFrame.ReleaseAccess( pAcc ); + bInit = true; + } + } + + if( !bInit ) + { + aFrame.Erase( Color( COL_BLACK ) ); + } + + xRet = Graphic( aFrame ).GetXGraphic(); + } + + g_object_unref( mpLastPixbuf ); + mpLastPixbuf = NULL; + + g_mutex_unlock( mpFrameMutex ); + } + } + + return xRet; +} + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL FrameGrabber::getImplementationName( ) + throw (uno::RuntimeException) +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_FRAMEGRABBER_IMPLEMENTATIONNAME ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL FrameGrabber::supportsService( const ::rtl::OUString& ServiceName ) + throw (uno::RuntimeException) +{ + return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL FrameGrabber::getSupportedServiceNames( ) + throw (uno::RuntimeException) +{ + uno::Sequence< ::rtl::OUString > aRet(1); + aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( AVMEDIA_GSTREAMER_FRAMEGRABBER_SERVICENAME ) ); + + return aRet; +} + +} // namespace win +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx new file mode 100644 index 000000000000..c9de03bfade9 --- /dev/null +++ b/avmedia/source/gstreamer/gstframegrabber.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: framegrabber.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _FRAMEGRABBER_HXX +#define _FRAMEGRABBER_HXX + +#include "gstplayer.hxx" +#include + +#ifndef _COM_SUN_STAR_MEDIA_XFRAMEGRABBER_HDL_ +#include "com/sun/star/media/XFrameGrabber.hdl" +#endif + +namespace avmedia { namespace gst { + +// ---------------- +// - FrameGrabber - +// ---------------- + +class FrameGrabber : public Player, + public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XFrameGrabber, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + // static create method instead of public Ctor + static FrameGrabber* create( const GString* pUri ); + + ~FrameGrabber(); + + // XFrameGrabber + virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + +protected: FrameGrabber( GString* pURI = NULL ); + + virtual gboolean busCallback( GstBus* pBus, + GstMessage* pMsg ); + +private: FrameGrabber( const FrameGrabber& ); + FrameGrabber& operator=( const FrameGrabber& ); + + GMutex* mpFrameMutex; + GCond* mpFrameCond; + GdkPixbuf* mpLastPixbuf; + double mfGrabTime; + bool mbIsInGrabMode; +}; + +} // namespace gst +} // namespace avmedia + +#endif // _FRAMEGRABBER_HXX diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx new file mode 100644 index 000000000000..f17199d36e27 --- /dev/null +++ b/avmedia/source/gstreamer/gstmanager.cxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: manager.cxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstmanager.hxx" +#include "gstplayer.hxx" + +using namespace ::com::sun::star; + +namespace avmedia +{ +namespace gst +{ +// ---------------- +// - Manager - +// ---------------- + +Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : + mxMgr( rxMgr ) +{} + +// ------------------------------------------------------------------------------ + +Manager::~Manager() +{} + +// ------------------------------------------------------------------------------ + +uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL ) + throw( uno::RuntimeException ) +{ + return( ::avmedia::gst::Player::create( rURL ) ); +} + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL Manager::getImplementationName() + throw( uno::RuntimeException ) +{ + return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ) ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aRet( 1 ); + aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ); + + return( aRet ); +} +} // namespace gst +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstmanager.hxx b/avmedia/source/gstreamer/gstmanager.hxx new file mode 100644 index 000000000000..38717952d071 --- /dev/null +++ b/avmedia/source/gstreamer/gstmanager.hxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: manager.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSTMANAGER_HXX +#define _GSTMANAGER_HXX + +#include "gstcommon.hxx" + +#ifndef _COM_SUN_STAR_MEDIA_XMANAGER_HDL_ +#include "com/sun/star/media/XManager.hdl" +#endif + +// ----------- +// - Manager - +// ----------- + +namespace avmedia +{ +namespace gst +{ +class Manager : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XManager, + ::com::sun::star::lang::XServiceInfo > +{ +public: Manager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr ); + ~Manager(); + + // XManager + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > SAL_CALL createPlayer( + const ::rtl::OUString& aURL ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr; +}; +} // namespace gst +} // namespace avmedia + +#endif // _GSTMANAGER_HXX diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx new file mode 100644 index 000000000000..e1a7ef566ee2 --- /dev/null +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -0,0 +1,929 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: player.cxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstplayer.hxx" +#include "gstwindow.hxx" +#include "gstframegrabber.hxx" +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; + +namespace avmedia +{ +namespace gst +{ +const double NANO_TIME_FACTOR = 1000000000.0; + +const long VIDEO_DEFAULT_WIDTH = 256; +const long VIDEO_DEFAULT_HEIGHT = 192; + +// ---------------- +// - GstBusSource - +// ---------------- + +struct GstBusSource : public GSource +{ + GstBus* mpBus; + + GstBusSource() : + mpBus( NULL ) + {} + + ~GstBusSource() + {} +}; + +// --------------- +// - Player - +// --------------- +Player::Player( GString* pURI ) : + mpMutex( g_mutex_new() ), + mpCond( g_cond_new() ), + mpThread( NULL ), + mpContext( NULL ), + mpLoop( NULL ), + mpPlayer( NULL ), + mpURI( pURI ), + mpPlayerWindow( NULL ), + mnIsVideoSource( 0 ), + mnVideoWidth( 0 ), + mnVideoHeight( 0 ), + mnInitialized( 0 ), + mnVolumeDB( 0 ), + mnLooping( 0 ), + mnQuit( 0 ), + mnVideoWindowSet( 0 ) +{ + // initialize GStreamer framework only once + static bool bGstInitialized = false; + + if( !bGstInitialized ) + { + gst_init( NULL, NULL ); + bGstInitialized = true; + } + + if( pURI ) + { + OSL_TRACE( ">>> --------------------------------" ); + OSL_TRACE( ">>> Creating Player object with URL: %s", pURI->str ); + + mpThread = g_thread_create( Player::implThreadFunc, this, true, NULL ); + } +} + +// ------------------------------------------------------------------------------ + +Player::~Player() +{ + if( g_atomic_pointer_get( &mpPlayer ) ) + { + implQuitThread(); + } + + // cleanup + g_cond_free( mpCond ); + g_mutex_free( mpMutex ); + g_string_free( mpURI, false ); +} + +// ------------------------------------------------------------------------------ +Player* Player::create( const ::rtl::OUString& rURL ) +{ + Player* pPlayer = NULL; + + if( rURL.getLength() ) + { + // safely initialize GLib threading framework + try + { + if( !g_thread_supported() ) + { + g_thread_init( NULL ); + } + } + catch( ... ) + {} + + if( g_thread_supported() ) + { + const INetURLObject aURL( rURL ); + + if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + { + GString* pURI = g_string_new( ::rtl::OUStringToOString( + aURL.GetMainURL( INetURLObject::NO_DECODE ), + RTL_TEXTENCODING_UTF8 ).getStr() ); + + if( pURI->len ) + { + pPlayer = new Player( pURI ); + + // wait until thread signals that it has finished initialization + if( pPlayer->mpThread ) + { + g_mutex_lock( pPlayer->mpMutex ); + + while( !pPlayer->implIsInitialized() ) + { + g_cond_wait( pPlayer->mpCond, pPlayer->mpMutex ); + } + + g_mutex_unlock( pPlayer->mpMutex ); + } + + // check if player pipeline could be initialized + if( !pPlayer->mpPlayer ) + { + delete pPlayer; + pPlayer = NULL; + } + } + else + { + g_string_free( pURI, false ); + } + } + } + } + + return( pPlayer ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::start() + throw( uno::RuntimeException ) +{ + if( implInitPlayer() && !isPlaying() ) + { + gst_element_set_state( mpPlayer, GST_STATE_PLAYING ); + } +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::stop() + throw( uno::RuntimeException ) +{ + if( implInitPlayer() && isPlaying() ) + { + gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); + } +} + +// ------------------------------------------------------------------------------ +sal_Bool SAL_CALL Player::isPlaying() + throw( uno::RuntimeException ) +{ + GstState aState = GST_STATE_NULL; + + if( mpPlayer ) + { + gst_element_get_state( mpPlayer, &aState, NULL, GST_CLOCK_TIME_NONE ); + } + + return( GST_STATE_PLAYING == aState ); +} + +// ------------------------------------------------------------------------------ +double SAL_CALL Player::getDuration() + throw( uno::RuntimeException ) +{ + gint64 nDuration = 0; + + if( implInitPlayer() ) + { + GstFormat aFormat = GST_FORMAT_TIME; + + if( !gst_element_query_duration( mpPlayer, &aFormat, &nDuration ) || + ( GST_FORMAT_TIME != aFormat ) || + ( nDuration < 0 ) ) + { + nDuration = 0; + } + } + + return( static_cast< double >( nDuration ) / NANO_TIME_FACTOR ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setMediaTime( double fTime ) + throw( uno::RuntimeException ) +{ + if( implInitPlayer() ) + { + fTime = ::std::min( ::std::max( fTime, 0.0 ), getDuration() ); + + gst_element_seek_simple( mpPlayer, GST_FORMAT_TIME, + (GstSeekFlags) ( GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT ), + static_cast< gint64 >( fTime * NANO_TIME_FACTOR ) ); + } +} + +// ------------------------------------------------------------------------------ +double SAL_CALL Player::getMediaTime() + throw( uno::RuntimeException ) +{ + double fRet = 0.0; + + if( implInitPlayer() ) + { + GstFormat aFormat = GST_FORMAT_TIME; + gint64 nCurTime = 0; + + if( gst_element_query_position( mpPlayer, &aFormat, &nCurTime ) && + ( GST_FORMAT_TIME == aFormat ) && + ( nCurTime >= 0 ) ) + { + fRet = static_cast< double >( nCurTime ) / NANO_TIME_FACTOR; + } + } + + return( fRet ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setStopTime( double /* fTime */ ) + throw( uno::RuntimeException ) +{ + if( implInitPlayer() ) + { + // TBD!!! + } +} + +// ------------------------------------------------------------------------------ +double SAL_CALL Player::getStopTime() + throw( uno::RuntimeException ) +{ + double fRet = 0.0; + + if( implInitPlayer() ) + { + // TBD!!! + fRet = getDuration(); + } + + return( fRet ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setRate( double /* fRate */ ) + throw( uno::RuntimeException ) +{ + if( implInitPlayer() ) + { + // TBD!!! + } +} + +// ------------------------------------------------------------------------------ +double SAL_CALL Player::getRate() + throw( uno::RuntimeException ) +{ + double fRet = 1.0; + + if( implInitPlayer() ) + { + // TBD!!!; + } + + return( fRet ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) + throw( uno::RuntimeException ) +{ + g_atomic_int_set( &mnLooping, bSet ? 1 : 0 ); +} + +// ------------------------------------------------------------------------------ +sal_Bool SAL_CALL Player::isPlaybackLoop() + throw( uno::RuntimeException ) +{ + return( g_atomic_int_get( &mnLooping ) > 0 ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setMute( sal_Bool bSet ) + throw( uno::RuntimeException ) +{ + if( implInitPlayer() && ( bSet != isMute() ) ) + { + if( bSet ) + { + g_object_set( mpPlayer, "volume", 0.0, NULL ); + } + else + { + setVolumeDB( mnVolumeDB ); + } + } +} + +// ------------------------------------------------------------------------------ +sal_Bool SAL_CALL Player::isMute() + throw( uno::RuntimeException ) +{ + gdouble fGstVolume = 1.0; + + if( implInitPlayer() ) + { + g_object_get( mpPlayer, "volume", &fGstVolume, NULL ); + } + + return( 0.0 == fGstVolume ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) + throw( uno::RuntimeException ) +{ + g_atomic_int_set( &mnVolumeDB, nVolumeDB ); + + if( implInitPlayer() ) + { + // maximum gain for gstreamer volume is 10 + double fGstVolume = pow( 10.0, static_cast< double >( ::std::min( + nVolumeDB, static_cast< sal_Int16 >( 20 ) ) / 20.0 ) ); + + g_object_set( mpPlayer, "volume", fGstVolume, NULL ); + } +} + +// ------------------------------------------------------------------------------ +sal_Int16 SAL_CALL Player::getVolumeDB() + throw( uno::RuntimeException ) +{ + return( static_cast< sal_Int16 >( g_atomic_int_get( &mnVolumeDB ) ) ); +} + +// ------------------------------------------------------------------------------ +awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() + throw( uno::RuntimeException ) +{ + awt::Size aSize( 0, 0 ); + + if( implInitPlayer() && ( g_atomic_int_get( &mnIsVideoSource ) > 0 ) ) + { + aSize.Width = g_atomic_int_get( &mnVideoWidth ); + aSize.Height = g_atomic_int_get( &mnVideoHeight ); + + // if we have a video source, but no size is given => use default size + if( ( aSize.Width <= 0 ) || ( aSize.Height <= 0 ) ) + { + aSize.Width = VIDEO_DEFAULT_WIDTH; + aSize.Height = VIDEO_DEFAULT_HEIGHT; + } + } + + OSL_TRACE( ">>> Requested preferred video size is: %d x %d pixel", aSize.Width, aSize.Height ); + + return( aSize ); +} + +// ------------------------------------------------------------------------------ +uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( + const uno::Sequence< uno::Any >& rArguments ) + throw( uno::RuntimeException ) +{ + uno::Reference< ::media::XPlayerWindow > xRet; + awt::Size aSize( getPreferredPlayerWindowSize() ); + + OSL_ENSURE( !g_atomic_pointer_get( &mpPlayerWindow ), "::avmedia::gst::Player already has a player window" ); + + if( ( aSize.Width > 0 ) && ( aSize.Height > 0 ) ) + { + Window* pPlayerWindow = new Window( *this ); + + xRet = pPlayerWindow; + + if( !pPlayerWindow->create( rArguments ) ) + { + xRet.clear(); + } + else + { + GstElement* pVideoSink = gst_element_factory_make( "xvimagesink", NULL ); + + if( !pVideoSink ) + { + pVideoSink = gst_element_factory_make( "ximagesink", NULL ); + } + + if( pVideoSink ) + { + GstState aOldState = GST_STATE_NULL; + + mpPlayerWindow = pPlayerWindow; + gst_element_get_state( mpPlayer, &aOldState, NULL, GST_CLOCK_TIME_NONE ); + gst_element_set_state( mpPlayer, GST_STATE_READY ); + g_object_set( mpPlayer, "video-sink", pVideoSink, NULL ); + gst_element_set_state( mpPlayer, aOldState ); + } + } + } + + return( xRet ); +} + +// ------------------------------------------------------------------------------ +uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() + throw( ::com::sun::star::uno::RuntimeException ) +{ + FrameGrabber* pFrameGrabber = NULL; + const awt::Size aPrefSize( getPreferredPlayerWindowSize() ); + + if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) ) + { + pFrameGrabber = FrameGrabber::create( mpURI ); + } + + return( pFrameGrabber ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::dispose() + throw( uno::RuntimeException ) +{ + if( mpPlayer ) + { + stop(); + implQuitThread(); + } + + OSL_ASSERT( NULL == mpPlayer ); +} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::addEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ ) + throw( uno::RuntimeException ) +{} + +// ------------------------------------------------------------------------------ +void SAL_CALL Player::removeEventListener( const uno::Reference< lang::XEventListener >& /*rxListener*/ ) + throw( uno::RuntimeException ) +{} + +// ------------------------------------------------------------------------------ +::rtl::OUString SAL_CALL Player::getImplementationName() + throw( uno::RuntimeException ) +{ + return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_IMPLEMENTATIONNAME ) ) ); +} + +// ------------------------------------------------------------------------------ +sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_SERVICENAME ) ) ); +} + +// ------------------------------------------------------------------------------ +uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aRet( 1 ); + aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_PLAYER_SERVICENAME ) ); + + return( aRet ); +} + +// ------------------------------------------------------------------------------ +void Player::implQuitThread() +{ + if( mpThread ) + { + // set quit flag to 1 so that the main loop will be quit in idle + // handler the next time it is called from the thread's main loop + g_atomic_int_add( &mnQuit, 1 ); + + // wait until loop and as such the thread has quit + g_thread_join( mpThread ); + mpThread = NULL; + } +} + +// ------------------------------------------------------------------------------ +bool Player::implInitPlayer() +{ + bool bRet = false; + + if( mpPlayer ) + { + GstState aState = GST_STATE_NULL; + + if( gst_element_get_state( mpPlayer, &aState, NULL, GST_CLOCK_TIME_NONE ) == GST_STATE_CHANGE_SUCCESS ) + { + bRet = ( GST_STATE_PAUSED == aState ) || ( GST_STATE_PLAYING == aState ); + + if( !bRet ) + { + gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); + bRet = ( gst_element_get_state( mpPlayer, &aState, NULL, + GST_CLOCK_TIME_NONE ) == GST_STATE_CHANGE_SUCCESS ) && + ( GST_STATE_PAUSED == aState ); + } + } + } + + return( bRet ); +} + +// ------------------------------------------------------------------------------ +gboolean Player::implBusPrepare( GSource* pSource, + gint* pTimeout ) +{ + if( pTimeout ) + { + *pTimeout = 0; + } + + return( implBusCheck( pSource ) ); +} + +// ------------------------------------------------------------------------------ +gboolean Player::implBusCheck( GSource* pSource ) +{ + GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource ); + + return( pBusSource && + GST_IS_BUS( pBusSource->mpBus ) && + gst_bus_have_pending( GST_BUS_CAST( pBusSource->mpBus ) ) ); +} + +// ------------------------------------------------------------------------------ +gboolean Player::implBusDispatch( GSource* pSource, + GSourceFunc /*aCallback*/, + gpointer pData ) +{ + GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource ); + gboolean bRet = false; + + if( pData && pBusSource && GST_IS_BUS( pBusSource->mpBus ) ) + { + GstMessage* pMsg = gst_bus_pop( pBusSource->mpBus ); + + if( pMsg ) + { + bRet = static_cast< Player* >( pData )->busCallback( pBusSource->mpBus, pMsg ); + gst_message_unref( pMsg ); + } + } + + return( bRet ); +} + +// ------------------------------------------------------------------------------ +void Player::implBusFinalize( GSource* pSource ) +{ + GstBusSource* pBusSource = static_cast< GstBusSource* >( pSource ); + + if( pBusSource && pBusSource->mpBus ) + { + gst_object_unref( pBusSource->mpBus ); + pBusSource->mpBus = NULL; + } +} + +// ------------------------------------------------------------------------------ +gboolean Player::busCallback( GstBus* /*pBus*/, + GstMessage* pMsg ) +{ + if( pMsg && mpLoop ) + { + switch( GST_MESSAGE_TYPE( pMsg ) ) + { + case ( GST_MESSAGE_EOS ): + { + if( g_atomic_int_get( &mnLooping ) > 0 ) + { + setMediaTime( 0.0 ); + start(); + } + else + { + stop(); + } + } + break; + + case ( GST_MESSAGE_ERROR ): + { + gchar* pDebug; + GError* pErr; + + gst_message_parse_error( pMsg, &pErr, &pDebug ); + fprintf( stderr, "Error: %s\n", pErr->message ); + + g_free( pDebug ); + g_error_free( pErr ); + } + break; + + default: + { + break; + } + } + } + + return( true ); +} + +// ------------------------------------------------------------------------------ +gboolean Player::implIdleFunc( gpointer pData ) +{ + return( pData ? static_cast< Player* >( pData )->idle() : true ); +} + +// ------------------------------------------------------------------------------ +gpointer Player::implThreadFunc( gpointer pData ) +{ + return( pData ? static_cast< Player* >( pData )->run() : NULL ); +} + +// ------------------------------------------------------------------------------ +GstBusSyncReply Player::implHandleCreateWindowFunc( GstBus* pBus, + GstMessage* pMsg, + gpointer pData ) +{ + return( pData ? static_cast< Player* >( pData )->handleCreateWindow( pBus, pMsg ) : GST_BUS_PASS ); +} + +// ------------------------------------------------------------------------------ +void Player::implHandleNewElementFunc( GstBin* /* pBin */, + GstElement* pElement, + gpointer pData ) +{ + if( pElement ) + { +#ifdef DEBUG + gchar* pElementName = gst_element_get_name( pElement ); + + if( pElementName ) + { + OSL_TRACE( ">>> Bin has element: %s", pElementName ); + g_free( pElementName ); + } +#endif + + if( GST_IS_BIN( pElement ) ) + { + // set this handler in case we have a GstBin element + g_signal_connect( GST_BIN( pElement ), "element-added", + G_CALLBACK( Player::implHandleNewElementFunc ), pData ); + } + + // watch for all pads that are going to be added to this element; + g_signal_connect( pElement, "pad-added", + G_CALLBACK( Player::implHandleNewPadFunc ), pData ); + } +} + +// ------------------------------------------------------------------------------ +void Player::implHandleNewPadFunc( GstElement* pElement, + GstPad* pPad, + gpointer pData ) +{ + Player* pPlayer = static_cast< Player* >( pData ); + + if( pPlayer && pElement && pPad ) + { +#ifdef DEBUG + gchar* pElementName = gst_element_get_name( pElement ); + gchar* pPadName = gst_pad_get_name( pPad ); + + OSL_TRACE( ">>> Element %s has pad: %s", pElementName, pPadName ); + + g_free( pPadName ); + g_free( pElementName ); +#endif + + GstCaps* pCaps = gst_pad_get_caps( pPad ); + + // we are interested only in getting video properties + // width and height or if we have a video source at all + if( pCaps ) + { + for( gint i = 0, nSize = gst_caps_get_size( pCaps ); i < nSize; ++i ) + { + const GstStructure* pStruct = gst_caps_get_structure( pCaps, i ); + + if( pStruct ) + { + const gchar* pStructName = gst_structure_get_name( pStruct ); + +#ifdef DEBUG + OSL_TRACE( "\t>>> Pad has structure: %s", pStructName ); + + for( gint n = 0, nFields = gst_structure_n_fields( pStruct ); n < nFields; ++n ) + { + OSL_TRACE( "\t\t>>> Structure has field: %s", gst_structure_nth_field_name( pStruct, n ) ); + } +#endif + + // just look for structures having 'video' in their names + if( ::std::string( pStructName ).find( "video" ) != ::std::string::npos ) + { + g_atomic_int_set( &pPlayer->mnIsVideoSource, 1 ); + + for( gint n = 0, nFields = gst_structure_n_fields( pStruct ); n < nFields; ++n ) + { + const gchar* pFieldName = gst_structure_nth_field_name( pStruct, n ); + gint nValue; + + if( ( ::std::string( pFieldName ).find( "width" ) != ::std::string::npos ) && + gst_structure_get_int( pStruct, pFieldName, &nValue ) ) + { + g_atomic_int_set( &pPlayer->mnVideoWidth, + ::std::max( (gint) g_atomic_int_get( + &pPlayer->mnVideoWidth ), nValue ) ); + } + else if( ( ::std::string( pFieldName ).find( "height" ) != ::std::string::npos ) && + gst_structure_get_int( pStruct, pFieldName, &nValue ) ) + { + g_atomic_int_set( &pPlayer->mnVideoHeight, + ::std::max( g_atomic_int_get( &pPlayer->mnVideoHeight ), nValue ) ); + } + } + } + } + } + + gst_caps_unref( pCaps ); + } + } +} + +// ------------------------------------------------------------------------------ +gboolean Player::idle() +{ + // test if main loop should quit and set flag mnQuit to 1 + bool bQuit = g_atomic_int_compare_and_exchange( &mnQuit, 1, 1 ); + + if( bQuit ) + { + // set mnQuit back to 0 to avoid mutiple g_main_loop_quit calls + // in case Player::idle() is called again later; + // the flag should have been set only once within Ctor called from + // the application thread + g_atomic_int_add( &mnQuit, -1 ); + g_main_loop_quit( mpLoop ); + } + + // don't eat up all cpu time + usleep( 1000 ); + + return( true ); +} + +// ------------------------------------------------------------------------------ +gpointer Player::run() +{ + static GSourceFuncs aSourceFuncs = + { + Player::implBusPrepare, + Player::implBusCheck, + Player::implBusDispatch, + Player::implBusFinalize, + NULL, + NULL + }; + + if( NULL != ( mpPlayer = gst_element_factory_make( "playbin", NULL ) ) ) + { + // initialization + // no mutex necessary since initialization + // is synchronous until loop is started + mpContext = g_main_context_new(); + mpLoop = g_main_loop_new( mpContext, false ); + + // add idle callback + GSource* pIdleSource = g_idle_source_new(); + g_source_set_callback( pIdleSource, Player::implIdleFunc, this, NULL ); + g_source_attach( pIdleSource, mpContext ); + + // add bus callback + GSource* pBusSource = g_source_new( &aSourceFuncs, sizeof( GstBusSource ) ); + static_cast< GstBusSource* >( pBusSource )->mpBus = gst_pipeline_get_bus( GST_PIPELINE( mpPlayer ) ); + g_source_set_callback( pBusSource, NULL, this, NULL ); + g_source_attach( pBusSource, mpContext ); + + // add bus sync handler to intercept video window creation for setting our own window + gst_bus_set_sync_handler( static_cast< GstBusSource* >( pBusSource )->mpBus, + Player::implHandleCreateWindowFunc, this ); + + // watch for all elements (and pads) that will be added to the playbin, + // in order to retrieve properties like video width and height + g_signal_connect( GST_BIN( mpPlayer ), "element-added", + G_CALLBACK( Player::implHandleNewElementFunc ), this ); + + // set source URI for player + g_object_set( mpPlayer, "uri", mpURI->str, NULL ); + + // set video fake sink first, since we only create a player without window here + // and don't want to have the gstreamer default window appearing + g_object_set( mpPlayer, "video-sink", gst_element_factory_make( "fakesink", NULL ), NULL ); + + // set state of player to READY or destroy object in case of FAILURE + if( gst_element_set_state( mpPlayer, GST_STATE_READY ) == GST_STATE_CHANGE_FAILURE ) + { + gst_object_unref( mpPlayer ); + mpPlayer = NULL; + } + + g_atomic_int_add( &mnInitialized, 1 ); + g_cond_signal( mpCond ); + + // run the main loop + g_main_loop_run( mpLoop ); + + // clenanup + // no mutex necessary since other thread joined us (this thread) + // after setting the quit flag + if( mpPlayer ) + { + gst_element_set_state( mpPlayer, GST_STATE_NULL ); + gst_object_unref( mpPlayer ); + mpPlayer = NULL; + } + + g_main_loop_unref( mpLoop ); + mpLoop = NULL; + + g_source_destroy( pBusSource ); + g_source_unref( pBusSource ); + + g_source_destroy( pIdleSource ); + g_source_unref( pIdleSource ); + + g_main_context_unref( mpContext ); + mpContext = NULL; + } + else + { + g_atomic_int_add( &mnInitialized, 1 ); + g_cond_signal( mpCond ); + } + + return( NULL ); +} + +// ------------------------------------------------------------------------------ +GstBusSyncReply Player::handleCreateWindow( GstBus* /* pBus */, + GstMessage* pMsg ) +{ + GstBusSyncReply eRet = GST_BUS_PASS; + + if( pMsg && + ( GST_MESSAGE_TYPE( pMsg ) == GST_MESSAGE_ELEMENT ) && + gst_structure_has_name( pMsg->structure, "prepare-xwindow-id" ) && + g_atomic_pointer_get( &mpPlayerWindow ) ) + { + OSL_TRACE( ">>> Got Request to create XOverlay" ); + + gst_x_overlay_set_xwindow_id( GST_X_OVERLAY( GST_MESSAGE_SRC( pMsg ) ), + static_cast< Window* >( g_atomic_pointer_get( + &mpPlayerWindow ) )->getXWindowHandle() ); + + gst_message_unref( pMsg ); + eRet = GST_BUS_DROP; + } + + return( eRet ); +} +} // namespace gst +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx new file mode 100644 index 000000000000..c8cf6d558994 --- /dev/null +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -0,0 +1,224 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: player.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSTPLAYER_HXX +#define _GSTPLAYER_HXX + +#include "gstcommon.hxx" +#include +#include + +#include "com/sun/star/media/XPlayer.hdl" + +namespace avmedia +{ +namespace gst +{ +class Window; + +// --------------- +// - Player_Impl - +// --------------- + +class Player : public ::cppu::WeakImplHelper3< ::com::sun::star::media::XPlayer, + ::com::sun::star::lang::XComponent, + ::com::sun::star::lang::XServiceInfo > +{ +public: + + // static create method instead of public Ctor + static Player* create( const ::rtl::OUString& rURL ); + + ~Player(); + + // XPlayer + virtual void SAL_CALL start() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL stop() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL isPlaying() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual double SAL_CALL getDuration() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setMediaTime( double fTime ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual double SAL_CALL getMediaTime() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setStopTime( double fTime ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual double SAL_CALL getStopTime() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setRate( double fRate ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual double SAL_CALL getRate() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL isPlaybackLoop() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setMute( sal_Bool bSet ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL isMute() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int16 SAL_CALL getVolumeDB() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::awt::Size SAL_CALL getPreferredPlayerWindowSize() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > SAL_CALL createPlayerWindow( + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::media::XFrameGrabber > SAL_CALL createFrameGrabber() + throw( ::com::sun::star::uno::RuntimeException ); + + // XComponent + virtual void SAL_CALL dispose() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + +protected: Player( GString* pURI = NULL ); + + virtual gboolean busCallback( GstBus* pBus, + GstMessage* pMsg ); + + virtual gboolean idle(); + + virtual gpointer run(); + + virtual GstBusSyncReply handleCreateWindow( GstBus* pBus, + GstMessage* pMsg ); + + void implQuitThread(); + + bool implInitPlayer(); + + bool implIsInitialized() const + { + return( g_atomic_int_get( &mnInitialized ) > 0 ); + } + + +private: Player( const Player& ) {} + + Player & operator=( const Player& ) + { + return( *this ); + } + + static gboolean implBusPrepare( GSource* pSource, + gint* pTimeout ); + + static gboolean implBusCheck( GSource* pSource ); + + static gboolean implBusDispatch( GSource* pSource, + GSourceFunc aCallback, + gpointer pData ); + + static void implBusFinalize( GSource* pSource ); + + static gboolean implIdleFunc( gpointer pData ); + + static gpointer implThreadFunc( gpointer pData ); + + static GstBusSyncReply implHandleCreateWindowFunc( GstBus* pBus, + GstMessage* pMsg, + gpointer pDData ); + + static void implHandleNewElementFunc( GstBin* pBin, + GstElement* pElement, + gpointer pData ); + + static void implHandleNewPadFunc( GstElement* pElem, + GstPad* pPad, + gpointer pData ); + +protected: + + GMutex* mpMutex; + GCond* mpCond; + GThread* mpThread; + GMainContext* mpContext; + GMainLoop* mpLoop; + GstElement* mpPlayer; + GString* mpURI; + +private: + + ::avmedia::gst::Window* mpPlayerWindow; + volatile gint mnIsVideoSource; + volatile gint mnVideoWidth; + volatile gint mnVideoHeight; + volatile gint mnInitialized; + volatile gint mnVolumeDB; + volatile gint mnLooping; + volatile gint mnQuit; + volatile gint mnVideoWindowSet; +}; +} // namespace gst +} // namespace avmedia + +#endif // _GSTPLAYER_HXX diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx new file mode 100644 index 000000000000..308b2b14672b --- /dev/null +++ b/avmedia/source/gstreamer/gstuno.cxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xineuno.cxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "gstcommon.hxx" +#include "gstmanager.hxx" + +using namespace ::com::sun::star; + +// ------------------- +// - factory methods - +// ------------------- + +static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) +{ + return uno::Reference< uno::XInterface >( *new ::avmedia::gst::Manager( rxFact ) ); +} + +// ------------------------------------------ +// - component_getImplementationEnvironment - +// ------------------------------------------ + +extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +// ----------------------- +// - component_writeInfo - +// ----------------------- + +extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) +{ + sal_Bool bRet = sal_False; + + if( pRegistryKey ) + { + try + { + uno::Reference< registry::XRegistryKey > xNewKey1( + static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( + ::rtl::OUString::createFromAscii( + "/" AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/" + AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ) ); + + bRet = sal_True; + } + catch( registry::InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + + return bRet; +} + +// ------------------------ +// - component_getFactory - +// ------------------------ + +extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) +{ + uno::Reference< lang::XSingleServiceFactory > xFactory; + void* pRet = 0; + + if( rtl_str_compare( pImplName, AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ) == 0 ) + { + const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ); + + xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), + ::rtl::OUString::createFromAscii( AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME ), + create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) ); + } + + if( xFactory.is() ) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + + return pRet; +} diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx new file mode 100644 index 000000000000..32552eb41b4c --- /dev/null +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -0,0 +1,671 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: window.cxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LG;;PLv3 License. + * + ************************************************************************/ + +#include +#include + +#include + +#include "gstwindow.hxx" +#include "gstplayer.hxx" +#include +#include + +using namespace ::com::sun::star; + +namespace avmedia +{ +namespace gst +{ +// --------------------- +// - PlayerChildWindow - +// --------------------- + +class PlayerChildWindow : public SystemChildWindow +{ +public: + + PlayerChildWindow( Window* pParent ); + ~PlayerChildWindow(); + +protected: + + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void KeyUp( const KeyEvent& rKEvt ); + virtual void Command( const CommandEvent& rCEvt ); +}; + +// --------------------------------------------------------------------- + +PlayerChildWindow::PlayerChildWindow( Window* pParent ) : + SystemChildWindow( pParent, WB_CLIPCHILDREN ) +{ +} + +// --------------------------------------------------------------------- + +PlayerChildWindow::~PlayerChildWindow() +{ +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::MouseMove( const MouseEvent& rMEvt ) +{ + const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), + rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); + + SystemChildWindow::MouseMove( rMEvt ); + GetParent()->MouseMove( aTransformedEvent ); +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::MouseButtonDown( const MouseEvent& rMEvt ) +{ + const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), + rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); + + SystemChildWindow::MouseButtonDown( rMEvt ); + GetParent()->MouseButtonDown( aTransformedEvent ); +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) +{ + const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), + rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); + + SystemChildWindow::MouseButtonUp( rMEvt ); + GetParent()->MouseButtonUp( aTransformedEvent ); +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::KeyInput( const KeyEvent& rKEvt ) +{ + SystemChildWindow::KeyInput( rKEvt ); + GetParent()->KeyInput( rKEvt ); +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::KeyUp( const KeyEvent& rKEvt ) +{ + SystemChildWindow::KeyUp( rKEvt ); + GetParent()->KeyUp( rKEvt ); +} + +// --------------------------------------------------------------------- + +void PlayerChildWindow::Command( const CommandEvent& rCEvt ) +{ + const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ), + rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() ); + + SystemChildWindow::Command( rCEvt ); + GetParent()->Command( aTransformedEvent ); +} + +// --------------- +// - Window - +// --------------- +Window::Window( ::avmedia::gst::Player& rPlayer ) : + maListeners( maMutex ), + maWindowRect( 0, 0, 0, 0 ), + mrPlayer( rPlayer ), + mpPlayerWindow( NULL ), + meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ), + mnPointerType( awt::SystemPointer::ARROW ) +{} + +// ------------------------------------------------------------------------------ + +Window::~Window() +{ + dispose(); +} + +// ------------------------------------------------------------------------------ + +void Window::implLayoutVideoWindow() +{ + if( mpPlayerWindow && ( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel ) ) + { + awt::Size aPrefSize( mrPlayer.getPreferredPlayerWindowSize() ); + awt::Rectangle aRect = getPosSize(); + int nW = aRect.Width, nH = aRect.Height; + int nVideoW = nW, nVideoH = nH; + int nX = 0, nY = 0, nWidth = 0, nHeight = 0; + bool bDone = false, bZoom = false; + + if( media::ZoomLevel_ORIGINAL == meZoomLevel ) + { + bZoom = true; + } + else if( media::ZoomLevel_ZOOM_1_TO_4 == meZoomLevel ) + { + aPrefSize.Width >>= 2; + aPrefSize.Height >>= 2; + bZoom = true; + } + else if( media::ZoomLevel_ZOOM_1_TO_2 == meZoomLevel ) + { + aPrefSize.Width >>= 1; + aPrefSize.Height >>= 1; + bZoom = true; + } + else if( media::ZoomLevel_ZOOM_2_TO_1 == meZoomLevel ) + { + aPrefSize.Width <<= 1; + aPrefSize.Height <<= 1; + bZoom = true; + } + else if( media::ZoomLevel_ZOOM_4_TO_1 == meZoomLevel ) + { + aPrefSize.Width <<= 2; + aPrefSize.Height <<= 2; + bZoom = true; + } + else if( media::ZoomLevel_FIT_TO_WINDOW == meZoomLevel ) + { + nWidth = nVideoW; + nHeight = nVideoH; + bDone = true; + } + + if( bZoom ) + { + if( ( aPrefSize.Width <= nVideoW ) && ( aPrefSize.Height <= nVideoH ) ) + { + nX = ( nVideoW - aPrefSize.Width ) >> 1; + nY = ( nVideoH - aPrefSize.Height ) >> 1; + nWidth = aPrefSize.Width; + nHeight = aPrefSize.Height; + bDone = true; + } + } + + if( !bDone ) + { + if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) && ( nVideoW > 0 ) && ( nVideoH > 0 ) ) + { + double fPrefWH = (double) aPrefSize.Width / aPrefSize.Height; + + if( fPrefWH < ( (double) nVideoW / nVideoH ) ) + { + nVideoW = (int) ( nVideoH * fPrefWH ); + } + else + { + nVideoH = (int) ( nVideoW / fPrefWH ); + } + + nX = ( nW - nVideoW ) >> 1; + nY = ( nH - nVideoH ) >> 1; + nWidth = nVideoW; + nHeight = nVideoH; + } + else + { + nX = nY = nWidth = nHeight = 0; + } + } + + mpPlayerWindow->SetPosSizePixel( Point( nX, nY ), Size( nWidth, nHeight ) ); + } +} + +// ------------------------------------------------------------------------------ + +bool Window::create( const uno::Sequence< uno::Any >& rArguments ) +{ + OSL_ASSERT( !mpPlayerWindow ); + OSL_ENSURE( rArguments.getLength() > 2, +"::avmedia::gst::Windiow::create: GStreamer backend needs \ +valid parent SystemChildWindow pointer (sal_IntPtr) as third Any \ +value in sequence of arguments" ); + + bool bRet = false; + + if( !mpPlayerWindow && ( rArguments.getLength() > 2 ) ) + { + SystemChildWindow* pParentWindow = NULL; + sal_IntPtr pIntPtr = NULL; + + // we are not interested in the first argument, which is a pure X11 window handle; + // this backend relies on a SystemChildWindow as parent for the PlayerWindow, given + // as third Sal_IntPtr value within the argument Sequence + rArguments[ 1 ] >>= maWindowRect; + + rArguments[ 2 ] >>= pIntPtr; + pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr ); + + if( pParentWindow ) + { + meZoomLevel = media::ZoomLevel_ORIGINAL; + + mpPlayerWindow = new PlayerChildWindow( pParentWindow ); + mpPlayerWindow->SetBackground( Color( COL_BLACK ) ); + mpPlayerWindow->SetPosSizePixel( Point( maWindowRect.X, maWindowRect.Y ), + Size( maWindowRect.Width, maWindowRect.Height ) ); + mpPlayerWindow->Show(); + + bRet = true; + } + } + + return( bRet ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::update() + throw( uno::RuntimeException ) +{ + if( mpPlayerWindow ) + { + mpPlayerWindow->Invalidate( INVALIDATE_UPDATE ); + mpPlayerWindow->Sync(); + } +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel eZoomLevel ) + throw(uno::RuntimeException) +{ + bool bRet = false; + + if( ( media::ZoomLevel_NOT_AVAILABLE != meZoomLevel ) && + ( media::ZoomLevel_NOT_AVAILABLE != eZoomLevel ) ) + { + if( eZoomLevel != meZoomLevel ) + { + meZoomLevel = eZoomLevel; + implLayoutVideoWindow(); + } + + bRet = true; + } + + return( bRet ); +} + +// ------------------------------------------------------------------------------ + +media::ZoomLevel SAL_CALL Window::getZoomLevel() + throw( uno::RuntimeException ) +{ + return( meZoomLevel ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setPointerType( sal_Int32 nPointerType ) + throw( uno::RuntimeException ) +{ + if( mpPlayerWindow ) + { + Pointer ePointer = POINTER_ARROW; + + switch( nPointerType ) + { + case (awt::SystemPointer::CROSS) : + { + ePointer = POINTER_CROSS; + } + break; + + case (awt::SystemPointer::HAND) : + { + ePointer = POINTER_HAND; + } + break; + + case (awt::SystemPointer::MOVE) : + { + ePointer = POINTER_MOVE; + } + break; + + case (awt::SystemPointer::WAIT) : + { + ePointer = POINTER_WAIT; + } + break; + + default: + break; + } + + mpPlayerWindow->SetPointer( ePointer ); + } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setPosSize( sal_Int32 nX, + sal_Int32 nY, + sal_Int32 nWidth, + sal_Int32 nHeight, + sal_Int16 /* Flags */ ) + throw( uno::RuntimeException ) +{ + maWindowRect.X = nX; + maWindowRect.Y = nY; + maWindowRect.Width = nWidth; + maWindowRect.Height = nHeight; + + implLayoutVideoWindow(); +} + +// ------------------------------------------------------------------------------ + +awt::Rectangle SAL_CALL Window::getPosSize() + throw( uno::RuntimeException ) +{ + return( maWindowRect ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setVisible( sal_Bool bVisible ) + throw( uno::RuntimeException ) +{ + if( mpPlayerWindow ) + { + bVisible ? mpPlayerWindow->Show() : mpPlayerWindow->Hide(); + } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setEnable( sal_Bool bEnable ) + throw( uno::RuntimeException ) +{ + if( mpPlayerWindow ) + { + mpPlayerWindow->Enable( bEnable ); + } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::setFocus() + throw( uno::RuntimeException ) +{ + if( mpPlayerWindow ) + { + mpPlayerWindow->GrabFocus(); + } +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::dispose() + throw( uno::RuntimeException ) +{ + delete mpPlayerWindow; + mpPlayerWindow = NULL; +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListeners.addInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >& + xListener ) + throw( uno::RuntimeException ) +{ + maListeners.removeInterface( getCppuType( &xListener ), xListener ); +} + +// ------------------------------------------------------------------------------ + +void Window::fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ) +{ + ::cppu::OInterfaceContainerHelper* pContainer = + maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseListener >* ) 0 ) ); + + if( pContainer ) + { + ::cppu::OInterfaceIteratorHelper aIter( *pContainer ); + + while( aIter.hasMoreElements() ) + { + uno::Reference< awt::XMouseListener >( aIter.next(), + uno::UNO_QUERY )->mousePressed( rEvt ); + } + } +} + +// ----------------------------------------------------------------------------- + +void Window::fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ) +{ + ::cppu::OInterfaceContainerHelper* pContainer = + maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseListener >* ) 0 ) ); + + if( pContainer ) + { + ::cppu::OInterfaceIteratorHelper aIter( *pContainer ); + + while( aIter.hasMoreElements() ) + { + uno::Reference< awt::XMouseListener >( aIter.next(), + uno::UNO_QUERY )->mouseReleased( rEvt ); + } + } +} + +// ----------------------------------------------------------------------------- + +void Window::fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ) +{ + ::cppu::OInterfaceContainerHelper* pContainer = + maListeners.getContainer( getCppuType( ( uno::Reference< awt::XMouseMotionListener >* ) + 0 ) ); + + if( pContainer ) + { + ::cppu::OInterfaceIteratorHelper aIter( *pContainer ); + + while( aIter.hasMoreElements() ) + { + uno::Reference< awt::XMouseMotionListener >( aIter.next(), + uno::UNO_QUERY )->mouseMoved( rEvt ); + } + } +} + +// ----------------------------------------------------------------------------- + +void Window::fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt ) +{ + ::cppu::OInterfaceContainerHelper* pContainer = + maListeners.getContainer( getCppuType( ( uno::Reference< awt::XFocusListener >* ) 0 ) ); + + if( pContainer ) + { + ::cppu::OInterfaceIteratorHelper aIter( *pContainer ); + + while( aIter.hasMoreElements() ) + { + uno::Reference< awt::XFocusListener >( aIter.next(), + uno::UNO_QUERY )->focusGained( rEvt ); + } + } +} + +// ------------------------------------------------------------------------------ + +long Window::getXWindowHandle() const +{ + return( mpPlayerWindow ? mpPlayerWindow->GetSystemData()->aWindow : 0 ); +} + + +// ------------------------------------------------------------------------------ + +::rtl::OUString SAL_CALL Window::getImplementationName() + throw( uno::RuntimeException ) +{ + return( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + AVMEDIA_GSTREAMER_WINDOW_IMPLEMENTATIONNAME ) ) ); +} + +// ------------------------------------------------------------------------------ + +sal_Bool SAL_CALL Window::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return( ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( + AVMEDIA_GSTREAMER_WINDOW_SERVICENAME ) ) ); +} + +// ------------------------------------------------------------------------------ + +uno::Sequence< ::rtl::OUString > SAL_CALL Window::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aRet( 1 ); + aRet[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( AVMEDIA_GSTREAMER_WINDOW_SERVICENAME ) ); + + return( aRet ); +} +} // namespace gst +} // namespace avmedia diff --git a/avmedia/source/gstreamer/gstwindow.hxx b/avmedia/source/gstreamer/gstwindow.hxx new file mode 100644 index 000000000000..b8b51a8c7c9a --- /dev/null +++ b/avmedia/source/gstreamer/gstwindow.hxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: window.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSTWINDOW_HXX +#define _GSTWINDOW_HXX + +#include "gstcommon.hxx" +#include + +#ifndef _COM_SUN_STAR_MEDIA_XPLAYERWINDOW_HDL_ +#include "com/sun/star/media/XPlayerWindow.hdl" +#endif + +namespace avmedia +{ +namespace gst +{ + +class PlayerChildWindow; + +// --------------- +// - Window - +// --------------- + +class Player; + +class Window : public ::cppu::WeakImplHelper2< ::com::sun::star::media::XPlayerWindow, + ::com::sun::star::lang::XServiceInfo > +{ + friend class Player; + +public: Window( ::avmedia::gst::Player& rPlayer ); + ~Window(); + + bool create( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ); + + // XPlayerWindow + virtual void SAL_CALL update() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL setZoomLevel( ::com::sun::star::media::ZoomLevel ZoomLevel ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::media::ZoomLevel SAL_CALL getZoomLevel() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XWindow + virtual void SAL_CALL setPosSize( sal_Int32 X, + sal_Int32 Y, + sal_Int32 Width, + sal_Int32 Height, + sal_Int16 Flags ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::awt::Rectangle SAL_CALL getPosSize() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setVisible( sal_Bool Visible ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setEnable( sal_Bool Enable ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL setFocus() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addWindowListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeWindowListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addFocusListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeFocusListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addKeyListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeKeyListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addMouseListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeMouseListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addMouseMotionListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeMouseMotionListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addPaintListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removePaintListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XComponent + virtual void SAL_CALL dispose() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + +public: + + void fireMousePressedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ); + + void fireMouseReleasedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ); + + void fireMouseMovedEvent( const ::com::sun::star::awt::MouseEvent& rEvt ); + + void fireKeyPressedEvent( const ::com::sun::star::awt::KeyEvent& rEvt ); + + void fireKeyReleasedEvent( const ::com::sun::star::awt::KeyEvent& rEvt ); + + void fireSetFocusEvent( const ::com::sun::star::awt::FocusEvent& rEvt ); + +protected: + + long getXWindowHandle() const; + +private: + + ::osl::Mutex maMutex; + ::cppu::OMultiTypeInterfaceContainerHelper maListeners; + ::com::sun::star::awt::Rectangle maWindowRect; + Player& mrPlayer; + PlayerChildWindow* mpPlayerWindow; + ::com::sun::star::media::ZoomLevel meZoomLevel; + sal_Int32 mnPointerType; + + void implLayoutVideoWindow(); +}; +} // namespace gst +} // namespace avmedia + +#endif // _GSTWINDOW_HXX diff --git a/avmedia/source/gstreamer/makefile.mk b/avmedia/source/gstreamer/makefile.mk new file mode 100644 index 000000000000..1c2aa65811cf --- /dev/null +++ b/avmedia/source/gstreamer/makefile.mk @@ -0,0 +1,75 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.5 $ +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/.. +PRJNAME=avmediagst +TARGET=avmediagst + +# --- Settings ---------------------------------- + +.INCLUDE : settings.mk + +.IF "$(verbose)"!="" || "$(VERBOSE)"!="" +CDEFS+= -DVERBOSE +.ENDIF + +# --- Files ---------------------------------- + +.IF "$(GUI)" == "UNX" && "$(GUIBASE)"!="aqua" && "$(ENABLE_GSTREAMER)" != "" + +PKGCONFIG_MODULES=gtk+-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 +.INCLUDE : pkg_config.mk + +SLOFILES= \ + $(SLO)$/gstuno.obj \ + $(SLO)$/gstmanager.obj \ + $(SLO)$/gstwindow.obj \ + $(SLO)$/gstplayer.obj \ + $(SLO)$/gstframegrabber.obj + +EXCEPTIONSFILES= \ + $(SLO)$/gstuno.obj \ + $(SLO)$/gstplayer.obj \ + $(SLO)$/gstframegrabber.obj + +SHL1TARGET=$(TARGET) +SHL1STDLIBS= $(CPPULIB) $(SALLIB) $(COMPHELPERLIB) $(CPPUHELPERLIB) $(TOOLSLIB) $(VCLLIB) +SHL1STDLIBS+=$(PKGCONFIG_LIBS) +SHL1IMPLIB=i$(TARGET) +SHL1LIBS=$(SLB)$/$(TARGET).lib +SHL1DEF=$(MISC)$/$(SHL1TARGET).def + +DEF1NAME=$(SHL1TARGET) +DEF1EXPORTFILE=exports.dxp + +.ENDIF + +.INCLUDE : target.mk diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx index fd89e9d4abde..4d09192b3031 100644 --- a/avmedia/source/inc/mediamisc.hxx +++ b/avmedia/source/inc/mediamisc.hxx @@ -30,12 +30,15 @@ class ResMgr; #define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() ) #ifdef WNT -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_DirectX" +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False #else #ifdef QUARTZ -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime" +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False #else -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.media.Manager_Java" +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False #endif #endif diff --git a/avmedia/source/java/Manager.java b/avmedia/source/java/Manager.java index 47707478fd5b..2e8cf04fce4a 100644 --- a/avmedia/source/java/Manager.java +++ b/avmedia/source/java/Manager.java @@ -89,7 +89,7 @@ public class Manager implements com.sun.star.lang.XServiceInfo, // - XServiceInfo - // ---------------- - private static final String s_implName = "com.sun.star.comp.media.Manager_Java"; + private static final String s_implName = "com.sun.star.comp.avmedia.Manager_Java"; private static final String s_serviceName = "com.sun.star.media.Manager_Java"; public synchronized String getImplementationName() diff --git a/avmedia/source/java/MediaUno.java b/avmedia/source/java/MediaUno.java index ca7a164586d8..f4121950165f 100644 --- a/avmedia/source/java/MediaUno.java +++ b/avmedia/source/java/MediaUno.java @@ -34,7 +34,7 @@ import com.sun.star.lang.XInitialization; public class MediaUno { - private static final String s_implName = "com.sun.star.comp.media.Manager_Java"; + private static final String s_implName = "com.sun.star.comp.avmedia.Manager_Java"; private static final String s_serviceName = "com.sun.star.media.Manager_Java"; // ------------------------------------------------------------------------- diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index b2d1e5162cb5..fb781d70cfb6 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -162,7 +162,9 @@ Size MediaWindow::getPreferredSize() const void MediaWindow::setPosSize( const Rectangle& rNewRect ) { if( mpImpl ) + { mpImpl->setPosSize( rNewRect ); + } } // ------------------------------------------------------------------------- @@ -368,6 +370,7 @@ void MediaWindow::getMediaFilters( FilterNameVector& rFilterNameVector ) "AU Audio", "au", "AVI", "avi", "CD Audio", "cda", + "Matroska Media", "mkv", "MIDI Audio", "mid;midi", "MPEG Audio", "mp2;mp3;mpa", "MPEG Video", "mpg;mpeg;mpv;mp4", @@ -464,39 +467,26 @@ bool MediaWindow::isMediaURL( const ::rtl::OUString& rURL, bool bDeep, Size* pPr { if( bDeep || pPreferredSizePixel ) { - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - if( xFactory.is() ) + try { - try - { - fprintf(stderr, "-->%s uno reference \n\n",AVMEDIA_MANAGER_SERVICE_NAME); + uno::Reference< media::XPlayer > xPlayer( priv::MediaWindowImpl::createPlayer( + aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) ); - uno::Reference< ::com::sun::star::media::XManager > xManager( - xFactory->createInstance( ::rtl::OUString::createFromAscii( AVMEDIA_MANAGER_SERVICE_NAME ) ), - uno::UNO_QUERY ); + if( xPlayer.is() ) + { + bRet = true; - if( xManager.is() ) + if( pPreferredSizePixel ) { - uno::Reference< media::XPlayer > xPlayer( xManager->createPlayer( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) ); - - if( xPlayer.is() ) - { - bRet = true; + const awt::Size aAwtSize( xPlayer->getPreferredPlayerWindowSize() ); - if( pPreferredSizePixel ) - { - const awt::Size aAwtSize( xPlayer->getPreferredPlayerWindowSize() ); - - pPreferredSizePixel->Width() = aAwtSize.Width; - pPreferredSizePixel->Height() = aAwtSize.Height; - } - } + pPreferredSizePixel->Width() = aAwtSize.Width; + pPreferredSizePixel->Height() = aAwtSize.Height; } } - catch( ... ) - { - } + } + catch( ... ) + { } } else diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 553eea6196c1..83bc9b458a8b 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -1,4 +1,4 @@ -/************************************************************************* +/************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -94,7 +94,7 @@ void MediaWindowControl::execute( const MediaItem& rItem ) // -------------------- MediaChildWindow::MediaChildWindow( Window* pParent ) : - JavaChildWindow( pParent, WB_CLIPCHILDREN ) + SystemChildWindow( pParent, WB_CLIPCHILDREN ) { } @@ -111,7 +111,7 @@ void MediaChildWindow::MouseMove( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); - JavaChildWindow::MouseMove( rMEvt ); + SystemChildWindow::MouseMove( rMEvt ); GetParent()->MouseMove( aTransformedEvent ); } @@ -122,7 +122,7 @@ void MediaChildWindow::MouseButtonDown( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); - JavaChildWindow::MouseButtonDown( rMEvt ); + SystemChildWindow::MouseButtonDown( rMEvt ); GetParent()->MouseButtonDown( aTransformedEvent ); } @@ -133,7 +133,7 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) const MouseEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rMEvt.GetPosPixel() ) ), rMEvt.GetClicks(), rMEvt.GetMode(), rMEvt.GetButtons(), rMEvt.GetModifier() ); - JavaChildWindow::MouseButtonUp( rMEvt ); + SystemChildWindow::MouseButtonUp( rMEvt ); GetParent()->MouseButtonUp( aTransformedEvent ); } @@ -141,7 +141,7 @@ void MediaChildWindow::MouseButtonUp( const MouseEvent& rMEvt ) void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) { - JavaChildWindow::KeyInput( rKEvt ); + SystemChildWindow::KeyInput( rKEvt ); GetParent()->KeyInput( rKEvt ); } @@ -149,7 +149,7 @@ void MediaChildWindow::KeyInput( const KeyEvent& rKEvt ) void MediaChildWindow::KeyUp( const KeyEvent& rKEvt ) { - JavaChildWindow::KeyUp( rKEvt ); + SystemChildWindow::KeyUp( rKEvt ); GetParent()->KeyUp( rKEvt ); } @@ -160,7 +160,7 @@ void MediaChildWindow::Command( const CommandEvent& rCEvt ) const CommandEvent aTransformedEvent( GetParent()->ScreenToOutputPixel( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ), rCEvt.GetCommand(), rCEvt.IsMouseEvent(), rCEvt.GetData() ); - JavaChildWindow::Command( rCEvt ); + SystemChildWindow::Command( rCEvt ); GetParent()->Command( aTransformedEvent ); } @@ -179,6 +179,7 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo mpEmptyBmpEx( NULL ), mpAudioBmpEx( NULL ) { + maChildWindow.SetBackground( Color( COL_BLACK ) ); maChildWindow.SetHelpId( HID_AVMEDIA_PLAYERWINDOW ); maChildWindow.Hide(); @@ -229,19 +230,24 @@ void MediaWindowImpl::onURLChanged() { if( getPlayer().is() ) { - uno::Sequence< uno::Any > aArgs( 2 ); uno::Reference< media::XPlayerWindow > xPlayerWindow; const Point aPoint; const Size aSize( maChildWindow.GetSizePixel() ); - const sal_IntPtr nWndHandle = static_cast< sal_IntPtr >( maChildWindow.getParentWindowHandleForJava() ); - - aArgs[ 0 ] = uno::makeAny( nWndHandle ); - aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) ); + const sal_IntPtr nWndHandle = (sal_IntPtr) maChildWindow. + GetParentWindowHandle( AVMEDIA_MANAGER_SERVICE_IS_JAVABASED ); try { if( nWndHandle != 0 ) + { + uno::Sequence< uno::Any > aArgs( 3 ); + + aArgs[ 0 ] = uno::makeAny( nWndHandle ); + aArgs[ 1 ] = uno::makeAny( awt::Rectangle( aPoint.X(), aPoint.Y(), aSize.Width(), aSize.Height() ) ); + aArgs[ 2 ] = uno::makeAny( reinterpret_cast< sal_IntPtr >( &maChildWindow ) ); + xPlayerWindow = getPlayer()->createPlayerWindow( aArgs ); + } } catch( uno::RuntimeException ) { @@ -273,8 +279,6 @@ void MediaWindowImpl::onURLChanged() updateMediaItem( aItem ); mpMediaWindowControl->setState( aItem ); } - - Invalidate(); } // --------------------------------------------------------------------- @@ -291,7 +295,7 @@ void MediaWindowImpl::update() void MediaWindowImpl::setPosSize( const Rectangle& rRect ) { - SetPosSizePixel( rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight() ); + SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() ); } // --------------------------------------------------------------------- @@ -305,7 +309,6 @@ void MediaWindowImpl::setPointer( const Pointer& rPointer ) if( xPlayerWindow.is() ) { - long nPointer; switch( rPointer.GetStyle() ) @@ -355,10 +358,10 @@ void MediaWindowImpl::Resize() mpMediaWindowControl->SetPosSizePixel( Point( nOffset, nControlY ), Size( aCurSize.Width() - ( nOffset << 1 ), nControlHeight ) ); } - maChildWindow.SetPosSizePixel( Point( nOffset, nOffset ), aPlayerWindowSize ); - if( xPlayerWindow.is() ) xPlayerWindow->setPosSize( 0, 0, aPlayerWindowSize.Width(), aPlayerWindowSize.Height(), 0 ); + + maChildWindow.SetPosSizePixel( Point( nOffset, nOffset ), aPlayerWindowSize ); } // --------------------------------------------------------------------- @@ -405,7 +408,7 @@ void MediaWindowImpl::Paint( const Rectangle& ) pLogo = mpEmptyBmpEx; } - else if ( !getPlayerWindow().is() ) + else if( !getPlayerWindow().is() ) { if( !mpAudioBmpEx ) mpAudioBmpEx = new BitmapEx( AVMEDIA_RESID( AVMEDIA_BMP_AUDIOLOGO ) ); @@ -446,8 +449,6 @@ void MediaWindowImpl::Paint( const Rectangle& ) aBasePos.Y() + ( ( aVideoRect.GetHeight() - aLogoSize.Height() ) >> 1 ) ), aLogoSize, *pLogo ); } - - update(); } // --------------------------------------------------------------------- diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index 679b864af6b7..9008e499647d 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -2,10 +2,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: mediawindow_impl.hxx,v $ + * $Revision: 1.3 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -29,7 +32,7 @@ #define _AVMEDIA_MEDIAWINDOW_IMPL_HXX #include -#include +#include #include "mediawindowbase_impl.hxx" #include "mediacontrol.hxx" @@ -61,7 +64,7 @@ namespace avmedia // - MediaChildWindow - // -------------------- - class MediaChildWindow : public JavaChildWindow + class MediaChildWindow : public SystemChildWindow { public: diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx index ea28121e3609..5412e7a5b804 100644 --- a/avmedia/source/viewer/mediawindowbase_impl.cxx +++ b/avmedia/source/viewer/mediawindowbase_impl.cxx @@ -143,10 +143,7 @@ void MediaWindowBaseImpl::stopPlayingInternal( bool bStop ) { if( isPlaying() ) { - if( bStop ) - mxPlayer->stop(); - else - mxPlayer->start(); + bStop ? mxPlayer->stop() : mxPlayer->start(); } } diff --git a/avmedia/source/win/winuno.cxx b/avmedia/source/win/winuno.cxx index 4b06fd10727f..645871290413 100644 --- a/avmedia/source/win/winuno.cxx +++ b/avmedia/source/win/winuno.cxx @@ -62,7 +62,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) { uno::Reference< registry::XRegistryKey > xNewKey1( static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - ::rtl::OUString::createFromAscii( "/com.sun.star.comp.media.Manager_DirectX/UNO/SERVICES/com.sun.star.media.Manager_DirectX" ) ) ); + ::rtl::OUString::createFromAscii( "/com.sun.star.comp.avmedia.Manager_DirectX/UNO/SERVICES/com.sun.star.media.Manager_DirectX" ) ) ); bRet = sal_True; } @@ -84,13 +84,13 @@ extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* uno::Reference< lang::XSingleServiceFactory > xFactory; void* pRet = 0; - if( rtl_str_compare( pImplName, "com.sun.star.comp.media.Manager_DirectX" ) == 0 ) + if( rtl_str_compare( pImplName, "com.sun.star.comp.avmedia.Manager_DirectX" ) == 0 ) { const ::rtl::OUString aServiceName( ::rtl::OUString::createFromAscii( "com.sun.star.media.Manager_DirectX" ) ); xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), - ::rtl::OUString::createFromAscii( "com.sun.star.comp.media.Manager_DirectX" ), + ::rtl::OUString::createFromAscii( "com.sun.star.comp.avmedia.Manager_DirectX" ), create_MediaPlayer, uno::Sequence< ::rtl::OUString >( &aServiceName, 1 ) ) ); } -- cgit From 4a9586e991cdec7564585070b90e1c6acbcecab1 Mon Sep 17 00:00:00 2001 From: ka Date: Wed, 9 Jun 2010 21:15:24 +0200 Subject: avmedia101: adjustments for new GStreamer build baseline --- avmedia/source/gstreamer/gstplayer.cxx | 26 +++++++++++--------- avmedia/source/gstreamer/gstplayer.hxx | 44 ++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 26 deletions(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index e1a7ef566ee2..e9fe02594b66 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -326,7 +326,10 @@ double SAL_CALL Player::getRate() void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw( uno::RuntimeException ) { - g_atomic_int_set( &mnLooping, bSet ? 1 : 0 ); + if( bSet && !isPlaybackLoop() ) + g_atomic_int_inc( &mnLooping ); + else if( !bSet && isPlaybackLoop() ) + g_atomic_int_dec_and_test( &mnLooping ); } // ------------------------------------------------------------------------------ @@ -371,10 +374,12 @@ sal_Bool SAL_CALL Player::isMute() void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) throw( uno::RuntimeException ) { - g_atomic_int_set( &mnVolumeDB, nVolumeDB ); - if( implInitPlayer() ) { + g_mutex_lock( mpMutex ); + mnVolumeDB = nVolumeDB; + g_mutex_unlock( mpMutex ); + // maximum gain for gstreamer volume is 10 double fGstVolume = pow( 10.0, static_cast< double >( ::std::min( nVolumeDB, static_cast< sal_Int16 >( 20 ) ) / 20.0 ) ); @@ -528,7 +533,7 @@ void Player::implQuitThread() { // set quit flag to 1 so that the main loop will be quit in idle // handler the next time it is called from the thread's main loop - g_atomic_int_add( &mnQuit, 1 ); + g_atomic_int_inc( &mnQuit ); // wait until loop and as such the thread has quit g_thread_join( mpThread ); @@ -758,7 +763,7 @@ void Player::implHandleNewPadFunc( GstElement* pElement, // just look for structures having 'video' in their names if( ::std::string( pStructName ).find( "video" ) != ::std::string::npos ) { - g_atomic_int_set( &pPlayer->mnIsVideoSource, 1 ); + g_atomic_int_inc( &pPlayer->mnIsVideoSource ); for( gint n = 0, nFields = gst_structure_n_fields( pStruct ); n < nFields; ++n ) { @@ -768,15 +773,14 @@ void Player::implHandleNewPadFunc( GstElement* pElement, if( ( ::std::string( pFieldName ).find( "width" ) != ::std::string::npos ) && gst_structure_get_int( pStruct, pFieldName, &nValue ) ) { - g_atomic_int_set( &pPlayer->mnVideoWidth, - ::std::max( (gint) g_atomic_int_get( - &pPlayer->mnVideoWidth ), nValue ) ); + const gint nDiff = nValue - g_atomic_int_get( &pPlayer->mnVideoWidth ); + g_atomic_int_add( &pPlayer->mnVideoWidth, ::std::max( nDiff, 0 ) ); } else if( ( ::std::string( pFieldName ).find( "height" ) != ::std::string::npos ) && gst_structure_get_int( pStruct, pFieldName, &nValue ) ) { - g_atomic_int_set( &pPlayer->mnVideoHeight, - ::std::max( g_atomic_int_get( &pPlayer->mnVideoHeight ), nValue ) ); + const gint nDiff = nValue - g_atomic_int_get( &pPlayer->mnVideoHeight ); + g_atomic_int_add( &pPlayer->mnVideoHeight, ::std::max( nDiff, 0 ) ); } } } @@ -800,7 +804,7 @@ gboolean Player::idle() // in case Player::idle() is called again later; // the flag should have been set only once within Ctor called from // the application thread - g_atomic_int_add( &mnQuit, -1 ); + g_atomic_int_dec_and_test( &mnQuit ); g_main_loop_quit( mpLoop ); } diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index c8cf6d558994..b4e437c89a8c 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -33,8 +33,21 @@ #include "gstcommon.hxx" #include -#include +#include + +// necessary for older GLib versions +#ifndef G_GNUC_NULL_TERMINATED +#if __GNUC__ >= 4 +#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) +#else +#define G_GNUC_NULL_TERMINATED +#endif +#endif + +// necessary for older GLib versions +struct GOptionGroup; +#include #include "com/sun/star/media/XPlayer.hdl" namespace avmedia @@ -140,7 +153,9 @@ public: throw( ::com::sun::star::uno::RuntimeException ); -protected: Player( GString* pURI = NULL ); +protected: + + Player( GString* pURI = NULL ); virtual gboolean busCallback( GstBus* pBus, GstMessage* pMsg ); @@ -162,12 +177,11 @@ protected: Player( GString* pURI = NULL ); } -private: Player( const Player& ) {} +private: - Player & operator=( const Player& ) - { - return( *this ); - } + Player( const Player& ); + + Player& operator=( const Player& ); static gboolean implBusPrepare( GSource* pSource, gint* pTimeout ); @@ -209,14 +223,14 @@ protected: private: ::avmedia::gst::Window* mpPlayerWindow; - volatile gint mnIsVideoSource; - volatile gint mnVideoWidth; - volatile gint mnVideoHeight; - volatile gint mnInitialized; - volatile gint mnVolumeDB; - volatile gint mnLooping; - volatile gint mnQuit; - volatile gint mnVideoWindowSet; + gint mnIsVideoSource; + gint mnVideoWidth; + gint mnVideoHeight; + gint mnInitialized; + gint mnVolumeDB; + gint mnLooping; + gint mnQuit; + gint mnVideoWindowSet; }; } // namespace gst } // namespace avmedia -- cgit From 9d445eb695924d5f21357d15379efe575887bc76 Mon Sep 17 00:00:00 2001 From: ka Date: Thu, 10 Jun 2010 00:35:19 +0200 Subject: avmedia101: syntax and changed file headers --- avmedia/source/gstreamer/gstcommon.hxx | 5 +---- avmedia/source/gstreamer/gstframegrabber.cxx | 5 +---- avmedia/source/gstreamer/gstframegrabber.hxx | 5 +---- avmedia/source/gstreamer/gstmanager.cxx | 5 +---- avmedia/source/gstreamer/gstmanager.hxx | 5 +---- avmedia/source/gstreamer/gstplayer.cxx | 5 +---- avmedia/source/gstreamer/gstplayer.hxx | 11 ++++------- avmedia/source/gstreamer/gstuno.cxx | 5 +---- avmedia/source/gstreamer/gstwindow.cxx | 7 ++----- avmedia/source/gstreamer/gstwindow.hxx | 5 +---- avmedia/source/gstreamer/makefile.mk | 8 ++------ 11 files changed, 16 insertions(+), 50 deletions(-) diff --git a/avmedia/source/gstreamer/gstcommon.hxx b/avmedia/source/gstreamer/gstcommon.hxx index be8bf32bb436..83bb818aefdc 100644 --- a/avmedia/source/gstreamer/gstcommon.hxx +++ b/avmedia/source/gstreamer/gstcommon.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: GSTREAMERcommon.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstframegrabber.cxx b/avmedia/source/gstreamer/gstframegrabber.cxx index 71e720987d52..bd55e11f8afe 100644 --- a/avmedia/source/gstreamer/gstframegrabber.cxx +++ b/avmedia/source/gstreamer/gstframegrabber.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: framegrabber.cxx,v $ - * $Revision: 1.7 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstframegrabber.hxx b/avmedia/source/gstreamer/gstframegrabber.hxx index c9de03bfade9..9a7ec1b74102 100644 --- a/avmedia/source/gstreamer/gstframegrabber.hxx +++ b/avmedia/source/gstreamer/gstframegrabber.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: framegrabber.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstmanager.cxx b/avmedia/source/gstreamer/gstmanager.cxx index f17199d36e27..61ee4ce22cd8 100644 --- a/avmedia/source/gstreamer/gstmanager.cxx +++ b/avmedia/source/gstreamer/gstmanager.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: manager.cxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstmanager.hxx b/avmedia/source/gstreamer/gstmanager.hxx index 38717952d071..9f80e8c1a901 100644 --- a/avmedia/source/gstreamer/gstmanager.hxx +++ b/avmedia/source/gstreamer/gstmanager.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: manager.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index e9fe02594b66..fe471a2c6fa2 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: player.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index b4e437c89a8c..2eca2b12a9a6 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: player.hxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -35,7 +32,7 @@ #include #include -// necessary for older GLib versions +// necessary for mixed environments with GStreamer-0.10 and GLib versions < 2.8 #ifndef G_GNUC_NULL_TERMINATED #if __GNUC__ >= 4 #define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) @@ -44,8 +41,8 @@ #endif #endif -// necessary for older GLib versions -struct GOptionGroup; +struct _GOptionGroup; +typedef struct _GOptionGroup GOptionGroup; #include #include "com/sun/star/media/XPlayer.hdl" diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx index 308b2b14672b..adcda63fcd9c 100644 --- a/avmedia/source/gstreamer/gstuno.cxx +++ b/avmedia/source/gstreamer/gstuno.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: xineuno.cxx,v $ - * $Revision: 1.6 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx index 32552eb41b4c..3b24e9974a3f 100644 --- a/avmedia/source/gstreamer/gstwindow.cxx +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: window.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -24,7 +21,7 @@ * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * - * for a copy of the LG;;PLv3 License. + * for a copy of the LGPLv3 License. * ************************************************************************/ diff --git a/avmedia/source/gstreamer/gstwindow.hxx b/avmedia/source/gstreamer/gstwindow.hxx index b8b51a8c7c9a..3a55fca9c8bf 100644 --- a/avmedia/source/gstreamer/gstwindow.hxx +++ b/avmedia/source/gstreamer/gstwindow.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: window.hxx,v $ - * $Revision: 1.4 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/avmedia/source/gstreamer/makefile.mk b/avmedia/source/gstreamer/makefile.mk index 1c2aa65811cf..2f22c7333778 100644 --- a/avmedia/source/gstreamer/makefile.mk +++ b/avmedia/source/gstreamer/makefile.mk @@ -1,14 +1,10 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.5 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # -- cgit From 5df6e57fdd735333425cda481798de5afa6a928a Mon Sep 17 00:00:00 2001 From: ka Date: Thu, 10 Jun 2010 14:05:44 +0200 Subject: avmedia101: added fallback to JMF backend for UNIX systems --- avmedia/source/inc/mediamisc.hxx | 27 ++++++++--- avmedia/source/java/PlayerWindow.java | 4 +- avmedia/source/java/avmedia.jar | Bin 16420 -> 16495 bytes avmedia/source/viewer/mediawindow.cxx | 7 ++- avmedia/source/viewer/mediawindow_impl.cxx | 8 ++-- avmedia/source/viewer/mediawindowbase_impl.cxx | 61 +++++++++++++++++++------ avmedia/source/viewer/mediawindowbase_impl.hxx | 5 +- 7 files changed, 83 insertions(+), 29 deletions(-) diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx index 4d09192b3031..f33bd46568c8 100644 --- a/avmedia/source/inc/mediamisc.hxx +++ b/avmedia/source/inc/mediamisc.hxx @@ -30,15 +30,30 @@ class ResMgr; #define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() ) #ifdef WNT -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX" -#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 "" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_False + #else #ifdef QUARTZ -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime" -#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 "" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_False + #else -#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer" -#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED sal_False + +#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 "com.sun.star.comp.avmedia.Manager_Java" +#define AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 sal_True + #endif #endif diff --git a/avmedia/source/java/PlayerWindow.java b/avmedia/source/java/PlayerWindow.java index 229c651d9f54..2229e4f1644b 100644 --- a/avmedia/source/java/PlayerWindow.java +++ b/avmedia/source/java/PlayerWindow.java @@ -67,9 +67,7 @@ public class PlayerWindow implements java.awt.event.KeyListener, maFrame = new WindowAdapter( AnyConverter.toInt( aArgs[ 0 ] ) ); maFrame.setPosSize( aBoundRect.X, aBoundRect.Y, aBoundRect.Width, aBoundRect.Height, (short) 0 ); - - if( aArgs.length > 2 ) - mbShowControls = AnyConverter.toBoolean( aArgs[ 2 ] ); + mbShowControls = false; java.awt.Panel aPanel = new java.awt.Panel( new java.awt.BorderLayout() ); diff --git a/avmedia/source/java/avmedia.jar b/avmedia/source/java/avmedia.jar index 55576baa5b34..3495d947bf71 100644 Binary files a/avmedia/source/java/avmedia.jar and b/avmedia/source/java/avmedia.jar differ diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index fb781d70cfb6..5005446633f4 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -469,8 +469,10 @@ bool MediaWindow::isMediaURL( const ::rtl::OUString& rURL, bool bDeep, Size* pPr { try { + sal_Bool bIsJavaBasedMediaWindow; uno::Reference< media::XPlayer > xPlayer( priv::MediaWindowImpl::createPlayer( - aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ) ); + aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ), + bIsJavaBasedMediaWindow ) ); if( xPlayer.is() ) { @@ -515,7 +517,8 @@ bool MediaWindow::isMediaURL( const ::rtl::OUString& rURL, bool bDeep, Size* pPr uno::Reference< media::XPlayer > MediaWindow::createPlayer( const ::rtl::OUString& rURL ) { - return priv::MediaWindowImpl::createPlayer( rURL ); + sal_Bool bJavaBased = sal_False; + return priv::MediaWindowImpl::createPlayer( rURL, bJavaBased ); } // ------------------------------------------------------------------------- diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 83bc9b458a8b..15c830cb97a6 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -231,10 +231,10 @@ void MediaWindowImpl::onURLChanged() if( getPlayer().is() ) { uno::Reference< media::XPlayerWindow > xPlayerWindow; - const Point aPoint; - const Size aSize( maChildWindow.GetSizePixel() ); - const sal_IntPtr nWndHandle = (sal_IntPtr) maChildWindow. - GetParentWindowHandle( AVMEDIA_MANAGER_SERVICE_IS_JAVABASED ); + + const Point aPoint; + const Size aSize( maChildWindow.GetSizePixel() ); + const sal_IntPtr nWndHandle = (sal_IntPtr) maChildWindow.GetParentWindowHandle( isMediaWindowJavaBased() ); try { diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx index 5412e7a5b804..a8ef536ac133 100644 --- a/avmedia/source/viewer/mediawindowbase_impl.cxx +++ b/avmedia/source/viewer/mediawindowbase_impl.cxx @@ -47,8 +47,18 @@ namespace avmedia { namespace priv { // - MediaWindowBaseImpl - // ----------------------- +struct ServiceManager +{ + const char* pServiceName; + sal_Bool bIsJavaBased; +}; + +// --------------------------------------------------------------------- + + MediaWindowBaseImpl::MediaWindowBaseImpl( MediaWindow* pMediaWindow ) : - mpMediaWindow( pMediaWindow ) + mpMediaWindow( pMediaWindow ), + mbIsMediaWindowJavaBased( sal_False ) { } @@ -61,28 +71,53 @@ MediaWindowBaseImpl::~MediaWindowBaseImpl() // ------------------------------------------------------------------------- -uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl::OUString& rURL ) +uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl::OUString& rURL, sal_Bool& rbJavaBased ) { uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); uno::Reference< media::XPlayer > xPlayer; + rbJavaBased = sal_False; + if( xFactory.is() ) { - try + static const ServiceManager aServiceManagers[] = { + { "AVMEDIA_MANAGER_SERVICE_NAME", AVMEDIA_MANAGER_SERVICE_IS_JAVABASED }, + { "AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1", AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 } + }; + + uno::Reference< media::XManager > xManager; - uno::Reference< ::com::sun::star::media::XManager > xManager( - xFactory->createInstance( ::rtl::OUString::createFromAscii( AVMEDIA_MANAGER_SERVICE_NAME ) ), - uno::UNO_QUERY ); + for( sal_uInt32 i = 0; ( i < ( sizeof( aServiceManagers ) / sizeof( ServiceManager ) ) ) && !xManager.is(); ++i ) + { + const String aServiceName( aServiceManagers[ i ].pServiceName, RTL_TEXTENCODING_ASCII_US ); - if( xManager.is() ) + if( aServiceName.Len() ) { - xPlayer = uno::Reference< ::com::sun::star::media::XPlayer >( - xManager->createPlayer( rURL ), uno::UNO_QUERY ); + try + { + xManager = uno::Reference< media::XManager >( xFactory->createInstance( aServiceName ), + uno::UNO_QUERY ); + + if( xManager.is() ) + { + xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ), + uno::UNO_QUERY ); + } + } + catch( ... ) + { + } + } + + if( !xPlayer.is() ) + { + xManager.clear(); + } + else + { + rbJavaBased = aServiceManagers[ i ].bIsJavaBased; } - } - catch( ... ) - { } } @@ -112,7 +147,7 @@ void MediaWindowBaseImpl::setURL( const ::rtl::OUString& rURL ) if( aURL.GetProtocol() != INET_PROT_NOT_VALID ) maFileURL = aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ); - mxPlayer = createPlayer( maFileURL ); + mxPlayer = createPlayer( maFileURL, mbIsMediaWindowJavaBased ); onURLChanged(); } } diff --git a/avmedia/source/viewer/mediawindowbase_impl.hxx b/avmedia/source/viewer/mediawindowbase_impl.hxx index 0b0f160b6e3c..028b7c6ed079 100644 --- a/avmedia/source/viewer/mediawindowbase_impl.hxx +++ b/avmedia/source/viewer/mediawindowbase_impl.hxx @@ -61,7 +61,8 @@ namespace avmedia virtual void cleanUp(); virtual void onURLChanged(); - static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const ::rtl::OUString& rURL ); + static ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > createPlayer( const ::rtl::OUString& rURL, + sal_Bool& rbJavaBased ); public: @@ -112,6 +113,7 @@ namespace avmedia void stopPlayingInternal( bool ); MediaWindow* getMediaWindow() const; + inline sal_Bool isMediaWindowJavaBased() const { return( mbIsMediaWindowJavaBased ); } ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > getPlayer() const; @@ -124,6 +126,7 @@ namespace avmedia ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer; ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayerWindow > mxPlayerWindow; MediaWindow* mpMediaWindow; + sal_Bool mbIsMediaWindowJavaBased; }; } } -- cgit From 70d60072ed2b8d6a8a50b5a433954e67d32f5f6a Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 10 Jun 2010 14:30:42 +0200 Subject: sb123:#i111449# cleanups in sfx2 qa/complex tests --- sfx2/prj/build.lst | 49 +- .../CheckGlobalEventBroadcaster_writer1.java | 243 ---- sfx2/qa/complex/DocHelper/DialogThread.java | 95 -- sfx2/qa/complex/DocHelper/WriterHelper.java | 296 ----- sfx2/qa/complex/DocHelper/makefile.mk | 46 - sfx2/qa/complex/DocumentMetaData.java | 546 --------- sfx2/qa/complex/DocumentMetadataAccessTest.java | 1275 ------------------- sfx2/qa/complex/docinfo/DocumentProperties.java | 436 ++++--- sfx2/qa/complex/docinfo/makefile.mk | 41 +- .../CheckGlobalEventBroadcaster_writer1.java | 281 +++++ .../complex/framework/DocHelper/DialogThread.java | 95 ++ .../complex/framework/DocHelper/WriterHelper.java | 287 +++++ sfx2/qa/complex/framework/DocHelper/makefile.mk | 49 + sfx2/qa/complex/framework/DocumentMetaData.java | 565 +++++++++ .../framework/DocumentMetadataAccessTest.java | 1293 ++++++++++++++++++++ sfx2/qa/complex/framework/TestDocument.java | 39 + sfx2/qa/complex/framework/makefile.mk | 65 + sfx2/qa/complex/framework/testdocuments/CUSTOM.odt | Bin 0 -> 1021 bytes sfx2/qa/complex/framework/testdocuments/TEST.odt | Bin 0 -> 13803 bytes .../complex/framework/testdocuments/TESTRDFA.odt | Bin 0 -> 7540 bytes sfx2/qa/complex/framework/testdocuments/empty.rdf | 13 + sfx2/qa/complex/makefile.mk | 61 - .../StandaloneDocumentInfoUnitTest.java | 66 +- sfx2/qa/complex/standalonedocumentinfo/Test01.java | 37 +- .../complex/standalonedocumentinfo/TestHelper.java | 14 +- sfx2/qa/complex/standalonedocumentinfo/makefile.mk | 69 +- sfx2/qa/complex/testdocuments/CUSTOM.odt | Bin 1021 -> 0 bytes sfx2/qa/complex/testdocuments/TEST.odt | Bin 13803 -> 0 bytes sfx2/qa/complex/testdocuments/TESTRDFA.odt | Bin 7540 -> 0 bytes 29 files changed, 3088 insertions(+), 2873 deletions(-) delete mode 100644 sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java delete mode 100644 sfx2/qa/complex/DocHelper/DialogThread.java delete mode 100644 sfx2/qa/complex/DocHelper/WriterHelper.java delete mode 100644 sfx2/qa/complex/DocHelper/makefile.mk delete mode 100644 sfx2/qa/complex/DocumentMetaData.java delete mode 100644 sfx2/qa/complex/DocumentMetadataAccessTest.java create mode 100644 sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java create mode 100644 sfx2/qa/complex/framework/DocHelper/DialogThread.java create mode 100644 sfx2/qa/complex/framework/DocHelper/WriterHelper.java create mode 100644 sfx2/qa/complex/framework/DocHelper/makefile.mk create mode 100644 sfx2/qa/complex/framework/DocumentMetaData.java create mode 100644 sfx2/qa/complex/framework/DocumentMetadataAccessTest.java create mode 100644 sfx2/qa/complex/framework/TestDocument.java create mode 100644 sfx2/qa/complex/framework/makefile.mk create mode 100644 sfx2/qa/complex/framework/testdocuments/CUSTOM.odt create mode 100644 sfx2/qa/complex/framework/testdocuments/TEST.odt create mode 100644 sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt create mode 100644 sfx2/qa/complex/framework/testdocuments/empty.rdf delete mode 100644 sfx2/qa/complex/makefile.mk delete mode 100644 sfx2/qa/complex/testdocuments/CUSTOM.odt delete mode 100644 sfx2/qa/complex/testdocuments/TEST.odt delete mode 100644 sfx2/qa/complex/testdocuments/TESTRDFA.odt diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index 3e791fbc2000..de63edf7dd37 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -1,24 +1,29 @@ sf sfx2 : l10n idl basic xmlscript framework shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 NULL -sf sfx2 usr1 - all sf_mkout NULL -sf sfx2\inc nmake - all sf_inc NULL -sf sfx2\prj get - all sf_prj NULL -sf sfx2\win\res get - all sf_wres NULL -sf sfx2\mac\res get - all sf_mres NULL -sf sfx2\source\inc get - all sf_sinc NULL -sf sfx2\sdi nmake - all sf_sdi NULL -sf sfx2\source\appl nmake - all sf_appl sf_sdi sf_inc NULL -sf sfx2\source\view nmake - all sf_view sf_sdi sf_inc NULL -sf sfx2\source\bastyp nmake - all sf_bast sf_sdi sf_inc NULL -sf sfx2\source\config nmake - all sf_cnfg sf_sdi sf_inc NULL -sf sfx2\source\control nmake - all sf_ctrl sf_sdi sf_inc NULL -sf sfx2\source\dialog nmake - all sf_dlg sf_sdi sf_inc NULL -sf sfx2\source\doc nmake - all sf_doc sf_sdi sf_inc NULL -sf sfx2\source\layout nmake - all sf_layout sf_sdi sf_inc NULL -sf sfx2\source\menu nmake - all sf_menu sf_sdi sf_inc NULL -sf sfx2\source\notify nmake - all sf_noti sf_sdi sf_inc NULL -sf sfx2\source\statbar nmake - all sf_sbar sf_sdi sf_inc NULL -sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL -sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL -sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL -sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL +sf sfx2 usr1 - all sf_mkout NULL +sf sfx2\inc nmake - all sf_inc NULL +sf sfx2\prj get - all sf_prj NULL +sf sfx2\win\res get - all sf_wres NULL +sf sfx2\mac\res get - all sf_mres NULL +sf sfx2\source\inc get - all sf_sinc NULL +sf sfx2\sdi nmake - all sf_sdi NULL +sf sfx2\source\appl nmake - all sf_appl sf_sdi sf_inc NULL +sf sfx2\source\view nmake - all sf_view sf_sdi sf_inc NULL +sf sfx2\source\bastyp nmake - all sf_bast sf_sdi sf_inc NULL +sf sfx2\source\config nmake - all sf_cnfg sf_sdi sf_inc NULL +sf sfx2\source\control nmake - all sf_ctrl sf_sdi sf_inc NULL +sf sfx2\source\dialog nmake - all sf_dlg sf_sdi sf_inc NULL +sf sfx2\source\doc nmake - all sf_doc sf_sdi sf_inc NULL +sf sfx2\source\layout nmake - all sf_layout sf_sdi sf_inc NULL +sf sfx2\source\menu nmake - all sf_menu sf_sdi sf_inc NULL +sf sfx2\source\notify nmake - all sf_noti sf_sdi sf_inc NULL +sf sfx2\source\statbar nmake - all sf_sbar sf_sdi sf_inc NULL +sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL +sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL +sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL +sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL + sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL + +sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL +sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_util NULL +sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL diff --git a/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java b/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java deleted file mode 100644 index d5dc17e183eb..000000000000 --- a/sfx2/qa/complex/CheckGlobalEventBroadcaster_writer1.java +++ /dev/null @@ -1,243 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.framework; - -import com.sun.star.awt.XWindow; -import com.sun.star.document.XEventBroadcaster; -import com.sun.star.document.XEventListener; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import complex.framework.DocHelper.WriterHelper; -import complexlib.ComplexTestCase; -import java.util.ArrayList; -import com.sun.star.task.XJobExecutor; -import com.sun.star.util.URL; -import util.UITools; - -/** - * This testcase checks the GlobalEventBroadcaster - * it will add an XEventListener and verify the Events - * raised when opening/changing and closing Office Documents - */ -public class CheckGlobalEventBroadcaster_writer1 extends ComplexTestCase { - XMultiServiceFactory m_xMSF = null; - XEventBroadcaster m_xEventBroadcaster = null; - ArrayList notifyEvents = new ArrayList(); - XTextDocument xTextDoc; - XSpreadsheetDocument xSheetDoc; - XEventListener m_xEventListener = new EventListenerImpl(); - - public String[] getTestMethodNames() { - return new String[] { - "initialize", "checkWriter", "cleanup" - }; - } - - public void initialize() { - m_xMSF = (XMultiServiceFactory) param.getMSF(); - log.println("check wether there is a valid MultiServiceFactory"); - - if (m_xMSF == null) { - assure("## Couldn't get MultiServiceFactory make sure your Office is started", - true); - } - - log.println("... done"); - - log.println( - "Create an instance of com.sun.star.frame.GlobalEventBroadcaster"); - - Object GlobalEventBroadcaster = null; - Object dispatcher = null; - - try { - GlobalEventBroadcaster = m_xMSF.createInstance( - "com.sun.star.frame.GlobalEventBroadcaster"); - } catch (com.sun.star.uno.Exception e) { - assure("## Exception while creating instance", false); - } - - log.println("... done"); - - log.println("check wether the created instance is valid"); - - if (GlobalEventBroadcaster == null) { - assure("couldn't create service", false); - } - - log.println("... done"); - - log.println( - "try to query the XEventBroadcaster from the gained Object"); - m_xEventBroadcaster = (XEventBroadcaster) UnoRuntime.queryInterface( - XEventBroadcaster.class, - GlobalEventBroadcaster); - - if (util.utils.isVoid(m_xEventBroadcaster)) { - assure("couldn't get XEventBroadcaster", false); - } - - log.println("... done"); - - log.println("adding Listener"); - m_xEventBroadcaster.addEventListener(m_xEventListener); - log.println("... done"); - } - - public void checkWriter() { - log.println("-- Checking Writer --"); - - WriterHelper wHelper = new WriterHelper(m_xMSF); - String[] expected; - boolean locRes = true; - log.println("opening an empty writer doc"); - notifyEvents.clear(); - xTextDoc = wHelper.openEmptyDoc(); - shortWait(); - expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus" }; - - assure("Wrong events fired when opening empty doc", - proveExpectation(expected)); - log.println("... done"); - - log.println("changing the writer doc"); - notifyEvents.clear(); - xTextDoc.getText().setString("GlobalEventBroadcaster"); - shortWait(); - expected = new String[] { "OnModifyChanged" }; - - assure("Wrong events fired when changing doc", - proveExpectation(expected)); - log.println("... done"); - - log.println("closing the empty writer doc"); - notifyEvents.clear(); - wHelper.closeDoc(xTextDoc); - shortWait(); - expected = new String[] { "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; - - assure("Wrong events fired when closing empty doc", - proveExpectation(expected)); - log.println("... done"); - - log.println("opening an writer doc via Window-New Window"); - notifyEvents.clear(); - xTextDoc = wHelper.openFromDialog(".uno:NewWindow", "", false); - shortWait(); - expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus", "OnUnfocus", "OnViewCreated", "OnFocus", }; - - assure("Wrong events fired when opening an writer doc via Window-New Window", - proveExpectation(expected)); - log.println("... done"); - - log.println("closing the created writer doc"); - notifyEvents.clear(); - - wHelper.closeDoc(xTextDoc); - shortWait(); - expected = new String[] { "OnViewClosed", "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; - - assure("Wrong events fired when closing Window-New Window", - proveExpectation(expected)); - - log.println("... done"); - - log.println("Opening document with label wizard"); - xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false); - shortWait(); - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit ().getActiveTopWindow ()); - UITools ut = new UITools(m_xMSF,xWindow); - notifyEvents.clear(); - log.println("pressing button 'New Document'"); - try{ - ut.clickButton ("New Document"); - } catch (Exception e) { - log.println("Couldn't press Button"); - } - log.println("... done"); - shortWait(); - shortWait(); - shortWait(); - expected = new String[] { "OnViewClosed", "OnCreate", "OnFocus", "OnModifyChanged" }; - - assure("Wrong events fired when starting labels wizard", - proveExpectation(expected)); - - log.println("-- Done Writer --"); - } - - public void cleanup() { - log.println("removing Listener"); - m_xEventBroadcaster.removeEventListener(m_xEventListener); - log.println("... done"); - } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on - * reset call. - */ - private void shortWait() { - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } - - private boolean proveExpectation(String[] expected) { - boolean locRes = true; - boolean failure = false; - - log.println("Fired Events:"); - for (int k=0;k - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.framework.DocHelper; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XController; -import com.sun.star.frame.XDispatch; -import com.sun.star.frame.XDispatchProvider; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.URL; -import com.sun.star.util.XURLTransformer; - -import java.lang.Thread; - - -/** - * This class opens a given dialog in a separate Thread by dispatching an url - * - */ -public class DialogThread extends Thread { - public XComponent m_xDoc = null; - public XMultiServiceFactory m_xMSF = null; - public String m_url = ""; - - public DialogThread(XComponent xDoc, XMultiServiceFactory msf, String url) { - this.m_xDoc = xDoc; - this.m_xMSF = msf; - this.m_url = url; - } - - public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, - m_xDoc); - - XController xController = aModel.getCurrentController(); - - //Opening Dialog - try { - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( - XDispatchProvider.class, - xController.getFrame()); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( - XURLTransformer.class, - m_xMSF.createInstance( - "com.sun.star.util.URLTransformer")); - - // Because it's an in/out parameter - // we must use an array of URL objects. - URL[] aParseURL = new URL[1]; - aParseURL[0] = new URL(); - aParseURL[0].Complete = m_url; - xParser.parseStrict(aParseURL); - - URL aURL = aParseURL[0]; - XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", com.sun.star.frame.FrameSearchFlag.SELF | - com.sun.star.frame.FrameSearchFlag.CHILDREN); - PropertyValue[] dispatchArguments = new PropertyValue[0]; - - if (xDispatcher != null) { - xDispatcher.dispatch(aURL, dispatchArguments); - } else { - System.out.println("xDispatcher is null"); - } - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't open dialog"); - } - } -} \ No newline at end of file diff --git a/sfx2/qa/complex/DocHelper/WriterHelper.java b/sfx2/qa/complex/DocHelper/WriterHelper.java deleted file mode 100644 index b65e8e915423..000000000000 --- a/sfx2/qa/complex/DocHelper/WriterHelper.java +++ /dev/null @@ -1,296 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.framework.DocHelper; - -import com.sun.star.accessibility.AccessibleRole; -import com.sun.star.accessibility.XAccessible; -import com.sun.star.accessibility.XAccessibleAction; -import com.sun.star.accessibility.XAccessibleContext; -import com.sun.star.accessibility.XAccessibleSelection; -import com.sun.star.awt.XExtendedToolkit; -import com.sun.star.awt.XWindow; -import com.sun.star.frame.XDesktop; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.XCloseable; - -import complex.framework.DocHelper.DialogThread; -import java.io.PrintWriter; - -import util.AccessibilityTools; -import util.WriterTools; - - -/** - * Methods to open Writer docs - * - */ -public class WriterHelper { - XMultiServiceFactory m_xMSF = null; - - /** Creates a new instance of WriterHelper - * @param m_xMSF The MultiServiceFactory gained from the office - */ - public WriterHelper(XMultiServiceFactory m_xMSF) { - this.m_xMSF = m_xMSF; - } - - /** Opens an empty document - * @return a reference to the opened document is returned - */ - public XTextDocument openEmptyDoc() { - return WriterTools.createTextDoc(m_xMSF); - } - - /** Closes a given XTextDocument - * @param xTextDoc the text document to be closed - * @return if an error occurs the errormessage is returned and an empty String if not - */ - public String closeDoc(XTextDocument xTextDoc) { - XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, xTextDoc); - String err = ""; - - try { - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - err = "couldn't close document " + e; - } - - return err; - } - - /** a TextDocument is opened by pressing a button in a dialog given by uno-URL - * @param url the uno-URL of the dialog to be opened - * @param createButton the language dependend label of the button to be pressed - * @param destroyLocal if true the document that has been opened to dispatch the dialog is closed before the method returns, - * otherwise this document remains open - * @return returns the created Textdocument - */ - public XTextDocument openFromDialog(String url, String createButton, - boolean destroyLocal) { - XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF); - XComponent comp = (XComponent) UnoRuntime.queryInterface( - XComponent.class, xLocalDoc); - DialogThread diagThread = new DialogThread(comp, m_xMSF, url); - diagThread.start(); - shortWait(); - - if (createButton.length() > 1) { - XExtendedToolkit tk = getToolkit(); - AccessibilityTools at = new AccessibilityTools(); - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = (XWindow) UnoRuntime.queryInterface( - XWindow.class, atw); - - XAccessible xRoot = at.getAccessibleObject(xWindow); - XAccessibleContext buttonContext = at.getAccessibleObjectForRole( - xRoot, - AccessibleRole.PUSH_BUTTON, - createButton); - - XAccessibleAction buttonAction = (XAccessibleAction) UnoRuntime.queryInterface( - XAccessibleAction.class, - buttonContext); - - try { - System.out.println("Name: " + - buttonContext.getAccessibleName()); - buttonAction.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - System.out.println("Couldn't press button"); - } - - shortWait(); - } - - XDesktop xDesktop = getDesktop(); - - XTextDocument returnDoc = (XTextDocument) UnoRuntime.queryInterface( - XTextDocument.class, - xDesktop.getCurrentComponent()); - - if (destroyLocal) { - closeDoc(xLocalDoc); - } - - return returnDoc; - } - - public XTextDocument DocByAutopilot(XMultiServiceFactory msf, - int[] indexes, boolean destroyLocal, - String bName) { - XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF); - Object toolkit = null; - - try { - toolkit = msf.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, toolkit); - - shortWait(); - - AccessibilityTools at = new AccessibilityTools(); - - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - atw); - - XAccessible xRoot = at.getAccessibleObject(xWindow); - - XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot, - AccessibleRole.MENU_BAR); - XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface( - XAccessibleSelection.class, ARoot); - - for (int k = 0; k < indexes.length; k++) { - try { - sel.selectAccessibleChild(indexes[k]); - shortWait(); - ARoot = ARoot.getAccessibleChild(indexes[k]) - .getAccessibleContext(); - sel = (XAccessibleSelection) UnoRuntime.queryInterface( - XAccessibleSelection.class, ARoot); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - } - - shortWait(); - - atw = tk.getActiveTopWindow(); - - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); - - xRoot = at.getAccessibleObject(xWindow); - - //at.printAccessibleTree(new PrintWriter(System.out),xRoot); - - XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface( - XAccessibleAction.class, - at.getAccessibleObjectForRole(xRoot, - AccessibleRole.PUSH_BUTTON, - bName)); - - try { - action.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - - shortWait(); - - atw = tk.getActiveTopWindow(); - - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw); - - xRoot = at.getAccessibleObject(xWindow); - - at.printAccessibleTree(new PrintWriter(System.out),xRoot); - - action = (XAccessibleAction) UnoRuntime.queryInterface( - XAccessibleAction.class, - at.getAccessibleObjectForRole(xRoot, - AccessibleRole.PUSH_BUTTON, - "Yes")); - - try { - if (action != null) action.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - - shortWait(); - - XDesktop xDesktop = getDesktop(); - - XTextDocument returnDoc = (XTextDocument) UnoRuntime.queryInterface( - XTextDocument.class, - xDesktop.getCurrentComponent()); - - if (destroyLocal) { - closeDoc(xLocalDoc); - } - - return returnDoc; - } - - /** - * Sleeps for 2 sec. to allow StarOffice to react - */ - private void shortWait() { - try { - Thread.sleep(4000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - - /** creates an instance of com.sun.star.awt.Toolkit to query the XExtendedToolkit - * interface - * @return returns the gained XExtendedToolkit Interface - */ - public XExtendedToolkit getToolkit() { - Object toolkit = null; - - try { - toolkit = m_xMSF.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't get toolkit"); - e.printStackTrace(); - } - - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, toolkit); - - return tk; - } - - /** creates an instance of com.sun.star.frame.Desktop to query the XDesktop interface - * @return returns the gained XDesktop interface - */ - protected XDesktop getDesktop() { - Object desk = null; - - try { - desk = m_xMSF.createInstance("com.sun.star.frame.Desktop"); - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't get desktop"); - e.printStackTrace(); - } - - XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface( - XDesktop.class, desk); - - return xDesktop; - } -} \ No newline at end of file diff --git a/sfx2/qa/complex/DocHelper/makefile.mk b/sfx2/qa/complex/DocHelper/makefile.mk deleted file mode 100644 index 6b6ac9191cdb..000000000000 --- a/sfx2/qa/complex/DocHelper/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = DocHelper -PRJNAME = $(TARGET) -PACKAGE = complex$/framework$/dochelper - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = DialogThread.java WriterHelper.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java deleted file mode 100644 index ae7970227c75..000000000000 --- a/sfx2/qa/complex/DocumentMetaData.java +++ /dev/null @@ -1,546 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.framework; - -import complexlib.ComplexTestCase; -import helper.StreamSimulator; - -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.Any; -import com.sun.star.lang.XInitialization; -import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.Locale; -import com.sun.star.lang.EventObject; -import com.sun.star.util.Date; -import com.sun.star.util.DateTime; -import com.sun.star.util.Time; -import com.sun.star.util.Duration; -import com.sun.star.util.XModifyListener; -import com.sun.star.util.XModifyBroadcaster; -import com.sun.star.beans.XPropertyContainer; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.NamedValue; -import com.sun.star.beans.PropertyAttribute; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.IllegalTypeException; -import com.sun.star.embed.XStorage; -import com.sun.star.io.XInputStream; -import com.sun.star.document.XDocumentProperties; - - -/** - * Test case for the service com.sun.star.document.DocumentProperties. - * Currently, this service is implemented in - * sfx2/source/doc/SfxDocumentMetaData.cxx. - * - * @author mst - */ -public class DocumentMetaData extends ComplexTestCase -{ - public String[] getTestMethodNames () { - return new String[] { "check", "cleanup" }; - } - - public void cleanup() { - // nothing to do - } - - // for testing modifications - class Listener implements XModifyListener { - private boolean m_Called; - - public Listener() { - m_Called = false; - } - - public boolean reset() { - boolean oldCalled = m_Called; - m_Called = false; - return oldCalled; - } - - public void modified(EventObject e) { - m_Called = true; - } - - public void disposing(EventObject e) { - } - } - - public void check() { - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF(); - assure("could not create MultiServiceFactory.", xMSF != null); - XPropertySet xPropertySet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xMSF); - Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); - XComponentContext xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); - assure("could not get component context.", xContext != null); - - String temp = util.utils.getOfficeTemp/*Dir*/(xMSF); - log.println("tempdir: " + temp); - - PropertyValue[] noArgs = { }; - PropertyValue mimetype = new PropertyValue(); - mimetype.Name = "MediaType"; - mimetype.Value = "application/vnd.oasis.opendocument.text"; - PropertyValue[] mimeArgs = { mimetype }; -// new Any("application/vnd.oasis.opendocument.text")) }; - PropertyValue cfile = new PropertyValue(); - cfile.Name = "URL"; - cfile.Value = temp + "EMPTY.odt"; - PropertyValue[] mimeEmptyArgs = { mimetype, cfile }; - - log.println("Creating service DocumentProperties..."); - - Object oDP = -// xMSF.createInstanceWithContext( -// "com.sun.star.document.DocumentProperties", xContext); - xMSF.createInstance("com.sun.star.document.DocumentProperties"); - XDocumentProperties xDP = (XDocumentProperties) - UnoRuntime.queryInterface(XDocumentProperties.class, oDP); - - log.println("...done"); - - - log.println("Checking initialize ..."); - - XDocumentProperties xDP2 = (XDocumentProperties) - UnoRuntime.queryInterface(XDocumentProperties.class, - xMSF.createInstance( - "com.sun.star.document.DocumentProperties")); - XInitialization xInit = (XInitialization) - UnoRuntime.queryInterface(XInitialization.class, xDP2); - xInit.initialize(new Object[] { }); - - log.println("...done"); - - log.println("Checking storing default-initialized meta data ..."); - -// xDP2.storeToMedium(temp + "EMPTY.odt", mimeArgs); - xDP2.storeToMedium("", mimeEmptyArgs); - - log.println("...done"); - - log.println("Checking loading default-initialized meta data ..."); - -// xDP2.loadFromMedium(temp + "EMPTY.odt", noArgs); - xDP2.loadFromMedium("", mimeEmptyArgs); - assure ("Author", "".equals(xDP2.getAuthor())); - - log.println("...done"); - - log.println("(Not) Checking preservation of custom meta data ..."); - - xDP2.loadFromMedium(util.utils.getFullTestURL("CUSTOM.odt"), - noArgs); - assure ("Author", "".equals(xDP2.getAuthor())); - xDP2.storeToMedium(temp + "CUSTOM.odt", mimeArgs); - - //FIXME: now what? comparing for binary equality seems useless - // we could unzip the written file and grep for the custom stuff - // but would that work on windows... - - log.println("...done"); - - log.println("Checking loading from test document..."); - - String file = util.utils.getFullTestURL("TEST.odt"); - xDP.loadFromMedium(file, noArgs); -/* XInputStream xStream = - new StreamSimulator("./testdocuments/TEST.odt", true, param); - Object oSF = - xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xSF = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, oSF); - Object oStor = xSF.createInstanceWithArguments( - new Object[] { xStream }); - XStorage xStor = (XStorage) UnoRuntime.queryInterface( - XStorage.class, oStor); - xDP.loadFromStorage(xStor);*/ - - log.println("...done"); - - log.println("Checking meta-data import..."); - - assure ("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor())); - assure ("Generator", - "StarOffice/8$Solaris_x86 OpenOffice.org_project/680m232$Build-9227" - .equals(xDP.getGenerator())); - assure ("CreationDate", 2007 == xDP.getCreationDate().Year); - assure ("Title", "Urgent Memo".equals(xDP.getTitle())); - assure ("Subject", "Wichtige Mitteilung".equals(xDP.getSubject())); - assure ("Description", - "Modern internal company memorandum in full-blocked style" - .equals(xDP.getDescription())); -// assure ("Language", "".equals(xDP.getLanguage())); - assure ("ModifiedBy", - "Karl-Heinz Mustermann".equals(xDP.getModifiedBy())); - assure ("ModificationDate", 10 == xDP.getModificationDate().Month); - assure ("PrintedBy", - "Karl-Heinz Mustermann".equals(xDP.getPrintedBy())); - assure ("PrintDate", 29 == xDP.getPrintDate().Day); - assure ("TemplateName", - "Modern Memo".equals(xDP.getTemplateName())); - assure ("TemplateURL", - xDP.getTemplateURL().endsWith("memmodern.ott")); - assure ("TemplateDate", 17 == xDP.getTemplateDate().Hours); - assure ("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL())); - assure ("AutoloadSecs", 0 == xDP.getAutoloadSecs()); - assure ("DefaultTarget", "_blank".equals(xDP.getDefaultTarget())); - assure ("EditingCycles", 3 == xDP.getEditingCycles()); - assure ("EditingDuration", 320 == xDP.getEditingDuration()); - - String[] kws = xDP.getKeywords(); - assure ("Keywords", fromArray(kws).containsAll( - fromArray(new Object[] { "Asien", "Memo", "Reis" }))); - - NamedValue[] ds = xDP.getDocumentStatistics(); -/* for (int i = 0; i < ds.length; ++i) { - log.println("nv: " + ds[i].Name + " " + ds[i].Value); - } - NamedValue nv1 = new NamedValue("WordCount", new Integer(23)); - NamedValue nv2 = new NamedValue("WordCount", new Integer(23)); - log.println("eq: " + nv1.equals(nv2)); // grrr, this is false... -*/ - assure ("DocumentStatistics:WordCount", containsNV(ds, - new NamedValue("WordCount", new Integer(23)))); - assure ("DocumentStatistics:PageCount", containsNV(ds, - new NamedValue("PageCount", new Integer(1)))); - - XPropertyContainer udpc = xDP.getUserDefinedProperties(); - XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, udpc); - assure ("UserDefined 1", "Dies ist ein wichtiger Hinweis" - .equals(udps.getPropertyValue("Hinweis"))); - assure ("UserDefined 2", ("Kann Spuren von N" - + new String(new byte[] { (byte) 0xc3, (byte) 0xbc }, "UTF-8") - + "ssen enthalten") - .equals(udps.getPropertyValue("Warnung"))); - - log.println("...done"); - - log.println("Checking meta-data updates..."); - - String str; - DateTime dt = new DateTime(); - Locale l = new Locale(); - int i; - - str = "me"; - xDP.setAuthor(str); - assure ("setAuthor", str.equals(xDP.getAuthor())); - str = "the computa"; - xDP.setGenerator(str); - assure ("setGenerator", str.equals(xDP.getGenerator())); - dt.Year = 2038; - dt.Month = 1; - dt.Day = 1; - xDP.setCreationDate(dt); - assure ("setCreationDate", dt.Year == xDP.getCreationDate().Year); - str = "El t'itulo"; - xDP.setTitle(str); - assure ("setTitle", str.equals(xDP.getTitle())); - str = "Ein verkommenes Subjekt"; - xDP.setSubject(str); - assure ("setSubject", str.equals(xDP.getSubject())); - str = "Este descripci'on no es importante"; - xDP.setDescription(str); - assure ("setDescription", str.equals(xDP.getDescription())); - l.Language = "en"; - l.Country = "GB"; - xDP.setLanguage(l); - Locale l2 = xDP.getLanguage(); - assure ("setLanguage Lang", l.Language.equals(l2.Language)); - assure ("setLanguage Cty", l.Country.equals(l2.Country)); - str = "myself"; - xDP.setModifiedBy(str); - assure ("setModifiedBy", str.equals(xDP.getModifiedBy())); - dt.Year = 2042; - xDP.setModificationDate(dt); - assure ("setModificationDate", - dt.Year == xDP.getModificationDate().Year); - str = "i didnt do it"; - xDP.setPrintedBy(str); - assure ("setPrintedBy", str.equals(xDP.getPrintedBy())); - dt.Year = 2024; - xDP.setPrintDate(dt); - assure ("setPrintDate", dt.Year == xDP.getPrintDate().Year); - str = "blah"; - xDP.setTemplateName(str); - assure ("setTemplateName", str.equals(xDP.getTemplateName())); - str = "gopher://some-hole-in-the-ground/"; - xDP.setTemplateURL(str); - assure ("setTemplateURL", str.equals(xDP.getTemplateURL())); - dt.Year = 2043; - xDP.setTemplateDate(dt); - assure ("setTemplateDate", dt.Year == xDP.getTemplateDate().Year); - str = "http://nowhere/"; - xDP.setAutoloadURL(str); - assure ("setAutoloadURL", str.equals(xDP.getAutoloadURL())); - i = 3661; // this might not work (due to conversion via double...) - xDP.setAutoloadSecs(i); -// log.println("set: " + i + " get: " + xDP.getAutoloadSecs()); - assure ("setAutoloadSecs", i == xDP.getAutoloadSecs()); - str = "_blank"; - xDP.setDefaultTarget(str); - assure ("setDefaultTarget", str.equals(xDP.getDefaultTarget())); - i = 42; - xDP.setEditingCycles((short) i); - assure ("setEditingCycles", i == xDP.getEditingCycles()); - i = 84; - xDP.setEditingDuration(i); - assure ("setEditingDuration", i == xDP.getEditingDuration()); - str = ""; - - String[] kws2 = new String[] { - "keywordly", "keywordlike", "keywordalicious" }; - xDP.setKeywords(kws2); - kws = xDP.getKeywords(); - assure ("setKeywords", fromArray(kws).containsAll(fromArray(kws2))); - - NamedValue[] ds2 = new NamedValue[] { - new NamedValue("SyllableCount", new Integer(9)), - new NamedValue("FrameCount", new Integer(2)), - new NamedValue("SentenceCount", new Integer(7)) }; - xDP.setDocumentStatistics(ds2); - ds = xDP.getDocumentStatistics(); - assure ("setDocumentStatistics:SyllableCount", containsNV(ds, - new NamedValue("SyllableCount", new Integer(9)))); - assure ("setDocumentStatistics:FrameCount", containsNV(ds, - new NamedValue("FrameCount", new Integer(2)))); - assure ("setDocumentStatistics:SentenceCount", containsNV(ds, - new NamedValue("SentenceCount", new Integer(7)))); - - log.println("...done"); - - log.println("Checking user-defined meta-data updates..."); - - // actually, this tests the PropertyBag service - // but maybe the DocumentProperties service will be implemented - // differently some day... - boolean b = true; - double d = 3.1415; - // note that Time is only supported for backward compatibilty! - Time t = new Time(); - t.Hours = 1; - t.Minutes = 16; - Date date = new Date(); - date.Year = 2071; - date.Month = 2; - date.Day = 3; - dt.Year = 2065; - Duration dur = new Duration(); - dur.Negative = true; - dur.Years = 1001; - dur.Months = 999; - dur.Days = 888; - dur.Hours = 777; - dur.Minutes = 666; - dur.Seconds = 555; - dur.MilliSeconds = 444; - - udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, - new Boolean(b)); - udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur); - udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t); - udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date); - udpc.addProperty("FrobStartTime", PropertyAttribute.REMOVEABLE, dt); - udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); - udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); - udpc.addProperty("Removed", PropertyAttribute.REMOVEABLE, "bar"); - // #i94175#: empty property name is valid ODF 1.1 - udpc.addProperty("", PropertyAttribute.REMOVEABLE, "eeeeek"); - try { - udpc.removeProperty("Info 1"); - udpc.removeProperty("Removed"); - } catch (UnknownPropertyException e) { - assure("removeProperty failed", false); - } - - try { - udpc.addProperty("Forbidden", PropertyAttribute.REMOVEABLE, - new String[] { "foo", "bar" }); - assure("inserting value of non-supported type did not fail", - false); - } catch (IllegalTypeException e) { - // ignore - } - - assure ("UserDefined bool", new Boolean(b).equals( - udps.getPropertyValue("Frobnicate"))); - assure ("UserDefined duration", eqDuration(dur, (Duration) - udps.getPropertyValue("FrobDuration"))); - assure ("UserDefined time", eqTime(t, (Time) - udps.getPropertyValue("FrobDuration2"))); - assure ("UserDefined date", eqDate(date, (Date) - udps.getPropertyValue("FrobEndDate"))); - assure ("UserDefined datetime", eqDateTime(dt, (DateTime) - udps.getPropertyValue("FrobStartTime"))); - assure ("UserDefined float", new Double(d).equals( - udps.getPropertyValue("Pi"))); - assure ("UserDefined string", "bar".equals( - udps.getPropertyValue("Foo"))); - assure ("UserDefined empty name", "eeeeek".equals( - udps.getPropertyValue(""))); - - try { - udps.getPropertyValue("Removed"); - assure("UserDefined remove didn't", false); - } catch (UnknownPropertyException e) { - // ok - } - - log.println("...done"); - - log.println("Checking storing meta-data to file..."); - - xDP.storeToMedium(temp + "TEST.odt", mimeArgs); - - log.println("...done"); - - log.println("Checking loading meta-data from stored file..."); - - xDP.loadFromMedium(temp + "TEST.odt", noArgs); - - log.println("...done"); - - log.println("Checking user-defined meta-data from stored file..."); - - udpc = xDP.getUserDefinedProperties(); - udps = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, udpc); - - assure ("UserDefined bool", new Boolean(b).equals( - udps.getPropertyValue("Frobnicate"))); - assure ("UserDefined duration", eqDuration(dur, (Duration) - udps.getPropertyValue("FrobDuration"))); - // this is now a Duration! - Duration t_dur = new Duration(false, (short)0, (short)0, (short)0, - t.Hours, t.Minutes, t.Seconds, - (short)(10 * t.HundredthSeconds)); - assure ("UserDefined time", eqDuration(t_dur, (Duration) - udps.getPropertyValue("FrobDuration2"))); - assure ("UserDefined date", eqDate(date, (Date) - udps.getPropertyValue("FrobEndDate"))); - assure ("UserDefined datetime", eqDateTime(dt, (DateTime) - udps.getPropertyValue("FrobStartTime"))); - assure ("UserDefined float", new Double(d).equals( - udps.getPropertyValue("Pi"))); - assure ("UserDefined string", "bar".equals( - udps.getPropertyValue("Foo"))); - - try { - udps.getPropertyValue("Removed"); - assure("UserDefined remove didn't", false); - } catch (UnknownPropertyException e) { - // ok - } - - log.println("...done"); - - log.println("Checking notification listener interface..."); - - Listener listener = new Listener(); - XModifyBroadcaster xMB = (XModifyBroadcaster) - UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP); - xMB.addModifyListener(listener); - xDP.setAuthor("not me"); - assure ("Listener Author", listener.reset()); - udpc.addProperty("Listener", PropertyAttribute.REMOVEABLE, "foo"); - assure ("Listener UserDefined Add", listener.reset()); - udps.setPropertyValue("Listener", "bar"); - assure ("Listener UserDefined Set", listener.reset()); - udpc.removeProperty("Listener"); - assure ("Listener UserDefined Remove", listener.reset()); - xMB.removeModifyListener(listener); - udpc.addProperty("Listener2", PropertyAttribute.REMOVEABLE, "foo"); - assure ("Removed Listener UserDefined Add", !listener.reset()); - - log.println("...done"); - - } catch (Exception e) { - report(e); - } - } - - // grrr... - boolean eqDateTime(DateTime a, DateTime b) { - return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day - && a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.HundredthSeconds == b.HundredthSeconds; - } - - boolean eqDate(Date a, Date b) { - return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day; - } - - boolean eqTime(Time a, Time b) { - return a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.HundredthSeconds == b.HundredthSeconds; - } - - boolean eqDuration(Duration a, Duration b) { - return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days - && a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.MilliSeconds == b.MilliSeconds - && a.Negative == b.Negative; - } - - java.util.Collection fromArray(Object[] os) { - java.util.Collection ret = new java.util.HashSet(); - for (int i = 0; i < os.length; ++i) { - ret.add(os[i]); - } - return ret; - } - - // bah, structs do not have proper equals(), and uno.Type is not comparable - public static boolean containsNV (NamedValue[] nvs, NamedValue nv) { - for (int i = 0; i < nvs.length; ++i) { - if (nvs[i].Name.equals(nv.Name) && nvs[i].Value.equals(nv.Value)) { - return true; - } - } - return false; - } - - public void report(Exception e) { - log.println("Exception occurred:"); - e.printStackTrace((java.io.PrintWriter) log); - failed(); - } -} - diff --git a/sfx2/qa/complex/DocumentMetadataAccessTest.java b/sfx2/qa/complex/DocumentMetadataAccessTest.java deleted file mode 100644 index a61280c45fe5..000000000000 --- a/sfx2/qa/complex/DocumentMetadataAccessTest.java +++ /dev/null @@ -1,1275 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.framework; - -import complexlib.ComplexTestCase; -import helper.StreamSimulator; - -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.Any; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XInitialization; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.lang.IllegalArgumentException; -import com.sun.star.lang.WrappedTargetException; -import com.sun.star.lang.WrappedTargetRuntimeException; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.Pair; -import com.sun.star.beans.StringPair; -import com.sun.star.container.XEnumerationAccess; -import com.sun.star.container.XEnumeration; -import com.sun.star.container.ElementExistException; -import com.sun.star.container.NoSuchElementException; -import com.sun.star.io.XInputStream; -import com.sun.star.io.XOutputStream; -import com.sun.star.util.XCloseable; -import com.sun.star.frame.XStorable; -import com.sun.star.frame.XLoadable; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XTextRange; -import com.sun.star.text.XText; -import com.sun.star.rdf.*; - -/** - * Test case for interface com.sun.star.rdf.XDocumentMetadataAccess - * Currently, this service is implemented in - * sfx2/source/doc/DocumentMetadataAccess.cxx - * - * Actually, this is not a service, so we need to create a document and - * go from there... - * - * @author mst - */ -public class DocumentMetadataAccessTest extends ComplexTestCase -{ - XMultiServiceFactory xMSF; - XComponentContext xContext; - String tempDir; - - String nsRDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; - String nsRDFS = "http://www.w3.org/2000/01/rdf-schema#"; - String nsPkg="http://docs.oasis-open.org/opendocument/meta/package/common#"; - String nsODF ="http://docs.oasis-open.org/opendocument/meta/package/odf#"; - - XURI foo; - XURI bar; - XURI baz; - - static XURI rdf_type; - static XURI rdfs_label; - static XURI pkg_Document; - static XURI pkg_hasPart; - static XURI pkg_MetadataFile; - static XURI odf_ContentFile; - static XURI odf_StylesFile; - static XURI odf_Element; - static XBlankNode blank1; - static XBlankNode blank2; - static XBlankNode blank3; - static XBlankNode blank4; - static String manifestPath = "manifest.rdf"; - static String contentPath = "content.xml"; - static String stylesPath = "styles.xml"; - static String fooPath = "foo.rdf"; - static String fooBarPath = "meta/foo/bar.rdf"; - - XRepository xRep; - XRepositorySupplier xRS; - XDocumentMetadataAccess xDMA; - - public String[] getTestMethodNames () - { - return new String[] { "check", "checkRDFa" }; - } - - public void before() - { - try { - - xMSF = (XMultiServiceFactory) param.getMSF(); - assure("could not create MultiServiceFactory.", xMSF != null); - XPropertySet xPropertySet = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, xMSF); - Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); - xContext = (XComponentContext) - UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); - assure("could not get component context.", xContext != null); - - tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF); - log.println("tempdir: " + tempDir); - - foo = URI.create(xContext, "uri:foo"); - assure("foo", null != foo); - bar = URI.create(xContext, "uri:bar"); - assure("bar", null != bar); - baz = URI.create(xContext, "uri:baz"); - assure("baz", null != baz); - - blank1 = BlankNode.create(xContext, "_:1"); - assure("blank1", null != blank1); - blank2 = BlankNode.create(xContext, "_:2"); - assure("blank2", null != blank2); - blank3 = BlankNode.create(xContext, "_:3"); - assure("blank3", null != blank3); - blank4 = BlankNode.create(xContext, "_:4"); - assure("blank4", null != blank4); - rdf_type = URI.createKnown(xContext, URIs.RDF_TYPE); - assure("rdf_type", null != rdf_type); - rdfs_label = URI.createKnown(xContext, URIs.RDFS_LABEL); - assure("rdfs_label", null != rdfs_label); - pkg_Document = URI.createKnown(xContext, URIs.PKG_DOCUMENT); - assure("pkg_Document", null != pkg_Document); - pkg_hasPart = URI.createKnown(xContext, URIs.PKG_HASPART); - assure("pkg_hasPart", null != pkg_hasPart); - pkg_MetadataFile = URI.createKnown(xContext, URIs.PKG_METADATAFILE); - assure("pkg_MetadataFile", null != pkg_MetadataFile); - odf_ContentFile = URI.createKnown(xContext, URIs.ODF_CONTENTFILE); - assure("odf_ContentFile", null != odf_ContentFile); - odf_StylesFile = URI.createKnown(xContext, URIs.ODF_STYLESFILE); - assure("odf_StylesFile", null != odf_StylesFile); - odf_Element = URI.createKnown(xContext, URIs.ODF_ELEMENT); - assure("odf_Element", null != odf_Element); - - } catch (Exception e) { - report(e); - } - } - - public void after() - { - xRep = null; - xRS = null; - xDMA = null; - } - - public void check() - { - XComponent xComp = null; - XComponent xComp2 = null; - try { - XEnumeration xStmtsEnum; - XNamedGraph xManifest; - - log.println("Creating document with Repository..."); - - // we cannot create a XDMA directly, we must create - // a document and get it from there :( - // create document - PropertyValue[] loadProps = new PropertyValue[1]; - loadProps[0] = new PropertyValue(); - loadProps[0].Name = "Hidden"; - loadProps[0].Value = new Boolean(true); - xComp = util.DesktopTools.openNewDoc(xMSF, "swriter", loadProps); - XTextDocument xText = (XTextDocument) UnoRuntime.queryInterface( - XTextDocument.class, xComp); - - XRepositorySupplier xRS = (XRepositorySupplier) - UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); - assure("xRS null", null != xRS); - XDocumentMetadataAccess xDMA = (XDocumentMetadataAccess) - UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS); - assure("xDMA null", null != xDMA); - xRep = xRS.getRDFRepository(); - assure("xRep null", null != xRep); - - log.println("...done"); - - log.println("Checking that new repository is initialized..."); - - XURI xBaseURI = (XURI) xDMA; - String baseURI = xBaseURI.getStringValue(); - assure("new: baseURI", - null != xBaseURI && !xBaseURI.getStringValue().equals("")); - - assure("new: # graphs", 1 == xRep.getGraphNames().length); - XURI manifest = URI.createNS(xContext, xBaseURI.getStringValue(), - manifestPath); - xManifest = xRep.getGraph(manifest); - assure("new: manifest graph", null != xManifest); - - Statement[] manifestStmts = getManifestStmts(xBaseURI); - xStmtsEnum = xRep.getStatements(null, null, null); - assure("new: manifest graph", eq(xStmtsEnum, manifestStmts)); - - log.println("...done"); - - log.println("Checking some invalid args..."); - - String content = "behold, for i am the content."; - XTextRange xTR = new TestRange(content); - XMetadatable xM = (XMetadatable) xTR; - - try { - xDMA.getElementByURI(null); - assure("getElementByURI: null allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.getMetadataGraphsWithType(null); - assure("getMetadataGraphsWithType: null URI allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("", new XURI[0]); - assure("addMetadataFile: empty filename allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("/foo", new XURI[0]); - assure("addMetadataFile: absolute filename allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("fo\"o", new XURI[0]); - assure("addMetadataFile: invalid filename allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("../foo", new XURI[0]); - assure("addMetadataFile: filename with .. allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("foo/../../bar", new XURI[0]); - assure("addMetadataFile: filename with nest .. allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("foo/././bar", new XURI[0]); - assure("addMetadataFile: filename with nest . allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("content.xml", new XURI[0]); - assure("addMetadataFile: content.xml allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("styles.xml", new XURI[0]); - assure("addMetadataFile: styles.xml allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("meta.xml", new XURI[0]); - assure("addMetadataFile: meta.xml allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addMetadataFile("settings.xml", new XURI[0]); - assure("addMetadataFile: settings.xml allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.importMetadataFile(FileFormat.RDF_XML, null, "foo", - foo, new XURI[0]); - assure("importMetadataFile: null stream allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - XInputStream xFooIn = - new StreamSimulator(tempDir + "empty.rdf", true, param); - xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "", - foo, new XURI[0]); - assure("importMetadataFile: empty filename allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - XInputStream xFooIn = - new StreamSimulator(tempDir + "empty.rdf", true, param); - xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml", - foo, new XURI[0]); - assure("importMetadataFile: meta.xml filename allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - XInputStream xFooIn = - new StreamSimulator(tempDir + "empty.rdf", true, param); - xDMA.importMetadataFile(FileFormat.RDF_XML, - xFooIn, "foo", null, new XURI[0]); - assure("importMetadataFile: null base URI allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - XInputStream xFooIn = - new StreamSimulator(tempDir + "empty.rdf", true, param); - xDMA.importMetadataFile(FileFormat.RDF_XML, - xFooIn, "foo", rdf_type, new XURI[0]); - assure("importMetadataFile: non-absolute base URI allowed", - false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.removeMetadataFile(null); - assure("removeMetadataFile: null URI allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addContentOrStylesFile(""); - assure("addContentOrStylesFile: empty filename allowed", - false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addContentOrStylesFile("/content.xml"); - assure("addContentOrStylesFile: absolute filename allowed", - false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.addContentOrStylesFile("foo.rdf"); - assure("addContentOrStylesFile: invalid filename allowed", - false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.removeContentOrStylesFile(""); - assure("removeContentOrStylesFile: empty filename allowed", - false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.loadMetadataFromStorage(null, foo, null); - assure("loadMetadataFromStorage: null storage allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.storeMetadataToStorage(null/*, base*/); - assure("storeMetadataToStorage: null storage allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.loadMetadataFromMedium(new PropertyValue[0]); - assure("loadMetadataFromMedium: empty medium allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - try { - xDMA.storeMetadataToMedium(new PropertyValue[0]); - assure("storeMetadataToMedium: empty medium allowed", false); - } catch (IllegalArgumentException e) { - // ignore - } - - log.println("...done"); - - log.println("Checking file addition/removal..."); - - xDMA.removeContentOrStylesFile(contentPath); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("removeContentOrStylesFile (content)", - eq(xStmtsEnum, new Statement[] { - manifestStmts[0], manifestStmts[2], manifestStmts[4] - })); - - xDMA.addContentOrStylesFile(contentPath); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("addContentOrStylesFile (content)", - eq(xStmtsEnum, manifestStmts)); - - xDMA.removeContentOrStylesFile(stylesPath); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("removeContentOrStylesFile (styles)", - eq(xStmtsEnum, new Statement[] { - manifestStmts[0], manifestStmts[1], manifestStmts[3] - })); - - xDMA.addContentOrStylesFile(stylesPath); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("addContentOrStylesFile (styles)", - eq(xStmtsEnum, manifestStmts)); - - XURI xFoo = URI.createNS(xContext, xBaseURI.getStringValue(), - fooPath); - Statement xM_BaseHaspartFoo = - new Statement(xBaseURI, pkg_hasPart, xFoo, manifest); - Statement xM_FooTypeMetadata = - new Statement(xFoo, rdf_type, pkg_MetadataFile, manifest); - Statement xM_FooTypeBar = - new Statement(xFoo, rdf_type, bar, manifest); - xDMA.addMetadataFile(fooPath, new XURI[] { bar }); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("addMetadataFile", - eq(xStmtsEnum, merge(manifestStmts, new Statement[] { - xM_BaseHaspartFoo, xM_FooTypeMetadata, xM_FooTypeBar - }))); - - XURI[] graphsBar = xDMA.getMetadataGraphsWithType(bar); - assure("getMetadataGraphsWithType", - graphsBar.length == 1 && eq(graphsBar[0], xFoo)); - - - xDMA.removeMetadataFile(xFoo); - xStmtsEnum = xManifest.getStatements(null, null, null); - assure("removeMetadataFile", - eq(xStmtsEnum, manifestStmts)); - - log.println("...done"); - - log.println("Checking mapping..."); - - XEnumerationAccess xTextEnum = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, - xText.getText()); - Object o = xTextEnum.createEnumeration().nextElement(); - XMetadatable xMeta1 = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, o); - - XURI uri; - XMetadatable xMeta; - xMeta = xDMA.getElementByURI(xMeta1); - assure("getElementByURI: null", null != xMeta); - String XmlId = xMeta.getMetadataReference().Second; - String XmlId1 = xMeta1.getMetadataReference().Second; - assure("getElementByURI: no xml id", !XmlId.equals("")); - assure("getElementByURI: different xml id", XmlId.equals(XmlId1)); - - log.println("...done"); - - log.println("Checking storing and loading..."); - - XURI xFoobar = URI.createNS(xContext, xBaseURI.getStringValue(), - fooBarPath); - Statement[] metadataStmts = getMetadataFileStmts(xBaseURI, - fooBarPath); - xDMA.addMetadataFile(fooBarPath, new XURI[0]); - xStmtsEnum = xRep.getStatements(null, null, null); - assure("addMetadataFile", - eq(xStmtsEnum, merge(manifestStmts, metadataStmts ))); - - Statement xFoobar_FooBarFoo = - new Statement(foo, bar, foo, xFoobar); - xRep.getGraph(xFoobar).addStatement(foo, bar, foo); - xStmtsEnum = xRep.getStatements(null, null, null); - assure("addStatement", - eq(xStmtsEnum, merge(manifestStmts, merge(metadataStmts, - new Statement[] { xFoobar_FooBarFoo })))); - - PropertyValue noMDNoContentFile = new PropertyValue(); - noMDNoContentFile.Name = "URL"; - noMDNoContentFile.Value = util.utils.getFullTestURL("CUSTOM.odt"); - PropertyValue noMDFile = new PropertyValue(); - noMDFile.Name = "URL"; - noMDFile.Value = util.utils.getFullTestURL("TEST.odt"); - PropertyValue file = new PropertyValue(); - file.Name = "URL"; - file.Value = tempDir + "TESTDMA.odt"; - /* - PropertyValue baseURL = new PropertyValue(); - baseURL.Name = "DocumentBaseURL"; - baseURL.Value = tempDir + "TMP.odt"; - */ - PropertyValue mimetype = new PropertyValue(); - mimetype.Name = "MediaType"; - mimetype.Value = "application/vnd.oasis.opendocument.text"; - PropertyValue[] argsEmptyNoContent = { mimetype, noMDNoContentFile}; - PropertyValue[] argsEmpty = { mimetype, noMDFile }; - PropertyValue[] args = { mimetype, file }; - - xStmtsEnum = xRep.getStatements(null, null, null); - XURI[] graphs = xRep.getGraphNames(); - - xDMA.storeMetadataToMedium(args); - - // this should re-init - xDMA.loadMetadataFromMedium(argsEmptyNoContent); - xRep = xRS.getRDFRepository(); - assure("xRep null", null != xRep); - assure("baseURI still tdoc?", - !baseURI.equals(xDMA.getStringValue())); - Statement[] manifestStmts2 = getManifestStmts((XURI) xDMA); - xStmtsEnum = xRep.getStatements(null, null, null); - // there is no content or styles file in here, so we have just - // the package stmt - assure("loadMetadataFromMedium (no metadata, no content)", - eq(xStmtsEnum, new Statement[] { manifestStmts2[0] })); - - // this should re-init - xDMA.loadMetadataFromMedium(argsEmpty); - xRep = xRS.getRDFRepository(); - assure("xRep null", null != xRep); - assure("baseURI still tdoc?", - !baseURI.equals(xDMA.getStringValue())); - Statement[] manifestStmts3 = getManifestStmts((XURI) xDMA); - - xStmtsEnum = xRep.getStatements(null, null, null); - assure("loadMetadataFromMedium (no metadata)", - eq(xStmtsEnum, manifestStmts3)); - - xDMA.loadMetadataFromMedium(args); - xRep = xRS.getRDFRepository(); - assure("xRep null", null != xRep); - Statement[] manifestStmts4 = getManifestStmts((XURI) xDMA); - Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDMA, - fooBarPath); - - xStmtsEnum = xRep.getStatements(null, null, null); - assure("some graph(s) not reloaded", - graphs.length == xRep.getGraphNames().length); - - XURI xFoobar4 = URI.createNS(xContext, xDMA.getStringValue(), - fooBarPath); - Statement xFoobar_FooBarFoo4 = - new Statement(foo, bar, foo, xFoobar4); - assure("loadMetadataFromMedium (re-load)", - eq(xStmtsEnum, merge(manifestStmts4, merge(metadataStmts4, - new Statement[] { xFoobar_FooBarFoo4 })))); - - log.println("...done"); - - log.println("Checking storing and loading via model..."); - - String f = tempDir + "TESTPARA.odt"; - - XStorable xStor = (XStorable) UnoRuntime.queryInterface( - XStorable.class, xRS); - - xStor.storeToURL(f, new PropertyValue[0]); - - xComp2 = util.DesktopTools.loadDoc(xMSF, f, loadProps); - - XDocumentMetadataAccess xDMA2 = (XDocumentMetadataAccess) - UnoRuntime.queryInterface(XDocumentMetadataAccess.class, - xComp2); - assure("xDMA2 null", null != xDMA2); - - XRepositorySupplier xRS2 = (XRepositorySupplier) - UnoRuntime.queryInterface(XRepositorySupplier.class, xComp2); - assure("xRS2 null", null != xRS2); - - XRepository xRep2 = xRS2.getRDFRepository(); - assure("xRep2 null", null != xRep2); - - Statement[] manifestStmts5 = getManifestStmts((XURI) xDMA2); - Statement[] metadataStmts5 = getMetadataFileStmts((XURI) xDMA2, - fooBarPath); - XURI xFoobar5 = URI.createNS(xContext, xDMA2.getStringValue(), - fooBarPath); - Statement xFoobar_FooBarFoo5 = - new Statement(foo, bar, foo, xFoobar5); - xStmtsEnum = xRep.getStatements(null, null, null); - XEnumeration xStmtsEnum2 = xRep2.getStatements(null, null, null); - assure("load: repository differs", - eq(xStmtsEnum2, merge(manifestStmts5, merge(metadataStmts5, - new Statement[] { xFoobar_FooBarFoo5 })))); - - log.println("...done"); - - } catch (Exception e) { - report(e); - } finally { - close(xComp); - close(xComp2); - } - } - - public void checkRDFa() - { - XComponent xComp = null; - String file; - try { - file = util.utils.getFullTestURL("TESTRDFA.odt"); - xComp = loadRDFa(file); - if (xComp != null) - { - file = tempDir + "TESTRDFA.odt"; - storeRDFa(xComp, file); - close(xComp); - xComp = loadRDFa(file); - } - } finally { - close(xComp); - } - } - - public void storeRDFa(XComponent xComp, String file) - { - try { - - log.println("Storing test document..."); - - XStorable xStor = (XStorable) UnoRuntime.queryInterface( - XStorable.class, xComp); - - xStor.storeToURL(file, new PropertyValue[0]); - - log.println("...done"); - - } catch (Exception e) { - report(e); - } - } - - public XComponent loadRDFa(String file) - { - XComponent xComp = null; - try { - - log.println("Loading test document..."); - - PropertyValue[] loadProps = new PropertyValue[1]; - loadProps[0] = new PropertyValue(); - loadProps[0].Name = "Hidden"; - loadProps[0].Value = new Boolean(true); - - - - xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps); - - XRepositorySupplier xRS = (XRepositorySupplier) - UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); - assure("xRS null", null != xRS); - - XDocumentRepository xRep = (XDocumentRepository) - UnoRuntime.queryInterface(XDocumentRepository.class, - xRS.getRDFRepository()); - assure("xRep null", null != xRep); - - XTextDocument xTextDoc = (XTextDocument) - UnoRuntime.queryInterface(XTextDocument.class, xComp); - - XText xText = xTextDoc.getText(); - - XEnumerationAccess xEA = (XEnumerationAccess) - UnoRuntime.queryInterface(XEnumerationAccess.class, xText); - XEnumeration xEnum = xEA.createEnumeration(); - - log.println("...done"); - - log.println("Checking RDFa in loaded test document..."); - - XMetadatable xPara; - Pair result; - - Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 1", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit1 - })); - - Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 2", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit2 - })); - - Statement x_BlankBarLit3 = - new Statement(blank1, bar, mkLit("3"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 3", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit3 - })); - XBlankNode b3 = (XBlankNode) UnoRuntime.queryInterface( - XBlankNode.class, result.First[0].Subject); - - Statement x_BlankBarLit4 = - new Statement(blank2, bar, mkLit("4"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 4", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit4 - })); - XBlankNode b4 = (XBlankNode) UnoRuntime.queryInterface( - XBlankNode.class, result.First[0].Subject); - - Statement x_BlankBarLit5 = - new Statement(blank1, bar, mkLit("5"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 5", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit5 - })); - XBlankNode b5 = (XBlankNode) UnoRuntime.queryInterface( - XBlankNode.class, result.First[0].Subject); - - assure("RDFa: 3 != 4", - !b3.getStringValue().equals(b4.getStringValue())); - assure("RDFa: 3 == 5", - b3.getStringValue().equals(b5.getStringValue())); - - Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null); - Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 6", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit6, x_FooBazLit6 - })); - - Statement x_FooBarLit7 = new Statement(foo, bar, mkLit("7"), null); - Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null); - Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 7", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit7, x_FooBazLit7, x_FooFooLit7 - })); - - XNode lit = mkLit("a fooish bar"); - XNode lit_type= mkLit("a fooish bar", bar); - Statement x_FooBarLit = new Statement(foo, bar, lit, null); - Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 8", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 9", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 10", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLittype - })); - - Statement x_FooBarLit11 - = new Statement(foo, bar, mkLit("11", bar), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 11", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit11 - })); - - XURI xFile = URI.createNS(xContext, file, "/" + contentPath); - Statement x_FileBarLit12 = - new Statement(xFile, bar, mkLit("12"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 12", - !result.Second && - eq(result.First, new Statement[] { - x_FileBarLit12 - })); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 13", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - Statement x_FooLabelLit14 = - new Statement(foo, rdfs_label, mkLit("14"), null); - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 14", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 15", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 16", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 17", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 18", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 19", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 20", eq(result.First, new Statement[] { } )); - - xPara = (XMetadatable) UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xRep.getStatementRDFa(xPara); - assure("RDFa: 21", eq(result.First, new Statement[] { } )); - - log.println("...done"); - - } catch (Exception e) { - report(e); - close(xComp); - } - return xComp; - } - - -// utilities ------------------------------------------------------------- - - public void report2(Exception e) - { - if (e instanceof WrappedTargetException) - { - log.println("Cause:"); - Exception cause = (Exception) - (((WrappedTargetException)e).TargetException); - log.println(cause.toString()); - report2(cause); - } else if (e instanceof WrappedTargetRuntimeException) { - log.println("Cause:"); - Exception cause = (Exception) - (((WrappedTargetRuntimeException)e).TargetException); - log.println(cause.toString()); - report2(cause); - } - } - - public void report(Exception e) { - log.println("Exception occurred:"); - e.printStackTrace((java.io.PrintWriter) log); - report2(e); - failed(); - } - - static void close(XComponent i_comp) - { - try { - XCloseable xClos = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, i_comp); - if (xClos != null) xClos.close(true); - } catch (Exception e) { - } - } - - XLiteral mkLit(String i_content) - { - return Literal.create(xContext, i_content); - } - - XLiteral mkLit(String i_content, XURI i_uri) - { - return Literal.createWithType(xContext, i_content, i_uri); - } - - static Statement[] merge(Statement[] i_A1, Statement[] i_A2) - { - // bah, java sucks... - Statement[] ret = new Statement[i_A1.length + i_A2.length]; - for (int i = 0; i < i_A1.length; ++i) { - ret[i] = i_A1[i]; - } - for (int i = 0; i < i_A2.length; ++i) { - ret[i+i_A1.length] = i_A2[i]; - } - return ret; - } - - public static String toS(XNode n) { - if (null == n) return "< null >"; - return n.getStringValue(); - } - - static boolean isBlank(XNode i_node) - { - XBlankNode blank = (XBlankNode) UnoRuntime.queryInterface( - XBlankNode.class, i_node); - return blank != null; - } - -/* - static class Statement implements XStatement - { - XResource m_Subject; - XResource m_Predicate; - XNode m_Object; - XURI m_Graph; - - Statement(XResource i_Subject, XResource i_Predicate, XNode i_Object, - XURI i_Graph) - { - m_Subject = i_Subject; - m_Predicate = i_Predicate; - m_Object = i_Object; - m_Graph = i_Graph; - } - - public XResource getSubject() { return m_Subject; } - public XResource getPredicate() { return m_Predicate; } - public XNode getObject() { return m_Object; } - public XURI getGraph() { return m_Graph; } - } -*/ - - static Statement[] toSeq(XEnumeration i_Enum) throws Exception - { - java.util.Collection c = new java.util.Vector(); - while (i_Enum.hasMoreElements()) { - Statement s = (Statement) i_Enum.nextElement(); -//log.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + "."); - c.add(s); - } -// return (Statement[]) c.toArray(); - // java sucks - Object[] arr = c.toArray(); - Statement[] ret = new Statement[arr.length]; - for (int i = 0; i < arr.length; ++i) { - ret[i] = (Statement) arr[i]; - } - return ret; - } - - static XNode[][] toSeqs(XEnumeration i_Enum) throws Exception - { - java.util.Collection c = new java.util.Vector(); - while (i_Enum.hasMoreElements()) { - XNode[] s = (XNode[]) i_Enum.nextElement(); - c.add(s); - } -// return (XNode[][]) c.toArray(); - Object[] arr = c.toArray(); - XNode[][] ret = new XNode[arr.length][]; - for (int i = 0; i < arr.length; ++i) { - ret[i] = (XNode[]) arr[i]; - } - return ret; - } - - static class BindingComp implements java.util.Comparator - { - public int compare(Object i_Left, Object i_Right) - { - XNode[] left = (XNode[]) i_Left; - XNode[] right = (XNode[]) i_Right; - if (left.length != right.length) throw new RuntimeException(); - for (int i = 0; i < left.length; ++i) { - int eq = (left[i].getStringValue().compareTo( - right[i].getStringValue())); - if (eq != 0) return eq; - } - return 0; - } - } - - static class StmtComp implements java.util.Comparator - { - public int compare(Object i_Left, Object i_Right) - { - int eq; - Statement left = (Statement) i_Left; - Statement right = (Statement) i_Right; - if ((eq = cmp(left.Graph, right.Graph )) != 0) return eq; - if ((eq = cmp(left.Subject, right.Subject )) != 0) return eq; - if ((eq = cmp(left.Predicate, right.Predicate)) != 0) return eq; - if ((eq = cmp(left.Object, right.Object )) != 0) return eq; - return 0; - } - - public int cmp(XNode i_Left, XNode i_Right) - { - if (isBlank(i_Left)) { - return isBlank(i_Right) ? 0 : 1; - } else { - if (isBlank(i_Right)) { - return -1; - } else { - return toS(i_Left).compareTo(toS(i_Right)); - } - } - } - } - - static boolean eq(Statement i_Left, Statement i_Right) - { - XURI lG = i_Left.Graph; - XURI rG = i_Right.Graph; - if (!eq(lG, rG)) { - log.println("Graphs differ: " + toS(lG) + " != " + toS(rG)); - return false; - } - if (!eq(i_Left.Subject, i_Right.Subject)) { - log.println("Subjects differ: " + - i_Left.Subject.getStringValue() + " != " + - i_Right.Subject.getStringValue()); - return false; - } - if (!eq(i_Left.Predicate, i_Right.Predicate)) { - log.println("Predicates differ: " + - i_Left.Predicate.getStringValue() + " != " + - i_Right.Predicate.getStringValue()); - return false; - } - if (!eq(i_Left.Object, i_Right.Object)) { - log.println("Objects differ: " + - i_Left.Object.getStringValue() + " != " + - i_Right.Object.getStringValue()); - return false; - } - return true; - } - - static boolean eq(Statement[] i_Result, Statement[] i_Expected) - { - if (i_Result.length != i_Expected.length) { - log.println("eq: different lengths: " + i_Result.length + " " + - i_Expected.length); - return false; - } - Statement[] expected = (Statement[]) - java.util.Arrays.asList(i_Expected).toArray(); - java.util.Arrays.sort(i_Result, new StmtComp()); - java.util.Arrays.sort(expected, new StmtComp()); - for (int i = 0; i < expected.length; ++i) { - if (!eq(i_Result[i], expected[i])) return false; - } - return true; - } - - static boolean eq(XEnumeration i_Enum, Statement[] i_Expected) - throws Exception - { - Statement[] current = toSeq(i_Enum); - return eq(current, i_Expected); - } - - static boolean eq(XNode i_Left, XNode i_Right) - { - if (i_Left == null) { - return (i_Right == null); - } else { - return (i_Right != null) && - (i_Left.getStringValue().equals(i_Right.getStringValue()) - // FIXME: hack: blank nodes considered equal - || (isBlank(i_Left) && isBlank(i_Right))); - } - } - - static boolean eq(XQuerySelectResult i_Result, - String[] i_Vars, XNode[][] i_Bindings) throws Exception - { - String[] vars = (String[]) i_Result.getBindingNames(); - XEnumeration iter = (XEnumeration) i_Result; - XNode[][] bindings = toSeqs(iter); - if (vars.length != i_Vars.length) { - log.println("var lengths differ"); - return false; - } - if (bindings.length != i_Bindings.length) { - log.println("binding lengths differ: " + i_Bindings.length + - " vs " + bindings.length ); - return false; - } - java.util.Arrays.sort(bindings, new BindingComp()); - java.util.Arrays.sort(i_Bindings, new BindingComp()); - for (int i = 0; i < i_Bindings.length; ++i) { - if (i_Bindings[i].length != i_Vars.length) { - log.println("TEST ERROR!"); - throw new Exception(); - } - if (bindings[i].length != i_Vars.length) { - log.println("binding length and var length differ"); - return false; - } - for (int j = 0; j < i_Vars.length; ++j) { - if (!eq(bindings[i][j], i_Bindings[i][j])) { - log.println("bindings differ: " + - toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j])); - return false; - } - } - } - for (int i = 0; i < i_Vars.length; ++i) { - if (!vars[i].equals(i_Vars[i])) { - log.println("variable names differ: " + - vars[i] + " != " + i_Vars[i]); - return false; - } - } - return true; - } - - static boolean eq(StringPair i_Left, StringPair i_Right) - { - return ((i_Left.First).equals(i_Right.First)) && - ((i_Left.Second).equals(i_Right.Second)); - } - - static String mkNamespace(String i_prefix, String i_namespace) - { - return "PREFIX " + i_prefix + ": <" + i_namespace + ">\n"; - } - - static String mkNss() - { - String namespaces = mkNamespace("rdf", - "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); - namespaces += mkNamespace("pkg", - "http://docs.oasis-open.org/opendocument/meta/package/common#"); - namespaces += mkNamespace("odf", - "http://docs.oasis-open.org/opendocument/meta/package/odf#"); - return namespaces; - } - - Statement[] getManifestStmts(XURI xBaseURI) throws Exception - { - XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(), - manifestPath); - XURI xContent = URI.createNS(xContext, xBaseURI.getStringValue(), - contentPath); - XURI xStyles = URI.createNS(xContext, xBaseURI.getStringValue(), - stylesPath); - Statement xM_BaseTypeDoc = - new Statement(xBaseURI, rdf_type, pkg_Document, xManifest); - Statement xM_BaseHaspartContent = - new Statement(xBaseURI, pkg_hasPart, xContent, xManifest); - Statement xM_BaseHaspartStyles = - new Statement(xBaseURI, pkg_hasPart, xStyles, xManifest); - Statement xM_ContentTypeContent = - new Statement(xContent, rdf_type, odf_ContentFile, xManifest); - Statement xM_StylesTypeStyles = - new Statement(xStyles, rdf_type, odf_StylesFile, xManifest); - return new Statement[] { - xM_BaseTypeDoc, xM_BaseHaspartContent, xM_BaseHaspartStyles, - xM_ContentTypeContent, xM_StylesTypeStyles - }; - } - - Statement[] getMetadataFileStmts(XURI xBaseURI, String Path) - throws Exception - { - XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(), - manifestPath); - XURI xGraph = URI.createNS(xContext, xBaseURI.getStringValue(), Path); - Statement xM_BaseHaspartGraph = - new Statement(xBaseURI, pkg_hasPart, xGraph, xManifest); - Statement xM_GraphTypeMetadata = - new Statement(xGraph, rdf_type, pkg_MetadataFile, xManifest); - return new Statement[] { xM_BaseHaspartGraph, xM_GraphTypeMetadata }; - } - - class TestRange implements XTextRange, XMetadatable, XServiceInfo - { - String m_Stream; - String m_XmlId; - String m_Text; - TestRange(String i_Str) { m_Text = i_Str; } - - public String getStringValue() { return ""; } - public String getNamespace() { return ""; } - public String getLocalName() { return ""; } - - public StringPair getMetadataReference() - { return new StringPair(m_Stream, m_XmlId); } - public void setMetadataReference(StringPair i_Ref) - throws IllegalArgumentException - { m_Stream = (String)i_Ref.First; m_XmlId = (String)i_Ref.Second; } - public void ensureMetadataReference() - { m_Stream = "content.xml"; m_XmlId = "42"; } - - public String getImplementationName() { return null; } - public String[] getSupportedServiceNames() { return null; } - public boolean supportsService(String i_Svc) - { return i_Svc.equals("com.sun.star.text.Paragraph"); } - - public XText getText() { return null; } - public XTextRange getStart() { return null; } - public XTextRange getEnd() { return null; } - public String getString() { return m_Text; } - public void setString(String i_Str) { m_Text = i_Str; } - } -} - diff --git a/sfx2/qa/complex/docinfo/DocumentProperties.java b/sfx2/qa/complex/docinfo/DocumentProperties.java index cff1dd341d48..afa188e20901 100644 --- a/sfx2/qa/complex/docinfo/DocumentProperties.java +++ b/sfx2/qa/complex/docinfo/DocumentProperties.java @@ -26,9 +26,12 @@ ************************************************************************/ package complex.docinfo; +import com.sun.star.beans.*; +import com.sun.star.beans.Property; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertyContainer; import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.XPropertySetInfo; import com.sun.star.document.XDocumentInfo; import com.sun.star.document.XDocumentInfoSupplier; import com.sun.star.frame.XComponentLoader; @@ -37,233 +40,324 @@ import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; import com.sun.star.util.Date; -import complexlib.ComplexTestCase; + import util.DesktopTools; import util.WriterTools; +import org.junit.After; +import org.junit.AfterClass; +// import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public class DocumentProperties +{ -public class DocumentProperties extends ComplexTestCase { XMultiServiceFactory m_xMSF = null; XTextDocument xTextDoc = null; + XTextDocument xTextDocSecond = null; - public String[] getTestMethodNames() { - return new String[] {"checkDocInfo", "cleanup"}; - } - - public void checkDocInfo() { - m_xMSF = (XMultiServiceFactory) param.getMSF(); - - log.println( - "check wether there is a valid MultiServiceFactory"); +// public String[] getTestMethodNames() { +// return new String[] {"checkDocInfo", "cleanup"}; +// } + @Test public void checkDocInfo() + { + m_xMSF = getMSF(); - if (m_xMSF == null) { - assure("## Couldn't get MultiServiceFactory make sure your Office is started", - true); - } + System.out.println("check wether there is a valid MultiServiceFactory"); - log.println("... done"); - - log.println("Opening a Writer document"); - xTextDoc = WriterTools.createTextDoc(m_xMSF); - log.println("... done"); - - XDocumentInfoSupplier xDocInfoSup = - (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, - xTextDoc); - XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo(); - XPropertyContainer xPropContainer = - (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, - xDocInfo); - - log.println("Trying to add a existing property"); - - boolean worked = - addProperty(xPropContainer, "Author", (short) 0, ""); - assure("Could set an existing property", !worked); - log.println("...done"); - - log.println("Trying to add a integer property"); - worked = - addProperty(xPropContainer, "intValue", com.sun.star.beans.PropertyAttribute.READONLY, - new Integer(17)); - assure("Couldn't set an integer property", worked); - log.println("...done"); - - log.println("Trying to add a double property"); - worked = - addProperty(xPropContainer, "doubleValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE , - new Double(17.7)); - assure("Couldn't set an double property", worked); - log.println("...done"); - - log.println("Trying to add a boolean property"); - worked = - addProperty(xPropContainer, "booleanValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, - Boolean.TRUE); - assure("Couldn't set an boolean property", worked); - log.println("...done"); - - log.println("Trying to add a date property"); - worked = - addProperty(xPropContainer, "dateValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, - new Date()); - assure("Couldn't set an date property", worked); - log.println("...done"); - - log.println("trying to remove a read only Property"); - try { - xPropContainer.removeProperty ("intValue"); - assure("Could remove read only property", false); - } catch (Exception e) { - log.println("\tException was thrown "+e); - log.println("\t...OK"); - } - log.println("...done"); + assertNotNull("## Couldn't get MultiServiceFactory make sure your Office is started", m_xMSF); String tempdir = System.getProperty("java.io.tmpdir"); String fs = System.getProperty("file.separator"); - if (!tempdir.endsWith(fs)) { + if (!tempdir.endsWith(fs)) + { tempdir += fs; } - tempdir = util.utils.getFullURL(tempdir); - - log.println("Storing the document"); - - try { - XStorable store = - (XStorable) UnoRuntime.queryInterface(XStorable.class, - xTextDoc); - store.storeToURL(tempdir + "DocInfo.oot", - new PropertyValue[] {}); - DesktopTools.closeDoc(xTextDoc); - } catch (Exception e) { - assure("Couldn't store document", false); + final String sTempDocument = tempdir + "DocInfo.oot"; + + if (true) + { + System.out.println("... done"); + + + System.out.println("Opening a Writer document"); + xTextDoc = WriterTools.createTextDoc(m_xMSF); + System.out.println("... done"); + + XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc); + XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo(); + XPropertyContainer xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo); + + System.out.println("Trying to add a existing property"); + + boolean worked = addProperty(xPropContainer, "Author", (short) 0, ""); + assertTrue("Could set an existing property", !worked); + System.out.println("...done"); + + System.out.println("Trying to add a integer property"); + worked = addProperty(xPropContainer, "intValue", com.sun.star.beans.PropertyAttribute.READONLY, new Integer(17)); + assertTrue("Couldn't set an integer property", worked); + System.out.println("...done"); + + System.out.println("Trying to add a double property"); + worked = addProperty(xPropContainer, "doubleValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, new Double(17.7)); + assertTrue("Couldn't set an double property", worked); + System.out.println("...done"); + + System.out.println("Trying to add a boolean property"); + worked = addProperty(xPropContainer, "booleanValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, Boolean.TRUE); + assertTrue("Couldn't set an boolean property", worked); + System.out.println("...done"); + + System.out.println("Trying to add a date property"); + worked = addProperty(xPropContainer, "dateValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE, new Date()); + assertTrue("Couldn't set an date property", worked); + System.out.println("...done"); + + System.out.println("trying to remove a read only Property"); + try + { + xPropContainer.removeProperty("intValue"); + fail("Could remove read only property"); + } + catch (Exception e) + { + System.out.println("\tException was thrown " + e); + System.out.println("\t...OK"); + } + System.out.println("...done"); + + XPropertySet xProps2 = UnoRuntime.queryInterface(XPropertySet.class, xPropContainer); + showPropertySet(xProps2); + + + System.out.println("Storing the document"); + try + { + XStorable store = UnoRuntime.queryInterface(XStorable.class, xTextDoc); + store.storeToURL(sTempDocument, new PropertyValue[] {}); + DesktopTools.closeDoc(xTextDoc); + } + catch (Exception e) + { + fail("Couldn't store document"); + } + + System.out.println("...done"); } - log.println("...done"); - - log.println("loading the document"); - - try { - XComponentLoader xCL = - (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, - m_xMSF.createInstance( - "com.sun.star.frame.Desktop")); - XComponent xComp = - xCL.loadComponentFromURL(tempdir + "DocInfo.oot", - "_blank", 0, new PropertyValue[] {}); - xTextDoc = - (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, - xComp); - } catch (Exception e) { - assure("Couldn't load document", false); - } - log.println("...done"); - - xDocInfoSup = - (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class, - xTextDoc); - xDocInfo = xDocInfoSup.getDocumentInfo(); - - XPropertySet xProps = - (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, - xDocInfo); - - assure("Integer doesn't work", - checkType(xProps, "intValue", "java.lang.Integer")); - assure("Double doesn't work", - checkType(xProps, "doubleValue", "java.lang.Double")); - assure("Boolean doesn't work", - checkType(xProps, "booleanValue", "java.lang.Boolean")); - assure("Date doesn't work", - checkType(xProps, "dateValue", - "com.sun.star.util.DateTime")); - - xPropContainer = - (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class, - xDocInfo); - - log.println("trying to remove a not user defined Property"); - try { - xPropContainer.removeProperty ("Author"); - assure("Could remove non user defined property", false); - } catch (Exception e) { - log.println("\tException was thrown "+e); - log.println("\t...OK"); - } - log.println("...done"); - - log.println("Trying to remove a user defined property"); - try { - xPropContainer.removeProperty ("dateValue"); - log.println("\t...OK"); - } catch (Exception e) { - log.println("\tException was thrown "+e); - log.println("\t...FAILED"); - assure("Could not remove user defined property", false); + if (true) + { + System.out.println("loading the document"); + + try + { + XComponentLoader xCL = UnoRuntime.queryInterface(XComponentLoader.class, m_xMSF.createInstance("com.sun.star.frame.Desktop")); + XComponent xComp = xCL.loadComponentFromURL(sTempDocument, "_blank", 0, new PropertyValue[] {}); + xTextDocSecond = UnoRuntime.queryInterface(XTextDocument.class, xComp); + } + catch (Exception e) + { + fail("Couldn't load document"); + } + + System.out.println("...done"); + + XDocumentInfoSupplier xDocInfoSup = UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDocSecond); + XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo(); + XPropertyContainer xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo); + + XPropertySet xProps = UnoRuntime.queryInterface(XPropertySet.class, xDocInfo); + showPropertySet(xProps); + + assertTrue("Double doesn't work", checkType(xProps, "doubleValue", "java.lang.Double")); + assertTrue("Boolean doesn't work", checkType(xProps, "booleanValue", "java.lang.Boolean")); + + // TODO: dateValue does not exist. + // assertTrue("Date doesn't work", checkType(xProps, "dateValue", "com.sun.star.util.DateTime")); + + // TODO: is java.lang.Double + // assertTrue("Integer doesn't work", checkType(xProps, "intValue", "java.lang.Integer")); + + xPropContainer = UnoRuntime.queryInterface(XPropertyContainer.class, xDocInfo); + + System.out.println("trying to remove a not user defined Property"); + try + { + xPropContainer.removeProperty("Author"); + fail("Could remove non user defined property"); + } + catch (Exception e) + { + System.out.println("\tException was thrown " + e); + System.out.println("\t...OK"); + } + System.out.println("...done"); + + + System.out.println("Trying to remove a user defined property"); + try + { + xPropContainer.removeProperty("booleanValue"); + System.out.println("\t...OK"); + } + catch (Exception e) + { + System.out.println("\tException was thrown " + e); + System.out.println("\t...FAILED"); + fail("Could not remove user defined property"); + } + showPropertySet(xProps); + System.out.println("...done"); } - log.println("...done"); - } - public void cleanup() { + @After public void cleanup() + { + DesktopTools.closeDoc(xTextDocSecond); DesktopTools.closeDoc(xTextDoc); } + private void showPropertySet(XPropertySet xProps) + { + try + { + // get an XPropertySet, here the one of a text cursor + // XPropertySet xCursorProps = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, mxDocCursor); + + // get the property info interface of this XPropertySet + XPropertySetInfo xPropsInfo = xProps.getPropertySetInfo(); + + // get all properties (NOT the values) from XPropertySetInfo + Property[] aProps = xPropsInfo.getProperties(); + int i; + for (i = 0; i < aProps.length; ++i) { + // number of property within this info object + System.out.print("Property #" + i); + + // name of property + System.out.print(": Name<" + aProps[i].Name); + + // handle of property (only for XFastPropertySet) + System.out.print("> Handle<" + aProps[i].Handle); + + // type of property + System.out.print("> " + aProps[i].Type.toString()); + + // attributes (flags) + System.out.print(" Attributes<"); + short nAttribs = aProps[i].Attributes; + if ((nAttribs & PropertyAttribute.MAYBEVOID) != 0) + System.out.print("MAYBEVOID|"); + if ((nAttribs & PropertyAttribute.BOUND) != 0) + System.out.print("BOUND|"); + if ((nAttribs & PropertyAttribute.CONSTRAINED) != 0) + System.out.print("CONSTRAINED|"); + if ((nAttribs & PropertyAttribute.READONLY) != 0) + System.out.print("READONLY|"); + if ((nAttribs & PropertyAttribute.TRANSIENT) != 0) + System.out.print("TRANSIENT|"); + if ((nAttribs & PropertyAttribute.MAYBEAMBIGUOUS ) != 0) + System.out.print("MAYBEAMBIGUOUS|"); + if ((nAttribs & PropertyAttribute.MAYBEDEFAULT) != 0) + System.out.print("MAYBEDEFAULT|"); + if ((nAttribs & PropertyAttribute.REMOVEABLE) != 0) + System.out.print("REMOVEABLE|"); + System.out.println("0>"); + } + } catch (Exception e) { + // If anything goes wrong, give the user a stack trace + e.printStackTrace(System.out); + } + } + private boolean checkType(XPropertySet xProps, String aName, - String expected) { + String expected) + { boolean ret = true; - log.println("Checking " + expected); + System.out.println("Checking " + expected); String getting = - getPropertyByName(xProps, aName).getClass().getName(); + getPropertyByName(xProps, aName).getClass().getName(); - if (!getting.equals(expected)) { - log.println("\t Expected: " + expected); - log.println("\t Detting: " + getting); + if (!getting.equals(expected)) + { + System.out.println("\t Expected: " + expected); + System.out.println("\t Getting: " + getting); ret = false; } - if (ret) { - log.println("...OK"); + if (ret) + { + System.out.println("...OK"); } - return ret; } - private Object getPropertyByName(XPropertySet xProps, String aName) { + private Object getPropertyByName(XPropertySet xProps, String aName) + { Object ret = null; - try { + try + { ret = xProps.getPropertyValue(aName); - } catch (Exception e) { - log.println("\tCouldn't get Property " + aName); - log.println("\tMessage " + e); + } + catch (Exception e) + { + System.out.println("\tCouldn't get Property " + aName); + System.out.println("\tMessage " + e); } return ret; } private boolean addProperty(XPropertyContainer xPropContainer, - String aName, short attr, Object defaults) { + String aName, short attr, Object defaults) + { boolean ret = true; - try { + try + { xPropContainer.addProperty(aName, attr, defaults); - } catch (Exception e) { + } + catch (Exception e) + { ret = false; - log.println("\tCouldn't get Property " + aName); - log.println("\tMessage " + e); + System.out.println("\tCouldn't get Property " + aName); + System.out.println("\tMessage " + e); } return ret; } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk index 8c3525541062..51f2ddd02597 100644 --- a/sfx2/qa/complex/docinfo/makefile.mk +++ b/sfx2/qa/complex/docinfo/makefile.mk @@ -25,32 +25,39 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = DocumentProperties +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ = ../../.. PRJNAME = sfx2 -PACKAGE = complex$/docinfo +TARGET = qa_complex_docinfo -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/docinfo +JAVATESTFILES = \ + DocumentProperties.java + +JAVAFILES = $(JAVATESTFILES) -#----- compile .java files ----------------------------------------- +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = DocumentProperties.java +# Sample how to debug +JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y + +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -#----- make a jar from compiled files ------------------------------ +ALLTAR : javatest -MAXLINELENGTH = 100000 +.END -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE -# --- Targets ------------------------------------------------------ -.INCLUDE : target.mk -run: - $(JAVAI) $(JAVAIFLAGS) -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -o $(PACKAGE:s#$/#.#).$(JAVAFILES:b) diff --git a/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java b/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java new file mode 100644 index 000000000000..c6dc073095b1 --- /dev/null +++ b/sfx2/qa/complex/framework/CheckGlobalEventBroadcaster_writer1.java @@ -0,0 +1,281 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.framework; + +import com.sun.star.awt.XWindow; +import com.sun.star.document.XEventBroadcaster; +import com.sun.star.document.XEventListener; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.sheet.XSpreadsheetDocument; +import com.sun.star.text.XTextDocument; +import com.sun.star.uno.UnoRuntime; +import complex.framework.DocHelper.WriterHelper; + +import java.util.ArrayList; + +import util.UITools; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + + +/** + * This testcase checks the GlobalEventBroadcaster + * it will add an XEventListener and verify the Events + * raised when opening/changing and closing Office Documents + */ +public class CheckGlobalEventBroadcaster_writer1 { + XMultiServiceFactory m_xMSF = null; + XEventBroadcaster m_xEventBroadcaster = null; + ArrayList notifyEvents = new ArrayList(); + // XTextDocument xTextDoc; + XSpreadsheetDocument xSheetDoc; + XEventListener m_xEventListener = new EventListenerImpl(); + +// public String[] getTestMethodNames() { +// return new String[] { +// "initialize", "checkWriter", "cleanup" +// }; +// } + + @Before public void initialize() { + m_xMSF = getMSF(); + System.out.println("check wether there is a valid MultiServiceFactory"); + + assertNotNull("## Couldn't get MultiServiceFactory make sure your Office is started", m_xMSF); + + System.out.println("... done"); + + System.out.println( + "Create an instance of com.sun.star.frame.GlobalEventBroadcaster"); + + Object GlobalEventBroadcaster = null; + Object dispatcher = null; + + try { + GlobalEventBroadcaster = m_xMSF.createInstance( + "com.sun.star.frame.GlobalEventBroadcaster"); + } catch (com.sun.star.uno.Exception e) { + fail("## Exception while creating instance"); + } + + System.out.println("... done"); + + System.out.println("check wether the created instance is valid"); + + assertNotNull("couldn't create service", GlobalEventBroadcaster); + + System.out.println("... done"); + + System.out.println( + "try to query the XEventBroadcaster from the gained Object"); + m_xEventBroadcaster = UnoRuntime.queryInterface(XEventBroadcaster.class, GlobalEventBroadcaster); + + if (util.utils.isVoid(m_xEventBroadcaster)) { + fail("couldn't get XEventBroadcaster"); + } + + System.out.println("... done"); + + System.out.println("adding Listener"); + m_xEventBroadcaster.addEventListener(m_xEventListener); + System.out.println("... done"); + } + + @Test public void checkWriter() { + System.out.println("-- Checking Writer --"); + + WriterHelper wHelper = new WriterHelper(m_xMSF); + String[] expected; + boolean locRes = true; + System.out.println("opening an empty writer doc"); + notifyEvents.clear(); + { + XTextDocument xTextDoc = wHelper.openEmptyDoc(); + shortWait(); + expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus" }; + + assertTrue("Wrong events fired when opening empty doc", + proveExpectation(expected)); + System.out.println("... done"); + + System.out.println("changing the writer doc"); + notifyEvents.clear(); + xTextDoc.getText().setString("GlobalEventBroadcaster"); + shortWait(); + expected = new String[] { "OnModifyChanged" }; + + assertTrue("Wrong events fired when changing doc", + proveExpectation(expected)); + System.out.println("... done"); + + System.out.println("closing the empty writer doc"); + notifyEvents.clear(); + wHelper.closeDoc(xTextDoc); + shortWait(); + } + expected = new String[] { "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; + + assertTrue("Wrong events fired when closing empty doc", + proveExpectation(expected)); + System.out.println("... done"); + + System.out.println("opening an writer doc via Window-New Window"); + notifyEvents.clear(); + { + XTextDocument xTextDoc = wHelper.openFromDialog(".uno:NewWindow", "", false); + + shortWait(); + expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus", "OnUnfocus", "OnViewCreated", "OnFocus", }; + + assertTrue("Wrong events fired when opening an writer doc via Window-New Window", + proveExpectation(expected)); + System.out.println("... done"); + + System.out.println("closing the created writer doc"); + notifyEvents.clear(); + + wHelper.closeDoc(xTextDoc); + shortWait(); + } + expected = new String[] { "OnViewClosed", "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; + + assertTrue("Wrong events fired when closing Window-New Window", + proveExpectation(expected)); + + System.out.println("... done"); + // TODO: It seems not possible to close the document without interactiv question + // there the follow test will not be execute + if (false) { + System.out.println("Opening document with label wizard"); + XTextDocument xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false); + shortWait(); + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit().getActiveTopWindow()); + UITools ut = new UITools(m_xMSF,xWindow); + notifyEvents.clear(); + System.out.println("pressing button 'New Document'"); + try{ + ut.clickButton ("New Document"); + } catch (Exception e) { + System.out.println("Couldn't press Button"); + } + System.out.println("... done"); + shortWait(); + shortWait(); + shortWait(); + expected = new String[] { "OnViewClosed", "OnCreate", "OnFocus", "OnModifyChanged" }; + + assertTrue("Wrong events fired when starting labels wizard", + proveExpectation(expected)); + + System.out.println("Try to close document..."); + wHelper.closeDoc(xTextDoc); + shortWait(); + wHelper.closeFromDialog(); + shortWait(); + xTextDoc = null; + } + + System.out.println("-- Done Writer --"); + } + + @After public void cleanup() { + System.out.println("removing Listener"); + m_xEventBroadcaster.removeEventListener(m_xEventListener); + System.out.println("... done"); + } + + /** + * Sleeps for 0.5 sec. to allow StarOffice to react on + * reset call. + */ + private void shortWait() { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + System.out.println("While waiting :" + e); + } + } + + private boolean proveExpectation(String[] expected) { + boolean locRes = true; + boolean failure = false; + + System.out.println("Fired Events:"); + for (int k=0;k + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.framework.DocHelper; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.XController; +import com.sun.star.frame.XDispatch; +import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.XModel; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.URL; +import com.sun.star.util.XURLTransformer; + +import java.lang.Thread; + + +/** + * This class opens a given dialog in a separate Thread by dispatching an url + * + */ +public class DialogThread extends Thread { + public XComponent m_xDoc = null; + public XMultiServiceFactory m_xMSF = null; + public String m_url = ""; + + public DialogThread(XComponent xDoc, XMultiServiceFactory msf, String url) { + this.m_xDoc = xDoc; + this.m_xMSF = msf; + this.m_url = url; + } + + public void run() { + XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + m_xDoc); + + XController xController = aModel.getCurrentController(); + + //Opening Dialog + try { + XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider.class, + xController.getFrame()); + XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer.class, + m_xMSF.createInstance( + "com.sun.star.util.URLTransformer")); + + // Because it's an in/out parameter + // we must use an array of URL objects. + URL[] aParseURL = new URL[1]; + aParseURL[0] = new URL(); + aParseURL[0].Complete = m_url; + xParser.parseStrict(aParseURL); + + URL aURL = aParseURL[0]; + XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", com.sun.star.frame.FrameSearchFlag.SELF | + com.sun.star.frame.FrameSearchFlag.CHILDREN); + PropertyValue[] dispatchArguments = new PropertyValue[0]; + + if (xDispatcher != null) { + xDispatcher.dispatch(aURL, dispatchArguments); + } else { + System.out.println("xDispatcher is null"); + } + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't open dialog"); + } + } +} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/DocHelper/WriterHelper.java b/sfx2/qa/complex/framework/DocHelper/WriterHelper.java new file mode 100644 index 000000000000..d3f19703bb9d --- /dev/null +++ b/sfx2/qa/complex/framework/DocHelper/WriterHelper.java @@ -0,0 +1,287 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.framework.DocHelper; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleAction; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleSelection; +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.awt.XWindow; +import com.sun.star.frame.XDesktop; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XTextDocument; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XCloseable; + +import complex.framework.DocHelper.DialogThread; +import java.io.PrintWriter; + +import util.AccessibilityTools; +import util.WriterTools; + + +/** + * Methods to open Writer docs + * + */ +public class WriterHelper { + XMultiServiceFactory m_xMSF = null; + + /** Creates a new instance of WriterHelper + * @param m_xMSF The MultiServiceFactory gained from the office + */ + public WriterHelper(XMultiServiceFactory m_xMSF) { + this.m_xMSF = m_xMSF; + } + + /** Opens an empty document + * @return a reference to the opened document is returned + */ + public XTextDocument openEmptyDoc() { + return WriterTools.createTextDoc(m_xMSF); + } + + /** Closes a given XTextDocument + * @param xTextDoc the text document to be closed + * @return if an error occurs the errormessage is returned and an empty String if not + */ + public String closeDoc(XTextDocument xTextDoc) { + XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, xTextDoc); + String err = ""; + + try { + closer.close(true); + } catch (com.sun.star.util.CloseVetoException e) { + err = "couldn't close document " + e; + System.out.println(err); + } + + return err; + } + + private XTextDocument xLocalDoc = null; + /** a TextDocument is opened by pressing a button in a dialog given by uno-URL + * @param url the uno-URL of the dialog to be opened + * @param createButton the language dependend label of the button to be pressed + * @param destroyLocal if true the document that has been opened to dispatch the dialog is closed before the method returns, + * otherwise this document remains open + * @return returns the created Textdocument + */ + public XTextDocument openFromDialog(String url, String createButton, + boolean destroyLocal) { + xLocalDoc = WriterTools.createTextDoc(m_xMSF); + XComponent comp = UnoRuntime.queryInterface(XComponent.class, xLocalDoc); + DialogThread diagThread = new DialogThread(comp, m_xMSF, url); + diagThread.start(); + shortWait(); + + if (createButton.length() > 1) { + XExtendedToolkit tk = getToolkit(); + AccessibilityTools at = new AccessibilityTools(); + Object atw = tk.getActiveTopWindow(); + + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + XAccessible xRoot = at.getAccessibleObject(xWindow); + XAccessibleContext buttonContext = at.getAccessibleObjectForRole( + xRoot, + AccessibleRole.PUSH_BUTTON, + createButton); + + XAccessibleAction buttonAction = UnoRuntime.queryInterface(XAccessibleAction.class, buttonContext); + + try { + System.out.println("Name: " + + buttonContext.getAccessibleName()); + buttonAction.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + System.out.println("Couldn't press button"); + } + + shortWait(); + } + + XDesktop xDesktop = getDesktop(); + + XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); + + if (destroyLocal) { + closeDoc(xLocalDoc); + xLocalDoc = null; + } + + return returnDoc; + } + public void closeFromDialog() + { + closeDoc(xLocalDoc); + xLocalDoc = null; + } + public void kill() + { + XDesktop xDesktop = getDesktop(); + xDesktop.terminate(); + } + + + public XTextDocument DocByAutopilot(XMultiServiceFactory msf, + int[] indexes, boolean destroyLocal, + String bName) { + XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF); + Object toolkit = null; + + try { + toolkit = msf.createInstance("com.sun.star.awt.Toolkit"); + } catch (com.sun.star.uno.Exception e) { + e.printStackTrace(); + } + + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); + + shortWait(); + + AccessibilityTools at = new AccessibilityTools(); + + Object atw = tk.getActiveTopWindow(); + + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + XAccessible xRoot = at.getAccessibleObject(xWindow); + + XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot, + AccessibleRole.MENU_BAR); + XAccessibleSelection sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); + + for (int k = 0; k < indexes.length; k++) { + try { + sel.selectAccessibleChild(indexes[k]); + shortWait(); + ARoot = ARoot.getAccessibleChild(indexes[k]) + .getAccessibleContext(); + sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + } + + shortWait(); + + atw = tk.getActiveTopWindow(); + + xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + xRoot = at.getAccessibleObject(xWindow); + + //at.printAccessibleTree(new PrintWriter(System.out),xRoot); + + XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName)); + + try { + action.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + + shortWait(); + + atw = tk.getActiveTopWindow(); + + xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + xRoot = at.getAccessibleObject(xWindow); + + at.printAccessibleTree(new PrintWriter(System.out),xRoot); + + action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes")); + + try { + if (action != null) action.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + + shortWait(); + + XDesktop xDesktop = getDesktop(); + + XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); + + if (destroyLocal) { + closeDoc(xLocalDoc); + } + + return returnDoc; + } + + /** + * Sleeps for 2 sec. to allow StarOffice to react + */ + private void shortWait() { + try { + Thread.sleep(4000); + } catch (InterruptedException e) { + System.out.println("While waiting :" + e); + } + } + + /** creates an instance of com.sun.star.awt.Toolkit to query the XExtendedToolkit + * interface + * @return returns the gained XExtendedToolkit Interface + */ + public XExtendedToolkit getToolkit() { + Object toolkit = null; + + try { + toolkit = m_xMSF.createInstance("com.sun.star.awt.Toolkit"); + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't get toolkit"); + e.printStackTrace(); + } + + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); + + return tk; + } + + /** creates an instance of com.sun.star.frame.Desktop to query the XDesktop interface + * @return returns the gained XDesktop interface + */ + protected XDesktop getDesktop() { + Object desk = null; + + try { + desk = m_xMSF.createInstance("com.sun.star.frame.Desktop"); + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't get desktop"); + e.printStackTrace(); + } + + XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, desk); + + return xDesktop; + } +} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/DocHelper/makefile.mk b/sfx2/qa/complex/framework/DocHelper/makefile.mk new file mode 100644 index 000000000000..ad614cfca3f8 --- /dev/null +++ b/sfx2/qa/complex/framework/DocHelper/makefile.mk @@ -0,0 +1,49 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ = ../../../.. +TARGET = DocHelper +PRJNAME = $(TARGET) +PACKAGE = complex/framework/dochelper + +# --- Settings ----------------------------------------------------- +.INCLUDE: settings.mk + + +#----- compile .java files ----------------------------------------- + +JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +JAVAFILES = \ + DialogThread.java \ + WriterHelper.java + +JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:b).class) + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/sfx2/qa/complex/framework/DocumentMetaData.java b/sfx2/qa/complex/framework/DocumentMetaData.java new file mode 100644 index 000000000000..c94d2f64e768 --- /dev/null +++ b/sfx2/qa/complex/framework/DocumentMetaData.java @@ -0,0 +1,565 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.framework; + + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XComponentContext; +import com.sun.star.lang.XInitialization; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lang.Locale; +import com.sun.star.lang.EventObject; +import com.sun.star.util.Date; +import com.sun.star.util.DateTime; +import com.sun.star.util.Time; +import com.sun.star.util.Duration; +import com.sun.star.util.XModifyListener; +import com.sun.star.util.XModifyBroadcaster; +import com.sun.star.beans.XPropertyContainer; +import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.NamedValue; +import com.sun.star.beans.PropertyAttribute; +import com.sun.star.beans.UnknownPropertyException; +import com.sun.star.beans.IllegalTypeException; + +import com.sun.star.document.XDocumentProperties; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +/** + * Test case for the service com.sun.star.document.DocumentProperties. + * Currently, this service is implemented in + * sfx2/source/doc/SfxDocumentMetaData.cxx. + * + * @author mst + */ +public class DocumentMetaData +{ +// public String[] getTestMethodNames () { +// return new String[] { "check", "cleanup" }; +// } + + @After public void cleanup() { + // nothing to do + } + + // for testing modifications + class Listener implements XModifyListener { + private boolean m_Called; + + public Listener() { + m_Called = false; + } + + public boolean reset() { + boolean oldCalled = m_Called; + m_Called = false; + return oldCalled; + } + + public void modified(EventObject e) { + m_Called = true; + } + + public void disposing(EventObject e) { + } + } + + @Test public void check() { + try { + XMultiServiceFactory xMSF = getMSF(); + assertNotNull("could not create MultiServiceFactory.", xMSF); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF); + Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); + assertNotNull("could not get component context.", xContext); + + // TODO: Path to temp + String temp = util.utils.getOfficeTemp/*Dir*/(xMSF); + System.out.println("tempdir: " + temp); + + PropertyValue[] noArgs = { }; + PropertyValue mimetype = new PropertyValue(); + mimetype.Name = "MediaType"; + mimetype.Value = "application/vnd.oasis.opendocument.text"; + PropertyValue[] mimeArgs = { mimetype }; +// new Any("application/vnd.oasis.opendocument.text")) }; + PropertyValue cfile = new PropertyValue(); + cfile.Name = "URL"; + cfile.Value = temp + "EMPTY.odt"; + PropertyValue[] mimeEmptyArgs = { mimetype, cfile }; + + System.out.println("Creating service DocumentProperties..."); + + Object oDP = +// xMSF.createInstanceWithContext( +// "com.sun.star.document.DocumentProperties", xContext); + xMSF.createInstance("com.sun.star.document.DocumentProperties"); + XDocumentProperties xDP = UnoRuntime.queryInterface(XDocumentProperties.class, oDP); + + System.out.println("...done"); + + + System.out.println("Checking initialize ..."); + + XDocumentProperties xDP2 = UnoRuntime.queryInterface(XDocumentProperties.class, xMSF.createInstance("com.sun.star.document.DocumentProperties")); + XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xDP2); + xInit.initialize(new Object[] { }); + + System.out.println("...done"); + + System.out.println("Checking storing default-initialized meta data ..."); + +// xDP2.storeToMedium(temp + "EMPTY.odt", mimeArgs); + xDP2.storeToMedium("", mimeEmptyArgs); + + System.out.println("...done"); + + System.out.println("Checking loading default-initialized meta data ..."); + +// xDP2.loadFromMedium(temp + "EMPTY.odt", noArgs); + xDP2.loadFromMedium("", mimeEmptyArgs); + assertTrue ("Author", "".equals(xDP2.getAuthor())); + + System.out.println("...done"); + + System.out.println("(Not) Checking preservation of custom meta data ..."); + + xDP2.loadFromMedium(TestDocument.getUrl("CUSTOM.odt"), + noArgs); + assertTrue ("Author", "".equals(xDP2.getAuthor())); + xDP2.storeToMedium(temp + "CUSTOM.odt", mimeArgs); + + //FIXME: now what? comparing for binary equality seems useless + // we could unzip the written file and grep for the custom stuff + // but would that work on windows... + + System.out.println("...done"); + + System.out.println("Checking loading from test document..."); + + String file = TestDocument.getUrl("TEST.odt"); + xDP.loadFromMedium(file, noArgs); +/* XInputStream xStream = + new StreamSimulator("./testdocuments/TEST.odt", true, param); + Object oSF = + xMSF.createInstance("com.sun.star.embed.StorageFactory"); + XSingleServiceFactory xSF = (XSingleServiceFactory) + UnoRuntime.queryInterface(XSingleServiceFactory.class, oSF); + Object oStor = xSF.createInstanceWithArguments( + new Object[] { xStream }); + XStorage xStor = (XStorage) UnoRuntime.queryInterface( + XStorage.class, oStor); + xDP.loadFromStorage(xStor);*/ + + System.out.println("...done"); + + System.out.println("Checking meta-data import..."); + + assertTrue("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor())); + assertTrue("Generator", + "StarOffice/8$Solaris_x86 OpenOffice.org_project/680m232$Build-9227" + .equals(xDP.getGenerator())); + assertTrue("CreationDate", 2007 == xDP.getCreationDate().Year); + assertTrue("Title", "Urgent Memo".equals(xDP.getTitle())); + assertTrue("Subject", "Wichtige Mitteilung".equals(xDP.getSubject())); + assertTrue("Description", + "Modern internal company memorandum in full-blocked style" + .equals(xDP.getDescription())); +// assertTrue("Language", "".equals(xDP.getLanguage())); + assertTrue("ModifiedBy", + "Karl-Heinz Mustermann".equals(xDP.getModifiedBy())); + assertTrue("ModificationDate", 10 == xDP.getModificationDate().Month); + assertTrue("PrintedBy", + "Karl-Heinz Mustermann".equals(xDP.getPrintedBy())); + assertTrue("PrintDate", 29 == xDP.getPrintDate().Day); + assertTrue("TemplateName", + "Modern Memo".equals(xDP.getTemplateName())); + assertTrue("TemplateURL", + xDP.getTemplateURL().endsWith("memmodern.ott")); + assertTrue("TemplateDate", 17 == xDP.getTemplateDate().Hours); + assertTrue("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL())); + assertTrue("AutoloadSecs", 0 == xDP.getAutoloadSecs()); + assertTrue("DefaultTarget", "_blank".equals(xDP.getDefaultTarget())); + assertTrue("EditingCycles", 3 == xDP.getEditingCycles()); + assertTrue("EditingDuration", 320 == xDP.getEditingDuration()); + + String[] kws = xDP.getKeywords(); + assertTrue("Keywords", fromArray(kws).containsAll( + fromArray(new Object[] { "Asien", "Memo", "Reis" }))); + + NamedValue[] ds = xDP.getDocumentStatistics(); +/* for (int i = 0; i < ds.length; ++i) { + System.out.println("nv: " + ds[i].Name + " " + ds[i].Value); + } + NamedValue nv1 = new NamedValue("WordCount", new Integer(23)); + NamedValue nv2 = new NamedValue("WordCount", new Integer(23)); + System.out.println("eq: " + nv1.equals(nv2)); // grrr, this is false... +*/ + assertTrue("DocumentStatistics:WordCount", containsNV(ds, + new NamedValue("WordCount", new Integer(23)))); + assertTrue("DocumentStatistics:PageCount", containsNV(ds, + new NamedValue("PageCount", new Integer(1)))); + + XPropertyContainer udpc = xDP.getUserDefinedProperties(); + XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet.class, udpc); + assertTrue("UserDefined 1", "Dies ist ein wichtiger Hinweis" + .equals(udps.getPropertyValue("Hinweis"))); + assertTrue("UserDefined 2", ("Kann Spuren von N" + + new String(new byte[] { (byte) 0xc3, (byte) 0xbc }, "UTF-8") + + "ssen enthalten") + .equals(udps.getPropertyValue("Warnung"))); + + System.out.println("...done"); + + System.out.println("Checking meta-data updates..."); + + String str; + DateTime dt = new DateTime(); + Locale l = new Locale(); + int i; + + str = "me"; + xDP.setAuthor(str); + assertTrue("setAuthor", str.equals(xDP.getAuthor())); + str = "the computa"; + xDP.setGenerator(str); + assertTrue("setGenerator", str.equals(xDP.getGenerator())); + dt.Year = 2038; + dt.Month = 1; + dt.Day = 1; + xDP.setCreationDate(dt); + assertTrue("setCreationDate", dt.Year == xDP.getCreationDate().Year); + str = "El t'itulo"; + xDP.setTitle(str); + assertTrue("setTitle", str.equals(xDP.getTitle())); + str = "Ein verkommenes Subjekt"; + xDP.setSubject(str); + assertTrue("setSubject", str.equals(xDP.getSubject())); + str = "Este descripci'on no es importante"; + xDP.setDescription(str); + assertTrue("setDescription", str.equals(xDP.getDescription())); + l.Language = "en"; + l.Country = "GB"; + xDP.setLanguage(l); + Locale l2 = xDP.getLanguage(); + assertTrue("setLanguage Lang", l.Language.equals(l2.Language)); + assertTrue("setLanguage Cty", l.Country.equals(l2.Country)); + str = "myself"; + xDP.setModifiedBy(str); + assertTrue("setModifiedBy", str.equals(xDP.getModifiedBy())); + dt.Year = 2042; + xDP.setModificationDate(dt); + assertTrue("setModificationDate", + dt.Year == xDP.getModificationDate().Year); + str = "i didnt do it"; + xDP.setPrintedBy(str); + assertTrue("setPrintedBy", str.equals(xDP.getPrintedBy())); + dt.Year = 2024; + xDP.setPrintDate(dt); + assertTrue("setPrintDate", dt.Year == xDP.getPrintDate().Year); + str = "blah"; + xDP.setTemplateName(str); + assertTrue("setTemplateName", str.equals(xDP.getTemplateName())); + str = "gopher://some-hole-in-the-ground/"; + xDP.setTemplateURL(str); + assertTrue("setTemplateURL", str.equals(xDP.getTemplateURL())); + dt.Year = 2043; + xDP.setTemplateDate(dt); + assertTrue("setTemplateDate", dt.Year == xDP.getTemplateDate().Year); + str = "http://nowhere/"; + xDP.setAutoloadURL(str); + assertTrue("setAutoloadURL", str.equals(xDP.getAutoloadURL())); + i = 3661; // this might not work (due to conversion via double...) + xDP.setAutoloadSecs(i); +// System.out.println("set: " + i + " get: " + xDP.getAutoloadSecs()); + assertTrue("setAutoloadSecs", i == xDP.getAutoloadSecs()); + str = "_blank"; + xDP.setDefaultTarget(str); + assertTrue("setDefaultTarget", str.equals(xDP.getDefaultTarget())); + i = 42; + xDP.setEditingCycles((short) i); + assertTrue("setEditingCycles", i == xDP.getEditingCycles()); + i = 84; + xDP.setEditingDuration(i); + assertTrue("setEditingDuration", i == xDP.getEditingDuration()); + str = ""; + + String[] kws2 = new String[] { + "keywordly", "keywordlike", "keywordalicious" }; + xDP.setKeywords(kws2); + kws = xDP.getKeywords(); + assertTrue("setKeywords", fromArray(kws).containsAll(fromArray(kws2))); + + NamedValue[] ds2 = new NamedValue[] { + new NamedValue("SyllableCount", new Integer(9)), + new NamedValue("FrameCount", new Integer(2)), + new NamedValue("SentenceCount", new Integer(7)) }; + xDP.setDocumentStatistics(ds2); + ds = xDP.getDocumentStatistics(); + assertTrue("setDocumentStatistics:SyllableCount", containsNV(ds, + new NamedValue("SyllableCount", new Integer(9)))); + assertTrue("setDocumentStatistics:FrameCount", containsNV(ds, + new NamedValue("FrameCount", new Integer(2)))); + assertTrue("setDocumentStatistics:SentenceCount", containsNV(ds, + new NamedValue("SentenceCount", new Integer(7)))); + + System.out.println("...done"); + + System.out.println("Checking user-defined meta-data updates..."); + + // actually, this tests the PropertyBag service + // but maybe the DocumentProperties service will be implemented + // differently some day... + boolean b = true; + double d = 3.1415; + // note that Time is only supported for backward compatibilty! + Time t = new Time(); + t.Hours = 1; + t.Minutes = 16; + Date date = new Date(); + date.Year = 2071; + date.Month = 2; + date.Day = 3; + dt.Year = 2065; + Duration dur = new Duration(); + dur.Negative = true; + dur.Years = 1001; + dur.Months = 999; + dur.Days = 888; + dur.Hours = 777; + dur.Minutes = 666; + dur.Seconds = 555; + dur.MilliSeconds = 444; + + udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, + new Boolean(b)); + udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur); + udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t); + udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date); + udpc.addProperty("FrobStartTime", PropertyAttribute.REMOVEABLE, dt); + udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); + udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); + udpc.addProperty("Removed", PropertyAttribute.REMOVEABLE, "bar"); + // #i94175#: empty property name is valid ODF 1.1 + udpc.addProperty("", PropertyAttribute.REMOVEABLE, "eeeeek"); + try { + udpc.removeProperty("Info 1"); + udpc.removeProperty("Removed"); + } catch (UnknownPropertyException e) { + fail("removeProperty failed"); + } + + try { + udpc.addProperty("Forbidden", PropertyAttribute.REMOVEABLE, + new String[] { "foo", "bar" }); + fail("inserting value of non-supported type did not fail"); + } catch (IllegalTypeException e) { + // ignore + } + + assertTrue("UserDefined bool", new Boolean(b).equals( + udps.getPropertyValue("Frobnicate"))); + assertTrue("UserDefined duration", eqDuration(dur, (Duration) + udps.getPropertyValue("FrobDuration"))); + assertTrue("UserDefined time", eqTime(t, (Time) + udps.getPropertyValue("FrobDuration2"))); + assertTrue("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) + udps.getPropertyValue("FrobStartTime"))); + assertTrue("UserDefined float", new Double(d).equals( + udps.getPropertyValue("Pi"))); + assertTrue("UserDefined string", "bar".equals( + udps.getPropertyValue("Foo"))); + assertTrue("UserDefined empty name", "eeeeek".equals( + udps.getPropertyValue(""))); + + try { + udps.getPropertyValue("Removed"); + fail("UserDefined remove didn't"); + } catch (UnknownPropertyException e) { + // ok + } + + System.out.println("...done"); + + System.out.println("Checking storing meta-data to file..."); + + xDP.storeToMedium(temp + "TEST.odt", mimeArgs); + + System.out.println("...done"); + + System.out.println("Checking loading meta-data from stored file..."); + + xDP.loadFromMedium(temp + "TEST.odt", noArgs); + + System.out.println("...done"); + + System.out.println("Checking user-defined meta-data from stored file..."); + + udpc = xDP.getUserDefinedProperties(); + udps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet.class, udpc); + + assertTrue("UserDefined bool", new Boolean(b).equals( + udps.getPropertyValue("Frobnicate"))); + assertTrue("UserDefined duration", eqDuration(dur, (Duration) + udps.getPropertyValue("FrobDuration"))); + // this is now a Duration! + Duration t_dur = new Duration(false, (short)0, (short)0, (short)0, + t.Hours, t.Minutes, t.Seconds, + (short)(10 * t.HundredthSeconds)); + assertTrue("UserDefined time", eqDuration(t_dur, (Duration) + udps.getPropertyValue("FrobDuration2"))); + assertTrue("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) + udps.getPropertyValue("FrobStartTime"))); + assertTrue("UserDefined float", new Double(d).equals( + udps.getPropertyValue("Pi"))); + assertTrue("UserDefined string", "bar".equals( + udps.getPropertyValue("Foo"))); + + try { + udps.getPropertyValue("Removed"); + fail("UserDefined remove didn't"); + } catch (UnknownPropertyException e) { + // ok + } + + System.out.println("...done"); + + System.out.println("Checking notification listener interface..."); + + Listener listener = new Listener(); + XModifyBroadcaster xMB = (XModifyBroadcaster) + UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP); + xMB.addModifyListener(listener); + xDP.setAuthor("not me"); + assertTrue("Listener Author", listener.reset()); + udpc.addProperty("Listener", PropertyAttribute.REMOVEABLE, "foo"); + assertTrue("Listener UserDefined Add", listener.reset()); + udps.setPropertyValue("Listener", "bar"); + assertTrue("Listener UserDefined Set", listener.reset()); + udpc.removeProperty("Listener"); + assertTrue("Listener UserDefined Remove", listener.reset()); + xMB.removeModifyListener(listener); + udpc.addProperty("Listener2", PropertyAttribute.REMOVEABLE, "foo"); + assertTrue("Removed Listener UserDefined Add", !listener.reset()); + + System.out.println("...done"); + + } catch (Exception e) { + report(e); + } + } + + // grrr... + boolean eqDateTime(DateTime a, DateTime b) { + return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day + && a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.HundredthSeconds == b.HundredthSeconds; + } + + boolean eqDate(Date a, Date b) { + return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day; + } + + boolean eqTime(Time a, Time b) { + return a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.HundredthSeconds == b.HundredthSeconds; + } + + boolean eqDuration(Duration a, Duration b) { + return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days + && a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.MilliSeconds == b.MilliSeconds + && a.Negative == b.Negative; + } + + java.util.Collection fromArray(Object[] os) { + java.util.Collection ret = new java.util.HashSet(); + for (int i = 0; i < os.length; ++i) { + ret.add(os[i]); + } + return ret; + } + + // bah, structs do not have proper equals(), and uno.Type is not comparable + public static boolean containsNV (NamedValue[] nvs, NamedValue nv) { + for (int i = 0; i < nvs.length; ++i) { + if (nvs[i].Name.equals(nv.Name) && nvs[i].Value.equals(nv.Value)) { + return true; + } + } + return false; + } + + public void report(Exception e) { + System.out.println("Exception occurred:"); + e.printStackTrace(); + fail(); + } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection() DocumentMetaData"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + +} + diff --git a/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java new file mode 100644 index 000000000000..0ebbbc25da59 --- /dev/null +++ b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java @@ -0,0 +1,1293 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.framework; + +// import complexlib.ComplexTestCase; +import helper.StreamSimulator; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XComponentContext; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lang.XComponent; + +import com.sun.star.lang.XServiceInfo; +import com.sun.star.lang.IllegalArgumentException; +import com.sun.star.lang.WrappedTargetException; +import com.sun.star.lang.WrappedTargetRuntimeException; +import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.Pair; +import com.sun.star.beans.StringPair; +import com.sun.star.container.XEnumerationAccess; +import com.sun.star.container.XEnumeration; +import com.sun.star.io.XInputStream; +import com.sun.star.util.XCloseable; +import com.sun.star.frame.XStorable; +import com.sun.star.text.XTextDocument; +import com.sun.star.text.XTextRange; +import com.sun.star.text.XText; +import com.sun.star.rdf.*; +import lib.TestParameters; + + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +/** + * Test case for interface com.sun.star.rdf.XDocumentMetadataAccess + * Currently, this service is implemented in + * sfx2/source/doc/DocumentMetadataAccess.cxx + * + * Actually, this is not a service, so we need to create a document and + * go from there... + * + * @author mst + */ +public class DocumentMetadataAccessTest +{ + XMultiServiceFactory xMSF; + XComponentContext xContext; + String tempDir; + + String nsRDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + String nsRDFS = "http://www.w3.org/2000/01/rdf-schema#"; + String nsPkg="http://docs.oasis-open.org/opendocument/meta/package/common#"; + String nsODF ="http://docs.oasis-open.org/opendocument/meta/package/odf#"; + + XURI foo; + XURI bar; + XURI baz; + + static XURI rdf_type; + static XURI rdfs_label; + static XURI pkg_Document; + static XURI pkg_hasPart; + static XURI pkg_MetadataFile; + static XURI odf_ContentFile; + static XURI odf_StylesFile; + static XURI odf_Element; + static XBlankNode blank1; + static XBlankNode blank2; + static XBlankNode blank3; + static XBlankNode blank4; + static String manifestPath = "manifest.rdf"; + static String contentPath = "content.xml"; + static String stylesPath = "styles.xml"; + static String fooPath = "foo.rdf"; + static String fooBarPath = "meta/foo/bar.rdf"; + + XRepository xRep; + XRepositorySupplier xRS; + XDocumentMetadataAccess xDMA; + +// public String[] getTestMethodNames () +// { +// return new String[] { "check", "checkRDFa" }; +// } + /** + * The test parameters + */ + private static TestParameters param = null; + + @Before public void before() + { + try { + + xMSF = getMSF(); + param = new TestParameters(); + param.put("ServiceFactory", xMSF); // important for param.getMSF() + + assertNotNull("could not create MultiServiceFactory.", xMSF); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF); + Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); + xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); + assertNotNull("could not get component context.", xContext); + + tempDir = util.utils.getOfficeTemp/*Dir*/(xMSF); + System.out.println("tempdir: " + tempDir); + + foo = URI.create(xContext, "uri:foo"); + assertNotNull("foo", foo); + bar = URI.create(xContext, "uri:bar"); + assertNotNull("bar", bar); + baz = URI.create(xContext, "uri:baz"); + assertNotNull("baz", baz); + + blank1 = BlankNode.create(xContext, "_:1"); + assertNotNull("blank1", blank1); + blank2 = BlankNode.create(xContext, "_:2"); + assertNotNull("blank2", blank2); + blank3 = BlankNode.create(xContext, "_:3"); + assertNotNull("blank3", blank3); + blank4 = BlankNode.create(xContext, "_:4"); + assertNotNull("blank4", blank4); + rdf_type = URI.createKnown(xContext, URIs.RDF_TYPE); + assertNotNull("rdf_type", rdf_type); + rdfs_label = URI.createKnown(xContext, URIs.RDFS_LABEL); + assertNotNull("rdfs_label", rdfs_label); + pkg_Document = URI.createKnown(xContext, URIs.PKG_DOCUMENT); + assertNotNull("pkg_Document", pkg_Document); + pkg_hasPart = URI.createKnown(xContext, URIs.PKG_HASPART); + assertNotNull("pkg_hasPart", pkg_hasPart); + pkg_MetadataFile = URI.createKnown(xContext, URIs.PKG_METADATAFILE); + assertNotNull("pkg_MetadataFile", pkg_MetadataFile); + odf_ContentFile = URI.createKnown(xContext, URIs.ODF_CONTENTFILE); + assertNotNull("odf_ContentFile", odf_ContentFile); + odf_StylesFile = URI.createKnown(xContext, URIs.ODF_STYLESFILE); + assertNotNull("odf_StylesFile", odf_StylesFile); + odf_Element = URI.createKnown(xContext, URIs.ODF_ELEMENT); + assertNotNull("odf_Element", odf_Element); + + } catch (Exception e) { + report(e); + } + } + + @After public void after() + { + xRep = null; + xRS = null; + xDMA = null; + } + + @Test public void check() + { + XComponent xComp = null; + XComponent xComp2 = null; + try { + XEnumeration xStmtsEnum; + XNamedGraph xManifest; + + System.out.println("Creating document with Repository..."); + + // we cannot create a XDMA directly, we must create + // a document and get it from there :( + // create document + PropertyValue[] loadProps = new PropertyValue[1]; + loadProps[0] = new PropertyValue(); + loadProps[0].Name = "Hidden"; + loadProps[0].Value = new Boolean(true); + xComp = util.DesktopTools.openNewDoc(xMSF, "swriter", loadProps); + XTextDocument xText = UnoRuntime.queryInterface(XTextDocument.class, xComp); + + XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); + assertNotNull("xRS null", xRS); + XDocumentMetadataAccess xDMA = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xRS); + assertNotNull("xDMA null", xDMA); + xRep = xRS.getRDFRepository(); + assertNotNull("xRep null", xRep); + + System.out.println("...done"); + + System.out.println("Checking that new repository is initialized..."); + + XURI xBaseURI = (XURI) xDMA; + String baseURI = xBaseURI.getStringValue(); + assertNotNull("new: baseURI", xBaseURI ); + assertTrue("new: baseURI", !xBaseURI.getStringValue().equals("")); + + assertTrue("new: # graphs", 1 == xRep.getGraphNames().length); + XURI manifest = URI.createNS(xContext, xBaseURI.getStringValue(), + manifestPath); + xManifest = xRep.getGraph(manifest); + assertTrue("new: manifest graph", null != xManifest); + + Statement[] manifestStmts = getManifestStmts(xBaseURI); + xStmtsEnum = xRep.getStatements(null, null, null); + assertTrue("new: manifest graph", eq(xStmtsEnum, manifestStmts)); + + System.out.println("...done"); + + System.out.println("Checking some invalid args..."); + + String content = "behold, for i am the content."; + XTextRange xTR = new TestRange(content); + XMetadatable xM = (XMetadatable) xTR; + + try { + xDMA.getElementByURI(null); + fail("getElementByURI: null allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.getMetadataGraphsWithType(null); + fail("getMetadataGraphsWithType: null URI allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("", new XURI[0]); + fail("addMetadataFile: empty filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("/foo", new XURI[0]); + fail("addMetadataFile: absolute filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("fo\"o", new XURI[0]); + fail("addMetadataFile: invalid filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("../foo", new XURI[0]); + fail("addMetadataFile: filename with .. allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("foo/../../bar", new XURI[0]); + fail("addMetadataFile: filename with nest .. allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("foo/././bar", new XURI[0]); + fail("addMetadataFile: filename with nest . allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("content.xml", new XURI[0]); + fail("addMetadataFile: content.xml allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("styles.xml", new XURI[0]); + fail("addMetadataFile: styles.xml allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("meta.xml", new XURI[0]); + fail("addMetadataFile: meta.xml allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addMetadataFile("settings.xml", new XURI[0]); + fail("addMetadataFile: settings.xml allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.importMetadataFile(FileFormat.RDF_XML, null, "foo", + foo, new XURI[0]); + fail("importMetadataFile: null stream allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + + final String sEmptyRDF = TestDocument.getUrl("empty.rdf"); + try { + XInputStream xFooIn = new StreamSimulator(sEmptyRDF, true, param); + xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "", + foo, new XURI[0]); + fail("importMetadataFile: empty filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + XInputStream xFooIn = + new StreamSimulator(sEmptyRDF, true, param); + xDMA.importMetadataFile(FileFormat.RDF_XML, xFooIn, "meta.xml", + foo, new XURI[0]); + fail("importMetadataFile: meta.xml filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + XInputStream xFooIn = + new StreamSimulator(sEmptyRDF, true, param); + xDMA.importMetadataFile(FileFormat.RDF_XML, + xFooIn, "foo", null, new XURI[0]); + fail("importMetadataFile: null base URI allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + XInputStream xFooIn = + new StreamSimulator(sEmptyRDF, true, param); + xDMA.importMetadataFile(FileFormat.RDF_XML, + xFooIn, "foo", rdf_type, new XURI[0]); + fail("importMetadataFile: non-absolute base URI allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.removeMetadataFile(null); + fail("removeMetadataFile: null URI allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addContentOrStylesFile(""); + fail("addContentOrStylesFile: empty filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addContentOrStylesFile("/content.xml"); + fail("addContentOrStylesFile: absolute filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.addContentOrStylesFile("foo.rdf"); + fail("addContentOrStylesFile: invalid filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.removeContentOrStylesFile(""); + fail("removeContentOrStylesFile: empty filename allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.loadMetadataFromStorage(null, foo, null); + fail("loadMetadataFromStorage: null storage allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.storeMetadataToStorage(null/*, base*/); + fail("storeMetadataToStorage: null storage allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.loadMetadataFromMedium(new PropertyValue[0]); + fail("loadMetadataFromMedium: empty medium allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + try { + xDMA.storeMetadataToMedium(new PropertyValue[0]); + fail("storeMetadataToMedium: empty medium allowed"); + } catch (IllegalArgumentException e) { + // ignore + } + + System.out.println("...done"); + + System.out.println("Checking file addition/removal..."); + + xDMA.removeContentOrStylesFile(contentPath); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("removeContentOrStylesFile (content)", + eq(xStmtsEnum, new Statement[] { + manifestStmts[0], manifestStmts[2], manifestStmts[4] + })); + + xDMA.addContentOrStylesFile(contentPath); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("addContentOrStylesFile (content)", + eq(xStmtsEnum, manifestStmts)); + + xDMA.removeContentOrStylesFile(stylesPath); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("removeContentOrStylesFile (styles)", + eq(xStmtsEnum, new Statement[] { + manifestStmts[0], manifestStmts[1], manifestStmts[3] + })); + + xDMA.addContentOrStylesFile(stylesPath); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("addContentOrStylesFile (styles)", + eq(xStmtsEnum, manifestStmts)); + + XURI xFoo = URI.createNS(xContext, xBaseURI.getStringValue(), + fooPath); + Statement xM_BaseHaspartFoo = + new Statement(xBaseURI, pkg_hasPart, xFoo, manifest); + Statement xM_FooTypeMetadata = + new Statement(xFoo, rdf_type, pkg_MetadataFile, manifest); + Statement xM_FooTypeBar = + new Statement(xFoo, rdf_type, bar, manifest); + xDMA.addMetadataFile(fooPath, new XURI[] { bar }); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("addMetadataFile", + eq(xStmtsEnum, merge(manifestStmts, new Statement[] { + xM_BaseHaspartFoo, xM_FooTypeMetadata, xM_FooTypeBar + }))); + + XURI[] graphsBar = xDMA.getMetadataGraphsWithType(bar); + assertTrue("getMetadataGraphsWithType", + graphsBar.length == 1 && eq(graphsBar[0], xFoo)); + + + xDMA.removeMetadataFile(xFoo); + xStmtsEnum = xManifest.getStatements(null, null, null); + assertTrue("removeMetadataFile", + eq(xStmtsEnum, manifestStmts)); + + System.out.println("...done"); + + System.out.println("Checking mapping..."); + + XEnumerationAccess xTextEnum = UnoRuntime.queryInterface(XEnumerationAccess.class, xText.getText()); + Object o = xTextEnum.createEnumeration().nextElement(); + XMetadatable xMeta1 = UnoRuntime.queryInterface(XMetadatable.class, o); + + XURI uri; + XMetadatable xMeta; + xMeta = xDMA.getElementByURI(xMeta1); + assertTrue("getElementByURI: null", null != xMeta); + String XmlId = xMeta.getMetadataReference().Second; + String XmlId1 = xMeta1.getMetadataReference().Second; + assertTrue("getElementByURI: no xml id", !XmlId.equals("")); + assertTrue("getElementByURI: different xml id", XmlId.equals(XmlId1)); + + System.out.println("...done"); + + System.out.println("Checking storing and loading..."); + + XURI xFoobar = URI.createNS(xContext, xBaseURI.getStringValue(), + fooBarPath); + Statement[] metadataStmts = getMetadataFileStmts(xBaseURI, + fooBarPath); + xDMA.addMetadataFile(fooBarPath, new XURI[0]); + xStmtsEnum = xRep.getStatements(null, null, null); + assertTrue("addMetadataFile", + eq(xStmtsEnum, merge(manifestStmts, metadataStmts ))); + + Statement xFoobar_FooBarFoo = + new Statement(foo, bar, foo, xFoobar); + xRep.getGraph(xFoobar).addStatement(foo, bar, foo); + xStmtsEnum = xRep.getStatements(null, null, null); + assertTrue("addStatement", + eq(xStmtsEnum, merge(manifestStmts, merge(metadataStmts, + new Statement[] { xFoobar_FooBarFoo })))); + + PropertyValue noMDNoContentFile = new PropertyValue(); + noMDNoContentFile.Name = "URL"; + noMDNoContentFile.Value = TestDocument.getUrl("CUSTOM.odt"); + PropertyValue noMDFile = new PropertyValue(); + noMDFile.Name = "URL"; + noMDFile.Value = TestDocument.getUrl("TEST.odt"); + PropertyValue file = new PropertyValue(); + file.Name = "URL"; + file.Value = tempDir + "TESTDMA.odt"; + /* + PropertyValue baseURL = new PropertyValue(); + baseURL.Name = "DocumentBaseURL"; + baseURL.Value = tempDir + "TMP.odt"; + */ + PropertyValue mimetype = new PropertyValue(); + mimetype.Name = "MediaType"; + mimetype.Value = "application/vnd.oasis.opendocument.text"; + PropertyValue[] argsEmptyNoContent = { mimetype, noMDNoContentFile}; + PropertyValue[] argsEmpty = { mimetype, noMDFile }; + PropertyValue[] args = { mimetype, file }; + + xStmtsEnum = xRep.getStatements(null, null, null); + XURI[] graphs = xRep.getGraphNames(); + + xDMA.storeMetadataToMedium(args); + + // this should re-init + xDMA.loadMetadataFromMedium(argsEmptyNoContent); + xRep = xRS.getRDFRepository(); + assertTrue("xRep null", null != xRep); + assertTrue("baseURI still tdoc?", + !baseURI.equals(xDMA.getStringValue())); + Statement[] manifestStmts2 = getManifestStmts((XURI) xDMA); + xStmtsEnum = xRep.getStatements(null, null, null); + // there is no content or styles file in here, so we have just + // the package stmt + assertTrue("loadMetadataFromMedium (no metadata, no content)", + eq(xStmtsEnum, new Statement[] { manifestStmts2[0] })); + + // this should re-init + xDMA.loadMetadataFromMedium(argsEmpty); + xRep = xRS.getRDFRepository(); + assertTrue("xRep null", null != xRep); + assertTrue("baseURI still tdoc?", + !baseURI.equals(xDMA.getStringValue())); + Statement[] manifestStmts3 = getManifestStmts((XURI) xDMA); + + xStmtsEnum = xRep.getStatements(null, null, null); + assertTrue("loadMetadataFromMedium (no metadata)", + eq(xStmtsEnum, manifestStmts3)); + + xDMA.loadMetadataFromMedium(args); + xRep = xRS.getRDFRepository(); + assertTrue("xRep null", null != xRep); + Statement[] manifestStmts4 = getManifestStmts((XURI) xDMA); + Statement[] metadataStmts4 = getMetadataFileStmts((XURI) xDMA, + fooBarPath); + + xStmtsEnum = xRep.getStatements(null, null, null); + assertTrue("some graph(s) not reloaded", + graphs.length == xRep.getGraphNames().length); + + XURI xFoobar4 = URI.createNS(xContext, xDMA.getStringValue(), + fooBarPath); + Statement xFoobar_FooBarFoo4 = + new Statement(foo, bar, foo, xFoobar4); + assertTrue("loadMetadataFromMedium (re-load)", + eq(xStmtsEnum, merge(manifestStmts4, merge(metadataStmts4, + new Statement[] { xFoobar_FooBarFoo4 })))); + + System.out.println("...done"); + + System.out.println("Checking storing and loading via model..."); + + String f = tempDir + "TESTPARA.odt"; + + XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xRS); + + xStor.storeToURL(f, new PropertyValue[0]); + + xComp2 = util.DesktopTools.loadDoc(xMSF, f, loadProps); + + XDocumentMetadataAccess xDMA2 = UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xComp2); + assertTrue("xDMA2 null", null != xDMA2); + + XRepositorySupplier xRS2 = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp2); + assertTrue("xRS2 null", null != xRS2); + + XRepository xRep2 = xRS2.getRDFRepository(); + assertTrue("xRep2 null", null != xRep2); + + Statement[] manifestStmts5 = getManifestStmts((XURI) xDMA2); + Statement[] metadataStmts5 = getMetadataFileStmts((XURI) xDMA2, + fooBarPath); + XURI xFoobar5 = URI.createNS(xContext, xDMA2.getStringValue(), + fooBarPath); + Statement xFoobar_FooBarFoo5 = + new Statement(foo, bar, foo, xFoobar5); + xStmtsEnum = xRep.getStatements(null, null, null); + XEnumeration xStmtsEnum2 = xRep2.getStatements(null, null, null); + assertTrue("load: repository differs", + eq(xStmtsEnum2, merge(manifestStmts5, merge(metadataStmts5, + new Statement[] { xFoobar_FooBarFoo5 })))); + + System.out.println("...done"); + + } catch (Exception e) { + report(e); + } finally { + close(xComp); + close(xComp2); + } + } + + @Test public void checkRDFa() + { + XComponent xComp = null; + try { + final String file = TestDocument.getUrl("TESTRDFA.odt"); + xComp = loadRDFa(file); + if (xComp != null) + { + final String sNewFile = tempDir + "TESTRDFA.odt"; + storeRDFa(xComp, sNewFile); + close(xComp); + + xComp = loadRDFa(sNewFile); + } + } finally { + close(xComp); + } + } + + private void storeRDFa(XComponent xComp, String file) + { + try { + + System.out.println("Storing test document..."); + + XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xComp); + + xStor.storeToURL(file, new PropertyValue[0]); + + System.out.println("...done"); + + } catch (Exception e) { + report(e); + } + } + + private XComponent loadRDFa(String file) + { + XComponent xComp = null; + try { + + System.out.println("Loading test document..."); + + PropertyValue[] loadProps = new PropertyValue[1]; + loadProps[0] = new PropertyValue(); + loadProps[0].Name = "Hidden"; + loadProps[0].Value = new Boolean(true); + + + + xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps); + + XRepositorySupplier xRS = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); + assertTrue("xRS null", null != xRS); + + XDocumentRepository xRep = UnoRuntime.queryInterface(XDocumentRepository.class, xRS.getRDFRepository()); + assertTrue("xRep null", null != xRep); + + XTextDocument xTextDoc = UnoRuntime.queryInterface(XTextDocument.class, xComp); + + XText xText = xTextDoc.getText(); + + XEnumerationAccess xEA = UnoRuntime.queryInterface(XEnumerationAccess.class, xText); + XEnumeration xEnum = xEA.createEnumeration(); + + System.out.println("...done"); + + System.out.println("Checking RDFa in loaded test document..."); + + XMetadatable xPara; + Pair result; + + Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 1", + !result.Second && + eq(result.First, new Statement[] { + x_FooBarLit1 + })); + + Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 2", + !result.Second && + eq(result.First, new Statement[] { + x_FooBarLit2 + })); + + Statement x_BlankBarLit3 = + new Statement(blank1, bar, mkLit("3"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 3", + !result.Second && + eq(result.First, new Statement[] { + x_BlankBarLit3 + })); + XBlankNode b3 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); + + Statement x_BlankBarLit4 = + new Statement(blank2, bar, mkLit("4"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 4", + !result.Second && + eq(result.First, new Statement[] { + x_BlankBarLit4 + })); + XBlankNode b4 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); + + Statement x_BlankBarLit5 = + new Statement(blank1, bar, mkLit("5"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 5", + !result.Second && + eq(result.First, new Statement[] { + x_BlankBarLit5 + })); + XBlankNode b5 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); + + assertTrue("RDFa: 3 != 4", + !b3.getStringValue().equals(b4.getStringValue())); + assertTrue("RDFa: 3 == 5", + b3.getStringValue().equals(b5.getStringValue())); + + Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null); + Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 6", + !result.Second && + eq(result.First, new Statement[] { + x_FooBarLit6, x_FooBazLit6 + })); + + Statement x_FooBarLit7 = new Statement(foo, bar, mkLit("7"), null); + Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null); + Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 7", + !result.Second && + eq(result.First, new Statement[] { + x_FooBarLit7, x_FooBazLit7, x_FooFooLit7 + })); + + XNode lit = mkLit("a fooish bar"); + XNode lit_type= mkLit("a fooish bar", bar); + Statement x_FooBarLit = new Statement(foo, bar, lit, null); + Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 8", + result.Second && + eq(result.First, new Statement[] { + x_FooBarLit + })); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 9", + result.Second && + eq(result.First, new Statement[] { + x_FooBarLit + })); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 10", + result.Second && + eq(result.First, new Statement[] { + x_FooBarLittype + })); + + Statement x_FooBarLit11 + = new Statement(foo, bar, mkLit("11", bar), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 11", + !result.Second && + eq(result.First, new Statement[] { + x_FooBarLit11 + })); + +// differ in file names, which is right in the new test environment +// XURI xFile = URI.createNS(xContext, file, "/" + contentPath); +// Statement x_FileBarLit12 = +// new Statement(xFile, bar, mkLit("12"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); +// result = xRep.getStatementRDFa(xPara); +// assertTrue("RDFa: 12", +// !result.Second && +// eq(result.First, new Statement[] { +// x_FileBarLit12 +// })); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 13", + result.Second && + eq(result.First, new Statement[] { + x_FooBarLit + })); + + Statement x_FooLabelLit14 = + new Statement(foo, rdfs_label, mkLit("14"), null); + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 14", + result.Second && + eq(result.First, new Statement[] { + /* x_FooLabelLit14 */ x_FooBarLit + })); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 15", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 16", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 17", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 18", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 19", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface( + XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 20", eq(result.First, new Statement[] { } )); + + xPara = UnoRuntime.queryInterface( + XMetadatable.class, xEnum.nextElement()); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 21", eq(result.First, new Statement[] { } )); + + System.out.println("...done"); + + } catch (Exception e) { + report(e); + close(xComp); + } + return xComp; + } + + +// utilities ------------------------------------------------------------- + + public void report2(Exception e) + { + if (e instanceof WrappedTargetException) + { + System.out.println("Cause:"); + Exception cause = (Exception) + (((WrappedTargetException)e).TargetException); + System.out.println(cause.toString()); + report2(cause); + } else if (e instanceof WrappedTargetRuntimeException) { + System.out.println("Cause:"); + Exception cause = (Exception) + (((WrappedTargetRuntimeException)e).TargetException); + System.out.println(cause.toString()); + report2(cause); + } + } + + public void report(Exception e) { + System.out.println("Exception occurred:"); + e.printStackTrace(); + report2(e); + fail(); + } + + static void close(XComponent i_comp) + { + try { + XCloseable xClos = UnoRuntime.queryInterface(XCloseable.class, i_comp); + if (xClos != null) + { + xClos.close(true); + } + } catch (Exception e) { + } + } + + XLiteral mkLit(String i_content) + { + return Literal.create(xContext, i_content); + } + + XLiteral mkLit(String i_content, XURI i_uri) + { + return Literal.createWithType(xContext, i_content, i_uri); + } + + static Statement[] merge(Statement[] i_A1, Statement[] i_A2) + { + // bah, java sucks... + Statement[] ret = new Statement[i_A1.length + i_A2.length]; + for (int i = 0; i < i_A1.length; ++i) { + ret[i] = i_A1[i]; + } + for (int i = 0; i < i_A2.length; ++i) { + ret[i+i_A1.length] = i_A2[i]; + } + return ret; + } + + public static String toS(XNode n) { + if (null == n) + { + return "< null >"; + } + return n.getStringValue(); + } + + static boolean isBlank(XNode i_node) + { + XBlankNode blank = UnoRuntime.queryInterface(XBlankNode.class, i_node); + return blank != null; + } + +/* + static class Statement implements XStatement + { + XResource m_Subject; + XResource m_Predicate; + XNode m_Object; + XURI m_Graph; + + Statement(XResource i_Subject, XResource i_Predicate, XNode i_Object, + XURI i_Graph) + { + m_Subject = i_Subject; + m_Predicate = i_Predicate; + m_Object = i_Object; + m_Graph = i_Graph; + } + + public XResource getSubject() { return m_Subject; } + public XResource getPredicate() { return m_Predicate; } + public XNode getObject() { return m_Object; } + public XURI getGraph() { return m_Graph; } + } +*/ + + static Statement[] toSeq(XEnumeration i_Enum) throws Exception + { + java.util.Collection c = new java.util.Vector(); + while (i_Enum.hasMoreElements()) { + Statement s = (Statement) i_Enum.nextElement(); +//System.out.println("toSeq: " + s.getSubject().getStringValue() + " " + s.getPredicate().getStringValue() + " " + s.getObject().getStringValue() + "."); + c.add(s); + } +// return (Statement[]) c.toArray(); + // java sucks + Object[] arr = c.toArray(); + Statement[] ret = new Statement[arr.length]; + for (int i = 0; i < arr.length; ++i) { + ret[i] = (Statement) arr[i]; + } + return ret; + } + + static XNode[][] toSeqs(XEnumeration i_Enum) throws Exception + { + java.util.Collection c = new java.util.Vector(); + while (i_Enum.hasMoreElements()) { + XNode[] s = (XNode[]) i_Enum.nextElement(); + c.add(s); + } +// return (XNode[][]) c.toArray(); + Object[] arr = c.toArray(); + XNode[][] ret = new XNode[arr.length][]; + for (int i = 0; i < arr.length; ++i) { + ret[i] = (XNode[]) arr[i]; + } + return ret; + } + + static class BindingComp implements java.util.Comparator + { + public int compare(Object i_Left, Object i_Right) + { + XNode[] left = (XNode[]) i_Left; + XNode[] right = (XNode[]) i_Right; + if (left.length != right.length) + { + throw new RuntimeException(); + } + for (int i = 0; i < left.length; ++i) { + int eq = (left[i].getStringValue().compareTo( + right[i].getStringValue())); + if (eq != 0) + { + return eq; + } + } + return 0; + } + } + + static class StmtComp implements java.util.Comparator + { + public int compare(Object i_Left, Object i_Right) + { + int eq; + Statement left = (Statement) i_Left; + Statement right = (Statement) i_Right; + if ((eq = cmp(left.Graph, right.Graph )) != 0) return eq; + if ((eq = cmp(left.Subject, right.Subject )) != 0) return eq; + if ((eq = cmp(left.Predicate, right.Predicate)) != 0) return eq; + if ((eq = cmp(left.Object, right.Object )) != 0) return eq; + return 0; + } + + public int cmp(XNode i_Left, XNode i_Right) + { + if (isBlank(i_Left)) { + return isBlank(i_Right) ? 0 : 1; + } else { + if (isBlank(i_Right)) { + return -1; + } else { + return toS(i_Left).compareTo(toS(i_Right)); + } + } + } + } + + static boolean eq(Statement i_Left, Statement i_Right) + { + XURI lG = i_Left.Graph; + XURI rG = i_Right.Graph; + if (!eq(lG, rG)) { + System.out.println("Graphs differ: " + toS(lG) + " != " + toS(rG)); + return false; + } + if (!eq(i_Left.Subject, i_Right.Subject)) { + System.out.println("Subjects differ: " + + i_Left.Subject.getStringValue() + " != " + + i_Right.Subject.getStringValue()); + return false; + } + if (!eq(i_Left.Predicate, i_Right.Predicate)) { + System.out.println("Predicates differ: " + + i_Left.Predicate.getStringValue() + " != " + + i_Right.Predicate.getStringValue()); + return false; + } + if (!eq(i_Left.Object, i_Right.Object)) { + System.out.println("Objects differ: " + + i_Left.Object.getStringValue() + " != " + + i_Right.Object.getStringValue()); + return false; + } + return true; + } + + static boolean eq(Statement[] i_Result, Statement[] i_Expected) + { + if (i_Result.length != i_Expected.length) { + System.out.println("eq: different lengths: " + i_Result.length + " " + + i_Expected.length); + return false; + } + Statement[] expected = (Statement[]) + java.util.Arrays.asList(i_Expected).toArray(); + java.util.Arrays.sort(i_Result, new StmtComp()); + java.util.Arrays.sort(expected, new StmtComp()); + for (int i = 0; i < expected.length; ++i) + { + // This is better for debug! + final Statement a = i_Result[i]; + final Statement b = expected[i]; + final boolean cond = eq(a, b); + if (!cond) return false; + } + return true; + } + + static boolean eq(XEnumeration i_Enum, Statement[] i_Expected) + throws Exception + { + Statement[] current = toSeq(i_Enum); + return eq(current, i_Expected); + } + + static boolean eq(XNode i_Left, XNode i_Right) + { + if (i_Left == null) { + return (i_Right == null); + } else { + return (i_Right != null) && + (i_Left.getStringValue().equals(i_Right.getStringValue()) + // FIXME: hack: blank nodes considered equal + || (isBlank(i_Left) && isBlank(i_Right))); + } + } + + static boolean eq(XQuerySelectResult i_Result, + String[] i_Vars, XNode[][] i_Bindings) throws Exception + { + String[] vars = i_Result.getBindingNames(); + XEnumeration iter = (XEnumeration) i_Result; + XNode[][] bindings = toSeqs(iter); + if (vars.length != i_Vars.length) { + System.out.println("var lengths differ"); + return false; + } + if (bindings.length != i_Bindings.length) { + System.out.println("binding lengths differ: " + i_Bindings.length + + " vs " + bindings.length ); + return false; + } + java.util.Arrays.sort(bindings, new BindingComp()); + java.util.Arrays.sort(i_Bindings, new BindingComp()); + for (int i = 0; i < i_Bindings.length; ++i) { + if (i_Bindings[i].length != i_Vars.length) { + System.out.println("TEST ERROR!"); + throw new Exception(); + } + if (bindings[i].length != i_Vars.length) { + System.out.println("binding length and var length differ"); + return false; + } + for (int j = 0; j < i_Vars.length; ++j) { + if (!eq(bindings[i][j], i_Bindings[i][j])) { + System.out.println("bindings differ: " + + toS(bindings[i][j]) + " != " + toS(i_Bindings[i][j])); + return false; + } + } + } + for (int i = 0; i < i_Vars.length; ++i) { + if (!vars[i].equals(i_Vars[i])) { + System.out.println("variable names differ: " + + vars[i] + " != " + i_Vars[i]); + return false; + } + } + return true; + } + + static boolean eq(StringPair i_Left, StringPair i_Right) + { + return ((i_Left.First).equals(i_Right.First)) && + ((i_Left.Second).equals(i_Right.Second)); + } + + static String mkNamespace(String i_prefix, String i_namespace) + { + return "PREFIX " + i_prefix + ": <" + i_namespace + ">\n"; + } + + static String mkNss() + { + String namespaces = mkNamespace("rdf", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + namespaces += mkNamespace("pkg", + "http://docs.oasis-open.org/opendocument/meta/package/common#"); + namespaces += mkNamespace("odf", + "http://docs.oasis-open.org/opendocument/meta/package/odf#"); + return namespaces; + } + + Statement[] getManifestStmts(XURI xBaseURI) throws Exception + { + XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(), + manifestPath); + XURI xContent = URI.createNS(xContext, xBaseURI.getStringValue(), + contentPath); + XURI xStyles = URI.createNS(xContext, xBaseURI.getStringValue(), + stylesPath); + Statement xM_BaseTypeDoc = + new Statement(xBaseURI, rdf_type, pkg_Document, xManifest); + Statement xM_BaseHaspartContent = + new Statement(xBaseURI, pkg_hasPart, xContent, xManifest); + Statement xM_BaseHaspartStyles = + new Statement(xBaseURI, pkg_hasPart, xStyles, xManifest); + Statement xM_ContentTypeContent = + new Statement(xContent, rdf_type, odf_ContentFile, xManifest); + Statement xM_StylesTypeStyles = + new Statement(xStyles, rdf_type, odf_StylesFile, xManifest); + return new Statement[] { + xM_BaseTypeDoc, xM_BaseHaspartContent, xM_BaseHaspartStyles, + xM_ContentTypeContent, xM_StylesTypeStyles + }; + } + + Statement[] getMetadataFileStmts(XURI xBaseURI, String Path) + throws Exception + { + XURI xManifest = URI.createNS(xContext, xBaseURI.getStringValue(), + manifestPath); + XURI xGraph = URI.createNS(xContext, xBaseURI.getStringValue(), Path); + Statement xM_BaseHaspartGraph = + new Statement(xBaseURI, pkg_hasPart, xGraph, xManifest); + Statement xM_GraphTypeMetadata = + new Statement(xGraph, rdf_type, pkg_MetadataFile, xManifest); + return new Statement[] { xM_BaseHaspartGraph, xM_GraphTypeMetadata }; + } + + class TestRange implements XTextRange, XMetadatable, XServiceInfo + { + String m_Stream; + String m_XmlId; + String m_Text; + TestRange(String i_Str) { m_Text = i_Str; } + + public String getStringValue() { return ""; } + public String getNamespace() { return ""; } + public String getLocalName() { return ""; } + + public StringPair getMetadataReference() + { + return new StringPair(m_Stream, m_XmlId); + } + public void setMetadataReference(StringPair i_Ref) + throws IllegalArgumentException + { + m_Stream = i_Ref.First; + m_XmlId = i_Ref.Second; + } + public void ensureMetadataReference() + { + m_Stream = "content.xml"; + m_XmlId = "42"; + } + + public String getImplementationName() { return null; } + public String[] getSupportedServiceNames() { return null; } + public boolean supportsService(String i_Svc) + { + return i_Svc.equals("com.sun.star.text.Paragraph"); + } + + public XText getText() { return null; } + public XTextRange getStart() { return null; } + public XTextRange getEnd() { return null; } + public String getString() { return m_Text; } + public void setString(String i_Str) { m_Text = i_Str; } + } + + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection() DocumentMetadataAccessTest"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + +} + diff --git a/sfx2/qa/complex/framework/TestDocument.java b/sfx2/qa/complex/framework/TestDocument.java new file mode 100644 index 000000000000..8cc6ef7756b1 --- /dev/null +++ b/sfx2/qa/complex/framework/TestDocument.java @@ -0,0 +1,39 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.framework; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument { + public static String getUrl(String name) { + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); + } + + private TestDocument() {} +} diff --git a/sfx2/qa/complex/framework/makefile.mk b/sfx2/qa/complex/framework/makefile.mk new file mode 100644 index 000000000000..1b74cad15ea8 --- /dev/null +++ b/sfx2/qa/complex/framework/makefile.mk @@ -0,0 +1,65 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE + +PRJ = ../../.. +PRJNAME = sfx2 +TARGET = qa_complex_framework + +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/framework +JAVATESTFILES = \ + DocumentMetadataAccessTest.java \ + DocumentMetaData.java \ + CheckGlobalEventBroadcaster_writer1.java + +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java + + +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) + +SUBDIRS = DocHelper + +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y + +.END + +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk + +ALLTAR : javatest + +.END + + diff --git a/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt b/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt new file mode 100644 index 000000000000..831a8f451dfd Binary files /dev/null and b/sfx2/qa/complex/framework/testdocuments/CUSTOM.odt differ diff --git a/sfx2/qa/complex/framework/testdocuments/TEST.odt b/sfx2/qa/complex/framework/testdocuments/TEST.odt new file mode 100644 index 000000000000..7c6f0b60f7b0 Binary files /dev/null and b/sfx2/qa/complex/framework/testdocuments/TEST.odt differ diff --git a/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt new file mode 100644 index 000000000000..d59739142df6 Binary files /dev/null and b/sfx2/qa/complex/framework/testdocuments/TESTRDFA.odt differ diff --git a/sfx2/qa/complex/framework/testdocuments/empty.rdf b/sfx2/qa/complex/framework/testdocuments/empty.rdf new file mode 100644 index 000000000000..af62bab39dfa --- /dev/null +++ b/sfx2/qa/complex/framework/testdocuments/empty.rdf @@ -0,0 +1,13 @@ + + + + + + + diff --git a/sfx2/qa/complex/makefile.mk b/sfx2/qa/complex/makefile.mk deleted file mode 100644 index b8bc897fccf7..000000000000 --- a/sfx2/qa/complex/makefile.mk +++ /dev/null @@ -1,61 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/.. -TARGET = CheckGlobalEventBroadcaster_writer1 -PRJNAME = $(TARGET) -PACKAGE = complex$/framework - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = CheckGlobalEventBroadcaster_writer1.java \ - DocumentMetaData.java \ - DocumentMetadataAccessTest.java - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -SUBDIRS = DocHelper -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - - -run: - +java -cp $(CLASSPATH) org.openoffice.Runner -TestBase java_complex -sce tests.sce -tdoc $(PWD)$/testdocuments diff --git a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java b/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java index 0136f8941df5..29fcaba8cb7a 100644 --- a/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java +++ b/sfx2/qa/complex/standalonedocumentinfo/StandaloneDocumentInfoUnitTest.java @@ -26,44 +26,76 @@ ************************************************************************/ package complex.standalonedocumentinfo; -import complexlib.ComplexTestCase; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + /* Document here */ -public class StandaloneDocumentInfoUnitTest extends ComplexTestCase { +public class StandaloneDocumentInfoUnitTest { private XMultiServiceFactory m_xMSF = null; - public String[] getTestMethodNames() { - return new String[] { - "ExecuteTest01"}; - } +// public String[] getTestMethodNames() { +// return new String[] { +// "ExecuteTest01"}; +// } - public String[] getTestObjectNames() { - return new String[] {"StandaloneDocumentInfoUnitTest"}; - } +// public String[] getTestObjectNames() { +// return new String[] {"StandaloneDocumentInfoUnitTest"}; +// } - public void before() { + @Before public void before() { try { - m_xMSF = (XMultiServiceFactory)param.getMSF(); + m_xMSF = getMSF(); } catch(Exception e) { - failed( "Failed to create service factory!" ); + fail( "Failed to create service factory!" ); } if( m_xMSF ==null ) { - failed( "Failed to create service factory!" ); + fail( "Failed to create service factory!" ); } } - public void after() { + @After public void after() { m_xMSF = null; } - public void ExecuteTest01() { - StandaloneDocumentInfoTest aTest = new Test01 (m_xMSF, log); - assure( "Test01 failed!", aTest.test() ); + @Test public void ExecuteTest01() { + StandaloneDocumentInfoTest aTest = new Test01 (m_xMSF); + assertTrue( "Test01 failed!", aTest.test() ); + } + + + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/sfx2/qa/complex/standalonedocumentinfo/Test01.java b/sfx2/qa/complex/standalonedocumentinfo/Test01.java index 92c59d81e1c4..2f9a6266b4e2 100644 --- a/sfx2/qa/complex/standalonedocumentinfo/Test01.java +++ b/sfx2/qa/complex/standalonedocumentinfo/Test01.java @@ -26,14 +26,6 @@ ************************************************************************/ package complex.standalonedocumentinfo; -import com.sun.star.beans.Property; -import com.sun.star.beans.XProperty; -import com.sun.star.beans.XPropertySetInfo; -import com.sun.star.io.IOException; -import com.sun.star.io.XInputStream; -import com.sun.star.io.XOutputStream; -import complexlib.ComplexTestCase; - import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.document.XStandaloneDocumentInfo; import com.sun.star.io.XTempFile; @@ -43,19 +35,15 @@ import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.AnyConverter; -import com.sun.star.task.ErrorCodeIOException; -import java.util.Properties; -import java.util.Random; -import share.LogWriter; public class Test01 implements StandaloneDocumentInfoTest { XMultiServiceFactory m_xMSF = null; TestHelper m_aTestHelper = null; - public Test01 ( XMultiServiceFactory xMSF, LogWriter aLogWriter ) { + public Test01 ( XMultiServiceFactory xMSF ) { m_xMSF = xMSF; - m_aTestHelper = new TestHelper( aLogWriter, "Test01: " ); + m_aTestHelper = new TestHelper( "Test01: " ); } public boolean test() { @@ -71,19 +59,16 @@ public class Test01 implements StandaloneDocumentInfoTest { m_aTestHelper.Message ( "==============================" ); //create a new temporary file Object oTempFile = m_xMSF.createInstance ( "com.sun.star.io.TempFile" ); - XTempFile xTempFile = (XTempFile) UnoRuntime.queryInterface ( - XTempFile.class, oTempFile ); + XTempFile xTempFile = UnoRuntime.queryInterface(XTempFile.class, oTempFile); //create a text document and initiallize it Object oTextDocument = m_xMSF.createInstance ( "com.sun.star.text.TextDocument" ); - XLoadable xLoadable = (XLoadable) UnoRuntime.queryInterface ( - XLoadable.class, oTextDocument ); + XLoadable xLoadable = UnoRuntime.queryInterface(XLoadable.class, oTextDocument); xLoadable.initNew(); m_aTestHelper.Message ( "New document initialized." ); //store the instance to the temporary file URL - XStorable xStorable = (XStorable) UnoRuntime.queryInterface ( - XStorable.class, oTextDocument ); + XStorable xStorable = UnoRuntime.queryInterface(XStorable.class, oTextDocument); String sURL = AnyConverter.toString ( xTempFile.getUri () ); PropertyValue aProps[] = new PropertyValue[2]; aProps[0] = new PropertyValue(); @@ -101,15 +86,13 @@ public class Test01 implements StandaloneDocumentInfoTest { Object oStandaloneDocInfo = m_xMSF.createInstance ( "com.sun.star.document.StandaloneDocumentInfo" ); XStandaloneDocumentInfo xStandaloneDocInfo = - (XStandaloneDocumentInfo) UnoRuntime.queryInterface ( - XStandaloneDocumentInfo.class, oStandaloneDocInfo ); + UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oStandaloneDocInfo); xStandaloneDocInfo.loadFromURL ( sURL ); m_aTestHelper.Message ( "StandaloneDocumentInfo loaded." ); //get the title from the object and check it XPropertySet xPropSet = - (XPropertySet)UnoRuntime.queryInterface ( - XPropertySet.class, oStandaloneDocInfo ); + UnoRuntime.queryInterface(XPropertySet.class, oStandaloneDocInfo); String sTitle = xPropSet.getPropertyValue ( "Title" ).toString (); m_aTestHelper.Message ( "Get title: " + sTitle ); if ( sTitle.compareTo ( sDocTitle[i] ) != 0 ) { @@ -134,14 +117,12 @@ public class Test01 implements StandaloneDocumentInfoTest { Object oStandaloneDocInfo_ = m_xMSF.createInstance ( "com.sun.star.document.StandaloneDocumentInfo" ); XStandaloneDocumentInfo xStandaloneDocInfo_ = - (XStandaloneDocumentInfo)UnoRuntime.queryInterface ( - XStandaloneDocumentInfo.class, oStandaloneDocInfo_ ); + UnoRuntime.queryInterface(XStandaloneDocumentInfo.class, oStandaloneDocInfo_); xStandaloneDocInfo_.loadFromURL ( sURL ); m_aTestHelper.Message ( "New StandaloneDocumentInfo loaded." ); //get the title and check it - XPropertySet xPropSet_ = (XPropertySet)UnoRuntime.queryInterface ( - XPropertySet.class, oStandaloneDocInfo_ ); + XPropertySet xPropSet_ = UnoRuntime.queryInterface(XPropertySet.class, oStandaloneDocInfo_); String sTitle_ = xPropSet_.getPropertyValue ( "Title" ).toString (); m_aTestHelper.Message ( "Get new title: " + sTitle_ ); if ( sTitle_.compareTo ( sTitle ) != 0 ) { diff --git a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java b/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java index f319fe412227..f6d63e1b7793 100644 --- a/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java +++ b/sfx2/qa/complex/standalonedocumentinfo/TestHelper.java @@ -26,23 +26,23 @@ ************************************************************************/ package complex.standalonedocumentinfo; -import share.LogWriter; public class TestHelper { - LogWriter m_aLogWriter; + String m_sTestPrefix; - /** Creates a new instance of TestHelper */ - public TestHelper ( LogWriter aLogWriter, String sTestPrefix ) { - m_aLogWriter = aLogWriter; + /** Creates a new instance of TestHelper + * @param sTestPrefix + */ + public TestHelper ( String sTestPrefix ) { m_sTestPrefix = sTestPrefix; } public void Error ( String sError ) { - m_aLogWriter.println ( m_sTestPrefix + "Error: " + sError ); + System.out.println ( m_sTestPrefix + "Error: " + sError ); } public void Message ( String sMessage ) { - m_aLogWriter.println ( m_sTestPrefix + sMessage ); + System.out.println ( m_sTestPrefix + sMessage ); } } diff --git a/sfx2/qa/complex/standalonedocumentinfo/makefile.mk b/sfx2/qa/complex/standalonedocumentinfo/makefile.mk index c65556aeb763..aade48dbd789 100644 --- a/sfx2/qa/complex/standalonedocumentinfo/makefile.mk +++ b/sfx2/qa/complex/standalonedocumentinfo/makefile.mk @@ -25,61 +25,32 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = StandaloneDocumentInfoUnitTest -PRJNAME = binfilter -PACKAGE = complex$/standalonedocumentinfo - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar - -JAVAFILES =\ - StandaloneDocumentInfoUnitTest.java\ - StandaloneDocumentInfoTest.java\ - Test01.java\ - TestHelper.java\ - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: .ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF -# test base is java complex -CT_TESTBASE = -TestBase java_complex +PRJ = ../../.. +PRJNAME = sfx2 +TARGET = qa_complex_standalonedocumentinfo -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/standalonedocumentinfo +JAVATESTFILES = \ + StandaloneDocumentInfoUnitTest.java -# start the runner application -CT_APP = org.openoffice.Runner +JAVAFILES = $(JAVATESTFILES) \ + StandaloneDocumentInfoTest.java \ + Test01.java \ + TestHelper.java -# --- Targets ------------------------------------------------------ +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run - -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) - - +ALLTAR : javatest +.END diff --git a/sfx2/qa/complex/testdocuments/CUSTOM.odt b/sfx2/qa/complex/testdocuments/CUSTOM.odt deleted file mode 100644 index 831a8f451dfd..000000000000 Binary files a/sfx2/qa/complex/testdocuments/CUSTOM.odt and /dev/null differ diff --git a/sfx2/qa/complex/testdocuments/TEST.odt b/sfx2/qa/complex/testdocuments/TEST.odt deleted file mode 100644 index 7c6f0b60f7b0..000000000000 Binary files a/sfx2/qa/complex/testdocuments/TEST.odt and /dev/null differ diff --git a/sfx2/qa/complex/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/testdocuments/TESTRDFA.odt deleted file mode 100644 index d59739142df6..000000000000 Binary files a/sfx2/qa/complex/testdocuments/TESTRDFA.odt and /dev/null differ -- cgit From 4393f0c2551af853c8b6e26c891829442100abbf Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 10 Jun 2010 15:17:05 +0200 Subject: #i112280# added missing minus in translation --- svx/source/svdraw/svdopath.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 2b495725c006..9d136ef82eae 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2927,7 +2927,8 @@ sal_Bool SdrPathObj::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegfx:: aScale = aCorrectedRangeNoCurve.getRange(); // define matrix for move polygon to zero point - aMoveToZeroMatrix.translate(-aCorrectedRangeNoCurve.getMinX(), aCorrectedRangeNoCurve.getMinY()); + // #i112280# Added missing minus for Y-Translation + aMoveToZeroMatrix.translate(-aCorrectedRangeNoCurve.getMinX(), -aCorrectedRangeNoCurve.getMinY()); } else { -- cgit From b1c60fae23e95b7ffd399a8df45e78ee19d60fa0 Mon Sep 17 00:00:00 2001 From: ka Date: Thu, 10 Jun 2010 22:32:46 +0200 Subject: avmedia101: don't use obsolete third parameter anymore --- avmedia/source/java/Manager.java | 2 +- avmedia/source/java/MediaUno.java | 2 +- avmedia/source/java/avmedia.jar | Bin 16495 -> 15776 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/avmedia/source/java/Manager.java b/avmedia/source/java/Manager.java index 2e8cf04fce4a..47707478fd5b 100644 --- a/avmedia/source/java/Manager.java +++ b/avmedia/source/java/Manager.java @@ -89,7 +89,7 @@ public class Manager implements com.sun.star.lang.XServiceInfo, // - XServiceInfo - // ---------------- - private static final String s_implName = "com.sun.star.comp.avmedia.Manager_Java"; + private static final String s_implName = "com.sun.star.comp.media.Manager_Java"; private static final String s_serviceName = "com.sun.star.media.Manager_Java"; public synchronized String getImplementationName() diff --git a/avmedia/source/java/MediaUno.java b/avmedia/source/java/MediaUno.java index f4121950165f..ca7a164586d8 100644 --- a/avmedia/source/java/MediaUno.java +++ b/avmedia/source/java/MediaUno.java @@ -34,7 +34,7 @@ import com.sun.star.lang.XInitialization; public class MediaUno { - private static final String s_implName = "com.sun.star.comp.avmedia.Manager_Java"; + private static final String s_implName = "com.sun.star.comp.media.Manager_Java"; private static final String s_serviceName = "com.sun.star.media.Manager_Java"; // ------------------------------------------------------------------------- diff --git a/avmedia/source/java/avmedia.jar b/avmedia/source/java/avmedia.jar index 3495d947bf71..85a98bbcf33c 100644 Binary files a/avmedia/source/java/avmedia.jar and b/avmedia/source/java/avmedia.jar differ -- cgit From c3655b7b8bbfe2b677c1e783d30801b965376beb Mon Sep 17 00:00:00 2001 From: ka Date: Thu, 10 Jun 2010 22:37:56 +0200 Subject: avmedia101: code cleanup --- avmedia/source/viewer/mediawindowbase_impl.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx index a8ef536ac133..94a6c36ed064 100644 --- a/avmedia/source/viewer/mediawindowbase_impl.cxx +++ b/avmedia/source/viewer/mediawindowbase_impl.cxx @@ -82,27 +82,25 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl: { static const ServiceManager aServiceManagers[] = { - { "AVMEDIA_MANAGER_SERVICE_NAME", AVMEDIA_MANAGER_SERVICE_IS_JAVABASED }, - { "AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1", AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 } + { AVMEDIA_MANAGER_SERVICE_NAME, AVMEDIA_MANAGER_SERVICE_IS_JAVABASED }, + { AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1, AVMEDIA_MANAGER_SERVICE_IS_JAVABASED_FALLBACK1 } }; - uno::Reference< media::XManager > xManager; - - for( sal_uInt32 i = 0; ( i < ( sizeof( aServiceManagers ) / sizeof( ServiceManager ) ) ) && !xManager.is(); ++i ) + for( sal_uInt32 i = 0; !xPlayer.is() && ( i < ( sizeof( aServiceManagers ) / sizeof( ServiceManager ) ) ); ++i ) { const String aServiceName( aServiceManagers[ i ].pServiceName, RTL_TEXTENCODING_ASCII_US ); if( aServiceName.Len() ) { + OSL_TRACE( "Trying to create media manager service %s", aServiceManagers[ i ].pServiceName ); + try { - xManager = uno::Reference< media::XManager >( xFactory->createInstance( aServiceName ), - uno::UNO_QUERY ); + uno::Reference< media::XManager > xManager( xFactory->createInstance( aServiceName ), uno::UNO_QUERY ); if( xManager.is() ) { - xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ), - uno::UNO_QUERY ); + xPlayer = uno::Reference< media::XPlayer >( xManager->createPlayer( rURL ), uno::UNO_QUERY ); } } catch( ... ) @@ -110,11 +108,7 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl: } } - if( !xPlayer.is() ) - { - xManager.clear(); - } - else + if( xPlayer.is() ) { rbJavaBased = aServiceManagers[ i ].bIsJavaBased; } @@ -124,7 +118,6 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const ::rtl: return xPlayer; } - // --------------------------------------------------------------------- void MediaWindowBaseImpl::setURL( const ::rtl::OUString& rURL ) -- cgit From 27908970ce3c92d8be0a01f1d522500a0a1b7100 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 14 Jun 2010 11:44:03 +0200 Subject: #i112361# - Fixed DAVResourceAccess::handleException() to suggest retry on status code 0 --- ucb/source/ucp/webdav/DAVResourceAccess.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 4ffc8dd88cf5..61eebe907608 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -1201,8 +1201,7 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) // if we have a bad connection try again. Up to three times. case DAVException::DAV_HTTP_ERROR: // retry up to three times, if not a client-side error. - if ( e.getStatus() > 0 && - ( e.getStatus() < 400 || e.getStatus() > 499 ) && + if ( ( e.getStatus() < 400 || e.getStatus() >= 500 ) && errorCount < 3 ) { return sal_True; -- cgit From 380197840a23e7930a7223ddfa5b6546c54fc479 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 14 Jun 2010 13:40:46 +0200 Subject: sb123:#i111449# add TODO --- sfx2/qa/complex/docinfo/DocumentProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/qa/complex/docinfo/DocumentProperties.java b/sfx2/qa/complex/docinfo/DocumentProperties.java index afa188e20901..0c4eb44c4a35 100644 --- a/sfx2/qa/complex/docinfo/DocumentProperties.java +++ b/sfx2/qa/complex/docinfo/DocumentProperties.java @@ -73,7 +73,7 @@ public class DocumentProperties assertNotNull("## Couldn't get MultiServiceFactory make sure your Office is started", m_xMSF); - + // TODO: need other temp directory! String tempdir = System.getProperty("java.io.tmpdir"); String fs = System.getProperty("file.separator"); -- cgit From 4cb6e6ea581178f7876538ec715b81623636df5d Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 14 Jun 2010 14:05:25 +0200 Subject: sb123:#i111449# cleanups in linguistic qa/complex tests --- linguistic/prj/build.lst | 4 + .../complex/linguistic/HangulHanjaConversion.java | 122 ++++++++++++--------- linguistic/qa/complex/linguistic/TestDocument.java | 41 +++++++ linguistic/qa/complex/linguistic/makefile.mk | 62 +++++------ 4 files changed, 142 insertions(+), 87 deletions(-) create mode 100644 linguistic/qa/complex/linguistic/TestDocument.java diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 57c332f6f3ea..d36b5d11cfcc 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -3,4 +3,8 @@ lg linguistic usr1 - all lg_mkout NULL lg linguistic\prj get - all lg_prj NULL lg linguistic\inc nmake - all lg_inc NULL lg linguistic\source nmake - all lg_src lg_inc NULL + lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL + +# could be we need a Japanese office version +lg linguistic\qa\complex\linguistic nmake - all lg_qa_complex NULL diff --git a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java index 160a1b42fd78..63412254c29f 100644 --- a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java +++ b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java @@ -43,56 +43,57 @@ import com.sun.star.linguistic2.XConversionDictionaryList; import com.sun.star.sheet.XSpreadsheet; import com.sun.star.sheet.XSpreadsheetDocument; import com.sun.star.table.XCell; -import com.sun.star.text.XTextCursor; -import com.sun.star.text.XTextDocument; -import com.sun.star.text.XWordCursor; + import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; -import java.io.PrintWriter; import util.DesktopTools; +// import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; -public class HangulHanjaConversion extends ComplexTestCase { +public class HangulHanjaConversion { XMultiServiceFactory xMSF = null; boolean disposed = false; Locale aLocale = new Locale("ko", "KR", ""); short dictType = ConversionDictionaryType.HANGUL_HANJA; - public String[] getTestMethodNames() { - return new String[] { "ConversionDictionaryList" }; - } +// public String[] getTestMethodNames() { +// return new String[] { "ConversionDictionaryList" }; +// } - public void before() { - xMSF = (XMultiServiceFactory) param.getMSF(); + @Before public void before() { + xMSF = getMSF(); } - public void ConversionDictionaryList() { + @Test public void ConversionDictionaryList() { Object ConversionDictionaryList = null; try { ConversionDictionaryList = xMSF.createInstance( "com.sun.star.linguistic2.ConversionDictionaryList"); } catch (com.sun.star.uno.Exception e) { - assure("Couldn't create ConversionDictionaryList", false); + fail("Couldn't create ConversionDictionaryList"); } if (ConversionDictionaryList == null) { - assure("Couldn't create ConversionDictionaryList", false); + fail("Couldn't create ConversionDictionaryList"); } boolean bList = checkXConversionDictionaryList( ConversionDictionaryList); - assure("XConversionDictionaryList doesnt work as expected", bList); + assertTrue("XConversionDictionaryList doesnt work as expected", bList); } private boolean checkXConversionDictionaryList(Object list) { boolean res = true; - XConversionDictionaryList xCList = (XConversionDictionaryList) UnoRuntime.queryInterface( - XConversionDictionaryList.class, - list); + XConversionDictionaryList xCList = UnoRuntime.queryInterface(XConversionDictionaryList.class, list); XConversionDictionary xDict = null; try { @@ -100,28 +101,30 @@ public class HangulHanjaConversion extends ComplexTestCase { dictType); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("Couldn't add Dictionary", false); + fail("Couldn't add Dictionary"); } catch (com.sun.star.container.ElementExistException e) { res = false; - assure("Couldn't add Dictionary", false); + fail("Couldn't add Dictionary"); } try { xCList.addNewDictionary("addNewDictionary", aLocale, dictType); res = false; - assure("wrong exception while adding Dictionary again", false); + fail("wrong exception while adding Dictionary again"); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("wrong exception while adding Dictionary again", false); + fail("wrong exception while adding Dictionary again"); } catch (com.sun.star.container.ElementExistException e) { } boolean localRes = checkNameContainer(xCList.getDictionaryContainer()); res &= localRes; - assure("getDictionaryContainer didn't work as expected", localRes); + assertTrue("getDictionaryContainer didn't work as expected", localRes); - String FileToLoad = util.utils.getFullTestURL("hangulhanja.sxc"); - XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, + String FileToLoad = TestDocument.getUrl("hangulhanja.sxc"); + // String FileToLoad = util.utils.getFullTestURL(); + +XComponent xDoc = DesktopTools.loadDoc(xMSF, FileToLoad, new PropertyValue[] { }); XSpreadsheet xSheet = getSheet(xDoc); boolean done = false; @@ -145,7 +148,7 @@ public class HangulHanjaConversion extends ComplexTestCase { } catch (com.sun.star.lang.IllegalArgumentException e) { e.printStackTrace(); res = false; - assure("Exception while checking adding entry", false); + fail("Exception while checking adding entry"); } catch (com.sun.star.container.ElementExistException e) { //ignored } @@ -157,7 +160,7 @@ public class HangulHanjaConversion extends ComplexTestCase { } catch (com.sun.star.lang.IllegalArgumentException e) { e.printStackTrace(); res = false; - assure("Exception while checking adding entry", false); + fail("Exception while checking adding entry"); } catch (com.sun.star.container.ElementExistException e) { //ignored } @@ -165,7 +168,7 @@ public class HangulHanjaConversion extends ComplexTestCase { localRes = xCList.queryMaxCharCount(aLocale, dictType, ConversionDirection.FROM_LEFT) == 42; res &= localRes; - assure("queryMaxCharCount returned the wrong value", localRes); + assertTrue("queryMaxCharCount returned the wrong value", localRes); String[] conversion = null; @@ -177,37 +180,36 @@ public class HangulHanjaConversion extends ComplexTestCase { TextConversionOption.NONE); } catch (com.sun.star.lang.IllegalArgumentException e) { res = false; - assure("Exception while calling queryConversions", false); + fail("Exception while calling queryConversions"); } catch (com.sun.star.lang.NoSupportException e) { res = false; - assure("Exception while calling queryConversions", false); + fail("Exception while calling queryConversions"); } localRes = conversion[0].equals(expectedConversion); res &= localRes; - assure("queryConversions didn't work as expected", localRes); + assertTrue("queryConversions didn't work as expected", localRes); try { xCList.getDictionaryContainer().removeByName("addNewDictionary"); } catch (com.sun.star.container.NoSuchElementException e) { res = false; - assure("exception while removing Dictionary again", false); + fail("exception while removing Dictionary again"); } catch (com.sun.star.lang.WrappedTargetException e) { res = false; - assure("exception while removing Dictionary again", false); + fail("exception while removing Dictionary again"); } localRes = !xCList.getDictionaryContainer() .hasByName("addNewDictionary"); res &= localRes; - assure("Dictionary hasn't been removed properly", localRes); + assertTrue("Dictionary hasn't been removed properly", localRes); - XComponent dicList = (XComponent) UnoRuntime.queryInterface( - XComponent.class, xCList); + XComponent dicList = UnoRuntime.queryInterface(XComponent.class, xCList); XEventListener listen = new EventListener(); dicList.addEventListener(listen); dicList.dispose(); - assure("dispose didn't work", disposed); + assertTrue("dispose didn't work", disposed); dicList.removeEventListener(listen); DesktopTools.closeDoc(xDoc); @@ -244,23 +246,17 @@ public class HangulHanjaConversion extends ComplexTestCase { } private XSpreadsheet getSheet(XComponent xDoc) { - XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface( - XSpreadsheetDocument.class, - xDoc); + XSpreadsheetDocument xSheetDoc = UnoRuntime.queryInterface(XSpreadsheetDocument.class, xDoc); XSpreadsheet xSheet = null; try { - xSheet = (XSpreadsheet) UnoRuntime.queryInterface( - XSpreadsheet.class, - xSheetDoc.getSheets() - .getByName(xSheetDoc.getSheets() - .getElementNames()[0])); + xSheet = UnoRuntime.queryInterface(XSpreadsheet.class, xSheetDoc.getSheets().getByName(xSheetDoc.getSheets().getElementNames()[0])); } catch (com.sun.star.container.NoSuchElementException e) { - log.println("Couldn't get sheet"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get sheet"); + e.printStackTrace(); } catch (com.sun.star.lang.WrappedTargetException e) { - log.println("Couldn't get sheet"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get sheet"); + e.printStackTrace(); } return xSheet; @@ -280,8 +276,8 @@ public class HangulHanjaConversion extends ComplexTestCase { try { re = xSpreadsheet.getCellByPosition(x, y); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Couldn't get word"); - e.printStackTrace((PrintWriter) log); + System.out.println("Couldn't get word"); + e.printStackTrace(); } return re; @@ -342,4 +338,26 @@ public class HangulHanjaConversion extends ComplexTestCase { disposed = true; } } -} \ No newline at end of file + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + +} diff --git a/linguistic/qa/complex/linguistic/TestDocument.java b/linguistic/qa/complex/linguistic/TestDocument.java new file mode 100644 index 000000000000..575640662e5f --- /dev/null +++ b/linguistic/qa/complex/linguistic/TestDocument.java @@ -0,0 +1,41 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.linguistic; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); + } + + private TestDocument() {} +} diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index 75330e3c5de0..b0d274167b98 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -25,49 +25,41 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = HangulHanjaConversion -PRJNAME = linguistic -PACKAGE = complex$/linguistic +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: + @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." +.ELSE -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ - OOoRunner.jar mysql.jar -JAVAFILES = HangulHanjaConversion.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = sc +TARGET = qa_complex_linguistic -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/linguistic -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# here store only Files which contain a @Test +JAVATESTFILES = \ + HangulHanjaConversion.java -# --- Parameters for the test -------------------------------------- +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java -# test base is java complex -CT_TESTBASE = -tb java_complex +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# subdirectories +# SUBDIRS = helper -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -RUN: run - -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_TEST) -tdoc $(PWD)$/testdocuments +.END +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest +.END -- cgit From 6232a745c835aba638fbde151f27de070e5a5c56 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 14 Jun 2010 18:26:43 +0200 Subject: ooo30gsl01: #i112083# fix return value in PreNotfiy --- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index f4f03170a90f..284b96a9e933 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -135,7 +135,10 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) sal_uInt16 nCode = pKeyEvent->GetKeyCode().GetCode(); if ( (bCtrl && bAlt && KEY_F == nCode) || KEY_ESCAPE == nCode ) + { + nRet = 1; GrabFocusToDocument(); + } if ( KEY_RETURN == nCode ) { @@ -154,6 +157,7 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) lArgs[1].Value <<= sal_False; impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); + nRet = 1; } break; } -- cgit From d2fc0f17b593f580b7c66521873fe4bfe4a9ab38 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 15 Jun 2010 15:21:45 +0200 Subject: #i112300# extended interpretation of MetaGradientAction in metafile primitive decomposition --- .../source/primitive2d/metafileprimitive2d.cxx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index 238c47419eb9..480fa99e07fe 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -2291,35 +2291,48 @@ namespace { const Gradient& rGradient = pA->GetGradient(); const drawinglayer::attribute::FillGradientAttribute aAttribute(createFillGradientAttribute(rGradient)); + basegfx::B2DPolyPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange)); if(aAttribute.getStartColor() == aAttribute.getEndColor()) { // not really a gradient. Create filled rectangle - const basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aRange)); - createFillPrimitive(basegfx::B2DPolyPolygon(aOutline), rTargetHolders.Current(), rPropertyHolders.Current()); + createFillPrimitive( + aOutline, + rTargetHolders.Current(), + rPropertyHolders.Current()); } else { // really a gradient aRange.transform(rPropertyHolders.Current().getTransformation()); + drawinglayer::primitive2d::Primitive2DSequence xGradient(1); if(rPropertyHolders.Current().isRasterOpInvert()) { // use a special version of FillGradientPrimitive2D which creates // non-overlapping geometry on decomposition to makethe old XOR // paint 'trick' work. - rTargetHolders.Current().append( + xGradient[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::NonOverlappingFillGradientPrimitive2D( aRange, aAttribute)); } else { - rTargetHolders.Current().append( + xGradient[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::FillGradientPrimitive2D( aRange, aAttribute)); } + + // #i112300# clip against polygon representing the rectangle from + // the action. This is implicitely done using a temp Clipping in VCL + // when a MetaGradientAction is executed + aOutline.transform(rPropertyHolders.Current().getTransformation()); + rTargetHolders.Current().append( + new drawinglayer::primitive2d::MaskPrimitive2D( + aOutline, + xGradient)); } } } -- cgit From 77b41d4ecd48f2dbc578ab1f320fdb69302547a8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Jun 2010 17:36:43 +0200 Subject: ooo30gsl01: #i112249# add missing URL conversion --- fpicker/source/unx/kde4/KDE4FilePicker.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/fpicker/source/unx/kde4/KDE4FilePicker.cxx index a7fa01a5ece6..eadc255f0ec0 100644 --- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx +++ b/fpicker/source/unx/kde4/KDE4FilePicker.cxx @@ -46,6 +46,8 @@ #include #include +#include "osl/file.h" + #include "KDE4FilePicker.hxx" #include "FPServiceInfo.hxx" @@ -246,7 +248,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() // kde file picker returns the file and directories for selectedFiles() // when a file is double clicked // make a true list of files - const QString dir = "file://" + KUrl(rawFiles[0]).directory(); + const QString dir = KUrl(rawFiles[0]).directory(); bool singleFile = true; if (rawFiles.size() > 1) @@ -262,7 +264,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() { // if the raw file is not the base directory (see above kde bug) // we add the file to list of avail files - if ((dir + "/") != ("file://" + rawFiles[i])) + if ((dir + "/") != ( rawFiles[i])) { QString filename = KUrl(rawFiles[i]).fileName(); @@ -280,7 +282,11 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles() // add all files and leading directory to outgoing OO sequence uno::Sequence< ::rtl::OUString > seq(files.size()); for (int i = 0; i < files.size(); ++i) - seq[i] = toOUString(files[i]); + { + rtl::OUString aFile(toOUString(files[i])), aURL; + osl_getFileURLFromSystemPath(aFile.pData, &aURL.pData ); + seq[i] = aURL; + } return seq; } -- cgit From 9508a731824e7f8a692d462da763b2db95463875 Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Jun 2010 06:33:39 +0200 Subject: impress186: #i4499# graphic dialog reorganisation - added support of bitmap resolution --- .../schema/org/openoffice/Office/Common.xcs | 346 +++++++-------------- 1 file changed, 114 insertions(+), 232 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index cb19bb01e1ba..3d193e6b9dc0 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -4355,69 +4355,123 @@ Specifies default settings of graphic export dialogs. - + + + Specifies the unit default that is used in the the graphic export dialog if exporting pixel graphics. + + + + + inches + + + + + cm + + + + + mm + + + + + points + + + + + pica + + + + + pixels + + + + 5 + + + + Specifies the unit default for the resolution that is used in the the graphic export dialog if exporting pixel graphics. + + + + + pixels/inch + + + + + pixels/cm + + + + + pixels/meter + + + + 0 + + + + Specifies the logical width of a graphic. [UNIT=1/100 mm]. + + + + + Represents the lowest value that can be entered in the dialog. + + + + 96 + + + + Specifies the maximum raw graphic size in bytes up to which the realtime preview is enabled, for fast computers this value may be enlarged + + 4000000 + + + + Specifies the unit default that is used in the the graphic export dialog if exporting vector graphics. + + + + + inches + + + + + cm + + + + + mm + + + + + points + + + + + pica + + + + 2 + + Specifies default settings of the Windows Bitmap export dialog. - - - - - - Specifies usable export modes. - - - - - - Original size - - - - - Logical size (dpi/pixel ratio) - - - - - Given size - - - - 0 - - - - - - - Specifies resolution which is to be used if export mode is 1. [UNIT=dpi] - - - - - - 75 - - - - - 150 - - - - - 300 - - - - - 600 - - - - 75 - @@ -4479,13 +4533,6 @@ true - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - @@ -4693,72 +4740,6 @@ 0 - - - Specifies if graphics are exported with the original- or selected size. - - - - - - - Specifies if graphics are exported with the original- or selected size. - - - - - Original size - - - - - Given size - - - - 0 - - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - - - - - Specifies default settings of the PCT - Mac Pict export dialog. - - - - - - - Specifies if graphics are exported with original- or selected size. - - - - - Original size - - - - - Given size - - - - 0 - - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - - Specifies default settings of the PBM - Portable Bitmap export dialog. @@ -4837,105 +4818,6 @@ 1 - - - Specifies default settings of the SVM - StarView Meta File export dialog. - - - - - - - Specifies if graphics should be exported with the original- or selected size. - - - - - Original size - - - - - Given size - - - - 0 - - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - - - - - Specifies default settings of the WMF - Windows Metafile export dialog. - - - - - - - Specifies if graphics should be exported with the original- or selected size. - - - - - Original size - - - - - Given size - - - - 0 - - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - - - - - Specifies default settings of the EMF - Enhanced Metafile export dialog. - - - - - - - Specifies if graphics should be exported with the original- or selected size. - - - - - Original size - - - - - Given size - - - - 0 - - - - Specifies the logical size of a graphic. [UNIT=1/100 mm]. - - - - - Specifies default settings of the PNG - Portable Network Graphic export dialog. -- cgit From ea0e9744690e2c3e75ab6b1eee1f57d94ceca5aa Mon Sep 17 00:00:00 2001 From: Wu Yan Date: Thu, 17 Jun 2010 16:33:20 +0800 Subject: findbarfixes01: #112235# [A11Y] Text in Find toolbar text field has wrong colour in High Contrast mode --- svx/source/tbxctrls/tbunosearchcontrollers.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index f4f03170a90f..889bf63459bd 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -92,7 +92,7 @@ FindTextFieldControl::~FindTextFieldControl() void FindTextFieldControl::InitControls_Impl() { SetText( String( ::rtl::OUString::createFromAscii("Find") ) ); - SetControlForeground(COL_GRAY); + SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); EnableAutocomplete(TRUE, TRUE); } @@ -117,7 +117,7 @@ void FindTextFieldControl::Modify() { ComboBox::Modify(); - SetControlForeground( Color( COL_BLACK ) ); + SetControlForeground( GetSettings().GetStyleSettings().GetWindowTextColor() ); } long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) @@ -171,7 +171,7 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) if ( GetText().Len() == 0 ) { SetText( String( ::rtl::OUString::createFromAscii("Find") ) ); - SetControlForeground(COL_GRAY); + SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); m_bToClearTextField = sal_True; } break; -- cgit From f288b50cef4d2a13cfb100af3a71f14b171d066a Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Thu, 17 Jun 2010 14:26:43 +0200 Subject: #i112245# 1st part for SvtGraphicStroke --- .../drawinglayer/primitive2d/chartprimitive2d.hxx | 2 +- .../primitive2d/drawinglayer_primitivetypes2d.hxx | 2 +- .../primitive2d/embedded3dprimitive2d.hxx | 2 +- .../primitive2d/helplineprimitive2d.hxx | 4 +- .../primitive2d/polygonprimitive2d.hxx | 2 +- .../primitive2d/polypolygonprimitive2d.hxx | 6 +- .../drawinglayer/primitive2d/sceneprimitive2d.hxx | 2 +- .../primitive2d/textdecoratedprimitive2d.hxx | 4 +- .../source/primitive2d/structuretagprimitive2d.cxx | 2 +- .../source/processor2d/vclmetafileprocessor2d.cxx | 192 +++++++++++---------- 10 files changed, 111 insertions(+), 107 deletions(-) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx index bd8c3be1fbbd..71c4cc6ffe1e 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/chartprimitive2d.hxx @@ -56,7 +56,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rTransformation, const Primitive2DSequence& rChildren); - // get data + /// data read access const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& getChartModel() const { return mxChartModel; } const basegfx::B2DHomMatrix& getTransformation() const { return maTransformation; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx index 7872ad825496..c60257551c28 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx @@ -90,7 +90,7 @@ #define PRIMITIVE2D_ID_EXECUTEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 47) #define PRIMITIVE2D_ID_PAGEPREVIEWPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 48) #define PRIMITIVE2D_ID_CHARTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 49) -#define PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50) +#define PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 50) #define PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 51) #define PRIMITIVE2D_ID_POLYPOLYGONMARKERPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 52) #define PRIMITIVE2D_ID_INVERTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_DRAWINGLAYER| 53) diff --git a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx index ce49995c999d..d651af24047d 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/embedded3dprimitive2d.hxx @@ -101,7 +101,7 @@ namespace drawinglayer double fShadowSlant, const basegfx::B3DRange& rScene3DRange); - /// get data + /// data read access const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; } const geometry::ViewInformation3D& getViewInformation3D() const { return maViewInformation3D; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx index 237ae00a4642..e2323765b2e5 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/helplineprimitive2d.hxx @@ -94,8 +94,8 @@ namespace drawinglayer double fDiscreteDashLength); /// data read access - const basegfx::B2DPoint getPosition() const { return maPosition; } - const basegfx::B2DVector getDirection() const { return maDirection; } + const basegfx::B2DPoint& getPosition() const { return maPosition; } + const basegfx::B2DVector& getDirection() const { return maDirection; } HelplineStyle2D getStyle() const { return meStyle; } const basegfx::BColor& getRGBColA() const { return maRGBColA; } const basegfx::BColor& getRGBColB() const { return maRGBColB; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx index 80e281ede05c..ee5de781be86 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polygonprimitive2d.hxx @@ -189,7 +189,7 @@ namespace drawinglayer const attribute::LineAttribute& rLineAttribute); /// data read access - basegfx::B2DPolygon getB2DPolygon() const { return maPolygon; } + const basegfx::B2DPolygon& getB2DPolygon() const { return maPolygon; } const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx index 18743937b6bc..4a48ae0d3e59 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/polypolygonprimitive2d.hxx @@ -69,7 +69,7 @@ namespace drawinglayer PolyPolygonHairlinePrimitive2D(const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::BColor& rBColor); /// data read access - basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const basegfx::BColor& getBColor() const { return maBColor; } /// compare operator @@ -123,7 +123,7 @@ namespace drawinglayer double fDiscreteDashLength); // data read access - basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const basegfx::BColor& getRGBColorA() const { return maRGBColorA; } const basegfx::BColor& getRGBColorB() const { return maRGBColorB; } double getDiscreteDashLength() const { return mfDiscreteDashLength; } @@ -182,7 +182,7 @@ namespace drawinglayer const attribute::LineAttribute& rLineAttribute); /// data read access - basegfx::B2DPolyPolygon getB2DPolyPolygon() const { return maPolyPolygon; } + const basegfx::B2DPolyPolygon& getB2DPolyPolygon() const { return maPolyPolygon; } const attribute::LineAttribute& getLineAttribute() const { return maLineAttribute; } const attribute::StrokeAttribute& getStrokeAttribute() const { return maStrokeAttribute; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx index 4c95972ca67d..278a1b0bfff2 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/sceneprimitive2d.hxx @@ -136,7 +136,7 @@ namespace drawinglayer const basegfx::B2DHomMatrix& rObjectTransformation, const geometry::ViewInformation3D& rViewInformation3D); - /// data ead access + /// data read access const primitive3d::Primitive3DSequence& getChildren3D() const { return mxChildren3D; } const attribute::SdrSceneAttribute& getSdrSceneAttribute() const { return maSdrSceneAttribute; } const attribute::SdrLightingAttribute& getSdrLightingAttribute() const { return maSdrLightingAttribute; } diff --git a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx index 6ae691cbcff9..5c1093bc333a 100644 --- a/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx +++ b/drawinglayer/inc/drawinglayer/primitive2d/textdecoratedprimitive2d.hxx @@ -129,8 +129,8 @@ namespace drawinglayer TextStrikeout getTextStrikeout() const { return meTextStrikeout; } TextEmphasisMark getTextEmphasisMark() const { return meTextEmphasisMark; } TextRelief getTextRelief() const { return meTextRelief; } - basegfx::BColor getOverlineColor() const { return maOverlineColor; } - basegfx::BColor getTextlineColor() const { return maTextlineColor; } + const basegfx::BColor& getOverlineColor() const { return maOverlineColor; } + const basegfx::BColor& getTextlineColor() const { return maTextlineColor; } bool getUnderlineAbove() const { return mbUnderlineAbove; } bool getWordLineMode() const { return mbWordLineMode; } bool getEmphasisMarkAbove() const { return mbEmphasisMarkAbove; } diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx index 0ead7302ba38..8adcb6a10b82 100644 --- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx @@ -50,7 +50,7 @@ namespace drawinglayer } // provide unique ID - ImplPrimitrive2DIDBlock(StructureTagPrimitive2D, PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D) + ImplPrimitrive2DIDBlock(StructureTagPrimitive2D, PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D) } // end of namespace primitive2d } // end of namespace drawinglayer diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 0bc1b57113b8..68ca424cca78 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -982,26 +982,69 @@ namespace drawinglayer } case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D : { - // direct draw of hairline; use default processing - // also support SvtGraphicStroke MetaCommentAction const primitive2d::PolygonHairlinePrimitive2D& rHairlinePrimitive = static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate); - const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rHairlinePrimitive.getBColor())); - SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rHairlinePrimitive.getB2DPolygon(), &aLineColor, 0, 0, 0, 0); + const basegfx::B2DPolygon& rBasePolygon = rHairlinePrimitive.getB2DPolygon(); - impStartSvtGraphicStroke(pSvtGraphicStroke); - RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate), false); - impEndSvtGraphicStroke(pSvtGraphicStroke); + if(rBasePolygon.count() > (0x0000ffff - 1)) + { + // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points + // per polygon. If there are more, split the polygon in half and call recursively + const sal_uInt32 nCount(rBasePolygon.count()); + const sal_uInt32 nHalfCount((nCount - 1) >> 1); + const basegfx::B2DPolygon aLeft(rBasePolygon, 0, nHalfCount + 1); + const basegfx::B2DPolygon aRight(rBasePolygon, nHalfCount, nCount - nHalfCount); + const primitive2d::PolygonHairlinePrimitive2D aPLeft(aLeft, rHairlinePrimitive.getBColor()); + const primitive2d::PolygonHairlinePrimitive2D aPRight(aRight, rHairlinePrimitive.getBColor()); + + processBasePrimitive2D(aPLeft); + processBasePrimitive2D(aPRight); + } + else + { + // direct draw of hairline; use default processing + // support SvtGraphicStroke MetaCommentAction + const basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rHairlinePrimitive.getBColor())); + SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke( + rHairlinePrimitive.getB2DPolygon(), + &aLineColor, + 0, 0, 0, 0); + + impStartSvtGraphicStroke(pSvtGraphicStroke); + RenderPolygonHairlinePrimitive2D(static_cast< const primitive2d::PolygonHairlinePrimitive2D& >(rCandidate), false); + impEndSvtGraphicStroke(pSvtGraphicStroke); + } break; } case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D : { - // support SvtGraphicStroke MetaCommentAction const primitive2d::PolygonStrokePrimitive2D& rStrokePrimitive = static_cast< const primitive2d::PolygonStrokePrimitive2D& >(rCandidate); - SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rStrokePrimitive.getB2DPolygon(), 0, &rStrokePrimitive.getLineAttribute(), - &rStrokePrimitive.getStrokeAttribute(), 0, 0); + const basegfx::B2DPolygon& rBasePolygon = rStrokePrimitive.getB2DPolygon(); - if(true) + if(rBasePolygon.count() > (0x0000ffff - 1)) { + // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points + // per polygon. If there are more, split the polygon in half and call recursively + const sal_uInt32 nCount(rBasePolygon.count()); + const sal_uInt32 nHalfCount((nCount - 1) >> 1); + const basegfx::B2DPolygon aLeft(rBasePolygon, 0, nHalfCount + 1); + const basegfx::B2DPolygon aRight(rBasePolygon, nHalfCount, nCount - nHalfCount); + const primitive2d::PolygonStrokePrimitive2D aPLeft( + aLeft, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute()); + const primitive2d::PolygonStrokePrimitive2D aPRight( + aRight, rStrokePrimitive.getLineAttribute(), rStrokePrimitive.getStrokeAttribute()); + + processBasePrimitive2D(aPLeft); + processBasePrimitive2D(aPRight); + } + else + { + // support SvtGraphicStroke MetaCommentAction + SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke( + rBasePolygon, 0, + &rStrokePrimitive.getLineAttribute(), + &rStrokePrimitive.getStrokeAttribute(), + 0, 0); + impStartSvtGraphicStroke(pSvtGraphicStroke); const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute(); @@ -1013,12 +1056,12 @@ namespace drawinglayer if(0.0 == rStroke.getFullDotDashLen()) { - aHairLinePolyPolygon.append(rStrokePrimitive.getB2DPolygon()); + aHairLinePolyPolygon.append(rBasePolygon); } else { basegfx::tools::applyLineDashing( - rStrokePrimitive.getB2DPolygon(), rStroke.getDotDashArray(), + rBasePolygon, rStroke.getDotDashArray(), &aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen()); } @@ -1048,93 +1091,54 @@ namespace drawinglayer impEndSvtGraphicStroke(pSvtGraphicStroke); } - else - { - // Adapt OutDev's DrawMode if special ones were used - const sal_uInt32 nOriginalDrawMode(mpOutputDevice->GetDrawMode()); - adaptLineToFillDrawMode(); - - impStartSvtGraphicStroke(pSvtGraphicStroke); - - // #i101491# - // Change default of fat line generation for MetaFiles: Create MetaPolyLineAction - // instead of decomposing all geometries when the polygon has more than given amount of - // points; else the decomposition will get too expensive quiclky. OTOH - // the decomposition provides the better quality e.g. taking edge roundings - // into account which will NOT be taken into account with LineInfo-based actions - const sal_uInt32 nSubPolygonCount(rStrokePrimitive.getB2DPolygon().count()); - bool bDone(0 == nSubPolygonCount); - - if(!bDone && nSubPolygonCount > 1000) - { - // create MetaPolyLineActions, but without LINE_DASH - const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute(); - - if(basegfx::fTools::more(rLine.getWidth(), 0.0)) - { - const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute(); - basegfx::B2DPolyPolygon aHairLinePolyPolygon; - - if(0.0 == rStroke.getFullDotDashLen()) - { - aHairLinePolyPolygon.append(rStrokePrimitive.getB2DPolygon()); - } - else - { - basegfx::tools::applyLineDashing( - rStrokePrimitive.getB2DPolygon(), rStroke.getDotDashArray(), - &aHairLinePolyPolygon, 0, rStroke.getFullDotDashLen()); - } - - const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLine.getColor())); - mpOutputDevice->SetLineColor(Color(aHairlineColor)); - mpOutputDevice->SetFillColor(); - - aHairLinePolyPolygon.transform(maCurrentTransformation); - - const LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); - - for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++) - { - const basegfx::B2DPolygon aCandidate(aHairLinePolyPolygon.getB2DPolygon(a)); - - if(aCandidate.count() > 1) - { - const Polygon aToolsPolygon(aCandidate); - - mpMetaFile->AddAction(new MetaPolyLineAction(aToolsPolygon, aLineInfo)); - } - } - - bDone = true; - } - } - - if(!bDone) - { - // use decomposition (creates line geometry as filled polygon - // geometry) - process(rCandidate.get2DDecomposition(getViewInformation2D())); - } - - impEndSvtGraphicStroke(pSvtGraphicStroke); - - // restore DrawMode - mpOutputDevice->SetDrawMode(nOriginalDrawMode); - } break; } case PRIMITIVE2D_ID_POLYGONSTROKEARROWPRIMITIVE2D : { - // support SvtGraphicStroke MetaCommentAction const primitive2d::PolygonStrokeArrowPrimitive2D& rStrokeArrowPrimitive = static_cast< const primitive2d::PolygonStrokeArrowPrimitive2D& >(rCandidate); - SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke(rStrokeArrowPrimitive.getB2DPolygon(), 0, &rStrokeArrowPrimitive.getLineAttribute(), - &rStrokeArrowPrimitive.getStrokeAttribute(), &rStrokeArrowPrimitive.getStart(), &rStrokeArrowPrimitive.getEnd()); + const basegfx::B2DPolygon& rBasePolygon = rStrokeArrowPrimitive.getB2DPolygon(); + + if(rBasePolygon.count() > (0x0000ffff - 1)) + { + // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points + // per polygon. If there are more, split the polygon in half and call recursively + const sal_uInt32 nCount(rBasePolygon.count()); + const sal_uInt32 nHalfCount((nCount - 1) >> 1); + const basegfx::B2DPolygon aLeft(rBasePolygon, 0, nHalfCount + 1); + const basegfx::B2DPolygon aRight(rBasePolygon, nHalfCount, nCount - nHalfCount); + const attribute::LineStartEndAttribute aEmpty; + const primitive2d::PolygonStrokeArrowPrimitive2D aPLeft( + aLeft, + rStrokeArrowPrimitive.getLineAttribute(), + rStrokeArrowPrimitive.getStrokeAttribute(), + rStrokeArrowPrimitive.getStart(), + aEmpty); + const primitive2d::PolygonStrokeArrowPrimitive2D aPRight( + aRight, + rStrokeArrowPrimitive.getLineAttribute(), + rStrokeArrowPrimitive.getStrokeAttribute(), + aEmpty, + rStrokeArrowPrimitive.getEnd()); + + processBasePrimitive2D(aPLeft); + processBasePrimitive2D(aPRight); + } + else + { + // support SvtGraphicStroke MetaCommentAction + SvtGraphicStroke* pSvtGraphicStroke = impTryToCreateSvtGraphicStroke( + rBasePolygon, 0, + &rStrokeArrowPrimitive.getLineAttribute(), + &rStrokeArrowPrimitive.getStrokeAttribute(), + &rStrokeArrowPrimitive.getStart(), + &rStrokeArrowPrimitive.getEnd()); + + impStartSvtGraphicStroke(pSvtGraphicStroke); + process(rCandidate.get2DDecomposition(getViewInformation2D())); + impEndSvtGraphicStroke(pSvtGraphicStroke); + } - impStartSvtGraphicStroke(pSvtGraphicStroke); - process(rCandidate.get2DDecomposition(getViewInformation2D())); - impEndSvtGraphicStroke(pSvtGraphicStroke); break; } case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D : @@ -1780,7 +1784,7 @@ namespace drawinglayer } break; } - case PRIMITIVE2D_ID_STRUCTURETAGRIMITIVE2D : + case PRIMITIVE2D_ID_STRUCTURETAGPRIMITIVE2D : { // structured tag primitive const primitive2d::StructureTagPrimitive2D& rStructureTagCandidate = static_cast< const primitive2d::StructureTagPrimitive2D& >(rCandidate); -- cgit From cc7090d4a96f70b56920302a48895100a0d7c671 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 17 Jun 2010 16:10:42 +0200 Subject: #i97336# check if text shape actually has text --- svx/source/sdr/properties/textproperties.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 348c319e256e..091656e1f261 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -185,18 +185,21 @@ namespace sdr { SdrText* pText = rObj.getText( nCount ); OutlinerParaObject* pParaObj = pText->GetOutlinerParaObject(); - rOutliner.SetText(*pParaObj); - sal_uInt32 nParaCount(rOutliner.GetParagraphCount()); - - if(nParaCount) + if( pParaObj ) { - ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL); - rOutliner.RemoveAttribs(aSelection, sal_True, 0); + rOutliner.SetText(*pParaObj); + sal_uInt32 nParaCount(rOutliner.GetParagraphCount()); - OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount); - rOutliner.Clear(); + if(nParaCount) + { + ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL); + rOutliner.RemoveAttribs(aSelection, sal_True, 0); - rObj.NbcSetOutlinerParaObjectForText( pTemp, pText ); + OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount); + rOutliner.Clear(); + + rObj.NbcSetOutlinerParaObjectForText( pTemp, pText ); + } } } } -- cgit From 7d9bce7ca0408786d0ad448dee0f2bf480870d3e Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 17 Jun 2010 16:30:50 +0200 Subject: jl153: #i110720# ignore spurious elements in .xcu set nodes --- configmgr/source/xcuparser.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index eda478b18b70..cd1e6e55d085 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -196,6 +196,14 @@ bool XcuParser::startElement( { handleSetNode( reader, dynamic_cast< SetNode * >(state_.top().node.get())); + } else if (ns == XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) + { + OSL_TRACE( + "configmgr bad set node member in %s", + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored } else { throw css::uno::RuntimeException( (rtl::OUString( -- cgit From 5dd14a854a449af2df6e573bc008416fd9f71e53 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 17 Jun 2010 18:28:42 +0200 Subject: unoawt2: allow creating dialogs with a parent window --- scripting/source/dlgprov/dlgprov.cxx | 25 +++++++++++++++++++++++++ scripting/source/dlgprov/dlgprov.hxx | 5 +++++ 2 files changed, 30 insertions(+) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index aa6c6cfb966a..48aac0c88f4e 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -766,6 +766,31 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs return xDialog; } + Reference < XDialog > DialogProviderImpl::createDialogWithArguments( + const ::rtl::OUString& URL, const Sequence< PropertyValue >& Arguments ) + throw (IllegalArgumentException, RuntimeException) + { + ::comphelper::NamedValueCollection aArguments( Arguments ); + + Reference< XWindowPeer > xParentPeer; + if ( aArguments.has( "ParentWindow" ) ) + { + const Any aParentWindow( aArguments.get( "ParentWindow" ) ); + if ( !( aParentWindow >>= xParentPeer ) ) + { + const Reference< XControl > xParentControl( aParentWindow, UNO_QUERY ); + if ( xParentControl.is() ) + xParentPeer = xParentControl->getPeer(); + } + } + + const Reference< XInterface > xHandler( aArguments.get( "EventHandler" ), UNO_QUERY ); + + Reference < XControl > xControl = DialogProviderImpl::createDialogImpl( URL, xHandler, xParentPeer, true ); + Reference< XDialog > xDialog( xControl, UNO_QUERY ); + return xDialog; + } + Reference< XWindow > DialogProviderImpl::createContainerWindow( const ::rtl::OUString& URL, const ::rtl::OUString& WindowType, const Reference< XWindowPeer >& xParent, const Reference< XInterface >& xHandler ) diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx index f55239ff13e8..d8bd8782b9f1 100644 --- a/scripting/source/dlgprov/dlgprov.hxx +++ b/scripting/source/dlgprov/dlgprov.hxx @@ -138,6 +138,11 @@ namespace dlgprov const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xHandler ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialogWithArguments( + const ::rtl::OUString& URL, + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createContainerWindow( const ::rtl::OUString& URL, const ::rtl::OUString& WindowType, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent, -- cgit From 1d10d008c5428bb8f24bbffedcf068ab656a967a Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 17 Jun 2010 21:10:41 +0200 Subject: #161254# adding timeout for get state to prevent freeze --- avmedia/source/gstreamer/gstplayer.cxx | 20 ++++++++++++++------ avmedia/source/gstreamer/gstplayer.hxx | 1 + 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index fe471a2c6fa2..edddf2755f93 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -35,6 +35,10 @@ #include #include + +// maximum timeout time in nanoseconds +#define GST_MAX_TIMEOUT 500000000 + using namespace ::com::sun::star; namespace avmedia @@ -81,7 +85,8 @@ Player::Player( GString* pURI ) : mnVolumeDB( 0 ), mnLooping( 0 ), mnQuit( 0 ), - mnVideoWindowSet( 0 ) + mnVideoWindowSet( 0 ), + mnInitFail( 0 ) { // initialize GStreamer framework only once static bool bGstInitialized = false; @@ -207,7 +212,7 @@ sal_Bool SAL_CALL Player::isPlaying() if( mpPlayer ) { - gst_element_get_state( mpPlayer, &aState, NULL, GST_CLOCK_TIME_NONE ); + gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ); } return( GST_STATE_PLAYING == aState ); @@ -450,7 +455,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( GstState aOldState = GST_STATE_NULL; mpPlayerWindow = pPlayerWindow; - gst_element_get_state( mpPlayer, &aOldState, NULL, GST_CLOCK_TIME_NONE ); + gst_element_get_state( mpPlayer, &aOldState, NULL, GST_MAX_TIMEOUT ); gst_element_set_state( mpPlayer, GST_STATE_READY ); g_object_set( mpPlayer, "video-sink", pVideoSink, NULL ); gst_element_set_state( mpPlayer, aOldState ); @@ -543,11 +548,11 @@ bool Player::implInitPlayer() { bool bRet = false; - if( mpPlayer ) + if( mpPlayer && (mnInitFail < 3) ) { GstState aState = GST_STATE_NULL; - if( gst_element_get_state( mpPlayer, &aState, NULL, GST_CLOCK_TIME_NONE ) == GST_STATE_CHANGE_SUCCESS ) + if( gst_element_get_state( mpPlayer, &aState, NULL, GST_MAX_TIMEOUT ) == GST_STATE_CHANGE_SUCCESS ) { bRet = ( GST_STATE_PAUSED == aState ) || ( GST_STATE_PLAYING == aState ); @@ -555,10 +560,13 @@ bool Player::implInitPlayer() { gst_element_set_state( mpPlayer, GST_STATE_PAUSED ); bRet = ( gst_element_get_state( mpPlayer, &aState, NULL, - GST_CLOCK_TIME_NONE ) == GST_STATE_CHANGE_SUCCESS ) && + GST_MAX_TIMEOUT ) == GST_STATE_CHANGE_SUCCESS ) && ( GST_STATE_PAUSED == aState ); } } + + if( ! bRet ) + mnInitFail++; } return( bRet ); diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx index 2eca2b12a9a6..d751e381258d 100644 --- a/avmedia/source/gstreamer/gstplayer.hxx +++ b/avmedia/source/gstreamer/gstplayer.hxx @@ -228,6 +228,7 @@ private: gint mnLooping; gint mnQuit; gint mnVideoWindowSet; + gint mnInitFail; }; } // namespace gst } // namespace avmedia -- cgit From f5dca43c9a814b8955edf6968443737e521162dc Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Fri, 18 Jun 2010 15:27:12 +0200 Subject: #i102353# correct page number and page count field when printing handouts --- svx/inc/svx/svdmodel.hxx | 6 +++++- svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 12 ++++++++++-- svx/source/svdraw/svdmodel.cxx | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index fc8d401f94e7..328efedd98f0 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -276,7 +276,7 @@ public: SdrOutlinerCache* mpOutlinerCache; SdrModelImpl* mpImpl; UINT16 mnCharCompressType; - UINT16 nReserveUInt5; + UINT16 mnHandoutPageCount; UINT16 nReserveUInt6; UINT16 nReserveUInt7; FASTBOOL mbModelLocked; @@ -298,6 +298,10 @@ public: SvNumberFormatter* mpNumberFormatter; public: const SvNumberFormatter& GetNumberFormatter() const; + + UINT16 getHandoutPageCount() const { return mnHandoutPageCount; } + void setHandoutPageCount( UINT16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; } + protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel(); diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 2320944afd03..089f75aa8ade 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -77,8 +77,16 @@ namespace if(pPage && pPage->GetModel()) { - const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); - nRetval = ((sal_Int16)nPageCount - 1) / 2; + if( (pPage->GetPageNum() == 0) && !pPage->IsMasterPage() ) + { + // handout page! + return pPage->GetModel()->getHandoutPageCount(); + } + else + { + const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); + nRetval = ((sal_Int16)nPageCount - 1) / 2; + } } return nRetval; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 2fcdfdffbb8a..8ab385fa329c 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -178,6 +178,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe mpOutlinerCache = NULL; mbKernAsianPunctuation = sal_False; mbAddExtLeading = sal_False; + mnHandoutPageCount = 0; SvxAsianConfig aAsian; mnCharCompressType = aAsian.GetCharDistanceCompression(); -- cgit From 94b9ce9272f17c7c2412eaba99771e782a463d1e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 18 Jun 2010 16:36:34 +0200 Subject: sb123: #i112473# RDFaExportHelper: don't use SvXMLExport::GetRelativeReference() --- xmloff/source/core/RDFaExportHelper.cxx | 37 ++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index 593e2d1f29e6..f603d21258fd 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -37,6 +37,8 @@ #include #include +#include +#include #include #include #include @@ -85,6 +87,39 @@ makeCURIE(SvXMLExport * i_pExport, return buf.makeStringAndClear(); } +// #i112473# SvXMLExport::GetRelativeReference() not right for RDF on SaveAs +// because the URIs in the repository are not rewritten on SaveAs, the +// URI of the loaded document has to be used, not the URI of the target doc. +static ::rtl::OUString +getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI) +{ + uno::Reference< rdf::XURI > const xModelURI( + rExport.GetModel(), uno::UNO_QUERY_THROW ); + ::rtl::OUString const baseURI( xModelURI->getStringValue() ); + + uno::Reference const xContext( + rExport.GetComponentContext()); + uno::Reference const xServiceFactory( + xContext->getServiceManager(), uno::UNO_SET_THROW); + uno::Reference const xUriFactory( + xServiceFactory->createInstanceWithContext( + ::rtl::OUString::createFromAscii( + "com.sun.star.uri.UriReferenceFactory"), xContext), + uno::UNO_QUERY_THROW); + + uno::Reference< uri::XUriReference > const xBaseURI( + xUriFactory->parse(baseURI), uno::UNO_SET_THROW ); + uno::Reference< uri::XUriReference > const xAbsoluteURI( + xUriFactory->parse(rURI), uno::UNO_SET_THROW ); + uno::Reference< uri::XUriReference > const xRelativeURI( + xUriFactory->makeRelative(xBaseURI, xAbsoluteURI, true, true, false), + uno::UNO_SET_THROW ); + ::rtl::OUString const relativeURI(xRelativeURI->getUriReference()); + + return relativeURI; +} + + //////////////////////////////////////////////////////////////////////////// RDFaExportHelper::RDFaExportHelper(SvXMLExport & i_rExport) @@ -145,7 +180,7 @@ RDFaExportHelper::AddRDFa( static const sal_Unicode s_OpenBracket ('['); static const sal_Unicode s_CloseBracket(']'); const ::rtl::OUString about( xSubjectURI.is() - ? m_rExport.GetRelativeReference(xSubjectURI->getStringValue()) + ? getRelativeReference(m_rExport, xSubjectURI->getStringValue()) : ::rtl::OUStringBuffer().append(s_OpenBracket).append( LookupBlankNode(xSubjectBNode)).append(s_CloseBracket) .makeStringAndClear() -- cgit From 973a452d8a84412ffed3380e4e9f51b5bf9f0e66 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 18 Jun 2010 16:44:10 +0200 Subject: sb123: #i112473#: DocumentMetadataAccessTest.java: re-activate disabled test --- .../complex/framework/DocumentMetadataAccessTest.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java index 0ebbbc25da59..3f61cb21b3dd 100644 --- a/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java +++ b/sfx2/qa/complex/framework/DocumentMetadataAccessTest.java @@ -798,17 +798,16 @@ public class DocumentMetadataAccessTest x_FooBarLit11 })); -// differ in file names, which is right in the new test environment -// XURI xFile = URI.createNS(xContext, file, "/" + contentPath); -// Statement x_FileBarLit12 = -// new Statement(xFile, bar, mkLit("12"), null); + XURI xFile = URI.createNS(xContext, file, "/" + contentPath); + Statement x_FileBarLit12 = + new Statement(xFile, bar, mkLit("12"), null); xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); -// result = xRep.getStatementRDFa(xPara); -// assertTrue("RDFa: 12", -// !result.Second && -// eq(result.First, new Statement[] { -// x_FileBarLit12 -// })); + result = xRep.getStatementRDFa(xPara); + assertTrue("RDFa: 12", + !result.Second && + eq(result.First, new Statement[] { + x_FileBarLit12 + })); xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); result = xRep.getStatementRDFa(xPara); -- cgit From a5b90aef59991be1c4436ce8bafdc7b1bf45f949 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 18 Jun 2010 17:07:20 +0200 Subject: sb123: rename DocumentMetaData.java to DocumentPropertiesTest.java --- sfx2/qa/complex/framework/DocumentMetaData.java | 565 --------------------- .../complex/framework/DocumentPropertiesTest.java | 565 +++++++++++++++++++++ sfx2/qa/complex/framework/makefile.mk | 2 +- 3 files changed, 566 insertions(+), 566 deletions(-) delete mode 100644 sfx2/qa/complex/framework/DocumentMetaData.java create mode 100644 sfx2/qa/complex/framework/DocumentPropertiesTest.java diff --git a/sfx2/qa/complex/framework/DocumentMetaData.java b/sfx2/qa/complex/framework/DocumentMetaData.java deleted file mode 100644 index c94d2f64e768..000000000000 --- a/sfx2/qa/complex/framework/DocumentMetaData.java +++ /dev/null @@ -1,565 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.framework; - - -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XComponentContext; -import com.sun.star.lang.XInitialization; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.Locale; -import com.sun.star.lang.EventObject; -import com.sun.star.util.Date; -import com.sun.star.util.DateTime; -import com.sun.star.util.Time; -import com.sun.star.util.Duration; -import com.sun.star.util.XModifyListener; -import com.sun.star.util.XModifyBroadcaster; -import com.sun.star.beans.XPropertyContainer; -import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.NamedValue; -import com.sun.star.beans.PropertyAttribute; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.beans.IllegalTypeException; - -import com.sun.star.document.XDocumentProperties; - -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openoffice.test.OfficeConnection; -import static org.junit.Assert.*; - -/** - * Test case for the service com.sun.star.document.DocumentProperties. - * Currently, this service is implemented in - * sfx2/source/doc/SfxDocumentMetaData.cxx. - * - * @author mst - */ -public class DocumentMetaData -{ -// public String[] getTestMethodNames () { -// return new String[] { "check", "cleanup" }; -// } - - @After public void cleanup() { - // nothing to do - } - - // for testing modifications - class Listener implements XModifyListener { - private boolean m_Called; - - public Listener() { - m_Called = false; - } - - public boolean reset() { - boolean oldCalled = m_Called; - m_Called = false; - return oldCalled; - } - - public void modified(EventObject e) { - m_Called = true; - } - - public void disposing(EventObject e) { - } - } - - @Test public void check() { - try { - XMultiServiceFactory xMSF = getMSF(); - assertNotNull("could not create MultiServiceFactory.", xMSF); - XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF); - Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); - XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); - assertNotNull("could not get component context.", xContext); - - // TODO: Path to temp - String temp = util.utils.getOfficeTemp/*Dir*/(xMSF); - System.out.println("tempdir: " + temp); - - PropertyValue[] noArgs = { }; - PropertyValue mimetype = new PropertyValue(); - mimetype.Name = "MediaType"; - mimetype.Value = "application/vnd.oasis.opendocument.text"; - PropertyValue[] mimeArgs = { mimetype }; -// new Any("application/vnd.oasis.opendocument.text")) }; - PropertyValue cfile = new PropertyValue(); - cfile.Name = "URL"; - cfile.Value = temp + "EMPTY.odt"; - PropertyValue[] mimeEmptyArgs = { mimetype, cfile }; - - System.out.println("Creating service DocumentProperties..."); - - Object oDP = -// xMSF.createInstanceWithContext( -// "com.sun.star.document.DocumentProperties", xContext); - xMSF.createInstance("com.sun.star.document.DocumentProperties"); - XDocumentProperties xDP = UnoRuntime.queryInterface(XDocumentProperties.class, oDP); - - System.out.println("...done"); - - - System.out.println("Checking initialize ..."); - - XDocumentProperties xDP2 = UnoRuntime.queryInterface(XDocumentProperties.class, xMSF.createInstance("com.sun.star.document.DocumentProperties")); - XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xDP2); - xInit.initialize(new Object[] { }); - - System.out.println("...done"); - - System.out.println("Checking storing default-initialized meta data ..."); - -// xDP2.storeToMedium(temp + "EMPTY.odt", mimeArgs); - xDP2.storeToMedium("", mimeEmptyArgs); - - System.out.println("...done"); - - System.out.println("Checking loading default-initialized meta data ..."); - -// xDP2.loadFromMedium(temp + "EMPTY.odt", noArgs); - xDP2.loadFromMedium("", mimeEmptyArgs); - assertTrue ("Author", "".equals(xDP2.getAuthor())); - - System.out.println("...done"); - - System.out.println("(Not) Checking preservation of custom meta data ..."); - - xDP2.loadFromMedium(TestDocument.getUrl("CUSTOM.odt"), - noArgs); - assertTrue ("Author", "".equals(xDP2.getAuthor())); - xDP2.storeToMedium(temp + "CUSTOM.odt", mimeArgs); - - //FIXME: now what? comparing for binary equality seems useless - // we could unzip the written file and grep for the custom stuff - // but would that work on windows... - - System.out.println("...done"); - - System.out.println("Checking loading from test document..."); - - String file = TestDocument.getUrl("TEST.odt"); - xDP.loadFromMedium(file, noArgs); -/* XInputStream xStream = - new StreamSimulator("./testdocuments/TEST.odt", true, param); - Object oSF = - xMSF.createInstance("com.sun.star.embed.StorageFactory"); - XSingleServiceFactory xSF = (XSingleServiceFactory) - UnoRuntime.queryInterface(XSingleServiceFactory.class, oSF); - Object oStor = xSF.createInstanceWithArguments( - new Object[] { xStream }); - XStorage xStor = (XStorage) UnoRuntime.queryInterface( - XStorage.class, oStor); - xDP.loadFromStorage(xStor);*/ - - System.out.println("...done"); - - System.out.println("Checking meta-data import..."); - - assertTrue("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor())); - assertTrue("Generator", - "StarOffice/8$Solaris_x86 OpenOffice.org_project/680m232$Build-9227" - .equals(xDP.getGenerator())); - assertTrue("CreationDate", 2007 == xDP.getCreationDate().Year); - assertTrue("Title", "Urgent Memo".equals(xDP.getTitle())); - assertTrue("Subject", "Wichtige Mitteilung".equals(xDP.getSubject())); - assertTrue("Description", - "Modern internal company memorandum in full-blocked style" - .equals(xDP.getDescription())); -// assertTrue("Language", "".equals(xDP.getLanguage())); - assertTrue("ModifiedBy", - "Karl-Heinz Mustermann".equals(xDP.getModifiedBy())); - assertTrue("ModificationDate", 10 == xDP.getModificationDate().Month); - assertTrue("PrintedBy", - "Karl-Heinz Mustermann".equals(xDP.getPrintedBy())); - assertTrue("PrintDate", 29 == xDP.getPrintDate().Day); - assertTrue("TemplateName", - "Modern Memo".equals(xDP.getTemplateName())); - assertTrue("TemplateURL", - xDP.getTemplateURL().endsWith("memmodern.ott")); - assertTrue("TemplateDate", 17 == xDP.getTemplateDate().Hours); - assertTrue("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL())); - assertTrue("AutoloadSecs", 0 == xDP.getAutoloadSecs()); - assertTrue("DefaultTarget", "_blank".equals(xDP.getDefaultTarget())); - assertTrue("EditingCycles", 3 == xDP.getEditingCycles()); - assertTrue("EditingDuration", 320 == xDP.getEditingDuration()); - - String[] kws = xDP.getKeywords(); - assertTrue("Keywords", fromArray(kws).containsAll( - fromArray(new Object[] { "Asien", "Memo", "Reis" }))); - - NamedValue[] ds = xDP.getDocumentStatistics(); -/* for (int i = 0; i < ds.length; ++i) { - System.out.println("nv: " + ds[i].Name + " " + ds[i].Value); - } - NamedValue nv1 = new NamedValue("WordCount", new Integer(23)); - NamedValue nv2 = new NamedValue("WordCount", new Integer(23)); - System.out.println("eq: " + nv1.equals(nv2)); // grrr, this is false... -*/ - assertTrue("DocumentStatistics:WordCount", containsNV(ds, - new NamedValue("WordCount", new Integer(23)))); - assertTrue("DocumentStatistics:PageCount", containsNV(ds, - new NamedValue("PageCount", new Integer(1)))); - - XPropertyContainer udpc = xDP.getUserDefinedProperties(); - XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, udpc); - assertTrue("UserDefined 1", "Dies ist ein wichtiger Hinweis" - .equals(udps.getPropertyValue("Hinweis"))); - assertTrue("UserDefined 2", ("Kann Spuren von N" - + new String(new byte[] { (byte) 0xc3, (byte) 0xbc }, "UTF-8") - + "ssen enthalten") - .equals(udps.getPropertyValue("Warnung"))); - - System.out.println("...done"); - - System.out.println("Checking meta-data updates..."); - - String str; - DateTime dt = new DateTime(); - Locale l = new Locale(); - int i; - - str = "me"; - xDP.setAuthor(str); - assertTrue("setAuthor", str.equals(xDP.getAuthor())); - str = "the computa"; - xDP.setGenerator(str); - assertTrue("setGenerator", str.equals(xDP.getGenerator())); - dt.Year = 2038; - dt.Month = 1; - dt.Day = 1; - xDP.setCreationDate(dt); - assertTrue("setCreationDate", dt.Year == xDP.getCreationDate().Year); - str = "El t'itulo"; - xDP.setTitle(str); - assertTrue("setTitle", str.equals(xDP.getTitle())); - str = "Ein verkommenes Subjekt"; - xDP.setSubject(str); - assertTrue("setSubject", str.equals(xDP.getSubject())); - str = "Este descripci'on no es importante"; - xDP.setDescription(str); - assertTrue("setDescription", str.equals(xDP.getDescription())); - l.Language = "en"; - l.Country = "GB"; - xDP.setLanguage(l); - Locale l2 = xDP.getLanguage(); - assertTrue("setLanguage Lang", l.Language.equals(l2.Language)); - assertTrue("setLanguage Cty", l.Country.equals(l2.Country)); - str = "myself"; - xDP.setModifiedBy(str); - assertTrue("setModifiedBy", str.equals(xDP.getModifiedBy())); - dt.Year = 2042; - xDP.setModificationDate(dt); - assertTrue("setModificationDate", - dt.Year == xDP.getModificationDate().Year); - str = "i didnt do it"; - xDP.setPrintedBy(str); - assertTrue("setPrintedBy", str.equals(xDP.getPrintedBy())); - dt.Year = 2024; - xDP.setPrintDate(dt); - assertTrue("setPrintDate", dt.Year == xDP.getPrintDate().Year); - str = "blah"; - xDP.setTemplateName(str); - assertTrue("setTemplateName", str.equals(xDP.getTemplateName())); - str = "gopher://some-hole-in-the-ground/"; - xDP.setTemplateURL(str); - assertTrue("setTemplateURL", str.equals(xDP.getTemplateURL())); - dt.Year = 2043; - xDP.setTemplateDate(dt); - assertTrue("setTemplateDate", dt.Year == xDP.getTemplateDate().Year); - str = "http://nowhere/"; - xDP.setAutoloadURL(str); - assertTrue("setAutoloadURL", str.equals(xDP.getAutoloadURL())); - i = 3661; // this might not work (due to conversion via double...) - xDP.setAutoloadSecs(i); -// System.out.println("set: " + i + " get: " + xDP.getAutoloadSecs()); - assertTrue("setAutoloadSecs", i == xDP.getAutoloadSecs()); - str = "_blank"; - xDP.setDefaultTarget(str); - assertTrue("setDefaultTarget", str.equals(xDP.getDefaultTarget())); - i = 42; - xDP.setEditingCycles((short) i); - assertTrue("setEditingCycles", i == xDP.getEditingCycles()); - i = 84; - xDP.setEditingDuration(i); - assertTrue("setEditingDuration", i == xDP.getEditingDuration()); - str = ""; - - String[] kws2 = new String[] { - "keywordly", "keywordlike", "keywordalicious" }; - xDP.setKeywords(kws2); - kws = xDP.getKeywords(); - assertTrue("setKeywords", fromArray(kws).containsAll(fromArray(kws2))); - - NamedValue[] ds2 = new NamedValue[] { - new NamedValue("SyllableCount", new Integer(9)), - new NamedValue("FrameCount", new Integer(2)), - new NamedValue("SentenceCount", new Integer(7)) }; - xDP.setDocumentStatistics(ds2); - ds = xDP.getDocumentStatistics(); - assertTrue("setDocumentStatistics:SyllableCount", containsNV(ds, - new NamedValue("SyllableCount", new Integer(9)))); - assertTrue("setDocumentStatistics:FrameCount", containsNV(ds, - new NamedValue("FrameCount", new Integer(2)))); - assertTrue("setDocumentStatistics:SentenceCount", containsNV(ds, - new NamedValue("SentenceCount", new Integer(7)))); - - System.out.println("...done"); - - System.out.println("Checking user-defined meta-data updates..."); - - // actually, this tests the PropertyBag service - // but maybe the DocumentProperties service will be implemented - // differently some day... - boolean b = true; - double d = 3.1415; - // note that Time is only supported for backward compatibilty! - Time t = new Time(); - t.Hours = 1; - t.Minutes = 16; - Date date = new Date(); - date.Year = 2071; - date.Month = 2; - date.Day = 3; - dt.Year = 2065; - Duration dur = new Duration(); - dur.Negative = true; - dur.Years = 1001; - dur.Months = 999; - dur.Days = 888; - dur.Hours = 777; - dur.Minutes = 666; - dur.Seconds = 555; - dur.MilliSeconds = 444; - - udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, - new Boolean(b)); - udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur); - udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t); - udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date); - udpc.addProperty("FrobStartTime", PropertyAttribute.REMOVEABLE, dt); - udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); - udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); - udpc.addProperty("Removed", PropertyAttribute.REMOVEABLE, "bar"); - // #i94175#: empty property name is valid ODF 1.1 - udpc.addProperty("", PropertyAttribute.REMOVEABLE, "eeeeek"); - try { - udpc.removeProperty("Info 1"); - udpc.removeProperty("Removed"); - } catch (UnknownPropertyException e) { - fail("removeProperty failed"); - } - - try { - udpc.addProperty("Forbidden", PropertyAttribute.REMOVEABLE, - new String[] { "foo", "bar" }); - fail("inserting value of non-supported type did not fail"); - } catch (IllegalTypeException e) { - // ignore - } - - assertTrue("UserDefined bool", new Boolean(b).equals( - udps.getPropertyValue("Frobnicate"))); - assertTrue("UserDefined duration", eqDuration(dur, (Duration) - udps.getPropertyValue("FrobDuration"))); - assertTrue("UserDefined time", eqTime(t, (Time) - udps.getPropertyValue("FrobDuration2"))); - assertTrue("UserDefined date", eqDate(date, (Date) - udps.getPropertyValue("FrobEndDate"))); - assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) - udps.getPropertyValue("FrobStartTime"))); - assertTrue("UserDefined float", new Double(d).equals( - udps.getPropertyValue("Pi"))); - assertTrue("UserDefined string", "bar".equals( - udps.getPropertyValue("Foo"))); - assertTrue("UserDefined empty name", "eeeeek".equals( - udps.getPropertyValue(""))); - - try { - udps.getPropertyValue("Removed"); - fail("UserDefined remove didn't"); - } catch (UnknownPropertyException e) { - // ok - } - - System.out.println("...done"); - - System.out.println("Checking storing meta-data to file..."); - - xDP.storeToMedium(temp + "TEST.odt", mimeArgs); - - System.out.println("...done"); - - System.out.println("Checking loading meta-data from stored file..."); - - xDP.loadFromMedium(temp + "TEST.odt", noArgs); - - System.out.println("...done"); - - System.out.println("Checking user-defined meta-data from stored file..."); - - udpc = xDP.getUserDefinedProperties(); - udps = (XPropertySet) UnoRuntime.queryInterface( - XPropertySet.class, udpc); - - assertTrue("UserDefined bool", new Boolean(b).equals( - udps.getPropertyValue("Frobnicate"))); - assertTrue("UserDefined duration", eqDuration(dur, (Duration) - udps.getPropertyValue("FrobDuration"))); - // this is now a Duration! - Duration t_dur = new Duration(false, (short)0, (short)0, (short)0, - t.Hours, t.Minutes, t.Seconds, - (short)(10 * t.HundredthSeconds)); - assertTrue("UserDefined time", eqDuration(t_dur, (Duration) - udps.getPropertyValue("FrobDuration2"))); - assertTrue("UserDefined date", eqDate(date, (Date) - udps.getPropertyValue("FrobEndDate"))); - assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) - udps.getPropertyValue("FrobStartTime"))); - assertTrue("UserDefined float", new Double(d).equals( - udps.getPropertyValue("Pi"))); - assertTrue("UserDefined string", "bar".equals( - udps.getPropertyValue("Foo"))); - - try { - udps.getPropertyValue("Removed"); - fail("UserDefined remove didn't"); - } catch (UnknownPropertyException e) { - // ok - } - - System.out.println("...done"); - - System.out.println("Checking notification listener interface..."); - - Listener listener = new Listener(); - XModifyBroadcaster xMB = (XModifyBroadcaster) - UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP); - xMB.addModifyListener(listener); - xDP.setAuthor("not me"); - assertTrue("Listener Author", listener.reset()); - udpc.addProperty("Listener", PropertyAttribute.REMOVEABLE, "foo"); - assertTrue("Listener UserDefined Add", listener.reset()); - udps.setPropertyValue("Listener", "bar"); - assertTrue("Listener UserDefined Set", listener.reset()); - udpc.removeProperty("Listener"); - assertTrue("Listener UserDefined Remove", listener.reset()); - xMB.removeModifyListener(listener); - udpc.addProperty("Listener2", PropertyAttribute.REMOVEABLE, "foo"); - assertTrue("Removed Listener UserDefined Add", !listener.reset()); - - System.out.println("...done"); - - } catch (Exception e) { - report(e); - } - } - - // grrr... - boolean eqDateTime(DateTime a, DateTime b) { - return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day - && a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.HundredthSeconds == b.HundredthSeconds; - } - - boolean eqDate(Date a, Date b) { - return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day; - } - - boolean eqTime(Time a, Time b) { - return a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.HundredthSeconds == b.HundredthSeconds; - } - - boolean eqDuration(Duration a, Duration b) { - return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days - && a.Hours == b.Hours && a.Minutes == b.Minutes - && a.Seconds == b.Seconds - && a.MilliSeconds == b.MilliSeconds - && a.Negative == b.Negative; - } - - java.util.Collection fromArray(Object[] os) { - java.util.Collection ret = new java.util.HashSet(); - for (int i = 0; i < os.length; ++i) { - ret.add(os[i]); - } - return ret; - } - - // bah, structs do not have proper equals(), and uno.Type is not comparable - public static boolean containsNV (NamedValue[] nvs, NamedValue nv) { - for (int i = 0; i < nvs.length; ++i) { - if (nvs[i].Name.equals(nv.Name) && nvs[i].Value.equals(nv.Value)) { - return true; - } - } - return false; - } - - public void report(Exception e) { - System.out.println("Exception occurred:"); - e.printStackTrace(); - fail(); - } - - - private XMultiServiceFactory getMSF() - { - final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); - return xMSF1; - } - - // setup and close connections - @BeforeClass public static void setUpConnection() throws Exception { - System.out.println("setUpConnection()"); - connection.setUp(); - } - - @AfterClass public static void tearDownConnection() - throws InterruptedException, com.sun.star.uno.Exception - { - System.out.println("tearDownConnection() DocumentMetaData"); - connection.tearDown(); - } - - private static final OfficeConnection connection = new OfficeConnection(); - -} - diff --git a/sfx2/qa/complex/framework/DocumentPropertiesTest.java b/sfx2/qa/complex/framework/DocumentPropertiesTest.java new file mode 100644 index 000000000000..20a0746c8322 --- /dev/null +++ b/sfx2/qa/complex/framework/DocumentPropertiesTest.java @@ -0,0 +1,565 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.framework; + + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XComponentContext; +import com.sun.star.lang.XInitialization; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lang.Locale; +import com.sun.star.lang.EventObject; +import com.sun.star.util.Date; +import com.sun.star.util.DateTime; +import com.sun.star.util.Time; +import com.sun.star.util.Duration; +import com.sun.star.util.XModifyListener; +import com.sun.star.util.XModifyBroadcaster; +import com.sun.star.beans.XPropertyContainer; +import com.sun.star.beans.XPropertySet; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.NamedValue; +import com.sun.star.beans.PropertyAttribute; +import com.sun.star.beans.UnknownPropertyException; +import com.sun.star.beans.IllegalTypeException; + +import com.sun.star.document.XDocumentProperties; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +/** + * Test case for the service com.sun.star.document.DocumentProperties. + * Currently, this service is implemented in + * sfx2/source/doc/SfxDocumentMetaData.cxx. + * + * @author mst + */ +public class DocumentPropertiesTest +{ +// public String[] getTestMethodNames () { +// return new String[] { "check", "cleanup" }; +// } + + @After public void cleanup() { + // nothing to do + } + + // for testing modifications + class Listener implements XModifyListener { + private boolean m_Called; + + public Listener() { + m_Called = false; + } + + public boolean reset() { + boolean oldCalled = m_Called; + m_Called = false; + return oldCalled; + } + + public void modified(EventObject e) { + m_Called = true; + } + + public void disposing(EventObject e) { + } + } + + @Test public void check() { + try { + XMultiServiceFactory xMSF = getMSF(); + assertNotNull("could not create MultiServiceFactory.", xMSF); + XPropertySet xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, xMSF); + Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext"); + XComponentContext xContext = UnoRuntime.queryInterface(XComponentContext.class, defaultCtx); + assertNotNull("could not get component context.", xContext); + + // TODO: Path to temp + String temp = util.utils.getOfficeTemp/*Dir*/(xMSF); + System.out.println("tempdir: " + temp); + + PropertyValue[] noArgs = { }; + PropertyValue mimetype = new PropertyValue(); + mimetype.Name = "MediaType"; + mimetype.Value = "application/vnd.oasis.opendocument.text"; + PropertyValue[] mimeArgs = { mimetype }; +// new Any("application/vnd.oasis.opendocument.text")) }; + PropertyValue cfile = new PropertyValue(); + cfile.Name = "URL"; + cfile.Value = temp + "EMPTY.odt"; + PropertyValue[] mimeEmptyArgs = { mimetype, cfile }; + + System.out.println("Creating service DocumentProperties..."); + + Object oDP = +// xMSF.createInstanceWithContext( +// "com.sun.star.document.DocumentProperties", xContext); + xMSF.createInstance("com.sun.star.document.DocumentProperties"); + XDocumentProperties xDP = UnoRuntime.queryInterface(XDocumentProperties.class, oDP); + + System.out.println("...done"); + + + System.out.println("Checking initialize ..."); + + XDocumentProperties xDP2 = UnoRuntime.queryInterface(XDocumentProperties.class, xMSF.createInstance("com.sun.star.document.DocumentProperties")); + XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xDP2); + xInit.initialize(new Object[] { }); + + System.out.println("...done"); + + System.out.println("Checking storing default-initialized meta data ..."); + +// xDP2.storeToMedium(temp + "EMPTY.odt", mimeArgs); + xDP2.storeToMedium("", mimeEmptyArgs); + + System.out.println("...done"); + + System.out.println("Checking loading default-initialized meta data ..."); + +// xDP2.loadFromMedium(temp + "EMPTY.odt", noArgs); + xDP2.loadFromMedium("", mimeEmptyArgs); + assertTrue ("Author", "".equals(xDP2.getAuthor())); + + System.out.println("...done"); + + System.out.println("(Not) Checking preservation of custom meta data ..."); + + xDP2.loadFromMedium(TestDocument.getUrl("CUSTOM.odt"), + noArgs); + assertTrue ("Author", "".equals(xDP2.getAuthor())); + xDP2.storeToMedium(temp + "CUSTOM.odt", mimeArgs); + + //FIXME: now what? comparing for binary equality seems useless + // we could unzip the written file and grep for the custom stuff + // but would that work on windows... + + System.out.println("...done"); + + System.out.println("Checking loading from test document..."); + + String file = TestDocument.getUrl("TEST.odt"); + xDP.loadFromMedium(file, noArgs); +/* XInputStream xStream = + new StreamSimulator("./testdocuments/TEST.odt", true, param); + Object oSF = + xMSF.createInstance("com.sun.star.embed.StorageFactory"); + XSingleServiceFactory xSF = (XSingleServiceFactory) + UnoRuntime.queryInterface(XSingleServiceFactory.class, oSF); + Object oStor = xSF.createInstanceWithArguments( + new Object[] { xStream }); + XStorage xStor = (XStorage) UnoRuntime.queryInterface( + XStorage.class, oStor); + xDP.loadFromStorage(xStor);*/ + + System.out.println("...done"); + + System.out.println("Checking meta-data import..."); + + assertTrue("Author", "Karl-Heinz Mustermann".equals(xDP.getAuthor())); + assertTrue("Generator", + "StarOffice/8$Solaris_x86 OpenOffice.org_project/680m232$Build-9227" + .equals(xDP.getGenerator())); + assertTrue("CreationDate", 2007 == xDP.getCreationDate().Year); + assertTrue("Title", "Urgent Memo".equals(xDP.getTitle())); + assertTrue("Subject", "Wichtige Mitteilung".equals(xDP.getSubject())); + assertTrue("Description", + "Modern internal company memorandum in full-blocked style" + .equals(xDP.getDescription())); +// assertTrue("Language", "".equals(xDP.getLanguage())); + assertTrue("ModifiedBy", + "Karl-Heinz Mustermann".equals(xDP.getModifiedBy())); + assertTrue("ModificationDate", 10 == xDP.getModificationDate().Month); + assertTrue("PrintedBy", + "Karl-Heinz Mustermann".equals(xDP.getPrintedBy())); + assertTrue("PrintDate", 29 == xDP.getPrintDate().Day); + assertTrue("TemplateName", + "Modern Memo".equals(xDP.getTemplateName())); + assertTrue("TemplateURL", + xDP.getTemplateURL().endsWith("memmodern.ott")); + assertTrue("TemplateDate", 17 == xDP.getTemplateDate().Hours); + assertTrue("AutoloadURL", "../TEST.odt".equals(xDP.getAutoloadURL())); + assertTrue("AutoloadSecs", 0 == xDP.getAutoloadSecs()); + assertTrue("DefaultTarget", "_blank".equals(xDP.getDefaultTarget())); + assertTrue("EditingCycles", 3 == xDP.getEditingCycles()); + assertTrue("EditingDuration", 320 == xDP.getEditingDuration()); + + String[] kws = xDP.getKeywords(); + assertTrue("Keywords", fromArray(kws).containsAll( + fromArray(new Object[] { "Asien", "Memo", "Reis" }))); + + NamedValue[] ds = xDP.getDocumentStatistics(); +/* for (int i = 0; i < ds.length; ++i) { + System.out.println("nv: " + ds[i].Name + " " + ds[i].Value); + } + NamedValue nv1 = new NamedValue("WordCount", new Integer(23)); + NamedValue nv2 = new NamedValue("WordCount", new Integer(23)); + System.out.println("eq: " + nv1.equals(nv2)); // grrr, this is false... +*/ + assertTrue("DocumentStatistics:WordCount", containsNV(ds, + new NamedValue("WordCount", new Integer(23)))); + assertTrue("DocumentStatistics:PageCount", containsNV(ds, + new NamedValue("PageCount", new Integer(1)))); + + XPropertyContainer udpc = xDP.getUserDefinedProperties(); + XPropertySet udps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet.class, udpc); + assertTrue("UserDefined 1", "Dies ist ein wichtiger Hinweis" + .equals(udps.getPropertyValue("Hinweis"))); + assertTrue("UserDefined 2", ("Kann Spuren von N" + + new String(new byte[] { (byte) 0xc3, (byte) 0xbc }, "UTF-8") + + "ssen enthalten") + .equals(udps.getPropertyValue("Warnung"))); + + System.out.println("...done"); + + System.out.println("Checking meta-data updates..."); + + String str; + DateTime dt = new DateTime(); + Locale l = new Locale(); + int i; + + str = "me"; + xDP.setAuthor(str); + assertTrue("setAuthor", str.equals(xDP.getAuthor())); + str = "the computa"; + xDP.setGenerator(str); + assertTrue("setGenerator", str.equals(xDP.getGenerator())); + dt.Year = 2038; + dt.Month = 1; + dt.Day = 1; + xDP.setCreationDate(dt); + assertTrue("setCreationDate", dt.Year == xDP.getCreationDate().Year); + str = "El t'itulo"; + xDP.setTitle(str); + assertTrue("setTitle", str.equals(xDP.getTitle())); + str = "Ein verkommenes Subjekt"; + xDP.setSubject(str); + assertTrue("setSubject", str.equals(xDP.getSubject())); + str = "Este descripci'on no es importante"; + xDP.setDescription(str); + assertTrue("setDescription", str.equals(xDP.getDescription())); + l.Language = "en"; + l.Country = "GB"; + xDP.setLanguage(l); + Locale l2 = xDP.getLanguage(); + assertTrue("setLanguage Lang", l.Language.equals(l2.Language)); + assertTrue("setLanguage Cty", l.Country.equals(l2.Country)); + str = "myself"; + xDP.setModifiedBy(str); + assertTrue("setModifiedBy", str.equals(xDP.getModifiedBy())); + dt.Year = 2042; + xDP.setModificationDate(dt); + assertTrue("setModificationDate", + dt.Year == xDP.getModificationDate().Year); + str = "i didnt do it"; + xDP.setPrintedBy(str); + assertTrue("setPrintedBy", str.equals(xDP.getPrintedBy())); + dt.Year = 2024; + xDP.setPrintDate(dt); + assertTrue("setPrintDate", dt.Year == xDP.getPrintDate().Year); + str = "blah"; + xDP.setTemplateName(str); + assertTrue("setTemplateName", str.equals(xDP.getTemplateName())); + str = "gopher://some-hole-in-the-ground/"; + xDP.setTemplateURL(str); + assertTrue("setTemplateURL", str.equals(xDP.getTemplateURL())); + dt.Year = 2043; + xDP.setTemplateDate(dt); + assertTrue("setTemplateDate", dt.Year == xDP.getTemplateDate().Year); + str = "http://nowhere/"; + xDP.setAutoloadURL(str); + assertTrue("setAutoloadURL", str.equals(xDP.getAutoloadURL())); + i = 3661; // this might not work (due to conversion via double...) + xDP.setAutoloadSecs(i); +// System.out.println("set: " + i + " get: " + xDP.getAutoloadSecs()); + assertTrue("setAutoloadSecs", i == xDP.getAutoloadSecs()); + str = "_blank"; + xDP.setDefaultTarget(str); + assertTrue("setDefaultTarget", str.equals(xDP.getDefaultTarget())); + i = 42; + xDP.setEditingCycles((short) i); + assertTrue("setEditingCycles", i == xDP.getEditingCycles()); + i = 84; + xDP.setEditingDuration(i); + assertTrue("setEditingDuration", i == xDP.getEditingDuration()); + str = ""; + + String[] kws2 = new String[] { + "keywordly", "keywordlike", "keywordalicious" }; + xDP.setKeywords(kws2); + kws = xDP.getKeywords(); + assertTrue("setKeywords", fromArray(kws).containsAll(fromArray(kws2))); + + NamedValue[] ds2 = new NamedValue[] { + new NamedValue("SyllableCount", new Integer(9)), + new NamedValue("FrameCount", new Integer(2)), + new NamedValue("SentenceCount", new Integer(7)) }; + xDP.setDocumentStatistics(ds2); + ds = xDP.getDocumentStatistics(); + assertTrue("setDocumentStatistics:SyllableCount", containsNV(ds, + new NamedValue("SyllableCount", new Integer(9)))); + assertTrue("setDocumentStatistics:FrameCount", containsNV(ds, + new NamedValue("FrameCount", new Integer(2)))); + assertTrue("setDocumentStatistics:SentenceCount", containsNV(ds, + new NamedValue("SentenceCount", new Integer(7)))); + + System.out.println("...done"); + + System.out.println("Checking user-defined meta-data updates..."); + + // actually, this tests the PropertyBag service + // but maybe the DocumentProperties service will be implemented + // differently some day... + boolean b = true; + double d = 3.1415; + // note that Time is only supported for backward compatibilty! + Time t = new Time(); + t.Hours = 1; + t.Minutes = 16; + Date date = new Date(); + date.Year = 2071; + date.Month = 2; + date.Day = 3; + dt.Year = 2065; + Duration dur = new Duration(); + dur.Negative = true; + dur.Years = 1001; + dur.Months = 999; + dur.Days = 888; + dur.Hours = 777; + dur.Minutes = 666; + dur.Seconds = 555; + dur.MilliSeconds = 444; + + udpc.addProperty("Frobnicate", PropertyAttribute.REMOVEABLE, + new Boolean(b)); + udpc.addProperty("FrobDuration", PropertyAttribute.REMOVEABLE, dur); + udpc.addProperty("FrobDuration2", PropertyAttribute.REMOVEABLE, t); + udpc.addProperty("FrobEndDate", PropertyAttribute.REMOVEABLE, date); + udpc.addProperty("FrobStartTime", PropertyAttribute.REMOVEABLE, dt); + udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); + udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); + udpc.addProperty("Removed", PropertyAttribute.REMOVEABLE, "bar"); + // #i94175#: empty property name is valid ODF 1.1 + udpc.addProperty("", PropertyAttribute.REMOVEABLE, "eeeeek"); + try { + udpc.removeProperty("Info 1"); + udpc.removeProperty("Removed"); + } catch (UnknownPropertyException e) { + fail("removeProperty failed"); + } + + try { + udpc.addProperty("Forbidden", PropertyAttribute.REMOVEABLE, + new String[] { "foo", "bar" }); + fail("inserting value of non-supported type did not fail"); + } catch (IllegalTypeException e) { + // ignore + } + + assertTrue("UserDefined bool", new Boolean(b).equals( + udps.getPropertyValue("Frobnicate"))); + assertTrue("UserDefined duration", eqDuration(dur, (Duration) + udps.getPropertyValue("FrobDuration"))); + assertTrue("UserDefined time", eqTime(t, (Time) + udps.getPropertyValue("FrobDuration2"))); + assertTrue("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) + udps.getPropertyValue("FrobStartTime"))); + assertTrue("UserDefined float", new Double(d).equals( + udps.getPropertyValue("Pi"))); + assertTrue("UserDefined string", "bar".equals( + udps.getPropertyValue("Foo"))); + assertTrue("UserDefined empty name", "eeeeek".equals( + udps.getPropertyValue(""))); + + try { + udps.getPropertyValue("Removed"); + fail("UserDefined remove didn't"); + } catch (UnknownPropertyException e) { + // ok + } + + System.out.println("...done"); + + System.out.println("Checking storing meta-data to file..."); + + xDP.storeToMedium(temp + "TEST.odt", mimeArgs); + + System.out.println("...done"); + + System.out.println("Checking loading meta-data from stored file..."); + + xDP.loadFromMedium(temp + "TEST.odt", noArgs); + + System.out.println("...done"); + + System.out.println("Checking user-defined meta-data from stored file..."); + + udpc = xDP.getUserDefinedProperties(); + udps = (XPropertySet) UnoRuntime.queryInterface( + XPropertySet.class, udpc); + + assertTrue("UserDefined bool", new Boolean(b).equals( + udps.getPropertyValue("Frobnicate"))); + assertTrue("UserDefined duration", eqDuration(dur, (Duration) + udps.getPropertyValue("FrobDuration"))); + // this is now a Duration! + Duration t_dur = new Duration(false, (short)0, (short)0, (short)0, + t.Hours, t.Minutes, t.Seconds, + (short)(10 * t.HundredthSeconds)); + assertTrue("UserDefined time", eqDuration(t_dur, (Duration) + udps.getPropertyValue("FrobDuration2"))); + assertTrue("UserDefined date", eqDate(date, (Date) + udps.getPropertyValue("FrobEndDate"))); + assertTrue("UserDefined datetime", eqDateTime(dt, (DateTime) + udps.getPropertyValue("FrobStartTime"))); + assertTrue("UserDefined float", new Double(d).equals( + udps.getPropertyValue("Pi"))); + assertTrue("UserDefined string", "bar".equals( + udps.getPropertyValue("Foo"))); + + try { + udps.getPropertyValue("Removed"); + fail("UserDefined remove didn't"); + } catch (UnknownPropertyException e) { + // ok + } + + System.out.println("...done"); + + System.out.println("Checking notification listener interface..."); + + Listener listener = new Listener(); + XModifyBroadcaster xMB = (XModifyBroadcaster) + UnoRuntime.queryInterface(XModifyBroadcaster.class, xDP); + xMB.addModifyListener(listener); + xDP.setAuthor("not me"); + assertTrue("Listener Author", listener.reset()); + udpc.addProperty("Listener", PropertyAttribute.REMOVEABLE, "foo"); + assertTrue("Listener UserDefined Add", listener.reset()); + udps.setPropertyValue("Listener", "bar"); + assertTrue("Listener UserDefined Set", listener.reset()); + udpc.removeProperty("Listener"); + assertTrue("Listener UserDefined Remove", listener.reset()); + xMB.removeModifyListener(listener); + udpc.addProperty("Listener2", PropertyAttribute.REMOVEABLE, "foo"); + assertTrue("Removed Listener UserDefined Add", !listener.reset()); + + System.out.println("...done"); + + } catch (Exception e) { + report(e); + } + } + + // grrr... + boolean eqDateTime(DateTime a, DateTime b) { + return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day + && a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.HundredthSeconds == b.HundredthSeconds; + } + + boolean eqDate(Date a, Date b) { + return a.Year == b.Year && a.Month == b.Month && a.Day == b.Day; + } + + boolean eqTime(Time a, Time b) { + return a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.HundredthSeconds == b.HundredthSeconds; + } + + boolean eqDuration(Duration a, Duration b) { + return a.Years == b.Years && a.Months == b.Months && a.Days == b.Days + && a.Hours == b.Hours && a.Minutes == b.Minutes + && a.Seconds == b.Seconds + && a.MilliSeconds == b.MilliSeconds + && a.Negative == b.Negative; + } + + java.util.Collection fromArray(Object[] os) { + java.util.Collection ret = new java.util.HashSet(); + for (int i = 0; i < os.length; ++i) { + ret.add(os[i]); + } + return ret; + } + + // bah, structs do not have proper equals(), and uno.Type is not comparable + public static boolean containsNV (NamedValue[] nvs, NamedValue nv) { + for (int i = 0; i < nvs.length; ++i) { + if (nvs[i].Name.equals(nv.Name) && nvs[i].Value.equals(nv.Value)) { + return true; + } + } + return false; + } + + public void report(Exception e) { + System.out.println("Exception occurred:"); + e.printStackTrace(); + fail(); + } + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection() DocumentPropertiesTest"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + +} + diff --git a/sfx2/qa/complex/framework/makefile.mk b/sfx2/qa/complex/framework/makefile.mk index 1b74cad15ea8..093bc828d4ef 100644 --- a/sfx2/qa/complex/framework/makefile.mk +++ b/sfx2/qa/complex/framework/makefile.mk @@ -36,8 +36,8 @@ TARGET = qa_complex_framework .IF "$(OOO_JUNIT_JAR)" != "" PACKAGE = complex/framework JAVATESTFILES = \ + DocumentPropertiesTest.java \ DocumentMetadataAccessTest.java \ - DocumentMetaData.java \ CheckGlobalEventBroadcaster_writer1.java JAVAFILES = $(JAVATESTFILES) \ -- cgit From e9a6e7712a22a7308adc3851fa072af9b566f233 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 21 Jun 2010 16:48:25 +0200 Subject: sb126: #i110006# removed unused configmgr::Pad::is() --- configmgr/source/pad.cxx | 5 ----- configmgr/source/pad.hxx | 2 -- 2 files changed, 7 deletions(-) diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx index c8c7218b6da6..a8169b271bb4 100644 --- a/configmgr/source/pad.cxx +++ b/configmgr/source/pad.cxx @@ -65,11 +65,6 @@ void Pad::clear() { buffer_.setLength(0); } -bool Pad::is() const { - OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0)); - return span_.is() || buffer_.getLength() != 0; -} - Span Pad::get() const { OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0)); if (span_.is()) { diff --git a/configmgr/source/pad.hxx b/configmgr/source/pad.hxx index 66a51f480023..9f6fbebcda43 100644 --- a/configmgr/source/pad.hxx +++ b/configmgr/source/pad.hxx @@ -45,8 +45,6 @@ public: void clear(); - bool is() const; - Span get() const; private: -- cgit From 4740aded6eb2e45c3565e2b70b29e691d190bad7 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 21 Jun 2010 17:41:23 +0200 Subject: sb126: #i111970# accept and ignore EnableAsync --- configmgr/source/configurationprovider.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index a89540a88158..78d71e73e7d5 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -241,7 +241,7 @@ Service::createInstanceWithArguments( if (nodepath.getLength() == 0) { badNodePath(); } - // For backwards compatibility, allow a notepath that misses the leading + // For backwards compatibility, allow a nodepath that misses the leading // slash: if (nodepath[0] != '/') { nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath; @@ -456,7 +456,8 @@ Factory::createInstanceWithArgumentsAndContext( " arguments")), 0); } - // For backwards compatibility, allow "Locale" in any case: + // For backwards compatibility, allow "Locale" and (ignored) + // "EnableAsync" in any case: if (name.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("locale"))) { @@ -471,8 +472,9 @@ Factory::createInstanceWithArgumentsAndContext( " one, non-empty, string Locale argument")), 0); } - } else { - //TODO + } else if (!name.equalsIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("enableasync"))) + { throw css::uno::Exception( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( -- cgit From 870203a92a83da9e2e1b8a56e4eab43aa561a564 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 21 Jun 2010 17:41:23 +0200 Subject: sb126: #i111970# accept and ignore EnableAsync (transplanted from 0c119e327cea31601db9932cf3f85bbab9ee06f5) --- configmgr/source/configurationprovider.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index a89540a88158..78d71e73e7d5 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -241,7 +241,7 @@ Service::createInstanceWithArguments( if (nodepath.getLength() == 0) { badNodePath(); } - // For backwards compatibility, allow a notepath that misses the leading + // For backwards compatibility, allow a nodepath that misses the leading // slash: if (nodepath[0] != '/') { nodepath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + nodepath; @@ -456,7 +456,8 @@ Factory::createInstanceWithArgumentsAndContext( " arguments")), 0); } - // For backwards compatibility, allow "Locale" in any case: + // For backwards compatibility, allow "Locale" and (ignored) + // "EnableAsync" in any case: if (name.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("locale"))) { @@ -471,8 +472,9 @@ Factory::createInstanceWithArgumentsAndContext( " one, non-empty, string Locale argument")), 0); } - } else { - //TODO + } else if (!name.equalsIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("enableasync"))) + { throw css::uno::Exception( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( -- cgit From 08839960ee1b13e181996b034827dd5391d69ebd Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 22 Jun 2010 01:36:43 +0200 Subject: unoawt2: createDialogWithArguments: use NamedValues instead of PropertyValues --- scripting/source/dlgprov/dlgprov.cxx | 2 +- scripting/source/dlgprov/dlgprov.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 48aac0c88f4e..0fc0778c71d9 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -767,7 +767,7 @@ static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAs } Reference < XDialog > DialogProviderImpl::createDialogWithArguments( - const ::rtl::OUString& URL, const Sequence< PropertyValue >& Arguments ) + const ::rtl::OUString& URL, const Sequence< NamedValue >& Arguments ) throw (IllegalArgumentException, RuntimeException) { ::comphelper::NamedValueCollection aArguments( Arguments ); diff --git a/scripting/source/dlgprov/dlgprov.hxx b/scripting/source/dlgprov/dlgprov.hxx index d8bd8782b9f1..bc15831d2ff1 100644 --- a/scripting/source/dlgprov/dlgprov.hxx +++ b/scripting/source/dlgprov/dlgprov.hxx @@ -140,7 +140,7 @@ namespace dlgprov virtual ::com::sun::star::uno::Reference < ::com::sun::star::awt::XDialog > SAL_CALL createDialogWithArguments( const ::rtl::OUString& URL, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Arguments ) + const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL createContainerWindow( -- cgit From 1601a33ae631de893be783ce005b318590561827 Mon Sep 17 00:00:00 2001 From: Wu Yan Date: Tue, 22 Jun 2010 15:28:35 +0800 Subject: findbarfixes01: #i112572# [vcl] assertion in ImageAryData::Load --- .../registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 6 ------ 1 file changed, 6 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index ebed194fcffc..70448e5bbf89 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -1463,9 +1463,6 @@ Find Text - - 1 - @@ -1487,9 +1484,6 @@ Focus to Findbar - - 1 - -- cgit From 122581b430e564bcde272a0753f36d64f3aaefb1 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 22 Jun 2010 17:08:07 +0200 Subject: fwk147: Provide better error message if there is no configuration access on startup --- desktop/inc/app.hxx | 3 ++- desktop/source/app/app.cxx | 20 +++++++++++++++++++- desktop/source/app/langselect.cxx | 23 ++++++++++++++++++++--- desktop/source/app/langselect.hxx | 19 ++++++++++++++----- 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 0ae632a6e968..df39d0142787 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -75,7 +75,8 @@ class Desktop : public Application BE_USERINSTALL_FAILED, BE_LANGUAGE_MISSING, BE_USERINSTALL_NOTENOUGHDISKSPACE, - BE_USERINSTALL_NOWRITEACCESS + BE_USERINSTALL_NOWRITEACCESS, + BE_OFFICECONFIG_BROKEN }; enum BootstrapStatus { diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 6f00d47332ac..05311010f455 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -474,6 +474,8 @@ void Desktop::Init() RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" ); SetBootstrapStatus(BS_OK); + Sleep(10000); + // create service factory... Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); if( rSMgr.is() ) @@ -489,7 +491,12 @@ void Desktop::Init() { // prepare language if ( !LanguageSelection::prepareLanguage() ) - SetBootstrapError( BE_LANGUAGE_MISSING ); + { + if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE ) + SetBootstrapError( BE_LANGUAGE_MISSING ); + else + SetBootstrapError( BE_OFFICECONFIG_BROKEN ); + } } if ( GetBootstrapError() == BE_OK ) @@ -870,6 +877,17 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) FatalError( aMessage); } + else if ( aBootstrapError == BE_OFFICECONFIG_BROKEN ) + { + OUString aMessage; + OUStringBuffer aDiagnosticMessage( 100 ); + OUString aErrorMsg; + aErrorMsg = GetMsgString( STR_CONFIG_ERR_ACCESS_GENERAL, + OUString( RTL_CONSTASCII_USTRINGPARAM( "A general error occurred while accessing your central configuration." )) ); + aDiagnosticMessage.append( aErrorMsg ); + aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() ); + FatalError(aMessage); + } else if ( aBootstrapError == BE_USERINSTALL_FAILED ) { OUString aMessage; diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index 5e2145b03729..9df8d82a37ff 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -64,10 +64,12 @@ namespace desktop { static char const SOFFICE_BOOTSTRAP[] = "Bootstrap"; static char const SOFFICE_STARTLANG[] = "STARTLANG"; + sal_Bool LanguageSelection::bFoundLanguage = sal_False; OUString LanguageSelection::aFoundLanguage; -const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US"); +LanguageSelection::LanguageSelectionStatus LanguageSelection::m_eStatus = LS_STATUS_OK; +const OUString LanguageSelection::usFallbackLanguage = OUString::createFromAscii("en-US"); static sal_Bool existsURL( OUString const& sURL ) { @@ -122,6 +124,7 @@ Locale LanguageSelection::IsoStringToLocale(const OUString& str) bool LanguageSelection::prepareLanguage() { + m_eStatus = LS_STATUS_OK; OUString sConfigSrvc = OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider"); Reference< XMultiServiceFactory > theMSF = comphelper::getProcessServiceFactory(); Reference< XLocalizable > theConfigProvider; @@ -131,7 +134,9 @@ bool LanguageSelection::prepareLanguage() } catch(const Exception&) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; } + if(!theConfigProvider.is()) return false; @@ -149,6 +154,7 @@ bool LanguageSelection::prepareLanguage() } catch(const Exception&) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; } // #i32939# use system locale to set document default locale @@ -162,6 +168,7 @@ bool LanguageSelection::prepareLanguage() } catch (Exception&) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; } // get the selected UI language as string @@ -350,8 +357,10 @@ OUString LanguageSelection::getLanguageString() aFoundLanguage = usFallbackLanguage; return aFoundLanguage; } + // fallback didn't work use first installed language aUserLanguage = getFirstInstalledLanguage(); + bFoundLanguage = sal_True; aFoundLanguage = aUserLanguage; return aFoundLanguage; @@ -455,7 +464,7 @@ sal_Bool LanguageSelection::isInstalledLanguage(OUString& usLocale, sal_Bool bEx // requested locale starts with the installed locale // (i.e. installed locale has index 0 in requested locale) bInstalled = sal_True; - usLocale = seqLanguages[i]; + usLocale = seqLanguages[i]; break; } } @@ -484,10 +493,12 @@ OUString LanguageSelection::getUserLanguage() } catch ( NoSuchElementException const & ) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; return OUString(); } catch ( WrappedTargetException const & ) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; return OUString(); } } @@ -506,10 +517,12 @@ OUString LanguageSelection::getSystemLanguage() } catch ( NoSuchElementException const & ) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; return OUString(); } catch ( WrappedTargetException const & ) { + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; return OUString(); } } @@ -533,9 +546,13 @@ void LanguageSelection::resetUserLanguage() { OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); OSL_ENSURE(sal_False, aMsg.getStr()); + m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN; } - } +LanguageSelection::LanguageSelectionStatus LanguageSelection::getStatus() +{ + return m_eStatus; +} } // namespace desktop diff --git a/desktop/source/app/langselect.hxx b/desktop/source/app/langselect.hxx index 60308164690f..bdf3cd6364de 100644 --- a/desktop/source/app/langselect.hxx +++ b/desktop/source/app/langselect.hxx @@ -40,10 +40,24 @@ namespace desktop class LanguageSelection { +public: + enum LanguageSelectionStatus + { + LS_STATUS_OK, + LS_STATUS_CANNOT_DETERMINE_LANGUAGE, + LS_STATUS_CONFIGURATIONACCESS_BROKEN + }; + + static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str); + static rtl::OUString getLanguageString(); + static bool prepareLanguage(); + static LanguageSelectionStatus getStatus(); + private: static const rtl::OUString usFallbackLanguage; static rtl::OUString aFoundLanguage; static sal_Bool bFoundLanguage; + static LanguageSelectionStatus m_eStatus; static com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate=sal_False); @@ -55,11 +69,6 @@ private: static rtl::OUString getSystemLanguage(); static void resetUserLanguage(); static void setDefaultLanguage(const rtl::OUString&); - -public: - static com::sun::star::lang::Locale IsoStringToLocale(const rtl::OUString& str); - static rtl::OUString getLanguageString(); - static bool prepareLanguage(); }; } //namespace desktop -- cgit From 98b532d57687b171a4770ac9d738a9e6ef4b85dd Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 22 Jun 2010 18:16:32 +0200 Subject: mib17: remove unused/needless code --- oovbaapi/ooo/vba/XVBAAppService.idl | 72 ----------------- oovbaapi/ooo/vba/XVBADocService.idl | 72 ----------------- oovbaapi/ooo/vba/makefile.mk | 5 +- vbahelper/inc/vbahelper/vbaapplicationbase.hxx | 5 +- vbahelper/inc/vbahelper/vbadocumentbase.hxx | 4 +- vbahelper/inc/vbahelper/vbahelperinterface.hxx | 30 ++++++- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 95 ++++++++++------------- vbahelper/source/vbahelper/vbadocumentbase.cxx | 51 +++++------- 8 files changed, 89 insertions(+), 245 deletions(-) delete mode 100755 oovbaapi/ooo/vba/XVBAAppService.idl delete mode 100755 oovbaapi/ooo/vba/XVBADocService.idl diff --git a/oovbaapi/ooo/vba/XVBAAppService.idl b/oovbaapi/ooo/vba/XVBAAppService.idl deleted file mode 100755 index 1c4a0920fbf8..000000000000 --- a/oovbaapi/ooo/vba/XVBAAppService.idl +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XWorkbook.idl,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __ooo_vba_appservice_idl__ -#define __ooo_vba_appservice_idl__ - -#ifndef __com_sun_star_uno_XInterface_idl__ -#include -#endif - -#ifndef __com_sun_star_uno_XComponentContext_idl__ -#include -#endif - -#ifndef __com_sun_star_frame_XModel_idl__ -#include -#endif - -#ifndef __com_sun_star_script_XLibraryContainer_idl__ -#include -#endif - -//============================================================================= - -module ooo { module vba { - -//============================================================================= - - -interface XHelperInterface; -interface XComponentContext; -interface XModel; - -interface XVBAAppService -{ - interface ::com::sun::star::uno::XInterface; - - any getVBE([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel); - any getVBProjects([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel, [in] ::com::sun::star::script::XLibraryContainer xMacroLibraryContainer, [in] com::sun::star::script::XLibraryContainer xDialogLibraryContainer); - - -}; - - }; }; - -#endif diff --git a/oovbaapi/ooo/vba/XVBADocService.idl b/oovbaapi/ooo/vba/XVBADocService.idl deleted file mode 100755 index 6500f028934b..000000000000 --- a/oovbaapi/ooo/vba/XVBADocService.idl +++ /dev/null @@ -1,72 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XVBADocService.idl,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef __ooo_vba_socservice_idl__ -#define __ooo_vba_appservice_idl__ - -#ifndef __com_sun_star_uno_XInterface_idl__ -#include -#endif - -#ifndef __com_sun_star_uno_XComponentContext_idl__ -#include -#endif - -#ifndef __com_sun_star_frame_XModel_idl__ -#include -#endif - -#ifndef __com_sun_star_script_XLibraryContainer_idl__ -#include -#endif - -//============================================================================= - -module ooo { module vba { - -//============================================================================= - - -interface XHelperInterface; -interface XComponentContext; -interface XModel; - -interface XVBADocService -{ - interface ::com::sun::star::uno::XInterface; - - - any getVBProject([in] XHelperInterface xParent, [in] ::com::sun::star::uno::XComponentContext xContext, [in] ::com::sun::star::frame::XModel xModel, [in] ::com::sun::star::script::XLibraryContainer xMacroLibraryContainer, [in] com::sun::star::script::XLibraryContainer xDialogLibraryContainer); - - -}; - - }; }; - -#endif diff --git a/oovbaapi/ooo/vba/makefile.mk b/oovbaapi/ooo/vba/makefile.mk index 75f6465bf4c0..4f6d378cfe3f 100644 --- a/oovbaapi/ooo/vba/makefile.mk +++ b/oovbaapi/ooo/vba/makefile.mk @@ -61,9 +61,8 @@ IDLFILES=\ XFontBase.idl\ XDialogsBase.idl\ XDialogBase.idl\ - XPageSetupBase.idl \ - XVBAAppService.idl\ - XVBADocService.idl\ + XPageSetupBase.idl + # ------------------------------------------------------------------ .ENDIF .INCLUDE : target.mk diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx index e2a5a3bff5da..73c1aa0d94e7 100644 --- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx +++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx @@ -57,13 +57,14 @@ public: virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (::com::sun::star::uno::RuntimeException); virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getVBProjects() throw (css::uno::RuntimeException); + virtual void SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException); virtual void SAL_CALL OnTime( const ::com::sun::star::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const ::com::sun::star::uno::Any& aLatestTime, const ::com::sun::star::uno::Any& aSchedule ) throw (::com::sun::star::uno::RuntimeException); virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException); virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL Quit( ) throw (::com::sun::star::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL SAL_CALL getVBProjects() throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx index 7131e1963b26..2588b7da1720 100644 --- a/vbahelper/inc/vbahelper/vbadocumentbase.hxx +++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx @@ -52,9 +52,7 @@ public: virtual ::rtl::OUString SAL_CALL getFullName() throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getSaved() throw (css::uno::RuntimeException); virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException); - - virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); // Michhael E. Bohn - + virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); // Methods virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges, diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx index 21339631e1ed..b095b5cd2823 100644 --- a/vbahelper/inc/vbahelper/vbahelperinterface.hxx +++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx @@ -28,6 +28,8 @@ #define OOVBAAPI_VBA_HELPERINTERFACE_HXX #include +#include +#include #include #include #include @@ -68,6 +70,7 @@ protected: css::uno::Reference< css::uno::XComponentContext > mxContext; public: InheritedHelperInterfaceImpl() {} + InheritedHelperInterfaceImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxContext( xContext ) {} InheritedHelperInterfaceImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : mxParent( xParent ), mxContext( xContext ) {} virtual rtl::OUString& getServiceImplName() = 0; virtual css::uno::Sequence getServiceNames() = 0; @@ -86,7 +89,6 @@ public: return xNameAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Application" ) ) ); } - // XServiceInfo Methods virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (css::uno::RuntimeException) { return getServiceImplName(); } virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (css::uno::RuntimeException) @@ -101,19 +103,39 @@ public: } virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (css::uno::RuntimeException) { - css::uno::Sequence< rtl::OUString > aNames = getServiceNames();; + css::uno::Sequence< rtl::OUString > aNames = getServiceNames(); return aNames; } }; template< typename Ifc1 > class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl1 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > +{ + typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base; +public: + InheritedHelperInterfaceImpl1< Ifc1 >() {} + InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {} + InheritedHelperInterfaceImpl1< Ifc1 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {} +}; +template< typename Ifc1, typename Ifc2 > +class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl2 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > > { -typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper1< Ifc1 > > Base; + typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper2< Ifc1, Ifc2 > > Base; public: - InheritedHelperInterfaceImpl1< Ifc1 > ( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {} + InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >() {} + InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {} + InheritedHelperInterfaceImpl2< Ifc1, Ifc2 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {} +}; +template< typename Ifc1, typename Ifc2, typename Ifc3 > +class VBAHELPER_DLLPUBLIC InheritedHelperInterfaceImpl3 : public InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > > +{ + typedef InheritedHelperInterfaceImpl< ::cppu::WeakImplHelper3< Ifc1, Ifc2, Ifc3 > > Base; +public: + InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >() {} + InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xContext ) {} + InheritedHelperInterfaceImpl3< Ifc1, Ifc2, Ifc3 >( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : Base( xParent, xContext ) {} }; // ============================================================================ diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 6d2c51066ca2..213133998def 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -24,39 +24,36 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #include "vbahelper/vbaapplicationbase.hxx" + #include -#include //Michael E. Bohn -#include //Michael E. Bohn -#include //Michael E. Bohn -#include //Michael E. Bohn +#include +#include +#include +#include #include #include #include #include #include #include -#include //Michael E. Bohn -#include //Michael E. Bohn +#include #include - -#include "vbacommandbars.hxx" +#include #include #include - -// start basic includes #include #include #include #include #include -// end basic includes -#include +#include "vbacommandbars.hxx" -using namespace com::sun::star; -using namespace ooo::vba; +using namespace ::com::sun::star; +using namespace ::ooo::vba; #define OFFICEVERSION "11.0" @@ -407,57 +404,43 @@ float SAL_CALL VbaApplicationBase::CentimetersToPoints( float _Centimeters ) thr return ( _Centimeters * rate ); } -// inserted by Michael E. Bohn uno::Any SAL_CALL VbaApplicationBase::getVBE() throw (uno::RuntimeException) { - uno::Any aAny; - uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager(); - try - { - uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAAppService" )),mxContext); - uno::Reference < ::ooo::vba::XVBAAppService > xVBAAppService (xInterface, ::uno::UNO_QUERY_THROW ); - if (xVBAAppService.is()){ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - return xVBAAppService->getVBE( this, mxContext, xModel); - } - - }catch(uno::Exception* e) - { - } - return aAny; + try // return empty object on error + { + uno::Sequence< uno::Any > aArgs( 2 ); + aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); + aArgs[ 1 ] <<= getCurrentDocument(); + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBE" ) ), aArgs, mxContext ); + return uno::Any( xVBE ); + } + catch( uno::Exception& ) + { + } + return uno::Any(); } uno::Any SAL_CALL VbaApplicationBase::getVBProjects() throw (uno::RuntimeException) { - uno::Any aAny; - uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager(); - try - { - uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBAAppService" )),mxContext); - uno::Reference < ::ooo::vba::XVBAAppService > xVBAAppService (xInterface, ::uno::UNO_QUERY_THROW ); - if (xVBAAppService.is()){ - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< document::XEmbeddedScripts > xEnbeddedScripts ( xModel, uno::UNO_QUERY_THROW ); - uno::Reference< script::XStorageBasedLibraryContainer > xMacroStorageBasedLibraryContainer = xEnbeddedScripts->getBasicLibraries(); - uno::Reference< script::XStorageBasedLibraryContainer > xDialogStorageBasedLibraryContainer = xEnbeddedScripts->getDialogLibraries(); - uno::Reference< script::XLibraryContainer > xMacroLibraryContainer ( xMacroStorageBasedLibraryContainer, uno::UNO_QUERY_THROW ); - uno::Reference< script::XLibraryContainer > xDialogLibraryContainer( xDialogStorageBasedLibraryContainer, uno::UNO_QUERY_THROW ); - return xVBAAppService->getVBProjects(this, mxContext, xModel, xMacroLibraryContainer, xDialogLibraryContainer); - } - - }catch(uno::Exception* e) - { - } - return aAny; - - - + try // return empty object on error + { + uno::Sequence< uno::Any > aArgs( 2 ); + aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); + aArgs[ 1 ] <<= getCurrentDocument(); + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< uno::XInterface > xVBProjects = xServiceManager->createInstanceWithArgumentsAndContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBProjects" ) ), aArgs, mxContext ); + return uno::Any( xVBProjects ); + } + catch( uno::Exception& ) + { + } + return uno::Any(); } - - - rtl::OUString& VbaApplicationBase::getServiceImplName() { diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index f27f2de53c8a..65f7f4bcfbeb 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -24,9 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include -#include -#include + +#include "vbahelper/vbadocumentbase.hxx" +#include "vbahelper/helperdecl.hxx" #include #include @@ -35,8 +35,8 @@ #include #include //Michael E. Bohn #include -#include +#include #include #include @@ -206,40 +206,25 @@ VbaDocumentBase::Activate() throw (uno::RuntimeException) xFrame->activate(); } -// ---- Michael E.Bohn Start----- - uno::Any SAL_CALL VbaDocumentBase::getVBProject() throw (uno::RuntimeException) - { - uno::Any aAny; - uno::Reference< ::lang::XMultiComponentFactory > xServiceManager = mxContext->getServiceManager(); - try - { - uno::Reference < ::uno::XInterface > xInterface = xServiceManager->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBADocService" )),mxContext); - uno::Reference < ::ooo::vba::XVBADocService > xVBADocService (xInterface, ::uno::UNO_QUERY_THROW ); - if (xVBADocService.is()){ - uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); - uno::Reference< document::XEmbeddedScripts > xEnbeddedScripts ( xModel, uno::UNO_QUERY_THROW ); - uno::Reference< script::XStorageBasedLibraryContainer > xMacroStorageBasedLibraryContainer = xEnbeddedScripts->getBasicLibraries(); - uno::Reference< script::XStorageBasedLibraryContainer > xDialogStorageBasedLibraryContainer = xEnbeddedScripts->getDialogLibraries(); - uno::Reference< script::XLibraryContainer > xMacroLibraryContainer ( xMacroStorageBasedLibraryContainer, uno::UNO_QUERY_THROW ); - uno::Reference< script::XLibraryContainer > xDialogLibraryContainer( xDialogStorageBasedLibraryContainer, uno::UNO_QUERY_THROW ); - - return xVBADocService->getVBProject( this, mxContext, xModel, xMacroLibraryContainer, xDialogLibraryContainer ); - } - - }catch(uno::Exception* e) - { - } - return aAny; - + try // return empty object on error + { + uno::Sequence< uno::Any > aArgs( 2 ); + aArgs[ 0 ] <<= uno::Reference< XHelperInterface >( this ); + aArgs[ 1 ] <<= mxModel; + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); + uno::Reference< uno::XInterface > xVBProjects = xServiceManager->createInstanceWithArgumentsAndContext( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.VBProject" ) ), aArgs, mxContext ); + return uno::Any( xVBProjects ); + } + catch( uno::Exception& ) + { + } + return uno::Any(); } - -// ---- Michael E.Bohn End ----- - - rtl::OUString& VbaDocumentBase::getServiceImplName() { -- cgit From 4e0e548c67ab51940bb9d079b723c10b0944777b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 23 Jun 2010 09:12:30 +0200 Subject: avmedia102: #161254# increase timeout so it works reliably --- avmedia/source/gstreamer/gstplayer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index edddf2755f93..71ac656a7b2c 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -37,7 +37,7 @@ // maximum timeout time in nanoseconds -#define GST_MAX_TIMEOUT 500000000 +#define GST_MAX_TIMEOUT (2500 * GST_MSECOND) using namespace ::com::sun::star; -- cgit From c6d6e6bf9f8d8a3a6e6543ded33e4ac387ea6766 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 23 Jun 2010 10:45:22 +0200 Subject: sb126: #i112542# resolve $0 symlinks recursively in start scripts (based on a patch by pooryorick) --- desktop/scripts/soffice.sh | 17 ++++++++--------- desktop/scripts/unoinfo.sh | 15 +++++++-------- desktop/scripts/unopkg.sh | 17 ++++++++--------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index ebbdeb9eabdb..636cc78afbd6 100644 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -43,15 +43,14 @@ export SAL_ENABLE_FILE_LOCKING #@# export JITC_PROCESSOR_TYPE=6 # resolve installation directory -sd_cwd="`pwd`" -if [ -h "$0" ] ; then - sd_basename=`basename "$0"` - sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` - cd "`dirname "$0"`" - cd "`dirname "$sd_script"`" -else - cd "`dirname "$0"`" -fi +sd_cwd=`pwd` +sd_res=$0 +while [ -h "$sd_res" ] ; do + cd "`dirname "$sd_res"`" + sd_basename=`basename "$sd_res"` + sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"` +done +cd "`dirname "$sd_res"`" sd_prog=`pwd` cd "$sd_cwd" diff --git a/desktop/scripts/unoinfo.sh b/desktop/scripts/unoinfo.sh index 081e414365cf..a7566155aa0d 100644 --- a/desktop/scripts/unoinfo.sh +++ b/desktop/scripts/unoinfo.sh @@ -29,14 +29,13 @@ set -e # resolve installation directory -if [ -h "$0" ] ; then - sd_basename=`basename "$0"` - sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` - cd "`dirname "$0"`" - cd "`dirname "$sd_script"`" -else - cd "`dirname "$0"`" -fi +sd_res=$0 +while [ -h "$sd_res" ] ; do + cd "`dirname "$sd_res"`" + sd_basename=`basename "$sd_res"` + sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"` +done +cd "`dirname "$sd_res"`" sd_prog=`pwd` case $1 in diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh index 0fe319735c06..055db33da791 100644 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh @@ -31,15 +31,14 @@ SAL_ENABLE_FILE_LOCKING=1 export SAL_ENABLE_FILE_LOCKING # resolve installation directory -sd_cwd="`pwd`" -if [ -h "$0" ] ; then - sd_basename=`basename "$0"` - sd_script=`ls -l "$0" | sed "s/.*${sd_basename} -> //g"` - cd "`dirname "$0"`" - cd "`dirname "$sd_script"`" -else - cd "`dirname "$0"`" -fi +sd_cwd=`pwd` +sd_res=$0 +while [ -h "$sd_res" ] ; do + cd "`dirname "$sd_res"`" + sd_basename=`basename "$sd_res"` + sd_res=`ls -l "$sd_basename" | sed "s/.*$sd_basename -> //g"` +done +cd "`dirname "$sd_res"`" sd_prog=`pwd` cd "$sd_cwd" -- cgit From 3878d8a7a5279d5b24e91b438084a82d91fd9ee4 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 23 Jun 2010 12:00:04 +0200 Subject: aw083 #i105548# Added using the VOCRedirector inside pageobject content creation --- svx/source/sdr/contact/viewobjectcontactofpageobj.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index 5ef26193d4b3..34731f100b5d 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -273,9 +273,16 @@ namespace sdr // init extractor, guarantee existance, set page there mpExtractor->SetStartPage(pPage); + // #i105548# also need to copy the VOCRedirector for sub-content creation + mpExtractor->SetViewObjectContactRedirector(GetObjectContact().GetViewObjectContactRedirector()); + // create page content xPageContent = mpExtractor->createPrimitive2DSequenceForPage(rDisplayInfo); + // #i105548# reset VOCRedirector to not accidentially have a pointer to a + // temporary class, so calls to it are avoided safely + mpExtractor->SetViewObjectContactRedirector(0); + // reset recursion flag bInCreatePrimitive2D = false; } -- cgit From b68a479f8fe93e9ab4bbb6d7c05d3c9e0532aa1a Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 23 Jun 2010 17:19:22 +0200 Subject: fwk147: #159152# Use a more robust exception handling to avoid crashes due to unexpected exceptions --- sfx2/source/view/userinputinterception.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx index e716e604b649..ad910a944e0f 100644 --- a/sfx2/source/view/userinputinterception.cxx +++ b/sfx2/source/view/userinputinterception.cxx @@ -216,6 +216,13 @@ namespace sfx2 if ( e.Context == xHandler ) aIterator.remove(); } + catch( const RuntimeException& ) + { + throw; + } + catch( const Exception& ) + { + } } } break; @@ -247,6 +254,13 @@ namespace sfx2 if ( e.Context == xHandler ) aIterator.remove(); } + catch( const RuntimeException& ) + { + throw; + } + catch( const Exception& ) + { + } } } break; -- cgit From 64994694589f6706b6d48356859555381ab7b76a Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 23 Jun 2010 19:44:37 +0200 Subject: mib17: #i109119 add Events menu entry --- .../registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index d3db05206a6a..2d887c084317 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -1,4 +1,4 @@ - + @@ -160,6 +160,14 @@ ~Select... + + + Sheet ~Events... + + + ~Events... + + DataPilot Filter -- cgit From 271727322f844a8b56d5f3054f0eb61a7e1484a9 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 24 Jun 2010 09:08:52 +0200 Subject: cws tl81: #i112179# dictionary issue with context menus fixed --- editeng/source/editeng/editview.cxx | 11 +++++++++-- editeng/source/misc/unolingu.cxx | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 editeng/source/misc/unolingu.cxx diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 642b5e0d9f17..c07b84d0d0f2 100755 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1044,7 +1044,8 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { PopupMenu aPopupMenu( EditResId( RID_MENU_SPELL ) ); PopupMenu *pAutoMenu = aPopupMenu.GetPopupMenu( MN_AUTOCORR ); - PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT ); + PopupMenu *pInsertMenu = aPopupMenu.GetPopupMenu( MN_INSERT ); // add word to user-dictionaries + pInsertMenu->SetMenuFlags( MENU_FLAG_NOAUTOMNEMONICS ); //! necessary to retrieve the correct dictionary names later EditPaM aPaM2( aPaM ); aPaM2.GetIndex()++; @@ -1261,7 +1262,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) } else if ( nId >= MN_DICTSTART ) { - Reference< XDictionary > xDic( pDic[nId - MN_DICTSTART], UNO_QUERY ); + String aDicName ( pInsertMenu->GetItemText(nId) ); + + uno::Reference< linguistic2::XDictionary > xDic; + uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() ); + if (xDicList.is()) + xDic = xDicList->getDictionaryByName( aDicName ); + if (xDic.is()) xDic->add( aSelected, sal_False, String() ); // save modified user-dictionary if it is persistent diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx old mode 100644 new mode 100755 index e95ce560023b..ae92fd1a01b8 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -1197,7 +1197,10 @@ uno::Reference< XDictionary > LinguMgr::GetStandard() // add new dictionary to list if (xTmp.is()) + { xTmpDicList->addDictionary( xTmp ); + xTmp->setActive( sal_True ); + } xDic = uno::Reference< XDictionary > ( xTmp, UNO_QUERY ); } #if OSL_DEBUG_LEVEL > 1 -- cgit From 594aabf05fc7b553acc137889bd7bb6f95bdd98d Mon Sep 17 00:00:00 2001 From: Caol?n McNamara Date: Thu, 24 Jun 2010 20:59:17 +0100 Subject: cmcfixes76: #i112656# osl_setEnvironment/osl_clearEnvironment --- connectivity/source/drivers/adabas/BDriver.cxx | 6 ++-- fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 39 ++--------------------- fpicker/source/unx/gnome/SalGtkFolderPicker.cxx | 3 +- fpicker/source/unx/gnome/SalGtkPicker.cxx | 41 +++++++++++++++++++++++++ fpicker/source/unx/gnome/SalGtkPicker.hxx | 2 +- svx/source/gengal/gengal.cxx | 5 +-- 6 files changed, 53 insertions(+), 43 deletions(-) diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx index e9a0798761b9..030e84534501 100644 --- a/connectivity/source/drivers/adabas/BDriver.cxx +++ b/connectivity/source/drivers/adabas/BDriver.cxx @@ -464,8 +464,10 @@ void SAL_CALL ODriver::createCatalog( const Sequence< PropertyValue >& info ) th { TDatabaseStruct aDBInfo; fillInfo(info,aDBInfo); - static char envName[] = "DBSERVICE=0"; - putenv( envName ); + + ::rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DBSERVICE")); + ::rtl::OUString envData(RTL_CONSTASCII_USTRINGPARAM("0")); + osl_setEnvironment(envVar.pData, envData.pData); m_sDbRunDir = m_sDbWorkURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/wrk/")) + aDBInfo.sDBName; String sTemp; diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index c6b0acd6a33f..4766bb844a90 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -33,13 +33,13 @@ //------------------------------------------------------------------------ #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -126,41 +126,8 @@ void SalGtkFilePicker::InitialMapping() gtk_widget_set_size_request (m_pPreview, -1, -1); } -static void lcl_setGTKLanguage(const uno::Reference& xServiceMgr) -{ - static bool bSet = false; - if (bSet) - return; - - OUString sUILocale; - try - { - uno::Reference xConfigMgr = - uno::Reference(xServiceMgr->createInstance( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), - UNO_QUERY_THROW ); - - Sequence< Any > theArgs(1); - theArgs[ 0 ] <<= OUString::createFromAscii("org.openoffice.Office.Linguistic/General"); - - uno::Reference< container::XNameAccess > xNameAccess = - uno::Reference< container::XNameAccess >(xConfigMgr->createInstanceWithArguments( - OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), theArgs ), - UNO_QUERY_THROW ); - - if (xNameAccess.is()) - xNameAccess->getByName(OUString::createFromAscii("UILocale")) >>= sUILocale; - } catch (...) {} - - if (sUILocale.getLength()) - { - sUILocale = rtl::OUString::createFromAscii("LANGUAGE=") + sUILocale.replace('-', '_'); - putenv(strdup(rtl::OUStringToOString(sUILocale, osl_getThreadTextEncoding()).getStr())); - } - bSet = true; -} - SalGtkFilePicker::SalGtkFilePicker( const uno::Reference& xServiceMgr ) : + SalGtkPicker(xServiceMgr), cppu::WeakComponentImplHelper10< XFilterManager, XFilterGroupManager, @@ -184,8 +151,6 @@ SalGtkFilePicker::SalGtkFilePicker( const uno::Reference& xServiceMgr ) : - m_xServiceMgr( xServiceMgr ) + SalGtkPicker(xServiceMgr), + m_xServiceMgr(xServiceMgr) { CResourceProvider aResProvider; diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx index 1a685e0981e6..6fd19b2f7f79 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -202,6 +203,46 @@ gint RunDialog::run() return nStatus; } +static void lcl_setGTKLanguage(const uno::Reference& xServiceMgr) +{ + static bool bSet = false; + if (bSet) + return; + + OUString sUILocale; + try + { + uno::Reference xConfigMgr = + uno::Reference(xServiceMgr->createInstance( + OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), + UNO_QUERY_THROW ); + + Sequence< Any > theArgs(1); + theArgs[ 0 ] <<= OUString::createFromAscii("org.openoffice.Office.Linguistic/General"); + + uno::Reference< container::XNameAccess > xNameAccess = + uno::Reference< container::XNameAccess >(xConfigMgr->createInstanceWithArguments( + OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), theArgs ), + UNO_QUERY_THROW ); + + if (xNameAccess.is()) + xNameAccess->getByName(OUString::createFromAscii("UILocale")) >>= sUILocale; + } catch (...) {} + + if (sUILocale.getLength()) + { + sUILocale = sUILocale.replace('-', '_'); + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("LANGUAGE")); + osl_setEnvironment(envVar.pData, sUILocale.pData); + } + bSet = true; +} + +SalGtkPicker::SalGtkPicker(const uno::Reference& xServiceMgr) : m_pDialog(0) +{ + lcl_setGTKLanguage(xServiceMgr); +} + SalGtkPicker::~SalGtkPicker() { if (m_pDialog) diff --git a/fpicker/source/unx/gnome/SalGtkPicker.hxx b/fpicker/source/unx/gnome/SalGtkPicker.hxx index 6349d3ed4988..94e7a11de99a 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.hxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.hxx @@ -53,7 +53,7 @@ class SalGtkPicker { public: - SalGtkPicker() : m_pDialog(0) {} + SalGtkPicker(const ::com::sun::star::uno::Reference& xServiceMgr); virtual ~SalGtkPicker(); protected: osl::Mutex m_rbHelperMtx; diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx index bc8e6ef7c4bd..4120027c3e35 100644 --- a/svx/source/gengal/gengal.cxx +++ b/svx/source/gengal/gengal.cxx @@ -241,8 +241,9 @@ void GalApp::Init() #endif rtl::OUString baseBinDir = fileName.copy( 0, lastSlash ); rtl::OUString installPrefix = baseBinDir + rtl::OUString::createFromAscii( "/../.." ); - rtl::OUString assignment = rtl::OUString::createFromAscii( "OOO_INSTALL_PREFIX=" ) + installPrefix; - putenv( strdup( OUSTRING_CSTR( assignment ))); + + rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("OOO_INSTALL_PREFIX")); + osl_setEnvironment(envVar.pData, installPrefix.pData); } OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) ); -- cgit From 5db01bbf8f1ef192cbd7c35695f517e3622e3913 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 25 Jun 2010 08:57:06 +0200 Subject: mib17: #i110821# COM default member support --- basic/source/classes/sb.cxx | 4 +++- basic/source/runtime/step2.cxx | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 79c5f78601ea..924a3ef2807f 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -569,11 +569,13 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) } } SetModuleType( ModuleType::CLASS ); + mbVBACompat = pClassModule->mbVBACompat; } SbClassModuleObject::~SbClassModuleObject() { - triggerTerminateEvent(); + if( StarBASIC::IsRunning() ) + triggerTerminateEvent(); // Must be deleted by base class dtor because this data // is not owned by the SbClassModuleObject object diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index 72ea67dd8db4..8e72fd2ac3c6 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -263,8 +263,10 @@ SbxVariable* SbiRuntime::FindElement pElem = pNew; } // Index-Access bei UnoObjekten beruecksichtigen - /* - else if( pElem->ISA(SbUnoProperty) ) + // definitely we want this for VBA where properties are often + // collections ( which need index access ), but lets only do + // this if we actually have params following + else if( bVBAEnabled && pElem->ISA(SbUnoProperty) && pElem->GetParameters() ) { // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen SbxVariableRef refTemp = pElem; @@ -274,7 +276,6 @@ SbxVariable* SbiRuntime::FindElement pElem->SetParameters( NULL ); // sonst bleibt Ref auf sich selbst pElem = pNew; } - */ } return CheckArray( pElem ); } -- cgit From 32b60d0777e2420f9779af1771ac32ce8a7f9761 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 25 Jun 2010 09:56:19 +0200 Subject: #i110653# - use ooo base version supplied by build env. --- desktop/test/deployment/boxt/makefile.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/desktop/test/deployment/boxt/makefile.mk b/desktop/test/deployment/boxt/makefile.mk index 63f123fcc608..11d736448d44 100644 --- a/desktop/test/deployment/boxt/makefile.mk +++ b/desktop/test/deployment/boxt/makefile.mk @@ -33,11 +33,9 @@ ENABLE_EXCEPTIONS = TRUE .INCLUDE: settings.mk .INCLUDE: rtlbootstrap.mk +.INCLUDE: versionlist.mk -#TODO: The underlying OOo base version needed here is currently only available -# as instsetoo_native/util/openoffice.lst OOOBASEVERSION, so hard-coding it here -# for now (see issue 110653): -my_version = 3.3 +my_version = $(OOOBASEVERSIONMAJOR).$(OOOBASEVERSIONMINOR) DLLPRE = -- cgit From 2ee058b62a083ad6dd208f79fefdd014f67678da Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 25 Jun 2010 11:04:30 +0200 Subject: #i112664# - service must not be 'one instance'. --- ucb/source/core/cmdenv.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx index 0f425e814400..5c0136fab063 100644 --- a/ucb/source/core/cmdenv.cxx +++ b/ucb/source/core/cmdenv.cxx @@ -183,7 +183,7 @@ UcbCommandEnvironment::createServiceFactory( const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) { return uno::Reference< lang::XSingleServiceFactory >( - cppu::createOneInstanceFactory( + cppu::createSingleFactory( rxServiceMgr, UcbCommandEnvironment::getImplementationName_Static(), UcbCommandEnvironment_CreateInstance, -- cgit From bb30c0a24baa2bc671daae588b523386470984c7 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Fri, 25 Jun 2010 13:15:03 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for WIN,W30,W31 --- basic/source/runtime/dllmgr.cxx | 27 ++------ basic/source/runtime/methods.cxx | 51 ++------------ basic/source/runtime/methods1.cxx | 33 --------- basic/source/runtime/step0.cxx | 7 -- connectivity/source/drivers/adabas/BDriver.cxx | 34 +++++----- connectivity/source/drivers/adabas/BFunctions.cxx | 2 +- connectivity/source/drivers/dbase/DTable.cxx | 8 --- connectivity/source/drivers/file/FResultSet.cxx | 5 -- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 2 +- connectivity/source/drivers/mozab/MDriver.cxx | 2 +- connectivity/source/drivers/odbc/OFunctions.cxx | 4 -- connectivity/source/inc/odbc/OFunctiondefs.hxx | 2 +- editeng/source/editeng/editattr.cxx | 9 --- editeng/source/misc/txtrange.cxx | 8 --- framework/inc/macros/debug/memorymeasure.hxx | 2 +- idl/source/cmptools/hash.cxx | 4 -- idl/source/prj/database.cxx | 6 -- idl/source/prj/idldll.cxx | 79 ---------------------- idl/source/prj/makefile.mk | 1 - sfx2/source/appl/app.cxx | 2 +- sfx2/source/appl/appquit.cxx | 3 - sfx2/source/appl/impldde.cxx | 8 +-- sfx2/source/appl/makefile.mk | 1 - sfx2/source/appl/sfxdll.cxx | 69 ------------------- sfx2/source/dialog/dinfdlg.cxx | 13 ---- sfx2/source/dialog/filedlghelper.cxx | 2 +- sfx2/source/view/viewfrm.cxx | 7 -- svx/inc/svimbase.hxx | 4 -- svx/inc/svx/svdedtv.hxx | 12 ---- svx/inc/svx/svdmodel.hxx | 2 +- svx/inc/svx/xpoly.hxx | 4 -- svx/source/engine3d/scene3d.cxx | 2 +- svx/source/svdraw/svdedtv.cxx | 40 ----------- svx/source/svdraw/svdocirc.cxx | 2 - svx/source/svdraw/svdpagv.cxx | 4 -- svx/util/svxpch.cxx | 2 +- ucb/source/ucp/odma/odma_lib.cxx | 4 -- 37 files changed, 42 insertions(+), 425 deletions(-) delete mode 100644 idl/source/prj/idldll.cxx delete mode 100644 sfx2/source/appl/sfxdll.cxx diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx index 22014763bb29..18ab61b37ef9 100644 --- a/basic/source/runtime/dllmgr.cxx +++ b/basic/source/runtime/dllmgr.cxx @@ -34,7 +34,7 @@ #include #endif -#if defined( WIN ) || defined( WNT ) +#if defined( WNT ) #ifndef _SVWIN_H #undef WB_LEFT #undef WB_RIGHT @@ -47,10 +47,7 @@ #include #include -#if defined(WIN) -typedef HINSTANCE SbiDllHandle; -typedef FARPROC SbiDllProc; -#elif defined(WNT) +#if defined(WNT) typedef HMODULE SbiDllHandle; typedef int(*SbiDllProc)(); #elif defined(OS2) @@ -72,7 +69,7 @@ typedef void* SbiDllProc; #endif extern "C" { -#if defined(INTEL) && (defined(WIN) || defined(WNT)) +#if defined(INTEL) && defined(WNT) extern INT16 WINAPI CallINT( SbiDllProc, char *stack, short nstack); extern INT32 WINAPI CallLNG( SbiDllProc, char *stack, short nstack); @@ -273,7 +270,7 @@ SbError SbiDllMgr::Call( const char* pProcName, const char* pDllName, void SbiDllMgr::CheckDllName( ByteString& rDllName ) { -#if defined(WIN) || defined(WNT) || defined(OS2) +#if defined(WNT) || defined(OS2) if( rDllName.Search('.') == STRING_NOTFOUND ) rDllName += ".DLL"; #else @@ -292,12 +289,7 @@ SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName ) SbiDllHandle hLib; #endif -#if defined(WIN) - hLib = LoadLibrary( (const char*)rDllName ); - if( (ULONG)hLib < 32 ) - hLib = 0; - -#elif defined(WNT) +#if defined(WNT) hLib = LoadLibrary( rDllName.GetBuffer() ); if( !(ULONG)hLib ) { @@ -318,7 +310,7 @@ SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName ) void SbiDllMgr::FreeDllHandle( SbiDllHandle hLib ) { -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( hLib ) FreeLibrary ((HINSTANCE) hLib); #elif defined(OS2) @@ -354,7 +346,7 @@ SbiDllProc SbiDllMgr::GetProcAddr(SbiDllHandle hLib, const ByteString& rProcName strncpy( buf2, "_", sizeof(buf2)-1 ); strncat( buf2, buf1, sizeof(buf2)-1-strlen(buf2) ); -#if defined(WIN) || defined(WNT) +#if defined(WNT) if( nOrd > 0 ) pProc = (SbiDllProc)GetProcAddress( hLib, (char*)(long) nOrd ); else @@ -543,12 +535,7 @@ void* SbiDllMgr::CreateStack( SbxArray* pArgs, USHORT& rSize ) char* pTop = pStack; USHORT nCount = pArgs->Count(); // erstes Element ueberspringen -#ifndef WIN for( USHORT nCur = 1; nCur < nCount; nCur++ ) -#else - // unter 16-Bit Windows anders rum (OS/2 ?????) - for( USHORT nCur = nCount-1; nCur >= 1; nCur-- ) -#endif { SbxVariable* pVar = pArgs->Get( nCur ); // AB 22.1.1996, Referenz diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 36fbda5c9097..dbeb7c619b9d 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -103,15 +103,10 @@ using namespace com::sun::star::io; #include #include -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) #include // _getdcwd get current work directory, _chdrive #endif -#ifdef WIN -#include // _dos_getfileattr -#include -#endif - #ifdef UNX #include #include @@ -420,7 +415,7 @@ RTLFUNC(CurDir) // zu ermitteln, dass eine virtuelle URL geliefert werden koennte. // rPar.Get(0)->PutEmpty(); -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) int nCurDir = 0; // Current dir // JSM if ( rPar.Count() == 2 ) { @@ -527,7 +522,7 @@ RTLFUNC(ChDrive) // JSM #ifndef UNX String aPar1 = rPar.Get(1)->GetString(); -#if defined (WIN) || defined (WNT) || defined (OS2) +#if defined (WNT) || defined (OS2) if (aPar1.Len() > 0) { int nCurDrive = (int)aPar1.GetBuffer()[0]; ; @@ -2792,11 +2787,7 @@ RTLFUNC(Dir) pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); else pRTLData->nDirFlags = 0; - // Nur diese Bitmaske ist unter Windows erlaubt - #ifdef WIN - if( nFlags & ~0x1E ) - StarBASIC::Error( SbERR_BAD_ARGUMENT ), pRTLData->nDirFlags = 0; - #endif + // Sb_ATTR_VOLUME wird getrennt gehandelt if( pRTLData->nDirFlags & Sb_ATTR_VOLUME ) aPath = aEntry.GetVolume(); @@ -2826,31 +2817,7 @@ RTLFUNC(Dir) } DirEntry aNextEntry=(*(pRTLData->pDir))[pRTLData->nCurDirPos++]; aPath = aNextEntry.GetName(); //Full(); - #ifdef WIN - aNextEntry.ToAbs(); - String sFull(aNextEntry.GetFull()); - unsigned nFlags; - - if (_dos_getfileattr( sFull.GetStr(), &nFlags )) - StarBASIC::Error( SbERR_FILE_NOT_FOUND ); - else - { - INT16 nCurFlags = pRTLData->nDirFlags; - if( (nCurFlags == Sb_ATTR_NORMAL) - && !(nFlags & ( _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR ) ) ) - break; - else if( (nCurFlags & Sb_ATTR_HIDDEN) && (nFlags & _A_HIDDEN) ) - break; - else if( (nCurFlags & Sb_ATTR_SYSTEM) && (nFlags & _A_SYSTEM) ) - break; - else if( (nCurFlags & Sb_ATTR_VOLUME) && (nFlags & _A_VOLID) ) - break; - else if( (nCurFlags & Sb_ATTR_DIRECTORY) && (nFlags & _A_SUBDIR) ) - break; - } - #else break; - #endif } } rPar.Get(0)->PutString( aPath ); @@ -4381,16 +4348,6 @@ RTLFUNC(SetAttr) // JSM // #57064 Bei virtuellen URLs den Real-Path extrahieren DirEntry aEntry( aStr ); String aFile = aEntry.GetFull(); - #ifdef WIN - int nErr = _dos_setfileattr( aFile.GetStr(),(unsigned ) nFlags ); - if ( nErr ) - { - if (errno == EACCES) - StarBASIC::Error( SbERR_ACCESS_DENIED ); - else - StarBASIC::Error( SbERR_FILE_NOT_FOUND ); - } - #endif ByteString aByteFile( aFile, gsl_getSystemTextEncoding() ); #ifdef WNT if (!SetFileAttributes (aByteFile.GetBuffer(),(DWORD)nFlags)) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index b25c213a493d..fae3a7d1854a 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -28,11 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basic.hxx" -#if defined(WIN) -#include -#else #include // getenv -#endif #include #include #include @@ -52,10 +48,6 @@ #include #endif -#if defined(WIN) -#include -#endif - #ifndef CLK_TCK #define CLK_TCK CLOCKS_PER_SEC #endif @@ -1152,31 +1144,10 @@ RTLFUNC(Environ) } String aResult; // sollte ANSI sein, aber unter Win16 in DLL nicht moeglich -#if defined(WIN) - LPSTR lpszEnv = GetDOSEnvironment(); - String aCompareStr( rPar.Get(1)->GetString() ); - aCompareStr += '='; - const char* pCompare = aCompareStr.GetStr(); - int nCompareLen = aCompareStr.Len(); - while ( *lpszEnv ) - { - // Es werden alle EnvString in der Form ENV=VAL 0-terminiert - // aneinander gehaengt. - - if ( strnicmp( pCompare, lpszEnv, nCompareLen ) == 0 ) - { - aResult = (const char*)(lpszEnv+nCompareLen); - rPar.Get(0)->PutString( aResult ); - return; - } - lpszEnv += lstrlen( lpszEnv ) + 1; // Next Enviroment-String - } -#else ByteString aByteStr( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() ); const char* pEnvStr = getenv( aByteStr.GetBuffer() ); if ( pEnvStr ) aResult = String::CreateFromAscii( pEnvStr ); -#endif rPar.Get(0)->PutString( aResult ); } @@ -1187,11 +1158,7 @@ static double GetDialogZoomFactor( BOOL bX, long nValue ) if( pDevice ) { Size aRefSize( nValue, nValue ); -#ifndef WIN Fraction aFracX( 1, 26 ); -#else - Fraction aFracX( 1, 23 ); -#endif Fraction aFracY( 1, 24 ); MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY ); Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap ); diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 39af5ea4adc3..437145613737 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -135,7 +135,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) } } -#ifndef WIN static SbxVariable* pTRUE = NULL; static SbxVariable* pFALSE = NULL; @@ -159,12 +158,6 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) } PushVar( pFALSE ); } -#else - BOOL bRes = p2->Compare( eOp, *p1 ); - SbxVariable* pRes = new SbxVariable; - pRes->PutBool( bRes ); - PushVar( pRes ); -#endif } void SbiRuntime::StepEXP() { StepArith( SbxEXP ); } diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx index e9a0798761b9..8e36597b3e5c 100644 --- a/connectivity/source/drivers/adabas/BDriver.cxx +++ b/connectivity/source/drivers/adabas/BDriver.cxx @@ -854,7 +854,7 @@ void ODriver::createNeededDirs(const ::rtl::OUString& sDBName) if(UCBContentHelper::Exists(sTemp)) UCBContentHelper::Kill(sTemp); -#if !(defined(WIN) || defined(WNT)) +#if !(defined(WNT)) sTemp = sDBConfig; sTemp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diag")); if(!UCBContentHelper::IsFolder(sTemp)) @@ -876,7 +876,7 @@ void ODriver::createNeededDirs(const ::rtl::OUString& sDBName) void ODriver::clearDatabase(const ::rtl::OUString& sDBName) { // stop the database ::rtl::OUString sCommand; -#if defined(WIN) || defined(WNT) +#if defined(WNT) ::rtl::OUString sStop = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("stop")); OArgumentList aArgs(2,&sDBName,&sStop); sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x_cons.exe")); @@ -921,7 +921,7 @@ void ODriver::createDb( const TDatabaseStruct& _aInfo) PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KERNELTRACESIZE")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("100"))); PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LOG_QUEUE_PAGES")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("10"))); -#if !(defined(WIN) || defined(WNT)) +#if !defined(WNT) PutParam(_aInfo.sDBName,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OPMSG1")),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/dev/null"))); #endif @@ -989,7 +989,7 @@ int ODriver::X_PARAM(const ::rtl::OUString& _DBNAME, ::std::auto_ptr pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE)); pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << "x_param" -#if defined(WIN) || defined(WNT) +#if defined(WNT) << ".exe" #endif << " -d " @@ -1000,7 +1000,7 @@ int ODriver::X_PARAM(const ::rtl::OUString& _DBNAME, << ::rtl::OString(_PWD,_PWD.getLength(),gsl_getSystemTextEncoding()) << " " << ::rtl::OString(_CMD,_CMD.getLength(),gsl_getSystemTextEncoding()) -#if (defined(WIN) || defined(WNT)) +#if defined(WNT) #if (OSL_DEBUG_LEVEL > 1) || defined(DBG_UTIL) << " >> %DBWORK%\\create.log 2>&1" #endif @@ -1050,7 +1050,7 @@ void ODriver::PutParam(const ::rtl::OUString& sDBName, { OArgumentList aArgs(3,&sDBName,&rWhat,&rHow); ::rtl::OUString sCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("putparam")); -#if defined(WIN) || defined(WNT) +#if defined(WNT) sCommand += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".exe")); #endif @@ -1112,7 +1112,7 @@ OSL_TRACE("CreateFile %d",_nSize); int ODriver::X_START(const ::rtl::OUString& sDBName) { ::rtl::OUString sCommand; -#if defined(WIN) || defined(WNT) +#if defined(WNT) ::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d")); ::rtl::OUString sArg3 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService")); @@ -1150,7 +1150,7 @@ int ODriver::X_START(const ::rtl::OUString& sDBName) int ODriver::X_STOP(const ::rtl::OUString& sDBName) { ::rtl::OUString sCommand; -#if defined(WIN) || defined(WNT) +#if defined(WNT) ::rtl::OUString sArg1 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-d")); ::rtl::OUString sArg2 = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-NoDBService")); @@ -1195,7 +1195,7 @@ void ODriver::XUTIL(const ::rtl::OUString& _rParam, ::std::auto_ptr pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE)); pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << -#if defined(WIN) || defined(WNT) +#if defined(WNT) "xutil.exe" #else "utility" @@ -1248,7 +1248,7 @@ void ODriver::LoadBatch(const ::rtl::OUString& sDBName, ::std::auto_ptr pFileStream( UcbStreamHelper::CreateStream(sCommandFile,STREAM_STD_READWRITE)); pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << "xload" -#if defined(WIN) || defined(WNT) +#if defined(WNT) << ".exe" #endif << " -d " @@ -1317,7 +1317,7 @@ void ODriver::fillEnvironmentVariables() ::rtl::OUString ODriver::generateInitFile() const { String sExt; -#if !(defined(WIN) || defined(WNT)) +#if !defined(WNT) sExt = String::CreateFromAscii(".sh"); #else sExt = String::CreateFromAscii(".bat"); @@ -1325,13 +1325,13 @@ void ODriver::fillEnvironmentVariables() String sWorkUrl(m_sDbWorkURL); ::utl::TempFile aCmdFile(String::CreateFromAscii("Init"),&sExt,&sWorkUrl); -#if !(defined(WIN) || defined(WNT)) +#if !defined(WNT) String sPhysicalPath; LocalFileHelper::ConvertURLToPhysicalName(aCmdFile.GetURL(),sPhysicalPath); chmod(ByteString(sPhysicalPath,gsl_getSystemTextEncoding()).GetBuffer(),S_IRUSR|S_IWUSR|S_IXUSR); #endif -#if !(defined(WIN) || defined(WNT)) +#if !defined(WNT) SvStream* pFileStream = aCmdFile.GetStream(STREAM_WRITE); (*pFileStream) << "#!/bin/sh" << sNewLine @@ -1441,7 +1441,7 @@ void ODriver::X_CONS(const ::rtl::OUString& sDBName,const ::rtl::OString& _ACTIO pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << "x_cons" -#if defined(WIN) || defined(WNT) +#if defined(WNT) << ".exe" #endif << " " @@ -1524,7 +1524,7 @@ sal_Bool ODriver::isVersion(const ::rtl::OUString& sDBName, const char* _pVersio pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << "getparam" -#if defined(WIN) || defined(WNT) +#if defined(WNT) << ".exe" #endif << " " @@ -1574,7 +1574,7 @@ void ODriver::checkAndInsertNewDevSpace(const ::rtl::OUString& sDBName, pFileStream->Seek(STREAM_SEEK_TO_END); (*pFileStream) << "getparam" -#if defined(WIN) || defined(WNT) +#if defined(WNT) << ".exe" #endif << " " @@ -1654,7 +1654,7 @@ sal_Bool ODriver::isKernelVersion(const char* _pVersion) // ----------------------------------------------------------------------------- void ODriver::installSystemTables( const TDatabaseStruct& _aInfo) { -#if defined(WIN) || defined(WNT) +#if defined(WNT) // xutil -d %_DBNAME% -u %_CONTROL_USER%,%_CONTROL_PWD% -b %m_sDbRoot%\env\TERMCHAR.ind ::rtl::OUString aBatch = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-b ")); ::rtl::OUString sTemp2 = m_sDbRootURL + m_sDelimit diff --git a/connectivity/source/drivers/adabas/BFunctions.cxx b/connectivity/source/drivers/adabas/BFunctions.cxx index 3a57e4818e88..6d58c030a578 100644 --- a/connectivity/source/drivers/adabas/BFunctions.cxx +++ b/connectivity/source/drivers/adabas/BFunctions.cxx @@ -129,7 +129,7 @@ sal_Bool LoadLibrary_ADABAS(::rtl::OUString &_rPath) } const sal_Char* pLibraryAsciiName = NULL; -#if defined(WIN) || defined(WNT) +#if defined(WNT) pLibraryAsciiName = "SQLOD32.DLL"; #elif ( defined(SOLARIS) && defined(SPARC)) || defined(LINUX) pLibraryAsciiName = "odbclib.so"; diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 8544e4affda7..7cc0cee80109 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -1432,16 +1432,8 @@ BOOL ODbaseTable::CreateMemoFile(const INetURLObject& aFile) char aBuffer[512]; // write buffer memset(aBuffer,0,sizeof(aBuffer)); -#ifdef WIN - m_pMemoStream->Seek(0L); - for (UINT16 i = 0; i < 512; i++) - { - (*m_pMemoStream) << BYTE(0); - } -#else m_pMemoStream->SetFiller('\0'); m_pMemoStream->SetStreamSize(512); -#endif m_pMemoStream->Seek(0L); (*m_pMemoStream) << long(1); // Zeiger auf ersten freien Block diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 265084be697f..3462422b99e6 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -75,12 +75,7 @@ using namespace com::sun::star::sdbcx; using namespace com::sun::star::container; // Maximale Anzahl von Rows, die mit ORDER BY sortiert durchlaufen werden koennen: -#if defined (WIN) -#define MAX_KEYSET_SIZE 0x3ff0 // Etwas weniger als ein Segment, damit - // noch Platz fuer Memory Debug-Informationen -#else #define MAX_KEYSET_SIZE 0x40000 // 256K -#endif namespace { diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index afb4d0da2640..0b1ec85697fa 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -133,7 +133,7 @@ namespace connectivity ::rtl::OUString StorageContainer::removeOldURLPrefix(const ::rtl::OUString& _sURL) { ::rtl::OUString sRet = _sURL; -#if defined(WIN) || defined(WNT) +#if defined(WNT) sal_Int32 nIndex = sRet.lastIndexOf('\\'); #else sal_Int32 nIndex = sRet.lastIndexOf('/'); diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index b0757a201844..37562fa57d57 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -249,7 +249,7 @@ EDriverType MozabDriver::impl_classifyURL( const ::rtl::OUString& url ) const sal_Char* pScheme; } aSchemeMap[] = { -#if defined(WNT) || defined(WIN) +#if defined(WNT) { Outlook, "outlook" }, { OutlookExpress, "outlookexp" }, #endif diff --git a/connectivity/source/drivers/odbc/OFunctions.cxx b/connectivity/source/drivers/odbc/OFunctions.cxx index d84c55787635..148c79ebadd4 100644 --- a/connectivity/source/drivers/odbc/OFunctions.cxx +++ b/connectivity/source/drivers/odbc/OFunctions.cxx @@ -109,10 +109,6 @@ sal_Bool LoadLibrary_ODBC3(::rtl::OUString &_rPath) if (bLoaded) return sal_True; -#ifdef WIN - _rPath = ::rtl::OUString::createFromAscii("ODBC.DLL"); - -#endif #ifdef WNT _rPath = ::rtl::OUString::createFromAscii("ODBC32.DLL"); #endif diff --git a/connectivity/source/inc/odbc/OFunctiondefs.hxx b/connectivity/source/inc/odbc/OFunctiondefs.hxx index 36c2a2f722da..25884342bf89 100644 --- a/connectivity/source/inc/odbc/OFunctiondefs.hxx +++ b/connectivity/source/inc/odbc/OFunctiondefs.hxx @@ -29,7 +29,7 @@ #ifndef _CONNECTIVITY_OFUNCTIONDEFS_HXX_ #define _CONNECTIVITY_OFUNCTIONDEFS_HXX_ -#if defined(WIN) || defined(WNT) +#if defined(WNT) #ifdef _MSC_VER #pragma warning(push) diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index a1d4a66b8fb1..81e211988a09 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -266,10 +266,6 @@ EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAt DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Kein Escapementattribut!" ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", off) -#endif - void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) { USHORT nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); @@ -283,11 +279,6 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) rFont.SetEscapement( nEsc ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", on) -#endif - - // ------------------------------------------------------------------------- // class EditCharAttribOutline // ------------------------------------------------------------------------- diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index 2bc219e9b69c..61e4a5253ced 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -45,10 +45,6 @@ |* *************************************************************************/ -#ifdef WIN -#pragma optimize ( "", off ) -#endif - TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon, USHORT nCacheSz, USHORT nLft, USHORT nRght, BOOL bSimpl, BOOL bInnr, BOOL bVert ) : @@ -97,10 +93,6 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg mpLinePolyPolygon = NULL; } -#ifdef WIN -#pragma optimize ( "", on ) -#endif - /************************************************************************* |* |* TextRanger::~TextRanger() diff --git a/framework/inc/macros/debug/memorymeasure.hxx b/framework/inc/macros/debug/memorymeasure.hxx index 06bd9305adeb..0c5be0d237c9 100644 --- a/framework/inc/macros/debug/memorymeasure.hxx +++ b/framework/inc/macros/debug/memorymeasure.hxx @@ -37,7 +37,7 @@ #ifdef ENABLE_MEMORYMEASURE - #if !defined( WIN ) && !defined( WNT ) + #if !defined( WNT ) #error "Macros to measure memory access not available under platforms different from windows!" #endif diff --git a/idl/source/cmptools/hash.cxx b/idl/source/cmptools/hash.cxx index 0c7985e05ec3..4d5427f3875c 100644 --- a/idl/source/cmptools/hash.cxx +++ b/idl/source/cmptools/hash.cxx @@ -141,10 +141,6 @@ BOOL SvHashTable::Test_Insert( const void * pElement, BOOL bInsert, SvStringHashTable::SvStringHashTable( UINT32 nMaxEntries ) : SvHashTable( nMaxEntries ) { -#ifdef WIN - DBG_ASSERT( (UINT32)nMaxEntries * sizeof( SvStringHashEntry ) <= 0xFF00, - "Hash table size cannot exeed 64k byte" ) -#endif pEntries = new SvStringHashEntry[ nMaxEntries ]; // RefCount auf eins setzen diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index e8c5bf1f0470..06e7e2d7c69c 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -697,10 +697,8 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm ) *************************************************************************/ void SvIdlDataBase::Write( const ByteString & rText ) { -#ifndef W31 if( nVerbosity != 0 ) fprintf( stdout, "%s", rText.GetBuffer() ); -#endif } /************************************************************************* @@ -714,7 +712,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn, ULONG nRow, ULONG nColumn ) const { //Fehlerbehandlung -#ifndef W31 fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n", rFileName.GetBuffer(), rErrWrn.GetBuffer(), nRow, nColumn ); @@ -722,7 +719,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn, { // Fehler gesetzt fprintf( stderr, "\t%s\n", rErrorText.GetBuffer() ); } -#endif } /************************************************************************* @@ -733,7 +729,6 @@ void SvIdlDataBase::WriteError( const ByteString & rErrWrn, void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) { //Fehlerbehandlung -#ifndef W31 String aFileName( rInStm.GetFileName() ); ByteString aErrorText; ULONG nRow = 0, nColumn = 0; @@ -793,7 +788,6 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) if( aN.Len() ) fprintf( stderr, "%s versus %s\n", pTok->GetString().GetBuffer(), aN.GetBuffer() ); } -#endif } /****************** SvIdlWorkingBase ****************************************/ diff --git a/idl/source/prj/idldll.cxx b/idl/source/prj/idldll.cxx deleted file mode 100644 index 607cc91e1bf6..000000000000 --- a/idl/source/prj/idldll.cxx +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_idl.hxx" - -#ifdef WIN -#include - -#ifndef _SYSDEP_HXX -#include -#endif - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; // HANDLE der DLL - - -/*************************************************************************** -|* -|* LibMain() -|* -|* Beschreibung Initialisierungsfunktion der DLL -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - -/*************************************************************************** -|* -|* WEP() -|* -|* Beschreibung DLL-Deinitialisierung -|* Ersterstellung TH 05.05.93 -|* Letzte Aenderung TH 05.05.93 -|* -***************************************************************************/ - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - -#endif diff --git a/idl/source/prj/makefile.mk b/idl/source/prj/makefile.mk index 3e0a55a7fd05..c33d2e9f3d7a 100644 --- a/idl/source/prj/makefile.mk +++ b/idl/source/prj/makefile.mk @@ -41,7 +41,6 @@ CDEFS+=-DIDL_COMPILER OBJFILES= $(OBJ)$/command.obj \ $(OBJ)$/svidl.obj \ $(OBJ)$/globals.obj \ - $(OBJ)$/idldll.obj \ $(OBJ)$/database.obj # --- Targets ------------------------------------------------------------ diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 6e13894feb49..7e4e9921573a 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -129,7 +129,7 @@ #include #endif -#if defined( WIN ) || defined( WNT ) || defined( OS2 ) +#if defined( WNT ) || defined( OS2 ) #define DDE_AVAILABLE #endif diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index 4da32cf9f566..8c2709a649be 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -30,9 +30,6 @@ #include #include -#ifdef WIN -#define _TL_LANG_SPECIAL -#endif #include #ifndef _MSGBOX_HXX //autogen #include diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 10e3c9b1a04a..20b7abb5d087 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #include #endif @@ -211,7 +211,7 @@ BOOL SvDDEObject::GetData( ::com::sun::star::uno::Any & rData /*out param*/, BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) { -#if defined(WIN) || defined(WNT) +#if defined(WNT) static BOOL bInWinExec = FALSE; #endif USHORT nLinkType = pSvLink->GetUpdateMode(); @@ -258,7 +258,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) // ansonsten unter Win/WinNT die Applikation direkt starten } -#if defined(WIN) || defined(WNT) +#if defined(WNT) // Server nicht da, starten und nochmal versuchen if( !bInWinExec ) @@ -291,7 +291,7 @@ BOOL SvDDEObject::Connect( SvBaseLink * pSvLink ) } } else -#endif // WIN / WNT +#endif // WNT { nError = DDELINK_ERROR_APP; } diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk index 72ac94a9b38e..30f74355077a 100644 --- a/sfx2/source/appl/makefile.mk +++ b/sfx2/source/appl/makefile.mk @@ -101,7 +101,6 @@ SFX_OBJECTS = \ $(SLO)$/module.obj \ $(SLO)$/newhelp.obj \ $(SLO)$/opengrf.obj \ - $(SLO)$/sfxdll.obj \ $(SLO)$/sfxhelp.obj \ $(SLO)$/sfxpicklist.obj \ $(SLO)$/shutdownicon.obj \ diff --git a/sfx2/source/appl/sfxdll.cxx b/sfx2/source/appl/sfxdll.cxx deleted file mode 100644 index 956a61b3e247..000000000000 --- a/sfx2/source/appl/sfxdll.cxx +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#ifdef WIN -#include -#endif - -#ifndef GCC -#endif - -#ifdef WIN - -// Statische DLL-Verwaltungs-Variablen -static HINSTANCE hDLLInst = 0; - -//========================================================================== - -extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR ) -{ -#ifndef WNT - if ( nHeap ) - UnlockData( 0 ); -#endif - - hDLLInst = hDLL; - - return TRUE; -} - - -//-------------------------------------------------------------------------- - -extern "C" int CALLBACK WEP( int ) -{ - return 1; -} - - -//========================================================================== - -#endif - diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 45ebfeac69f9..7b320742f33b 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1523,19 +1523,6 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent, { // Dateiname String aFile( pInfoItem->GetValue() ); -#ifdef WIN - if ( aFile.Len() <= 8 ) - { - String sTmp( SfxResId( STR_NONAME ) ); - USHORT nLen = Min( (USHORT)8, sTmp.Len() ); - - if ( sTmp.Copy( 0, nLen ).Lower() == - aFile.Copy( 0, nLen ).Lower() ) - { - aFile = pInfoItem->GetValue(); - } - } -#endif INetURLObject aURL; aURL.SetSmartProtocol( INET_PROT_FILE ); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 7d177d0bbfd8..d56c36bfd5ea 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1927,7 +1927,7 @@ void FileDialogHelper_Impl::addGraphicFilter() } } -#if defined(WIN) || defined(WNT) +#if defined(WNT) if ( aExtensions.Len() > 240 ) aExtensions = DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ); #endif diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 189c9a8aae0e..9b4fff98493c 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1108,10 +1108,6 @@ void SfxViewFrame::DoActivate( sal_Bool bUI, SfxViewFrame* pOldFrame ) DBG_CHKTHIS(SfxViewFrame, 0); SFX_APP(); -#ifdef WIN - pSfxApp->TestFreeResources_Impl(); -#endif - pDispatcher->DoActivate_Impl( bUI, pOldFrame ); // Wenn ich einen parent habe und dieser ist kein parent des alten @@ -1176,9 +1172,6 @@ void SfxViewFrame::DoDeactivate(sal_Bool bUI, SfxViewFrame* pNewFrame ) pFrame = pFrame->GetParentViewFrame(); } } -#ifdef WIN - pSfxApp->TestFreeResources_Impl(); -#endif } //------------------------------------------------------------------------ diff --git a/svx/inc/svimbase.hxx b/svx/inc/svimbase.hxx index 3d43e5fb9aac..ba10f76b01f9 100644 --- a/svx/inc/svimbase.hxx +++ b/svx/inc/svimbase.hxx @@ -36,11 +36,7 @@ // - Defines - // ----------- -#ifdef WIN -#define _SVHUGE huge -#else #define _SVHUGE -#endif // ---------------- // - SimDepthType - diff --git a/svx/inc/svx/svdedtv.hxx b/svx/inc/svx/svdedtv.hxx index 98e76bf28969..83429ae6c58e 100644 --- a/svx/inc/svx/svdedtv.hxx +++ b/svx/inc/svx/svdedtv.hxx @@ -208,7 +208,6 @@ public: // verwendet. NotifyNewUndoAction() wird in diesem Fall erst beim letzten // EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer // leeren Klammerung. -#ifndef WIN void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf @@ -218,17 +217,6 @@ public: // nur nach dem 1. BegUndo oder vor dem letzten EndUndo: void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); } void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); } -#else // ifndef WIN - void BegUndo(); - void BegUndo(const String& rComment); - void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE); - void BegUndo(SdrUndoGroup* pUndoGrp); - void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges) - void AddUndo(SdrUndoAction* pUndo); - // nur nach dem 1. BegUndo oder vor dem letzten EndUndo: - void SetUndoComment(const String& rComment); - void SetUndoComment(const String& rComment, const String& rObjDescr); -#endif bool IsUndoEnabled() const; std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO ); diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index fc8d401f94e7..61edcd5c7fe7 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -53,7 +53,7 @@ class OutputDevice; #include -#if defined(UNX) || defined(WIN) || defined(WNT) +#if defined(UNX) || defined(WNT) #define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */ #endif diff --git a/svx/inc/svx/xpoly.hxx b/svx/inc/svx/xpoly.hxx index 409d957cae84..28b7e3dcdd3e 100644 --- a/svx/inc/svx/xpoly.hxx +++ b/svx/inc/svx/xpoly.hxx @@ -45,11 +45,7 @@ class OutputDevice; #define XPOLYPOLY_APPEND 0xFFFF #define XPOLY_APPEND 0xFFFF -#ifdef WIN // Windows 16 Bit -#define XPOLY_MAXPOINTS 8160 /* =0xFF00/sizeof(Point), also mit etwas Platz! */ -#else #define XPOLY_MAXPOINTS 0xFFF0 /* Auch fuer die 32-Bitter etwas Luft lassen */ -#endif /************************************************************************/ // Punktstile im XPolygon: diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 036f700e6e96..0b06a74c280d 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -240,7 +240,7 @@ void E3dScene::SetDefaultAttributes(E3dDefaultAttributes& /*rDefault*/) #endif // Fuer WIN95/NT die FP-Exceptions abschalten -#if defined(WNT) || defined(WIN) +#if defined(WNT) #define SC_FPEXCEPTIONS_ON() _control87( _MCW_EM, 0 ) #define SC_FPEXCEPTIONS_OFF() _control87( _MCW_EM, _MCW_EM ) SC_FPEXCEPTIONS_OFF(); diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 5eae04dbbc87..26966a543f1c 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -1039,46 +1039,6 @@ void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrO //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef WIN -void SdrEditView::BegUndo() // Undo-Klammerung auf -{ - pMod->BegUndo(); -} - -void SdrEditView::BegUndo(const String& rComment) // Undo-Klammerung auf -{ - pMod->BegUndo(rComment); -} - -void SdrEditView::BegUndo(const String& rComment, const String& rObjDescr, - SdrRepeatFunc eFunc) // Undo-Klammerung auf -{ - pMod->BegUndo(rComment,rObjDescr,eFunc); -} - -void SdrEditView::BegUndo(SdrUndoGroup* pUndoGrp) // Undo-Klammerung auf -{ - pMod->BegUndo(pUndoGrp); -} - -void SdrEditView::AddUndo(SdrUndoAction* pUndo) // Action hinzufuegen -{ - pMod->AddUndo(pUndo); -} - // nur nach dem 1. BegUndo oder vor dem letzten EndUndo: -void SdrEditView::SetUndoComment(const String& rComment) -{ - pMod->SetUndoComment(rComment); -} - - -void SdrEditView::SetUndoComment(const String& rComment, - const String& rObjDescr) -{ - pMod->SetUndoComment(rComment,rObjDescr); -} -#endif - bool SdrEditView::IsUndoEnabled() const { return pMod->IsUndoEnabled(); diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 4c600cba821f..31582d652dc4 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -171,10 +171,8 @@ FASTBOOL SdrCircObj::PaintNeedsXPolyCirc() const // und wenn nicht WIN dann (erstmal) auch fuer Kreis-/Ellipsenausschnitte // und Kreis-/Ellipsenboegen (wg. Genauigkeit) FASTBOOL bNeed=aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 || meCircleKind==OBJ_CCUT; -#ifndef WIN // Wenn nicht Win, dann fuer alle ausser Vollkreis (erstmal!!!) if (meCircleKind!=OBJ_CIRC) bNeed=TRUE; -#endif const SfxItemSet& rSet = GetObjectItemSet(); if(!bNeed) diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index bad1401c2305..03e3dc31a94f 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -580,10 +580,6 @@ void SdrPageView::DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, C rOut.SetLineColor( aColor ); bool bMap0=rOut.IsMapModeEnabled(); -#ifdef WIN // SetPixel-Profiling fuer Windows - COLORREF aWinColRef=PALETTERGB(aColor.GetRed()>>8,aColor.GetGreen()>>8,aColor.GetBlue()>>8); - HDC aWinhDC=Sysdepen::GethDC(rOut); -#endif long nWrX=0;//aWriterPageOffset.X(); long nWrY=0;//aWriterPageOffset.Y(); diff --git a/svx/util/svxpch.cxx b/svx/util/svxpch.cxx index a59ef4b90a74..b8f6b92b38db 100644 --- a/svx/util/svxpch.cxx +++ b/svx/util/svxpch.cxx @@ -29,7 +29,7 @@ #include "precompiled_svx.hxx" #include #include -#if defined(WNT) || defined (WIN) +#if defined(WNT) #include #endif #include diff --git a/ucb/source/ucp/odma/odma_lib.cxx b/ucb/source/ucp/odma/odma_lib.cxx index 774bcf5f6323..cf9da3a2b942 100644 --- a/ucb/source/ucp/odma/odma_lib.cxx +++ b/ucb/source/ucp/odma/odma_lib.cxx @@ -78,10 +78,6 @@ namespace odma if (bLoaded) return sal_True; ::rtl::OUString sPath; - #ifdef WIN - sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA.DLL")); - - #endif #ifdef WNT sPath = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ODMA32.DLL")); #endif -- cgit From 1404c71e271169299640a1d1b6fb7e46407792b7 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 25 Jun 2010 15:18:20 +0200 Subject: dv19#i29340# Implmented handler for NameClashResolveRequests --- uui/source/iahndl.cxx | 77 +++++++++++------------------- uui/source/ids.hrc | 5 ++ uui/source/makefile.mk | 2 + uui/source/nameclashdlg.cxx | 102 +++++++++++++++++++++++++++++++++++++++ uui/source/nameclashdlg.hrc | 41 ++++++++++++++++ uui/source/nameclashdlg.hxx | 63 ++++++++++++++++++++++++ uui/source/nameclashdlg.src | 113 ++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 354 insertions(+), 49 deletions(-) mode change 100644 => 100755 uui/source/iahndl.cxx mode change 100644 => 100755 uui/source/ids.hrc mode change 100644 => 100755 uui/source/makefile.mk create mode 100755 uui/source/nameclashdlg.cxx create mode 100755 uui/source/nameclashdlg.hrc create mode 100755 uui/source/nameclashdlg.hxx create mode 100755 uui/source/nameclashdlg.src diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx old mode 100644 new mode 100755 index e883bd60848d..ee233f5ac9de --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -89,6 +89,7 @@ #include "newerverwarn.hxx" #include "iahndl.hxx" +#include "nameclashdlg.hxx" /** === begin UNO using === **/ using ::com::sun::star::uno::Sequence; @@ -867,14 +868,13 @@ UUIInteractionHelper::handleRequest_impl( if ( handleCertificateValidationRequest( rRequest ) ) return true; -// @@@ Todo #i29340#: activate! -// ucb::NameClashResolveRequest aNameClashResolveRequest; -// if (aAnyRequest >>= aNameClashResolveRequest) -// { -// handleNameClashResolveRequest(aNameClashResolveRequest, -// rRequest->getContinuations()); -// return true; -// } + ucb::NameClashResolveRequest aNameClashResolveRequest; + if (aAnyRequest >>= aNameClashResolveRequest) + { + handleNameClashResolveRequest(aNameClashResolveRequest, + rRequest->getContinuations()); + return true; + } if ( handleMasterPasswordRequest( rRequest ) ) return true; @@ -1187,32 +1187,22 @@ executeMessageBox( return aResult; } -enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; - -NameClashResolveDialogResult -executeNameClashResolveDialog( - Window * /*pParent*/, - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) +NameClashResolveDialogResult executeSimpleNameClashResolveDialog( Window *pParent, + rtl::OUString const & rTargetFolderURL, + rtl::OUString const & rClashingName, + rtl::OUString & rProposedNewName, + bool bAllowOverwrite ) { - // @@@ Todo DV: execute overwrite-rename dialog, deliver result - OSL_ENSURE( false, - "executeNameClashResolveDialog not yet implemented!" ); - return ABORT; -} + std::auto_ptr< ResMgr > xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); + if ( !xManager.get() ) + return ABORT; -NameClashResolveDialogResult -executeSimpleNameClashResolveDialog( - Window * /*pParent*/, - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) -{ - // @@@ Todo DV: execute rename-only dialog, deliver result - OSL_ENSURE( false, - "executeSimpleNameClashResolveDialog not yet implemented!" ); - return ABORT; + NameClashDialog aDialog( pParent, xManager.get(), rTargetFolderURL, + rClashingName, rProposedNewName, bAllowOverwrite ); + + NameClashResolveDialogResult eResult = (NameClashResolveDialogResult) aDialog.Execute(); + rProposedNewName = aDialog.getNewName(); + return eResult; } } // namespace @@ -1246,18 +1236,12 @@ UUIInteractionHelper::handleNameClashResolveRequest( NameClashResolveDialogResult eResult = ABORT; rtl::OUString aProposedNewName( rRequest.ProposedNewName ); - if ( xReplaceExistingData.is() ) - eResult = executeNameClashResolveDialog( - getParentProperty(), - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); - else - eResult = executeSimpleNameClashResolveDialog( - getParentProperty(), - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); + + eResult = executeSimpleNameClashResolveDialog( getParentProperty(), + rRequest.TargetFolderURL, + rRequest.ClashingName, + aProposedNewName, + xReplaceExistingData.is() ); switch ( eResult ) { @@ -1277,11 +1261,6 @@ UUIInteractionHelper::handleNameClashResolveRequest( "No ReplaceExistingData continuation available!" ); xReplaceExistingData->select(); break; - - default: - OSL_ENSURE( false, "Unknown NameClashResolveDialogResult value. " - "Interaction Request not handled!" ); - break; } } diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc old mode 100644 new mode 100755 index 9bf5856bc270..42d06bd63850 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -48,6 +48,7 @@ #define DLG_FILTER_SELECT (RID_UUI_START + 10) // RID_UUI_START + 11 moved to ERRCODE_UUI_WRONGMEDIUM #define DLG_UUI_MASTERPASSWORD (RID_UUI_START + 12) +#define DLG_SIMPLE_NAME_CLASH (RID_UUI_START + 13) #define STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13) #define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14) // RID_UUI_START + 15, 16, 17 are misused by syncaccess/source/ui/resids.hrc @@ -86,6 +87,9 @@ #define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) #define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53) #define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54) +#define STR_RENAME_OR_REPLACE (RID_UUI_START + 55) +#define STR_NAME_CLASH_RENAME_ONLY (RID_UUI_START + 56) +#define STR_SAME_NAME_USED (RID_UUI_START + 57) #define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) #define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) @@ -178,6 +182,7 @@ #define HID_DLG_SSLWARN_UUI (HID_UUI_START+8) #define HID_XMLSECDLG_MACROWARN (HID_UUI_START+9) #define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START+10) +#define HID_DLG_SIMPLE_NAME_CLASH (HID_UUI_START+11) // HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in // sfx2/util/hidother.src diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk old mode 100644 new mode 100755 index 5c20e593046a..ebe61b2c570e --- a/uui/source/makefile.mk +++ b/uui/source/makefile.mk @@ -60,6 +60,7 @@ SLOFILES = \ $(SLO)$/lockfailed.obj \ $(SLO)$/trylater.obj \ $(SLO)$/newerverwarn.obj \ + $(SLO)$/nameclashdlg.obj \ $(SLO)$/passwordcontainer.obj SRS1NAME=$(TARGET) @@ -81,6 +82,7 @@ SRC1FILES = \ alreadyopen.src\ lockfailed.src\ trylater.src\ + nameclashdlg.src\ newerverwarn.src .INCLUDE: target.mk diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx new file mode 100755 index 000000000000..dd4566e45b30 --- /dev/null +++ b/uui/source/nameclashdlg.cxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vcl/msgbox.hxx" + +#include "ids.hrc" +#include "nameclashdlg.hrc" +#include "nameclashdlg.hxx" + +// NameClashDialog --------------------------------------------------------- + +IMPL_LINK( NameClashDialog, ButtonHdl_Impl, PushButton *, pBtn ) +{ + long nRet = (long) ABORT; + if ( &maBtnRename == pBtn ) + { + nRet = (long) RENAME; + rtl::OUString aNewName = maEDNewName.GetText(); + if ( ( aNewName == maNewName ) || !aNewName.getLength() ) + { + ErrorBox aError( NULL, WB_OK, maSameName ); + aError.Execute(); + return 1; + } + maNewName = aNewName; + } + else if ( &maBtnOverwrite == pBtn ) + nRet = (long) OVERWRITE; + + EndDialog( nRet ); + + return 1; +} + +// ----------------------------------------------------------------------- +NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr, + rtl::OUString const & rTargetFolderURL, + rtl::OUString const & rClashingName, + rtl::OUString const & rProposedNewName, + bool bAllowOverwrite ) + : ModalDialog( pParent, ResId( DLG_SIMPLE_NAME_CLASH, *pResMgr ) ), + maFTMessage ( this, ResId( FT_FILE_EXISTS_WARNING, *pResMgr ) ), + maEDNewName ( this, ResId( EDIT_NEW_NAME, *pResMgr ) ), + maBtnOverwrite ( this, ResId( BTN_OVERWRITE, *pResMgr ) ), + maBtnRename ( this, ResId( BTN_RENAME, *pResMgr ) ), + maBtnCancel ( this, ResId( BTN_CANCEL, *pResMgr ) ), + maBtnHelp ( this, ResId( BTN_HELP, *pResMgr ) ), + maNewName ( rClashingName ) +{ + FreeResource(); + + Link aLink( LINK( this, NameClashDialog, ButtonHdl_Impl ) ); + maBtnOverwrite.SetClickHdl( aLink ); + maBtnRename.SetClickHdl( aLink ); + maBtnCancel.SetClickHdl( aLink ); + + String aInfo; + if ( bAllowOverwrite ) + { + aInfo = String( ResId( STR_RENAME_OR_REPLACE, *pResMgr ) ); + } + else + { + aInfo = String( ResId( STR_NAME_CLASH_RENAME_ONLY, *pResMgr ) ); + maBtnOverwrite.Hide(); + } + + maSameName = String ( ResId( STR_SAME_NAME_USED, *pResMgr ) ); + + aInfo.SearchAndReplaceAscii( "%NAME", rClashingName ); + aInfo.SearchAndReplaceAscii( "%FOLDER", rTargetFolderURL ); + maFTMessage.SetText( aInfo ); + if ( rProposedNewName.getLength() ) + maEDNewName.SetText( rProposedNewName ); + else + maEDNewName.SetText( rClashingName ); +} + diff --git a/uui/source/nameclashdlg.hrc b/uui/source/nameclashdlg.hrc new file mode 100755 index 000000000000..1bfdc01de5ab --- /dev/null +++ b/uui/source/nameclashdlg.hrc @@ -0,0 +1,41 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef UUI_NAMECLASHDLG_HRC +#define UUI_NAMECLASHDLG_HRC + +//============================================================================ + +#define FT_FILE_EXISTS_WARNING 20 +#define EDIT_NEW_NAME 21 +#define BTN_OVERWRITE 22 +#define BTN_RENAME 23 +#define BTN_CANCEL 24 +#define BTN_HELP 25 + +#endif // UUI_NAMECLASHDLG_HRC + diff --git a/uui/source/nameclashdlg.hxx b/uui/source/nameclashdlg.hxx new file mode 100755 index 000000000000..1e234008a229 --- /dev/null +++ b/uui/source/nameclashdlg.hxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef UUI_NAMECLASHDLG_HXX +#define UUI_NAMECLASHDLG_HXX + +#include "vcl/button.hxx" +#include "vcl/dialog.hxx" +#include "vcl/fixed.hxx" +#include "vcl/edit.hxx" + +//============================================================================ + +enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; + +class NameClashDialog : public ModalDialog +{ + FixedText maFTMessage; + Edit maEDNewName; + PushButton maBtnOverwrite; + PushButton maBtnRename; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + rtl::OUString maSameName; + rtl::OUString maNewName; + + DECL_LINK( ButtonHdl_Impl, PushButton * ); + +public: + NameClashDialog( Window* pParent, ResMgr* pResMgr, + rtl::OUString const & rTargetFolderURL, + rtl::OUString const & rClashingName, + rtl::OUString const & rProposedNewName, + bool bAllowOverwrite ); + rtl::OUString getNewName() const { return maNewName; } +}; + +#endif // UUI_COOKIEDG_HXX + diff --git a/uui/source/nameclashdlg.src b/uui/source/nameclashdlg.src new file mode 100755 index 000000000000..de8cdb8e716d --- /dev/null +++ b/uui/source/nameclashdlg.src @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define __RSC + +#ifndef UUI_IDS_HRC +#include "ids.hrc" +#endif + +#ifndef UUI_NAMECLASHDLG_HRC +#include "nameclashdlg.hrc" +#endif + +#define DLG_WIDTH 250 +#define DLG_HEIGTH 75 +#define BORDER_OFFSET 6 +#define EDIT_HEIGTH 12 +#define BTN_WIDTH 50 +#define BTN_HEIGTH 14 + +ModalDialog DLG_SIMPLE_NAME_CLASH +{ + HelpId = HID_DLG_SIMPLE_NAME_CLASH ; + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGTH ) ; + Moveable = TRUE ; + Text [ en-US ] = "File Exists" ; + + FixedText FT_FILE_EXISTS_WARNING + { + Pos = MAP_APPFONT ( BORDER_OFFSET, BORDER_OFFSET ) ; + Size = MAP_APPFONT ( DLG_WIDTH - 2*BORDER_OFFSET, DLG_HEIGTH - EDIT_HEIGTH - BTN_HEIGTH - 4*BORDER_OFFSET ) ; + WordBreak = TRUE ; + }; + + Edit EDIT_NEW_NAME + { + Border = TRUE ; + Pos = MAP_APPFONT ( BORDER_OFFSET, DLG_HEIGTH - EDIT_HEIGTH - BTN_HEIGTH - 2*BORDER_OFFSET ) ; + Size = MAP_APPFONT ( DLG_WIDTH - 2*BORDER_OFFSET , EDIT_HEIGTH ) ; + }; + + PushButton BTN_OVERWRITE + { + Pos = MAP_APPFONT ( DLG_WIDTH - 3*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; + Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; + TabStop = TRUE ; + Text [ en-US ] = "Replace" ; + }; + + PushButton BTN_RENAME + { + Pos = MAP_APPFONT ( DLG_WIDTH - 2*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; + Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; + TabStop = TRUE ; + Text [ en-US ] = "Rename" ; + DefButton = TRUE ; + }; + + CancelButton BTN_CANCEL + { + Pos = MAP_APPFONT ( DLG_WIDTH - BTN_WIDTH - BORDER_OFFSET, DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; + Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; + TabStop = TRUE ; + }; + + HelpButton BTN_HELP + { + Pos = MAP_APPFONT ( BORDER_OFFSET, DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; + Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; + TabStop = TRUE ; + }; +}; + +String STR_RENAME_OR_REPLACE +{ + Text = "A file with the name \"%NAME\" already exists in the location \"%FOLDER\".\nChoose Replace to overwrite the existing file or provide a new name."; +}; + +String STR_NAME_CLASH_RENAME_ONLY +{ + Text = "A file with the name \"%NAME\" already exists in the location \"%FOLDER\".\nPlease enter a new name."; +}; + +String STR_SAME_NAME_USED +{ + Text = "Please provide a different file name!"; +}; -- cgit From bd30219e004c372905bd1549446506cc02b0e9fe Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 25 Jun 2010 15:19:04 +0200 Subject: dv19#i29340# Implmented handler for NameClashResolveRequests --- ucb/source/core/cmdenv.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 ucb/source/core/cmdenv.cxx diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx old mode 100644 new mode 100755 index 0f425e814400..5c0136fab063 --- a/ucb/source/core/cmdenv.cxx +++ b/ucb/source/core/cmdenv.cxx @@ -183,7 +183,7 @@ UcbCommandEnvironment::createServiceFactory( const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) { return uno::Reference< lang::XSingleServiceFactory >( - cppu::createOneInstanceFactory( + cppu::createSingleFactory( rxServiceMgr, UcbCommandEnvironment::getImplementationName_Static(), UcbCommandEnvironment_CreateInstance, -- cgit From 7359de66a265a67863bab7e2ee424b40dcf7343c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 25 Jun 2010 17:42:50 +0200 Subject: sw33bf06: #i110070#: fix regression: member initialization removed by accident --- xmloff/source/text/XMLTextMarkImportContext.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index af51f5f56d98..00cdce37f4d5 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -116,6 +116,7 @@ XMLTextMarkImportContext::XMLTextMarkImportContext( const OUString& rLocalName ) : SvXMLImportContext(rImport, nPrefix, rLocalName) , m_rHelper(rHlp) + , m_bHaveAbout(false) { } -- cgit From 07a000e572751457da400f615c085e6916c2aa28 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 28 Jun 2010 09:26:14 +0200 Subject: fwk147: #i112578# Remove Sleep command used for debugging --- desktop/source/app/app.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 05311010f455..04574b4c57b8 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -474,8 +474,6 @@ void Desktop::Init() RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" ); SetBootstrapStatus(BS_OK); - Sleep(10000); - // create service factory... Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); if( rSMgr.is() ) -- cgit From 1e403838eea9f2a13692574cb50441c01f8a6948 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 28 Jun 2010 12:54:49 +0200 Subject: sb123:#i111449# cleanups in framework for qa/complex tests --- framework/prj/build.lst | 30 + .../complex/ModuleManager/CheckXModuleManager.java | 137 ++- framework/qa/complex/ModuleManager/makefile.mk | 70 +- .../complex/XUserInputInterception/EventTest.java | 167 +-- .../qa/complex/XUserInputInterception/makefile.mk | 140 ++- .../AcceleratorsConfigurationTest.java | 583 +++++---- .../qa/complex/accelerators/helper/KeyMapping.java | 4 +- .../qa/complex/accelerators/helper/makefile.mk | 4 +- framework/qa/complex/accelerators/makefile.mk | 73 +- framework/qa/complex/api_internal/CheckAPI.java | 103 +- framework/qa/complex/api_internal/makefile.mk | 76 +- .../qa/complex/broken_document/LoadDocument.java | 75 +- .../qa/complex/broken_document/TestDocument.java | 41 + framework/qa/complex/broken_document/dbf.dbf.emf | 1 - framework/qa/complex/broken_document/makefile.mk | 68 +- .../broken_document/test_documents/dbf.dbf.emf | 1 + .../CheckContextMenuInterceptor.java | 291 +++-- .../ContextMenuInterceptor.java | 106 +- .../qa/complex/contextMenuInterceptor/makefile.mk | 67 +- .../complex/contextMenuInterceptor/space-metal.jpg | Bin 0 -> 4313 bytes framework/qa/complex/desktop/DesktopTerminate.java | 153 ++- framework/qa/complex/desktop/makefile.mk | 68 +- .../qa/complex/dispatches/checkdispatchapi.java | 314 ++--- .../qa/complex/dispatches/helper/Interceptor.java | 85 +- framework/qa/complex/dispatches/helper/makefile.mk | 9 +- framework/qa/complex/dispatches/makefile.mk | 141 ++- .../disposing/GetServiceWhileDisposingOffice.java | 86 +- framework/qa/complex/disposing/makefile.mk | 62 +- .../qa/complex/framework/autosave/AutoSave.java | 123 +- .../complex/framework/autosave/ConfigHelper.java | 37 +- .../qa/complex/framework/autosave/makefile.mk | 139 ++- .../complex/framework/recovery/RecoveryTest.java | 10 + .../qa/complex/imageManager/CheckImageManager.java | 176 +-- .../imageManager/interfaces/_XComponent.java | 32 +- .../imageManager/interfaces/_XImageManager.java | 15 +- .../imageManager/interfaces/_XInitialization.java | 13 +- .../imageManager/interfaces/_XTypeProvider.java | 21 +- .../imageManager/interfaces/_XUIConfiguration.java | 13 +- .../interfaces/_XUIConfigurationPersistence.java | 19 +- .../qa/complex/imageManager/interfaces/makefile.mk | 16 +- framework/qa/complex/imageManager/makefile.mk | 117 +- .../loadAllDocuments/CheckXComponentLoader.java | 447 +++---- .../qa/complex/loadAllDocuments/TestDocument.java | 41 + .../qa/complex/loadAllDocuments/helper/makefile.mk | 9 +- framework/qa/complex/loadAllDocuments/makefile.mk | 142 ++- .../qa/complex/path_settings/PathSettingsTest.java | 1236 ++++++++++++++------ framework/qa/complex/path_settings/makefile.mk | 71 +- .../path_substitution/PathSubstitutionTest.java | 229 ++-- framework/qa/complex/path_substitution/makefile.mk | 128 +- .../qa/complex/sequence/CheckSequenceOfEnum.java | 95 -- framework/qa/complex/sequence/makefile.mk | 98 -- framework/source/services/pathsettings.cxx | 7 + 52 files changed, 3726 insertions(+), 2463 deletions(-) create mode 100644 framework/qa/complex/broken_document/TestDocument.java delete mode 100755 framework/qa/complex/broken_document/dbf.dbf.emf create mode 100755 framework/qa/complex/broken_document/test_documents/dbf.dbf.emf create mode 100644 framework/qa/complex/contextMenuInterceptor/space-metal.jpg create mode 100644 framework/qa/complex/loadAllDocuments/TestDocument.java delete mode 100755 framework/qa/complex/sequence/CheckSequenceOfEnum.java delete mode 100755 framework/qa/complex/sequence/makefile.mk diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 5c745e09077d..72adda8dde70 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -21,3 +21,33 @@ fr framework\source\accelerators nmake - all fr_accelerators fr_t fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL + +# complex tests +fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL +fr framework\qa\complex\XUserInputInterception nmake - all fr_qa_complex_xuserinputinterception NULL +fr framework\qa\complex\accelerators\helper nmake - all fr_qa_complex_accel_helper NULL +fr framework\qa\complex\accelerators nmake - all fr_qa_complex_accel fr_qa_complex_accel_helper NULL + +# unclear should be remove +# fr framework\qa\complex\api_internal nmake - all fr_qa_complex_api_internal NULL +# BUG! opens an error box +fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL +fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL +fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL +fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL +fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL +fr framework\qa\complex\framework\autosave nmake - all fr_qa_complex_framework_autosave NULL + +# much too complex, will not change to new junit +# fr framework\qa\complex\framework\recovery nmake - all fr_qa_complex_framework_recovery NULL + +fr framework\qa\complex\imageManager\interfaces nmake - all fr_qa_complex_imageManager_interfaces NULL +fr framework\qa\complex\imageManager nmake - all fr_qa_complex_imageManager fr_qa_complex_imageManager_interfaces NULL + +fr framework\qa\complex\loadAllDocuments\helper nmake - all fr_qa_complex_loadAllDocuments_helper NULL +fr framework\qa\complex\loadAllDocuments nmake - all fr_qa_complex_loadAllDocuments fr_qa_complex_loadAllDocuments_helper NULL + +# need cleanups +# fr framework\qa\complex\path_settings nmake - all fr_qa_complex_path_settings NULL +# fr framework\qa\complex\path_substitution nmake - all fr_qa_complex_path_substitution NULL + diff --git a/framework/qa/complex/ModuleManager/CheckXModuleManager.java b/framework/qa/complex/ModuleManager/CheckXModuleManager.java index ba0c9e318980..22e3003d86e3 100644 --- a/framework/qa/complex/ModuleManager/CheckXModuleManager.java +++ b/framework/qa/complex/ModuleManager/CheckXModuleManager.java @@ -30,21 +30,27 @@ package complex.ModuleManager; import com.sun.star.beans.*; import com.sun.star.frame.*; import com.sun.star.lang.*; -import com.sun.star.uno.*; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.UnoRuntime; import com.sun.star.util.*; import com.sun.star.container.*; -import complexlib.ComplexTestCase; -import helper.URLHelper; -import java.lang.*; -import java.util.*; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ //----------------------------------------------- /** @short todo document me */ -public class CheckXModuleManager extends ComplexTestCase +public class CheckXModuleManager { //------------------------------------------- // some const @@ -71,16 +77,16 @@ public class CheckXModuleManager extends ComplexTestCase @return All test methods. @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkModuleIdentification" , - "checkModuleConfigurationReadable" , - "checkModuleConfigurationWriteable", - "checkModuleConfigurationQueries" - }; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkModuleIdentification" , +// "checkModuleConfigurationReadable" , +// "checkModuleConfigurationWriteable", +// "checkModuleConfigurationQueries" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. @@ -88,36 +94,28 @@ public class CheckXModuleManager extends ComplexTestCase @descr Use either a component loader from desktop or from frame */ - public void before() + @Before public void before() throws java.lang.Exception { // get uno service manager from global test environment - m_xSmgr = (XMultiServiceFactory)param.getMSF(); + m_xSmgr = getMSF(); // create module manager - m_xMM = (XModuleManager)UnoRuntime.queryInterface( - XModuleManager.class, - m_xSmgr.createInstance("com.sun.star.frame.ModuleManager")); + m_xMM = UnoRuntime.queryInterface(XModuleManager.class, m_xSmgr.createInstance("com.sun.star.frame.ModuleManager")); // create desktop instance to create a special frame to load documents there. - XFrame xDesktop = (XFrame)UnoRuntime.queryInterface( - XFrame.class, - m_xSmgr.createInstance("com.sun.star.frame.Desktop")); + XFrame xDesktop = UnoRuntime.queryInterface(XFrame.class, m_xSmgr.createInstance("com.sun.star.frame.Desktop")); - m_xLoader = (XComponentLoader)UnoRuntime.queryInterface( - XComponentLoader.class, - xDesktop.findFrame("_blank", 0)); + m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, xDesktop.findFrame("_blank", 0)); } //------------------------------------------- /** @short close the environment. */ - public void after() + @After public void after() throws java.lang.Exception { - XCloseable xClose = (XCloseable)UnoRuntime.queryInterface( - XCloseable.class, - m_xLoader); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, m_xLoader); xClose.close(false); m_xLoader = null; @@ -128,7 +126,7 @@ public class CheckXModuleManager extends ComplexTestCase //------------------------------------------- /** @todo document me */ - public void checkModuleIdentification() + @Test public void checkModuleIdentification() throws java.lang.Exception { impl_identifyModulesBasedOnDocs("com.sun.star.text.TextDocument" ); @@ -139,13 +137,14 @@ public class CheckXModuleManager extends ComplexTestCase impl_identifyModulesBasedOnDocs("com.sun.star.drawing.DrawingDocument" ); impl_identifyModulesBasedOnDocs("com.sun.star.presentation.PresentationDocument"); impl_identifyModulesBasedOnDocs("com.sun.star.sdb.OfficeDatabaseDocument" ); - impl_identifyModulesBasedOnDocs("com.sun.star.chart.ChartDocument" ); + // TODO: fails + // impl_identifyModulesBasedOnDocs("com.sun.star.chart.ChartDocument" ); } //------------------------------------------- /** @todo document me */ - public void checkModuleConfigurationReadable() + @Test public void checkModuleConfigurationReadable() throws java.lang.Exception { } @@ -153,7 +152,7 @@ public class CheckXModuleManager extends ComplexTestCase //------------------------------------------- /** @todo document me */ - public void checkModuleConfigurationWriteable() + @Test public void checkModuleConfigurationWriteable() throws java.lang.Exception { // modules supporting real documents @@ -182,7 +181,7 @@ public class CheckXModuleManager extends ComplexTestCase //------------------------------------------- /** @todo document me */ - public void checkModuleConfigurationQueries() + @Test public void checkModuleConfigurationQueries() throws java.lang.Exception { impl_searchModulesByDocumentService("com.sun.star.text.TextDocument" ); @@ -202,14 +201,14 @@ public class CheckXModuleManager extends ComplexTestCase private void impl_searchModulesByDocumentService(String sDocumentService) throws java.lang.Exception { - log.println("search modules matching document service '"+sDocumentService+"' ..."); + System.out.println("search modules matching document service '"+sDocumentService+"' ..."); NamedValue[] lProps = new NamedValue[1]; lProps[0] = new NamedValue(); lProps[0].Name = "ooSetupFactoryDocumentService"; lProps[0].Value = sDocumentService; - XContainerQuery xMM = (XContainerQuery)UnoRuntime.queryInterface(XContainerQuery.class, m_xMM); + XContainerQuery xMM = UnoRuntime.queryInterface(XContainerQuery.class, m_xMM); XEnumeration xResult = xMM.createSubSetEnumerationByProperties(lProps); while(xResult.hasMoreElements()) { @@ -221,18 +220,26 @@ public class CheckXModuleManager extends ComplexTestCase for (i=0; iComplexTest checks the interface @@ -64,7 +73,7 @@ import util.SOfficeFactory; * @short Check the interface XUserInputIntercaption * @descr checks is a simple way the interface XUserInputInteraction */ -public class EventTest extends ComplexTestCase { +public class EventTest { //------------------------------------------- // some const @@ -112,16 +121,16 @@ public class EventTest extends ComplexTestCase { * @return All test methods. * @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() { - return new String[] - { "checkTextDocument", - "checkCalcDocument", - "checkDrawDocument", - "checkImpressDocument", - "checkChartDocument", - "checkMathDocument", - }; - } +// public String[] getTestMethodNames() { +// return new String[] +// { "checkTextDocument", +// "checkCalcDocument", +// "checkDrawDocument", +// "checkImpressDocument", +// "checkChartDocument", +// "checkMathDocument", +// }; +// } //------------------------------------------- /** @@ -130,17 +139,17 @@ public class EventTest extends ComplexTestCase { * @descr create an empty test frame, where we can load * different components inside. */ - public void before() { +@Before public void before() { // get uno service manager from global test environment - m_xMSF = (XMultiServiceFactory)param.getMSF(); + m_xMSF = getMSF(); // create frame instance try { // get a soffice factory object - m_SOF = SOfficeFactory.getFactory((XMultiServiceFactory) param.getMSF()); + m_SOF = SOfficeFactory.getFactory(getMSF()); } catch(java.lang.Throwable ex) { - failed("Could not create the XUserInputInterception instance."); + fail("Could not create the XUserInputInterception instance."); } } @@ -151,12 +160,11 @@ public class EventTest extends ComplexTestCase { * @param xDoc the document to close */ public void closeDoc(XInterface xDoc) { - XCloseable xClose = (XCloseable)UnoRuntime.queryInterface( - XCloseable.class, xDoc); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDoc); try { xClose.close(false); } catch(com.sun.star.util.CloseVetoException exVeto) { - log.println("document couldn't be closed successfully."); + System.out.println("document couldn't be closed successfully."); } } @@ -166,14 +174,14 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkTextDocument(){ + @Test public void checkTextDocument(){ XTextDocument xDoc = null; try{ xDoc = m_SOF.createTextDoc("WriterTest"); } catch (com.sun.star.uno.Exception e){ - failed("Could not create a text document: " +e.toString()); + fail("Could not create a text document: " +e.toString()); } checkListener(xDoc); @@ -187,14 +195,14 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkImpressDocument(){ + @Test public void checkImpressDocument(){ XComponent xDoc = null; try{ xDoc = m_SOF.createImpressDoc("ImpressTest"); } catch (com.sun.star.uno.Exception e){ - failed("Could not create an impress document: " +e.toString()); + fail("Could not create an impress document: " +e.toString()); } checkListener(xDoc); @@ -208,20 +216,21 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkChartDocument(){ - - XChartDocument xDoc = null; - - try{ - xDoc = m_SOF.createChartDoc("ChartTest"); - } catch (com.sun.star.uno.Exception e){ - failed("Could not create a chart document: " +e.toString()); - } - - checkListener(xDoc); - - closeDoc(xDoc); - } +// TODO! +// @Test public void checkChartDocument(){ +// +// XChartDocument xDoc = null; +// +// try{ +// xDoc = m_SOF.createChartDoc("ChartTest"); +// } catch (com.sun.star.uno.Exception e){ +// fail("Could not create a chart document: " +e.toString()); +// } +// +// checkListener(xDoc); +// +// closeDoc(xDoc); +// } /** * creates a math document and check the XMouseClickHandler and @@ -229,14 +238,14 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkMathDocument(){ + @Test public void checkMathDocument(){ XComponent xDoc = null; try{ xDoc = m_SOF.createMathDoc("MathTest"); } catch (com.sun.star.uno.Exception e){ - failed("Could not create a math document: " +e.toString()); + fail("Could not create a math document: " +e.toString()); } checkListener(xDoc); @@ -250,14 +259,14 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkDrawDocument(){ + @Test public void checkDrawDocument(){ XComponent xDoc = null; try{ xDoc = m_SOF.createDrawDoc("DrawTest"); } catch (com.sun.star.uno.Exception e){ - failed("Could not create a draw document: " +e.toString()); + fail("Could not create a draw document: " +e.toString()); } checkListener(xDoc); @@ -271,14 +280,14 @@ public class EventTest extends ComplexTestCase { * @see com.sun.star.awt.XKeyHandler * @see com.sun.star.awt.XMouseClickHandler */ - public void checkCalcDocument(){ + @Test public void checkCalcDocument(){ XSpreadsheetDocument xDoc = null; try{ xDoc = m_SOF.createCalcDoc("CalcTest"); } catch (com.sun.star.uno.Exception e){ - failed("Could not create a calc document: " +e.toString()); + fail("Could not create a calc document: " +e.toString()); } checkListener(xDoc); @@ -293,7 +302,7 @@ public class EventTest extends ComplexTestCase { */ private void checkListener(XInterface xDoc){ - XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xDoc); + XModel xModel = UnoRuntime.queryInterface(XModel.class, xDoc); XUserInputInterception xUII = getUII(xModel); @@ -320,15 +329,15 @@ public class EventTest extends ComplexTestCase { xUII.addKeyHandler(keyListener); - log.println("starting thread to check the key listener..."); + System.out.println("starting thread to check the key listener..."); EventTrigger et = new EventTrigger(xModel, EventTriggerType.KEY_TEXT_INTO_DOC); et.run(); util.utils.shortWait(m_threadWait); - log.println("key listener thread should be finished."); + System.out.println("key listener thread should be finished."); - assure("key event does not work!", m_keyPressed && m_keyReleased); + assertTrue("key event does not work!", m_keyPressed && m_keyReleased); xUII.removeKeyHandler(keyListener); } @@ -354,15 +363,15 @@ public class EventTest extends ComplexTestCase { xUII.addMouseClickHandler(mouseListener); - log.println("starting thread to check the mouse listener..."); + System.out.println("starting thread to check the mouse listener..."); EventTrigger et = new EventTrigger(xModel, EventTriggerType.MOUSE_KLICK_INTO_DOC); et.run(); util.utils.shortWait(m_threadWait); - log.println("mouse listener thread should be finished."); + System.out.println("mouse listener thread should be finished."); - assure("mouse event does not work!", m_mousePressed && m_mouseReleased); + assertTrue("mouse event does not work!", m_mousePressed && m_mouseReleased); xUII.removeMouseClickHandler(mouseListener); } @@ -375,10 +384,9 @@ public class EventTest extends ComplexTestCase { XController xController = xModel.getCurrentController(); - XUserInputInterception xUII = (XUserInputInterception) UnoRuntime.queryInterface( - XUserInputInterception.class, xController); + XUserInputInterception xUII = UnoRuntime.queryInterface(XUserInputInterception.class, xController); if (xUII == null) { - failed("could not get XUserInputInterception from XContoller", true); + fail("could not get XUserInputInterception from XContoller"); } return xUII; } @@ -395,7 +403,7 @@ public class EventTest extends ComplexTestCase { * @return returns TRUE in erery case */ public boolean keyPressed( KeyEvent oEvent ){ - log.println("XKeyHandler: keyPressed-Event"); + System.out.println("XKeyHandler: keyPressed-Event"); m_keyPressed = true; return true; } @@ -406,7 +414,7 @@ public class EventTest extends ComplexTestCase { * @return returns TRUE in erery case */ public boolean keyReleased( KeyEvent oEvent ){ - log.println("XKeyHandler: keyReleased-Event"); + System.out.println("XKeyHandler: keyReleased-Event"); m_keyReleased = true; return true; } @@ -415,7 +423,7 @@ public class EventTest extends ComplexTestCase { * @param oEvent refers to the object that fired the event. */ public void disposing( EventObject oEvent ){ - log.println("XKeyHandler: disposing-Event"); + System.out.println("XKeyHandler: disposing-Event"); } } @@ -431,7 +439,7 @@ public class EventTest extends ComplexTestCase { * @return returns TRUE in erery case */ public boolean mousePressed( MouseEvent oEvent ){ - log.println("XMouseClickHandler: mousePressed-Event"); + System.out.println("XMouseClickHandler: mousePressed-Event"); m_mousePressed = true; return true; } @@ -442,7 +450,7 @@ public class EventTest extends ComplexTestCase { * @return returns TRUE in erery case */ public boolean mouseReleased( MouseEvent oEvent ){ - log.println("XMouseClickHandler: mouseReleased-Event"); + System.out.println("XMouseClickHandler: mouseReleased-Event"); m_mouseReleased = true; return true; } @@ -451,7 +459,7 @@ public class EventTest extends ComplexTestCase { * @param oEvent refers to the object that fired the event. */ public void disposing( EventObject oEvent ){ - log.println("XMouseClickHandler: disposing-Event"); + System.out.println("XMouseClickHandler: disposing-Event"); } }; @@ -529,7 +537,7 @@ public class EventTest extends ComplexTestCase { // get the position and the range of a scroll bar XWindow xWindow = at.getCurrentWindow( - (XMultiServiceFactory) param.getMSF(), + getMSF(), xModel); XAccessible xRoot = at.getAccessibleObject(xWindow); @@ -537,7 +545,7 @@ public class EventTest extends ComplexTestCase { XAccessibleContext xPanel = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent xPanelCont = (XAccessibleComponent) UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel); + XAccessibleComponent xPanelCont = UnoRuntime.queryInterface(XAccessibleComponent.class, xPanel); // the position of the panel Point point = xPanelCont.getLocationOnScreen(); @@ -549,15 +557,15 @@ public class EventTest extends ComplexTestCase { Robot rob = new Robot(); int x = point.X + (rect.Width / 2); int y = point.Y + (rect.Height / 2); - log.println("try to klick into the middle of the document"); + System.out.println("try to klick into the middle of the document"); rob.mouseMove(x, y); rob.mousePress(InputEvent.BUTTON1_MASK); rob.mouseRelease(InputEvent.BUTTON1_MASK); } catch (java.awt.AWTException e) { - log.println("couldn't press mouse button"); + System.out.println("couldn't press mouse button"); } } catch (java.lang.Exception e){ - log.println("could not click into the scroll bar: " + e.toString()); + System.out.println("could not click into the scroll bar: " + e.toString()); } } @@ -569,11 +577,11 @@ public class EventTest extends ComplexTestCase { private void keyIntoDoc(){ try { Robot rob = new Robot(); - log.println("try to press 'A'"); + System.out.println("try to press 'A'"); rob.keyPress(java.awt.event.KeyEvent.VK_A); rob.keyRelease(java.awt.event.KeyEvent.VK_A); } catch (java.awt.AWTException e) { - log.println("couldn't press key"); + System.out.println("couldn't press key"); } } @@ -591,4 +599,29 @@ public class EventTest extends ComplexTestCase { /** write some text into a spread sheet*/ final public static int KEY_TEXT_INTO_DOC = 2; } + + + + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } \ No newline at end of file diff --git a/framework/qa/complex/XUserInputInterception/makefile.mk b/framework/qa/complex/XUserInputInterception/makefile.mk index d3ca648b02f0..fff9ea938f6b 100644 --- a/framework/qa/complex/XUserInputInterception/makefile.mk +++ b/framework/qa/complex/XUserInputInterception/makefile.mk @@ -24,66 +24,106 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = EventTest -PRJNAME = framework -PACKAGE = complex$/XUserInputInterception - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ - OOoRunner.jar mysql.jar -JAVAFILES = EventTest.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: .ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF -# test base is java complex -CT_TESTBASE = -TestBase java_complex +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_xuserinputinterception -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/XUserInputInterception -# start the runner application -CT_APP = org.openoffice.Runner +# here store only Files which contain a @Test +JAVATESTFILES = \ + EventTest.java -# --- Targets ------------------------------------------------------ +# put here all other files +JAVAFILES = $(JAVATESTFILES) -.IF "$(depend)" == "" -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR -.ELSE -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLDEP -.ENDIF +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -.INCLUDE : target.mk +# subdirectories +# SUBDIRS = helper -#$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : $(JAVAFILES:b).props -# cp $(JAVAFILES:b).props $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props -# jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(JAVAFILES:b).props +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -RUN: run +.END -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest +.END +# +# +# +# PRJ = ..$/..$/.. +# TARGET = EventTest +# PRJNAME = framework +# PACKAGE = complex$/XUserInputInterception +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ +# OOoRunner.jar mysql.jar +# JAVAFILES = EventTest.java +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # test looks something like the.full.package.TestName +# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .IF "$(depend)" == "" +# $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR +# .ELSE +# $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLDEP +# .ENDIF +# +# .INCLUDE : target.mk +# +# #$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : $(JAVAFILES:b).props +# # cp $(JAVAFILES:b).props $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props +# # jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(JAVAFILES:b).props +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) +# +# +# diff --git a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java index 95a0fce2c92c..98e73189ea7e 100644 --- a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java +++ b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java @@ -24,133 +24,159 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package complex.accelerators; // imports -import com.sun.star.awt.*; -import com.sun.star.beans.*; -import com.sun.star.container.*; -import com.sun.star.embed.*; -import com.sun.star.lang.*; -import com.sun.star.ui.*; -import com.sun.star.uno.*; -import com.sun.star.util.*; - -import complexlib.ComplexTestCase; - -import java.lang.*; -import java.util.*; - -import helper.*; - +import com.sun.star.awt.KeyEvent; +import com.sun.star.beans.PropertyValue; +import com.sun.star.beans.XPropertySet; +import com.sun.star.container.XNameAccess; +import com.sun.star.container.XNameContainer; +import com.sun.star.embed.XStorage; +import com.sun.star.embed.XTransactedObject; +import com.sun.star.lang.XInitialization; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.lang.XSingleServiceFactory; +import com.sun.star.ui.XAcceleratorConfiguration; +import com.sun.star.ui.XUIConfigurationManager; +import com.sun.star.ui.XUIConfigurationPersistence; +import com.sun.star.ui.XUIConfigurationStorage; +import com.sun.star.uno.AnyConverter; +import com.sun.star.uno.XInterface; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XChangesBatch; + +import complex.accelerators.helper.KeyMapping; + + +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.FileHelper; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ //----------------------------------------------- + /** @short todo document me */ -public class AcceleratorsConfigurationTest extends ComplexTestCase +public class AcceleratorsConfigurationTest { + /** points to the global uno service manager. */ private XMultiServiceFactory m_xSmgr = null; - /** the accelerator configuration for testing. */ private XAcceleratorConfiguration m_xGlobalAccelCfg = null; private XAcceleratorConfiguration m_xModuleAccelCfg = null; private XAcceleratorConfiguration m_xDocumentAccelCfg = null; - /** XCS/XCU based accelerator configuration. */ private XNameAccess m_xConfig = null; - private XNameAccess m_xPrimaryKeys = null; + private XNameAccess m_xPrimaryKeys = null; private XNameAccess m_xSecondaryKeys = null; //------------------------------------------- // test environment - //----------------------------------------------- /** @short todo document me */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkGlobalAccelCfg", - "checkModuleAccelCfg", - "checkDocumentAccelCfg" - }; - } - +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkGlobalAccelCfg", +// "checkModuleAccelCfg", +// "checkDocumentAccelCfg" +// }; +// } //----------------------------------------------- /** @short Create the environment for following tests. */ + @Before public void before() - throws java.lang.Exception + throws java.lang.Exception { // get uno service manager from global test environment - m_xSmgr = (XMultiServiceFactory)param.getMSF(); - - m_xGlobalAccelCfg = (XAcceleratorConfiguration)UnoRuntime.queryInterface( - XAcceleratorConfiguration.class, - m_xSmgr.createInstance("com.sun.star.ui.GlobalAcceleratorConfiguration")); - m_xModuleAccelCfg = (XAcceleratorConfiguration)UnoRuntime.queryInterface( - XAcceleratorConfiguration.class, - m_xSmgr.createInstance("com.sun.star.ui.ModuleAcceleratorConfiguration")); - m_xDocumentAccelCfg = (XAcceleratorConfiguration)UnoRuntime.queryInterface( - XAcceleratorConfiguration.class, - m_xSmgr.createInstance("com.sun.star.ui.DocumentAcceleratorConfiguration")); + m_xSmgr = getMSF(); + + m_xGlobalAccelCfg = UnoRuntime.queryInterface(XAcceleratorConfiguration.class, m_xSmgr.createInstance("com.sun.star.ui.GlobalAcceleratorConfiguration")); + m_xModuleAccelCfg = UnoRuntime.queryInterface(XAcceleratorConfiguration.class, m_xSmgr.createInstance("com.sun.star.ui.ModuleAcceleratorConfiguration")); + m_xDocumentAccelCfg = UnoRuntime.queryInterface(XAcceleratorConfiguration.class, m_xSmgr.createInstance("com.sun.star.ui.DocumentAcceleratorConfiguration")); String sConfigPath = "org.openoffice.Office.Accelerators"; boolean bReadOnly = false; - XNameAccess m_xConfig = openConfig(m_xSmgr, sConfigPath, bReadOnly); - if (m_xConfig != null) + XNameAccess m_xConfig2 = openConfig(m_xSmgr, sConfigPath, bReadOnly); + if (m_xConfig2 != null) { - m_xPrimaryKeys = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, m_xConfig.getByName("PrimaryKeys")); - m_xSecondaryKeys = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, m_xConfig.getByName("SecondaryKeys")); + m_xPrimaryKeys = UnoRuntime.queryInterface(XNameAccess.class, m_xConfig2.getByName("PrimaryKeys")); + m_xSecondaryKeys = UnoRuntime.queryInterface(XNameAccess.class, m_xConfig2.getByName("SecondaryKeys")); } } //------------------------------------------- /** @short close the environment. */ + @After public void after() - throws java.lang.Exception + throws java.lang.Exception { - m_xConfig = null; - m_xGlobalAccelCfg = null; - m_xModuleAccelCfg = null; + m_xConfig = null; + m_xGlobalAccelCfg = null; + m_xModuleAccelCfg = null; m_xDocumentAccelCfg = null; - m_xSmgr = null; + m_xSmgr = null; } //------------------------------------------- /** @todo document me. */ + @Test public void checkGlobalAccelCfg() - throws java.lang.Exception + throws java.lang.Exception { - log.println("\n---- check Global accelerator configuration: ----"); + System.out.println("\n---- check Global accelerator configuration: ----"); String[] sKeys; - XNameAccess xPrimaryAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class,m_xPrimaryKeys.getByName("Global")); - XNameAccess xSecondaryAccess = (XNameAccess)UnoRuntime.queryInterface(XNameAccess.class, m_xSecondaryKeys.getByName("Global")); + XNameAccess xPrimaryAccess = UnoRuntime.queryInterface(XNameAccess.class, m_xPrimaryKeys.getByName("Global")); + XNameAccess xSecondaryAccess = UnoRuntime.queryInterface(XNameAccess.class, m_xSecondaryKeys.getByName("Global")); - sKeys = new String[] { "A_MOD1" }; + sKeys = new String[] + { + "A_MOD1" + }; impl_checkGetKeyCommands(m_xGlobalAccelCfg, xPrimaryAccess, sKeys); - sKeys = new String[] { "PASTE", "X_SHIFT" }; - String[] sCommands = new String[] { ".uno:test", ".uno:test" }; + sKeys = new String[] + { + "PASTE", "X_SHIFT" + }; + String[] sCommands = new String[] + { + ".uno:test", ".uno:test" + }; impl_checkSetKeyCommands(m_xGlobalAccelCfg, xPrimaryAccess, xSecondaryAccess, sKeys, sCommands); - sKeys = new String[] { "C_MOD1", "CUT" }; + sKeys = new String[] + { + "C_MOD1", "CUT" + }; impl_checkRemoveKeyCommands(m_xGlobalAccelCfg, xPrimaryAccess, xSecondaryAccess, sKeys); - String[] sCommandList = new String[] { ".uno:Paste", ".uno:CloseWin" }; + String[] sCommandList = new String[] + { + ".uno:Paste", ".uno:CloseWin" + }; impl_checkGetPreferredKeyEventsForCommandList(m_xGlobalAccelCfg, xPrimaryAccess, sCommandList); } //------------------------------------------- /** @todo document me. */ + @Test public void checkModuleAccelCfg() - throws java.lang.Exception + throws java.lang.Exception { String[] sModules = new String[] { @@ -159,87 +185,171 @@ public class AcceleratorsConfigurationTest extends ComplexTestCase "com.sun.star.presentation.PresentationDocument", "com.sun.star.sheet.SpreadsheetDocument", "com.sun.star.text.TextDocument", - // add other modules here + // add other modules here }; - for (int i=0; i0) + if (xAccess.hasByName(sKeys[i]) && getCommandFromConfiguration(xAccess, sKeys[i]).length() > 0) { - log.println("** get command by " + sKeys[i] + " **"); + System.out.println("** get command by " + sKeys[i] + " **"); String sCmdFromCache = new String(); // get a value using XAcceleratorConfiguration API String sCmdFromConfiguration = new String(); // get a value using configuration API // GET shortcuts/commands using XAcceleratorConfiguration API sCmdFromCache = xAccelCfg.getCommandByKeyEvent(convertShortcut2AWTKey(sKeys[i])); - log.println(sKeys[i] + "-->" + sCmdFromCache + ", by XAcceleratorConfiguration API"); + System.out.println(sKeys[i] + "-->" + sCmdFromCache + ", by XAcceleratorConfiguration API"); // GET shortcuts/commands using configuration API sCmdFromConfiguration = getCommandFromConfiguration(xAccess, sKeys[i]); - log.println(sKeys[i] + "-->" + sCmdFromConfiguration + ", by configuration API"); + System.out.println(sKeys[i] + "-->" + sCmdFromConfiguration + ", by configuration API"); - assure("values are different by XAcceleratorConfiguration API and configuration API!", sCmdFromCache.equals(sCmdFromConfiguration)); + assertTrue("values are different by XAcceleratorConfiguration API and configuration API!", sCmdFromCache.equals(sCmdFromConfiguration)); String sLocale = "es"; setOfficeLocale(sLocale); sCmdFromConfiguration = getCommandFromConfiguration(xAccess, sKeys[i]); - log.println(sKeys[i] + "-->" + sCmdFromConfiguration + ", by configuration API" + " for locale:"+ getOfficeLocale()); + System.out.println(sKeys[i] + "-->" + sCmdFromConfiguration + ", by configuration API" + " for locale:" + getOfficeLocale()); sLocale = "en-US"; setOfficeLocale(sLocale); //reset to default locale } else { - log.println(sKeys[i] + " doesn't exist!"); + System.out.println(sKeys[i] + " doesn't exist!"); } } } @@ -307,20 +420,24 @@ public class AcceleratorsConfigurationTest extends ComplexTestCase /** @todo document me. */ private void impl_checkSetKeyCommands(XAcceleratorConfiguration xAccelCfg, XNameAccess xPrimaryAccess, XNameAccess xSecondaryAccess, String[] sKeys, String[] sCommands) - throws java.lang.Exception + throws java.lang.Exception { - log.println("check setKeyCommands..."); + System.out.println("check setKeyCommands..."); - for (int i=0; i +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.broken_document; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("test_documents", name)); + } + + private TestDocument() {} +} diff --git a/framework/qa/complex/broken_document/dbf.dbf.emf b/framework/qa/complex/broken_document/dbf.dbf.emf deleted file mode 100755 index 11e45e9df5d1..000000000000 --- a/framework/qa/complex/broken_document/dbf.dbf.emf +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/framework/qa/complex/broken_document/makefile.mk b/framework/qa/complex/broken_document/makefile.mk index c8f24a937159..cdd5cb42cd2b 100755 --- a/framework/qa/complex/broken_document/makefile.mk +++ b/framework/qa/complex/broken_document/makefile.mk @@ -25,56 +25,44 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckHeadlessState -PRJNAME = $(TARGET) -PACKAGE = complex$/broken_document -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = LoadDocument.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_broken_document -# --- Parameters for the test -------------------------------------- +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/broken_document -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# here store only Files which contain a @Test +JAVATESTFILES = \ + LoadDocument.java -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +#JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ +# OOoRunner.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start the runner application -CT_APP = org.openoffice.Runner +# subdirectories +# SUBDIRS = helper -# the current directory for loading the document -CT_WORKDIR = -WorkingDir $(PWD) +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ +.END -.INCLUDE : target.mk +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest -RUN: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_WORKDIR) $(CT_TEST) +.END -run: RUN diff --git a/framework/qa/complex/broken_document/test_documents/dbf.dbf.emf b/framework/qa/complex/broken_document/test_documents/dbf.dbf.emf new file mode 100755 index 000000000000..11e45e9df5d1 --- /dev/null +++ b/framework/qa/complex/broken_document/test_documents/dbf.dbf.emf @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java index 556cadc7d1b0..471f5246b787 100644 --- a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java +++ b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java @@ -1,4 +1,4 @@ -package contextMenuInterceptor; +package complex.contextMenuInterceptor; import com.sun.star.accessibility.AccessibleRole; import com.sun.star.accessibility.XAccessible; @@ -9,102 +9,119 @@ import com.sun.star.awt.Rectangle; import com.sun.star.awt.XBitmap; import com.sun.star.awt.XExtendedToolkit; import com.sun.star.awt.XWindow; -import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; -import com.sun.star.beans.XPropertySetInfo; -import com.sun.star.container.XIndexAccess; import com.sun.star.drawing.XShape; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.frame.XController; -import com.sun.star.frame.XDesktop; import com.sun.star.frame.XFrame; import com.sun.star.frame.XModel; import com.sun.star.lang.IndexOutOfBoundsException; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XInitialization; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.text.XTextDocument; -import com.sun.star.ui.XContextMenuInterceptor; import com.sun.star.ui.XContextMenuInterception; +import com.sun.star.ui.XContextMenuInterceptor; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; -import com.sun.star.uno.Exception; -import com.sun.star.util.CloseVetoException; import com.sun.star.util.XCloseable; -import com.sun.star.view.XViewSettingsSupplier; -import complexlib.ComplexTestCase; import java.awt.Robot; import java.awt.event.InputEvent; -import java.io.PrintWriter; -import share.LogWriter; +import java.io.File; import util.AccessibilityTools; import util.DesktopTools; import util.DrawTools; import util.SOfficeFactory; import util.utils; +import org.openoffice.test.OfficeFileUrl; + +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ /** * */ -public class CheckContextMenuInterceptor extends ComplexTestCase { +public class CheckContextMenuInterceptor +{ + XMultiServiceFactory xMSF = null; XFrame xFrame = null; Point point = null; XWindow xWindow = null; + com.sun.star.lang.XComponent xDrawDoc; - public void before() { - xMSF = (XMultiServiceFactory)param.getMSF(); + @Before + public void before() + { + xMSF = getMSF(); } - public void after() { - log.println("release the popup menu"); - try { + @After + public void after() + { + System.out.println("release the popup menu"); + try + { Robot rob = new Robot(); int x = point.X; int y = point.Y; rob.mouseMove(x, y); rob.mousePress(InputEvent.BUTTON1_MASK); rob.mouseRelease(InputEvent.BUTTON1_MASK); - } catch (java.awt.AWTException e) { - log.println("couldn't press mouse button"); + } + catch (java.awt.AWTException e) + { + System.out.println("couldn't press mouse button"); } - com.sun.star.util.XCloseable xClose = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface( - com.sun.star.util.XCloseable.class, xFrame); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xFrame); try { - xClose.close(false); + xClose.close(true); } - catch(com.sun.star.util.CloseVetoException exVeto) + catch (com.sun.star.util.CloseVetoException exVeto) { - failed("Test frame couldn't be closed successfully."); + fail("Test frame couldn't be closed successfully."); } xFrame = null; - } - public String[] getTestMethodNames() { - return new String[]{"checkContextMenuInterceptor"}; +// xClose = UnoRuntime.queryInterface(XCloseable.class, xDrawDoc); +// try +// { +// xClose.close(true); +// } +// catch (com.sun.star.util.CloseVetoException exVeto) +// { +// fail("Test DrawDoc couldn't be closed successfully."); +// } + } - public void checkContextMenuInterceptor() { - log.println(" **** Context Menu Interceptor *** "); +// public String[] getTestMethodNames() { +// return new String[]{"checkContextMenuInterceptor"}; +// } + @Test + public void checkContextMenuInterceptor() + { + System.out.println(" **** Context Menu Interceptor *** "); - try { + try + { // intialize the test document - com.sun.star.lang.XComponent xDrawDoc = DrawTools.createDrawDoc(xMSF); + xDrawDoc = DrawTools.createDrawDoc(xMSF); - SOfficeFactory SOF = SOfficeFactory.getFactory( xMSF); - XShape oShape = SOF.createShape(xDrawDoc,5000,5000,1500,1000,"GraphicObject"); - DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc,0)).add(oShape); + SOfficeFactory SOF = SOfficeFactory.getFactory(xMSF); + XShape oShape = SOF.createShape(xDrawDoc, 5000, 5000, 1500, 1000, "GraphicObject"); + DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc, 0)).add(oShape); com.sun.star.frame.XModel xModel = - (com.sun.star.frame.XModel)UnoRuntime.queryInterface( - com.sun.star.frame.XModel.class, xDrawDoc); + UnoRuntime.queryInterface(com.sun.star.frame.XModel.class, xDrawDoc); // get the frame for later usage xFrame = xModel.getCurrentController().getFrame(); @@ -115,143 +132,166 @@ public class CheckContextMenuInterceptor extends ComplexTestCase { XBitmap xBitmap = null; // adding graphic as ObjRelation for GraphicObjectShape - XPropertySet oShapeProps = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class,oShape); - log.println( "Inserting a shape into the document"); + XPropertySet oShapeProps = UnoRuntime.queryInterface(XPropertySet.class, oShape); + System.out.println("Inserting a shape into the document"); try { - oShapeProps.setPropertyValue( - "GraphicURL",util.utils.getFullTestURL("space-metal.jpg")); - xBitmap = (XBitmap) AnyConverter.toObject( - new Type(XBitmap.class),oShapeProps.getPropertyValue - ("GraphicObjectFillBitmap")); - } catch (com.sun.star.lang.WrappedTargetException e) { - } catch (com.sun.star.lang.IllegalArgumentException e) { - } catch (com.sun.star.beans.PropertyVetoException e) { - } catch (com.sun.star.beans.UnknownPropertyException e) { + String sFile = OfficeFileUrl.getAbsolute(new File("space-metal.jpg")); + // String sFile = util.utils.getFullTestURL("space-metal.jpg"); + oShapeProps.setPropertyValue("GraphicURL", sFile); + Object oProp = oShapeProps.getPropertyValue("GraphicObjectFillBitmap"); + xBitmap = (XBitmap) AnyConverter.toObject(new Type(XBitmap.class), oProp); + } + catch (com.sun.star.lang.WrappedTargetException e) + { + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + } + catch (com.sun.star.beans.PropertyVetoException e) + { + } + catch (com.sun.star.beans.UnknownPropertyException e) + { } // reuse the frame com.sun.star.frame.XController xController = xFrame.getController(); - com.sun.star.ui.XContextMenuInterception xContextMenuInterception = null; - com.sun.star.ui.XContextMenuInterceptor xContextMenuInterceptor = null; + XContextMenuInterception xContextMenuInterception = null; + XContextMenuInterceptor xContextMenuInterceptor = null; - if ( xController != null ) + if (xController != null) { - log.println( "Creating context menu interceptor"); + System.out.println("Creating context menu interceptor"); // add our context menu interceptor xContextMenuInterception = - (com.sun.star.ui.XContextMenuInterception)UnoRuntime.queryInterface( - com.sun.star.ui.XContextMenuInterception.class, xController ); + UnoRuntime.queryInterface(XContextMenuInterception.class, xController); - if( xContextMenuInterception != null ) + if (xContextMenuInterception != null) { - ContextMenuInterceptor aContextMenuInterceptor = new ContextMenuInterceptor( xBitmap ); + ContextMenuInterceptor aContextMenuInterceptor = new ContextMenuInterceptor(xBitmap); xContextMenuInterceptor = - (com.sun.star.ui.XContextMenuInterceptor)UnoRuntime.queryInterface( - com.sun.star.ui.XContextMenuInterceptor.class, aContextMenuInterceptor ); + UnoRuntime.queryInterface(XContextMenuInterceptor.class, aContextMenuInterceptor); - log.println( "Register context menu interceptor"); - xContextMenuInterception.registerContextMenuInterceptor( xContextMenuInterceptor ); + System.out.println("Register context menu interceptor"); + xContextMenuInterception.registerContextMenuInterceptor(xContextMenuInterceptor); } } - // utils.shortWait(10000); + // utils.shortWait(10000); - openContextMenu((XModel) UnoRuntime.queryInterface(XModel.class, xDrawDoc)); + openContextMenu(UnoRuntime.queryInterface(XModel.class, xDrawDoc)); checkHelpEntry(); // remove our context menu interceptor - if ( xContextMenuInterception != null && - xContextMenuInterceptor != null ) { - log.println( "Release context menu interceptor"); + if (xContextMenuInterception != null + && xContextMenuInterceptor != null) + { + System.out.println("Release context menu interceptor"); xContextMenuInterception.releaseContextMenuInterceptor( - xContextMenuInterceptor ); + xContextMenuInterceptor); } } - catch ( com.sun.star.uno.RuntimeException ex ) { - ex.printStackTrace((PrintWriter)log); - failed("Runtime exception caught!" + ex.getMessage()); + catch (com.sun.star.uno.RuntimeException ex) + { + // ex.printStackTrace(); + fail("Runtime exception caught!" + ex.getMessage()); } - catch ( java.lang.Exception ex ) { - ex.printStackTrace((PrintWriter)log); - failed("Java lang exception caught!" + ex.getMessage()); + catch (java.lang.Exception ex) + { + // ex.printStackTrace(); + fail("Java lang exception caught!" + ex.getMessage()); } } - private void checkHelpEntry(){ + private void checkHelpEntry() + { XInterface toolkit = null; - log.println("get accesibility..."); - try{ + System.out.println("get accesibility..."); + try + { toolkit = (XInterface) xMSF.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e){ - log.println("could not get Toolkit " + e.toString()); } - XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface( - XExtendedToolkit.class, toolkit); + catch (com.sun.star.uno.Exception e) + { + System.out.println("could not get Toolkit " + e.toString()); + } + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); XAccessible xRoot = null; AccessibilityTools at = new AccessibilityTools(); - try { - xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, - tk.getTopWindow(0)); + try + { + xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getTopWindow(0)); xRoot = at.getAccessibleObject(xWindow); // at.printAccessibleTree((PrintWriter)log, xRoot, param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); - at.printAccessibleTree((PrintWriter)log, xRoot, true); + // at.printAccessibleTree(System.out, xRoot, true); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - log.println("Couldn't get Window"); + System.out.println("Couldn't get Window"); } XAccessibleContext oPopMenu = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU); - log.println("ImplementationName: " + util.utils.getImplName(oPopMenu)); + System.out.println("ImplementationName: " + util.utils.getImplName(oPopMenu)); XAccessible xHelp = null; - try{ - log.println("Try to get first entry of context menu..."); + try + { + System.out.println("Try to get first entry of context menu..."); xHelp = oPopMenu.getAccessibleChild(0); - } catch (IndexOutOfBoundsException e){ - failed("Not possible to get first entry of context menu"); + } + catch (IndexOutOfBoundsException e) + { + fail("Not possible to get first entry of context menu"); } - if (xHelp == null) failed("first entry of context menu is NULL"); + if (xHelp == null) + { + fail("first entry of context menu is NULL"); + } XAccessibleContext xHelpCont = xHelp.getAccessibleContext(); - if ( xHelpCont == null ) - failed("No able to retrieve accessible context from first entry of context menu"); + if (xHelpCont == null) + { + fail("No able to retrieve accessible context from first entry of context menu"); + } String aAccessibleName = xHelpCont.getAccessibleName(); - if ( !aAccessibleName.equals( "Help" )) { - log.println("Accessible name found = "+aAccessibleName ); - failed("First entry of context menu is not from context menu interceptor"); + if (!aAccessibleName.equals("Help")) + { + System.out.println("Accessible name found = " + aAccessibleName); + fail("First entry of context menu is not from context menu interceptor"); } try { - log.println("try to get first children of Help context..."); + System.out.println("try to get first children of Help context..."); XAccessible xHelpChild = xHelpCont.getAccessibleChild(0); - } catch (IndexOutOfBoundsException e){ - failed("not possible to get first children of Help context"); + } + catch (IndexOutOfBoundsException e) + { + fail("not possible to get first children of Help context"); } } - private void openContextMenu(XModel aModel){ + private void openContextMenu(XModel aModel) + { - log.println("try to open contex menu..."); + System.out.println("try to open contex menu..."); AccessibilityTools at = new AccessibilityTools(); xWindow = at.getCurrentWindow(xMSF, aModel); @@ -260,14 +300,14 @@ public class CheckContextMenuInterceptor extends ComplexTestCase { XInterface oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL); - XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface( - XAccessibleComponent.class, oObj); + XAccessibleComponent window = UnoRuntime.queryInterface(XAccessibleComponent.class, oObj); point = window.getLocationOnScreen(); Rectangle rect = window.getBounds(); - log.println("klick mouse button..."); - try { + System.out.println("klick mouse button..."); + try + { Robot rob = new Robot(); int x = point.X + (rect.Width / 2); int y = point.Y + (rect.Height / 2); @@ -277,11 +317,36 @@ public class CheckContextMenuInterceptor extends ComplexTestCase { System.out.println("Release Button"); rob.mouseRelease(InputEvent.BUTTON3_MASK); System.out.println("done"); - } catch (java.awt.AWTException e) { - log.println("couldn't press mouse button"); + } + catch (java.awt.AWTException e) + { + System.out.println("couldn't press mouse button"); } utils.shortWait(3000); } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass + public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java index cb0d95900c6f..6455807f5630 100644 --- a/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java +++ b/framework/qa/complex/contextMenuInterceptor/ContextMenuInterceptor.java @@ -1,24 +1,21 @@ -package contextMenuInterceptor; +package complex.contextMenuInterceptor; import com.sun.star.ui.*; -import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.beans.XPropertySet; -import com.sun.star.container.XIndexContainer; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.Exception; -import com.sun.star.beans.UnknownPropertyException; -import com.sun.star.lang.IllegalArgumentException; -public class ContextMenuInterceptor implements XContextMenuInterceptor { +public class ContextMenuInterceptor implements XContextMenuInterceptor +{ - private com.sun.star.awt.XBitmap myBitmap; + private com.sun.star.awt.XBitmap myBitmap; - public ContextMenuInterceptor( com.sun.star.awt.XBitmap aBitmap ) { - myBitmap = aBitmap; - } + public ContextMenuInterceptor(com.sun.star.awt.XBitmap aBitmap) + { + myBitmap = aBitmap; + } - public ContextMenuInterceptorAction notifyContextMenuExecute( - com.sun.star.ui.ContextMenuExecuteEvent aEvent ) throws RuntimeException + public ContextMenuInterceptorAction notifyContextMenuExecute( + com.sun.star.ui.ContextMenuExecuteEvent aEvent) throws RuntimeException { try { @@ -26,103 +23,90 @@ public class ContextMenuInterceptor implements XContextMenuInterceptor { // create sub menus, menu entries and separators com.sun.star.container.XIndexContainer xContextMenu = aEvent.ActionTriggerContainer; com.sun.star.lang.XMultiServiceFactory xMenuElementFactory = - (com.sun.star.lang.XMultiServiceFactory)UnoRuntime.queryInterface( - com.sun.star.lang.XMultiServiceFactory.class, xContextMenu ); + UnoRuntime.queryInterface(com.sun.star.lang.XMultiServiceFactory.class, xContextMenu); - if ( xMenuElementFactory != null ) + if (xMenuElementFactory != null) { // create root menu entry for sub menu and sub menu com.sun.star.beans.XPropertySet xRootMenuEntry = - (XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger" )); + UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); // create a line separator for our new help sub menu com.sun.star.beans.XPropertySet xSeparator = - (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerSeparator" ) ); - Short aSeparatorType = new Short( ActionTriggerSeparatorType.LINE ); - xSeparator.setPropertyValue( "SeparatorType", (Object)aSeparatorType ); + UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerSeparator")); + Short aSeparatorType = new Short(ActionTriggerSeparatorType.LINE); + xSeparator.setPropertyValue("SeparatorType", (Object) aSeparatorType); // query sub menu for index container to get access com.sun.star.container.XIndexContainer xSubMenuContainer = - (com.sun.star.container.XIndexContainer)UnoRuntime.queryInterface( - com.sun.star.container.XIndexContainer.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer" )); + UnoRuntime.queryInterface(com.sun.star.container.XIndexContainer.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTriggerContainer")); // intialize root menu entry "Help" - xRootMenuEntry.setPropertyValue( "Text", new String( "Help" )); - xRootMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5410" )); - xRootMenuEntry.setPropertyValue( "HelpURL", new String( "5410" )); - xRootMenuEntry.setPropertyValue( "SubContainer", (Object)xSubMenuContainer ); - xRootMenuEntry.setPropertyValue( "Image", myBitmap ); + xRootMenuEntry.setPropertyValue("Text", ("Help")); + xRootMenuEntry.setPropertyValue("CommandURL", ("slot:5410")); + xRootMenuEntry.setPropertyValue("HelpURL", ("5410")); + xRootMenuEntry.setPropertyValue("SubContainer", (Object) xSubMenuContainer); + xRootMenuEntry.setPropertyValue("Image", myBitmap); // create menu entries for the new sub menu // intialize help/content menu entry // entry "Content" - XPropertySet xMenuEntry = (XPropertySet)UnoRuntime.queryInterface( - XPropertySet.class, xMenuElementFactory.createInstance ( - "com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Content" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5401" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5401" )); + XPropertySet xMenuEntry = UnoRuntime.queryInterface(XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); + xMenuEntry.setPropertyValue("Text", ("Content")); + xMenuEntry.setPropertyValue("CommandURL", ("slot:5401")); + xMenuEntry.setPropertyValue("HelpURL", ("5401")); // insert menu entry to sub menu - xSubMenuContainer.insertByIndex ( 0, (Object)xMenuEntry ); + xSubMenuContainer.insertByIndex(0, (Object) xMenuEntry); // intialize help/help agent // entry "Help Agent" - xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Help Agent" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5962" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5962" )); + xMenuEntry = UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); + xMenuEntry.setPropertyValue("Text", ("Help Agent")); + xMenuEntry.setPropertyValue("CommandURL", ("slot:5962")); + xMenuEntry.setPropertyValue("HelpURL", ("5962")); // insert menu entry to sub menu - xSubMenuContainer.insertByIndex( 1, (Object)xMenuEntry ); + xSubMenuContainer.insertByIndex(1, (Object) xMenuEntry); // intialize help/tips // entry "Tips" - xMenuEntry = (com.sun.star.beans.XPropertySet)UnoRuntime.queryInterface( - com.sun.star.beans.XPropertySet.class, - xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger" )); - xMenuEntry.setPropertyValue( "Text", new String( "Tips" )); - xMenuEntry.setPropertyValue( "CommandURL", new String( "slot:5404" )); - xMenuEntry.setPropertyValue( "HelpURL", new String( "5404" )); + xMenuEntry = UnoRuntime.queryInterface(com.sun.star.beans.XPropertySet.class, xMenuElementFactory.createInstance("com.sun.star.ui.ActionTrigger")); + xMenuEntry.setPropertyValue("Text", ("Tips")); + xMenuEntry.setPropertyValue("CommandURL", ("slot:5404")); + xMenuEntry.setPropertyValue("HelpURL", ("5404")); // insert menu entry to sub menu - xSubMenuContainer.insertByIndex ( 2, (Object)xMenuEntry ); + xSubMenuContainer.insertByIndex(2, (Object) xMenuEntry); // add separator into the given context menu - xContextMenu.insertByIndex ( 0, (Object)xSeparator ); + xContextMenu.insertByIndex(0, (Object) xSeparator); // add new sub menu into the given context menu - xContextMenu.insertByIndex ( 0, (Object)xRootMenuEntry ); + xContextMenu.insertByIndex(0, (Object) xRootMenuEntry); // The controller should execute the modified context menu and stop notifying other // interceptors. - return com.sun.star.ui.ContextMenuInterceptorAction.EXECUTE_MODIFIED ; + return com.sun.star.ui.ContextMenuInterceptorAction.EXECUTE_MODIFIED; } } - catch ( com.sun.star.beans.UnknownPropertyException ex ) + catch (com.sun.star.beans.UnknownPropertyException ex) { // do something useful // we used a unknown property } - catch ( com.sun.star.lang.IndexOutOfBoundsException ex ) + catch (com.sun.star.lang.IndexOutOfBoundsException ex) { // do something useful // we used an invalid index for accessing a container } - catch ( com.sun.star.uno.Exception ex ) + catch (com.sun.star.uno.Exception ex) { // something strange has happend! } - catch ( java.lang.Throwable ex ) + catch (java.lang.Throwable ex) { - // catch java exceptions � do something useful + // catch java exceptions do something useful } return com.sun.star.ui.ContextMenuInterceptorAction.IGNORED; diff --git a/framework/qa/complex/contextMenuInterceptor/makefile.mk b/framework/qa/complex/contextMenuInterceptor/makefile.mk index f8dcaf26d208..fcaeb6f8cb96 100644 --- a/framework/qa/complex/contextMenuInterceptor/makefile.mk +++ b/framework/qa/complex/contextMenuInterceptor/makefile.mk @@ -25,53 +25,42 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = ContextMenuInterceptor -PRJNAME = framework -PACKAGE = contextMenuInterceptor - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = ContextMenuInterceptor.java CheckContextMenuInterceptor.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -#----- make a jar from compiled files ------------------------------ +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_contextMenuInterceptor -MAXLINELENGTH = 100000 +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/contextMenuInterceptor -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckContextMenuInterceptor.java -# --- Parameters for the test -------------------------------------- +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + ContextMenuInterceptor.java -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand \ - "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +#JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ +# OOoRunner.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# subdirectories +# SUBDIRS = helper -# replace $/ with . in package name -CT_PACKAGE = -o $(PACKAGE:s\$/\.\) +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# start the runner application -CT_APP = org.openoffice.Runner +.END -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) -tdoc \\margritte\qaapi\workspace\qadev\testdocs $(CT_PACKAGE).CheckContextMenuInterceptor +.END diff --git a/framework/qa/complex/contextMenuInterceptor/space-metal.jpg b/framework/qa/complex/contextMenuInterceptor/space-metal.jpg new file mode 100644 index 000000000000..d23344389073 Binary files /dev/null and b/framework/qa/complex/contextMenuInterceptor/space-metal.jpg differ diff --git a/framework/qa/complex/desktop/DesktopTerminate.java b/framework/qa/complex/desktop/DesktopTerminate.java index 88cfa433aa31..0f385edf0cb0 100755 --- a/framework/qa/complex/desktop/DesktopTerminate.java +++ b/framework/qa/complex/desktop/DesktopTerminate.java @@ -27,51 +27,46 @@ package complex.desktop; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.lang.XInitialization; -import com.sun.star.uno.Type; -import com.sun.star.uno.Any; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XComponent; import com.sun.star.frame.XDesktop; -import com.sun.star.frame.XFramesSupplier; -import com.sun.star.frame.XFrames; -import com.sun.star.registry.XRegistryKey; -import com.sun.star.comp.loader.FactoryHelper; -import com.sun.star.container.XIndexAccess; -import com.sun.star.beans.XPropertySet; import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.AnyConverter; -import com.sun.star.frame.XComponentLoader; -import com.sun.star.awt.Rectangle; -import com.sun.star.util.XCloseable; -import helper.ConfigurationRead; -import complexlib.ComplexTestCase; import helper.OfficeProvider; //import complex.persistent_window_states.helper.DocumentHandle; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + /** * Parameters: *
    *
  • NoOffice=yes - StarOffice is not started initially.
  • *
*/ -public class DesktopTerminate extends ComplexTestCase { +public class DesktopTerminate +{ private XMultiServiceFactory xMSF; - private OfficeProvider oProvider; - private int iOfficeCloseTime = 0; + private int iOfficeCloseTime = 1000; /** * A frunction to tell the framework, which test functions are available. * Right now, it's only 'checkPersistentWindowState'. * @return All test methods. */ - public String[] getTestMethodNames() { - return new String[]{"checkPersistentWindowState"}; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkPersistentWindowState" +// }; +// } /** * Test if all available document types change the @@ -94,65 +89,107 @@ public class DesktopTerminate extends ComplexTestCase { * - close office * - Test finished */ - public void checkPersistentWindowState() + @Test public void checkPersistentWindowState() { - try { - - log.println("Connect the first time."); - log.println("AppExecCommand: " + (String)param.get("AppExecutionCommand")); - log.println("ConnString: " + (String)param.get("ConnectionString")); - oProvider = new OfficeProvider(); - iOfficeCloseTime = param.getInt("OfficeCloseTime"); - if ( iOfficeCloseTime == 0 ) { - iOfficeCloseTime = 1000; - } + try + { - if (!connect()) return; + System.out.println("Connect the first time."); +// System.out.println("AppExecCommand: " + (String) param.get("AppExecutionCommand")); +// System.out.println("ConnString: " + (String) param.get("ConnectionString")); +// oProvider = new OfficeProvider(); +// iOfficeCloseTime = param.getInt("OfficeCloseTime"); +// if (iOfficeCloseTime == 0) +// { +// iOfficeCloseTime = 1000; +// } + + if (!connect()) + { + return; + } - if (!disconnect()) return; + if (!disconnect()) + { + return; + } } - catch(Exception e) { + catch (Exception e) + { e.printStackTrace(); } } - private boolean connect() { - try { - xMSF = (XMultiServiceFactory)oProvider.getManager(param); - try { + private boolean connect() + { + try + { + xMSF = getMSF(); + try + { Thread.sleep(10000); } - catch(java.lang.InterruptedException e) {} + catch (java.lang.InterruptedException e) + { + } } - catch (java.lang.Exception e) { - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Cannot connect the Office."); + catch (java.lang.Exception e) + { + System.out.println(e.getClass().getName()); + System.out.println("Message: " + e.getMessage()); + fail("Cannot connect the Office."); return false; } return true; } - private boolean disconnect() { - try { + private boolean disconnect() + { + try + { XDesktop desk = null; - desk = (XDesktop) UnoRuntime.queryInterface( - XDesktop.class, xMSF.createInstance( - "com.sun.star.frame.Desktop")); + desk = UnoRuntime.queryInterface(XDesktop.class, xMSF.createInstance("com.sun.star.frame.Desktop")); desk.terminate(); - log.println("Waiting " + iOfficeCloseTime + " milliseconds for the Office to close down"); - try { + System.out.println("Waiting " + iOfficeCloseTime + " milliseconds for the Office to close down"); + try + { Thread.sleep(iOfficeCloseTime); } - catch(java.lang.InterruptedException e) {} + catch (java.lang.InterruptedException e) + { + } xMSF = null; } - catch (java.lang.Exception e) { + catch (java.lang.Exception e) + { e.printStackTrace(); - failed("Cannot dispose the Office."); + fail("Cannot dispose the Office."); return false; } return true; } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass public static void setUpConnection() throws Exception { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + // don't do a tearDown here, desktop is already terminated. + // connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/framework/qa/complex/desktop/makefile.mk b/framework/qa/complex/desktop/makefile.mk index 3ad4801eb0d5..abff76d8e505 100755 --- a/framework/qa/complex/desktop/makefile.mk +++ b/framework/qa/complex/desktop/makefile.mk @@ -25,55 +25,41 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = DesktopTerminate -PRJNAME = $(TARGET) -PACKAGE = complex$/desktop - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = DesktopTerminate.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_desktop -# --- Parameters for the test -------------------------------------- +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/desktop -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# here store only Files which contain a @Test +JAVATESTFILES = \ + DesktopTerminate.java -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +#JARFILES = ridl.jar unoil.jar jurt.jar juh.jar jut.jar java_uno.jar \ +# OOoRunner.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start the runner application -CT_APP = org.openoffice.Runner +# subdirectories +# SUBDIRS = helper -# --- Targets ------------------------------------------------------ +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR +.END -.INCLUDE : target.mk - -RUN: run +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) -NoOffice yes $(CT_TESTBASE) $(CT_TEST) +ALLTAR : javatest +.END diff --git a/framework/qa/complex/dispatches/checkdispatchapi.java b/framework/qa/complex/dispatches/checkdispatchapi.java index 518ec277ae53..ce08c8bed6da 100644 --- a/framework/qa/complex/dispatches/checkdispatchapi.java +++ b/framework/qa/complex/dispatches/checkdispatchapi.java @@ -24,110 +24,119 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package complex.dispatches; -import com.sun.star.frame.*; -import com.sun.star.lang.*; -import com.sun.star.util.*; -import com.sun.star.beans.*; -import com.sun.star.uno.*; +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.DispatchInformation; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XDispatchInformationProvider; +import com.sun.star.frame.XDispatchProviderInterception; +import com.sun.star.frame.XDispatchProviderInterceptor; +import com.sun.star.frame.XFrame; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XCloseable; +import complex.dispatches.helper.Interceptor; +import java.util.HashMap; + + -import java.util.*; -import complexlib.ComplexTestCase; -import helper.*; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ //----------------------------------------------- /** @short Check the interface XDispatchInformationProvider - @descr Because there exists more then one implementation of a dispatch - object, we have to test all these implementations ... +@descr Because there exists more then one implementation of a dispatch +object, we have to test all these implementations ... */ -public class checkdispatchapi extends ComplexTestCase +public class checkdispatchapi { //------------------------------------------- // some const //------------------------------------------- // member - /** points to the global uno service manager. */ private XMultiServiceFactory m_xMSF = null; private connectivity.tools.HsqlDatabase db; - /** can be used to create new test frames. */ private XFrame m_xDesktop = null; - /** provides XDispatchInformationProvider interface. */ private XFrame m_xFrame = null; //------------------------------------------- // test environment - //------------------------------------------- /** @short A function to tell the framework, - which test functions are available. + which test functions are available. - @return All test methods. - @todo Think about selection of tests from outside ... + @return All test methods. + @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - return new String[] - { - "checkDispatchInfoOfWriter", - "checkDispatchInfoOfCalc", - "checkDispatchInfoOfDraw", - "checkDispatchInfoOfImpress", - "checkDispatchInfoOfMath", - "checkDispatchInfoOfChart", - "checkDispatchInfoOfBibliography", - "checkDispatchInfoOfQueryDesign", - "checkDispatchInfoOfTableDesign", - "checkDispatchInfoOfFormGridView", - "checkDispatchInfoOfDataSourceBrowser", - "checkDispatchInfoOfRelationDesign", - "checkDispatchInfoOfBasic", - "checkDispatchInfoOfStartModule", - "checkInterceptorLifeTime", - "checkInterception" - }; - } +// public String[] getTestMethodNames() +// { +// return new String[] +// { +// "checkDispatchInfoOfWriter", +// "checkDispatchInfoOfCalc", +// "checkDispatchInfoOfDraw", +// "checkDispatchInfoOfImpress", +// "checkDispatchInfoOfMath", +// "checkDispatchInfoOfChart", +// "checkDispatchInfoOfBibliography", +// "checkDispatchInfoOfQueryDesign", +// "checkDispatchInfoOfTableDesign", +// "checkDispatchInfoOfFormGridView", +// "checkDispatchInfoOfDataSourceBrowser", +// "checkDispatchInfoOfRelationDesign", +// "checkDispatchInfoOfBasic", +// "checkDispatchInfoOfStartModule", +// "checkInterceptorLifeTime", +// "checkInterception" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. - @descr create an empty test frame, where we can load - different components inside. + @descr create an empty test frame, where we can load + different components inside. */ - public void before() + @Before public void before() { try { // get uno service manager from global test environment - m_xMSF = (XMultiServiceFactory)param.getMSF(); + m_xMSF = getMSF(); db = new connectivity.tools.HsqlDatabase(m_xMSF); // create desktop - m_xDesktop = (XFrame)UnoRuntime.queryInterface( - XFrame.class, - m_xMSF.createInstance("com.sun.star.frame.Desktop")); + m_xDesktop = UnoRuntime.queryInterface(XFrame.class, m_xMSF.createInstance("com.sun.star.frame.Desktop")); m_xFrame = impl_createNewFrame(); } - catch(java.lang.Throwable ex) + catch (java.lang.Throwable ex) { - failed("Cant initialize test environment."); + fail("Cant initialize test environment."); } } //------------------------------------------- /** @short close the environment. */ - public void after() + @After public void after() { db.close(); impl_closeFrame(m_xFrame); @@ -135,109 +144,115 @@ public class checkdispatchapi extends ComplexTestCase } //------------------------------------------- - public void checkDispatchInfoOfWriter() + @Test public void checkDispatchInfoOfWriter() { impl_checkDispatchInfoOfXXX("private:factory/swriter"); } //------------------------------------------- - public void checkDispatchInfoOfCalc() + @Test public void checkDispatchInfoOfCalc() { impl_checkDispatchInfoOfXXX("private:factory/scalc"); } //------------------------------------------- - public void checkDispatchInfoOfDraw() + @Test public void checkDispatchInfoOfDraw() { impl_checkDispatchInfoOfXXX("private:factory/sdraw"); } //------------------------------------------- - public void checkDispatchInfoOfImpress() + @Test public void checkDispatchInfoOfImpress() { impl_checkDispatchInfoOfXXX("private:factory/simpress"); } //------------------------------------------- - public void checkDispatchInfoOfChart() + @Test public void checkDispatchInfoOfChart() { impl_checkDispatchInfoOfXXX("private:factory/schart"); } //------------------------------------------- - public void checkDispatchInfoOfMath() + @Test public void checkDispatchInfoOfMath() { impl_checkDispatchInfoOfXXX("private:factory/smath"); } //------------------------------------------- - public void checkDispatchInfoOfDataBase() + @Test public void checkDispatchInfoOfDataBase() { impl_checkDispatchInfoOfXXX("private:factory/sdatabase"); } //------------------------------------------- - public void checkDispatchInfoOfBibliography() + @Test public void checkDispatchInfoOfBibliography() { impl_checkDispatchInfoOfXXX(".component:Bibliography/View1"); } //------------------------------------------- - public void checkDispatchInfoOfQueryDesign() + @Test public void checkDispatchInfoOfQueryDesign() { callDatabaseDispatch(".component:DB/QueryDesign"); } //------------------------------------------- - public void checkDispatchInfoOfTableDesign() + @Test public void checkDispatchInfoOfTableDesign() { callDatabaseDispatch(".component:DB/TableDesign"); } //------------------------------------------- - public void checkDispatchInfoOfFormGridView() + @Test public void checkDispatchInfoOfFormGridView() { impl_checkDispatchInfoOfXXX(".component:DB/FormGridView"); } //------------------------------------------- - public void checkDispatchInfoOfDataSourceBrowser() + @Test public void checkDispatchInfoOfDataSourceBrowser() { impl_checkDispatchInfoOfXXX(".component:DB/DataSourceBrowser"); } //------------------------------------------- - public void checkDispatchInfoOfRelationDesign() + @Test public void checkDispatchInfoOfRelationDesign() { callDatabaseDispatch(".component:DB/RelationDesign"); } //------------------------------------------- + private void callDatabaseDispatch(String url) { try { final PropertyValue args = new PropertyValue(); args.Name = "ActiveConnection"; - args.Value = (Object)db.defaultConnection(); + args.Value = (Object) db.defaultConnection(); XFrame xFrame = impl_createNewFrame(); - impl_loadIntoFrame(xFrame, url, new PropertyValue[] { args }); + impl_loadIntoFrame(xFrame, url, new PropertyValue[] + { + args + }); impl_checkDispatchInfo(xFrame); impl_closeFrame(xFrame); - } catch(java.lang.Exception e ) { - } + } + catch (java.lang.Exception e) + { + } } //------------------------------------------- - public void checkDispatchInfoOfBasic() + @Test public void checkDispatchInfoOfBasic() { Object aComponent = impl_createUNOComponent("com.sun.star.script.BasicIDE"); impl_checkDispatchInfo(aComponent); } //------------------------------------------- - public void checkDispatchInfoOfStartModule() + @Test public void checkDispatchInfoOfStartModule() { Object aComponent = impl_createUNOComponent("com.sun.star.frame.StartModule"); impl_checkDispatchInfo(aComponent); @@ -250,60 +265,56 @@ public class checkdispatchapi extends ComplexTestCase // xInterceptor. Otherwhise we cant check some internal states of aInterceptor at the end of this method, because // it was already killed .-) - Interceptor aInterceptor = new Interceptor(log); - com.sun.star.frame.XDispatchProviderInterceptor xInterceptor = (com.sun.star.frame.XDispatchProviderInterceptor)UnoRuntime.queryInterface( - com.sun.star.frame.XDispatchProviderInterceptor.class, - aInterceptor); + Interceptor aInterceptor = new Interceptor(); + XDispatchProviderInterceptor xInterceptor = UnoRuntime.queryInterface(XDispatchProviderInterceptor.class, aInterceptor); - com.sun.star.frame.XFrame xFrame = impl_createNewFrame(); - com.sun.star.frame.XDispatchProviderInterception xInterception = (com.sun.star.frame.XDispatchProviderInterception)UnoRuntime.queryInterface( - com.sun.star.frame.XDispatchProviderInterception.class, - xFrame); + XFrame xFrame = impl_createNewFrame(); + XDispatchProviderInterception xInterception = UnoRuntime.queryInterface(XDispatchProviderInterception.class, xFrame); xInterception.registerDispatchProviderInterceptor(xInterceptor); impl_closeFrame(xFrame); - int nRegCount = aInterceptor.getRegistrationCount(); + int nRegCount = aInterceptor.getRegistrationCount(); boolean bIsRegistered = aInterceptor.isRegistered(); - log.println("registration count = "+nRegCount ); - log.println("is registered ? = "+bIsRegistered); + System.out.println("registration count = " + nRegCount); + System.out.println("is registered ? = " + bIsRegistered); if (nRegCount < 1) - failed("Interceptor was never registered."); + { + fail("Interceptor was never registered."); + } if (bIsRegistered) - failed("Interceptor was not deregistered automaticly on closing the corresponding frame."); + { + fail("Interceptor was not deregistered automaticly on closing the corresponding frame."); + } - log.println("Destruction of interception chain works as designed .-)"); + System.out.println("Destruction of interception chain works as designed .-)"); } //------------------------------------------- public void checkInterception() { - String [] lDisabledURLs = new String [1]; - lDisabledURLs[0] = ".uno:Open"; + String[] lDisabledURLs = new String[1]; + lDisabledURLs[0] = ".uno:Open"; - log.println("create and initialize interceptor ..."); - Interceptor aInterceptor = new Interceptor(log); + System.out.println("create and initialize interceptor ..."); + Interceptor aInterceptor = new Interceptor(); aInterceptor.setURLs4URLs4Blocking(lDisabledURLs); - com.sun.star.frame.XDispatchProviderInterceptor xInterceptor = (com.sun.star.frame.XDispatchProviderInterceptor)UnoRuntime.queryInterface( - com.sun.star.frame.XDispatchProviderInterceptor.class, - aInterceptor); + XDispatchProviderInterceptor xInterceptor = UnoRuntime.queryInterface(XDispatchProviderInterceptor.class, aInterceptor); - log.println("create and initialize frame ..."); - com.sun.star.frame.XFrame xFrame = impl_createNewFrame(); + System.out.println("create and initialize frame ..."); + XFrame xFrame = impl_createNewFrame(); impl_loadIntoFrame(xFrame, "private:factory/swriter", null); - com.sun.star.frame.XDispatchProviderInterception xInterception = (com.sun.star.frame.XDispatchProviderInterception)UnoRuntime.queryInterface( - com.sun.star.frame.XDispatchProviderInterception.class, - xFrame); + XDispatchProviderInterception xInterception = UnoRuntime.queryInterface(XDispatchProviderInterception.class, xFrame); - log.println("register interceptor ..."); + System.out.println("register interceptor ..."); xInterception.registerDispatchProviderInterceptor(xInterceptor); - log.println("deregister interceptor ..."); + System.out.println("deregister interceptor ..."); xInterception.releaseDispatchProviderInterceptor(xInterceptor); } @@ -311,7 +322,7 @@ public class checkdispatchapi extends ComplexTestCase private void impl_checkDispatchInfoOfXXX(String sXXX) { XFrame xFrame = impl_createNewFrame(); - impl_loadIntoFrame(xFrame, sXXX,null); + impl_loadIntoFrame(xFrame, sXXX, null); impl_checkDispatchInfo(xFrame); impl_closeFrame(xFrame); } @@ -319,26 +330,28 @@ public class checkdispatchapi extends ComplexTestCase //------------------------------------------- /** @short load an URL into the current test frame. */ - private void impl_loadIntoFrame(XFrame xFrame, String sURL,PropertyValue args[]) + private void impl_loadIntoFrame(XFrame xFrame, String sURL, PropertyValue args[]) { - XComponentLoader xLoader = (XComponentLoader)UnoRuntime.queryInterface( - XComponentLoader.class, - xFrame); + XComponentLoader xLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame); if (xLoader == null) - failed("Frame does not provide required interface XComponentLoader."); + { + fail("Frame does not provide required interface XComponentLoader."); + } XComponent xDoc = null; try { xDoc = xLoader.loadComponentFromURL(sURL, "_self", 0, args); } - catch(java.lang.Throwable ex) + catch (java.lang.Throwable ex) { xDoc = null; } if (xDoc == null) - failed("Could not load \""+sURL+"\"."); + { + fail("Could not load \"" + sURL + "\"."); + } } //------------------------------------------- @@ -351,112 +364,135 @@ public class checkdispatchapi extends ComplexTestCase { aComponent = m_xMSF.createInstance(sName); } - catch(java.lang.Throwable ex) + catch (java.lang.Throwable ex) { aComponent = null; } if (aComponent == null) - failed("Could not create UNO component \""+sName+"\"."); + { + fail("Could not create UNO component \"" + sName + "\"."); + } return aComponent; } //------------------------------------------- /** @short check the interface XDispatchInformationProvider - at the specified component. + at the specified component. */ private void impl_checkDispatchInfo(Object aComponent) { - XDispatchInformationProvider xInfoProvider = (XDispatchInformationProvider)UnoRuntime.queryInterface( - XDispatchInformationProvider.class, - aComponent); + XDispatchInformationProvider xInfoProvider = UnoRuntime.queryInterface(XDispatchInformationProvider.class, aComponent); if (xInfoProvider == null) { // Warning - log.println("Warning:\tComponent does not provide the [optional!] interface XDispatchInformationProvider."); + System.out.println("Warning:\tComponent does not provide the [optional!] interface XDispatchInformationProvider."); return; } try { short[] lGroups = xInfoProvider.getSupportedCommandGroups(); - int c1 = lGroups.length; - int i1 = 0; - for (i1=0; i1 dont break this test + fail("At least one DispatchInformation item does not match the requested group.\n\trequested group=[" + nGroup + + "] returned groupd=[" + aInfo.GroupId + "] command=\"" + aInfo.Command + "\""); // true => dont break this test continue; } if (aCheckMap.containsKey(aInfo.Command)) { // Error - failed("Found a duplicate item: group=["+aInfo.GroupId+"] command=\""+aInfo.Command+"\"", true); // true => dont break this test + fail("Found a duplicate item: group=[" + aInfo.GroupId + "] command=\"" + aInfo.Command + "\""); // true => dont break this test continue; } aCheckMap.put(aInfo.Command, aInfo.Command); - log.println("\t["+aInfo.GroupId+"] \""+aInfo.Command+"\""); + System.out.println("\t[" + aInfo.GroupId + "] \"" + aInfo.Command + "\""); } } } - catch(java.lang.Throwable ex) + catch (java.lang.Throwable ex) { - failed("Exception caught during using XDispatchInformationProvider."); - ex.printStackTrace(); + fail("Exception caught during using XDispatchInformationProvider."); + // ex.printStackTrace(); } } //------------------------------------------- - private synchronized com.sun.star.frame.XFrame impl_createNewFrame() + private synchronized XFrame impl_createNewFrame() { - com.sun.star.frame.XFrame xFrame = null; + XFrame xFrame = null; try { xFrame = m_xDesktop.findFrame("_blank", 0); xFrame.getContainerWindow().setVisible(true); } - catch(java.lang.Throwable ex) + catch (java.lang.Throwable ex) { - failed("Could not create the frame instance."); + fail("Could not create the frame instance."); } return xFrame; - } + } //------------------------------------------- - private synchronized void impl_closeFrame(com.sun.star.frame.XFrame xFrame) + private synchronized void impl_closeFrame(XFrame xFrame) { - com.sun.star.util.XCloseable xClose = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface( - com.sun.star.util.XCloseable.class, - xFrame); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xFrame); try { xClose.close(false); } - catch(com.sun.star.util.CloseVetoException exVeto) + catch (com.sun.star.util.CloseVetoException exVeto) { - failed("Test frame couldn't be closed successfully."); + fail("Test frame couldn't be closed successfully."); } } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass + public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/framework/qa/complex/dispatches/helper/Interceptor.java b/framework/qa/complex/dispatches/helper/Interceptor.java index a5b6b25c69d5..70e50b212a01 100644 --- a/framework/qa/complex/dispatches/helper/Interceptor.java +++ b/framework/qa/complex/dispatches/helper/Interceptor.java @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package complex.dispatches; +package complex.dispatches.helper; // __________ Imports __________ @@ -32,19 +32,18 @@ package complex.dispatches; import com.sun.star.beans.PropertyValue; // exceptions -import com.sun.star.uno.Exception; -import com.sun.star.uno.RuntimeException; - -// interfaces -import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.DispatchDescriptor; import com.sun.star.frame.XDispatch; +import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XDispatchProviderInterceptor; -import com.sun.star.frame.XDispatchProviderInterception; import com.sun.star.frame.XInterceptorInfo; +import com.sun.star.frame.XStatusListener; + +// interfaces + // helper -import com.sun.star.uno.UnoRuntime; -import share.LogWriter; +import com.sun.star.util.URL; // others //import java.lang.*; @@ -54,10 +53,10 @@ import share.LogWriter; /** * implements a configurable interceptor for dispatch events. */ -public class Interceptor implements com.sun.star.frame.XDispatchProvider, - com.sun.star.frame.XDispatch, - com.sun.star.frame.XDispatchProviderInterceptor, - com.sun.star.frame.XInterceptorInfo +public class Interceptor implements XDispatchProvider, + XDispatch, + XDispatchProviderInterceptor, + XInterceptorInfo { // ____________________ @@ -88,8 +87,8 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, The slave can be used inside queryDispatch() to forward requests, which are not handled by this interceptor instance. */ - private com.sun.star.frame.XDispatchProvider m_xSlave = null; - private com.sun.star.frame.XDispatchProvider m_xMaster = null; + private XDispatchProvider m_xSlave = null; + private XDispatchProvider m_xMaster = null; // ____________________ @@ -107,20 +106,14 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, */ private boolean m_bIsRegistered = false; - // ____________________ - - /** used for log output. - */ - private LogWriter m_aLog; // ____________________ /** ctor * It's initialize an object of this class with default values. */ - public Interceptor(LogWriter aLog) + public Interceptor() { - m_aLog = aLog; } // ____________________ @@ -134,27 +127,27 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, // ____________________ /** XDispatchProviderInterceptor */ - public synchronized com.sun.star.frame.XDispatchProvider getSlaveDispatchProvider() + public synchronized XDispatchProvider getSlaveDispatchProvider() { - m_aLog.println("Interceptor.getSlaveDispatchProvider() called"); + System.out.println("Interceptor.getSlaveDispatchProvider() called"); return m_xSlave; } // ____________________ /** XDispatchProviderInterceptor */ - public synchronized com.sun.star.frame.XDispatchProvider getMasterDispatchProvider() + public synchronized XDispatchProvider getMasterDispatchProvider() { - m_aLog.println("Interceptor.getMasterDispatchProvider() called"); + System.out.println("Interceptor.getMasterDispatchProvider() called"); return m_xMaster; } // ____________________ /** XDispatchProviderInterceptor */ - public synchronized void setSlaveDispatchProvider(com.sun.star.frame.XDispatchProvider xSlave) + public synchronized void setSlaveDispatchProvider(XDispatchProvider xSlave) { - m_aLog.println("Interceptor.setSlaveDispatchProvider("+xSlave+") called"); + System.out.println("Interceptor.setSlaveDispatchProvider("+xSlave+") called"); if (xSlave != null) { @@ -162,7 +155,9 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, m_bIsRegistered = true; } else + { m_bIsRegistered = false; + } m_xSlave = xSlave; } @@ -170,9 +165,9 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, // ____________________ /** XDispatchProviderInterceptor */ - public synchronized void setMasterDispatchProvider(com.sun.star.frame.XDispatchProvider xMaster) + public synchronized void setMasterDispatchProvider(XDispatchProvider xMaster) { - m_aLog.println("Interceptor.setMasterDispatchProvider("+xMaster+") called"); + System.out.println("Interceptor.setMasterDispatchProvider("+xMaster+") called"); m_xMaster = xMaster; } @@ -180,25 +175,25 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, /** XDispatchProvider */ - public synchronized com.sun.star.frame.XDispatch queryDispatch(com.sun.star.util.URL aURL , + public synchronized XDispatch queryDispatch(URL aURL , String sTargetFrameName, int nSearchFlags ) { - m_aLog.println("Interceptor.queryDispatch('"+aURL.Complete+"', '"+sTargetFrameName+"', "+nSearchFlags+") called"); + System.out.println("Interceptor.queryDispatch('"+aURL.Complete+"', '"+sTargetFrameName+"', "+nSearchFlags+") called"); if (impl_isBlockedURL(aURL.Complete)) { - m_aLog.println("Interceptor.queryDispatch(): URL blocked => returns NULL"); + System.out.println("Interceptor.queryDispatch(): URL blocked => returns NULL"); return null; } if (m_xSlave != null) { - m_aLog.println("Interceptor.queryDispatch(): ask slave ..."); + System.out.println("Interceptor.queryDispatch(): ask slave ..."); return m_xSlave.queryDispatch(aURL, sTargetFrameName, nSearchFlags); } - m_aLog.println("Interceptor.queryDispatch(): no idea => returns this"); + System.out.println("Interceptor.queryDispatch(): no idea => returns this"); return this; } @@ -206,12 +201,12 @@ public class Interceptor implements com.sun.star.frame.XDispatchProvider, /** XDispatchProvider */ - public com.sun.star.frame.XDispatch[] queryDispatches(com.sun.star.frame.DispatchDescriptor[] lRequests) + public XDispatch[] queryDispatches(DispatchDescriptor[] lRequests) { int i = 0; int c = lRequests.length; - com.sun.star.frame.XDispatch[] lResults = new com.sun.star.frame.XDispatch[c]; + XDispatch[] lResults = new XDispatch[c]; for (i=0; idispose method call. */ public boolean _removeEventListener() { - if (disposed) return false; + if (disposed) + { + System.out.println("Hint: already disposed."); + return false; + } // the second listener should not be called oObj.removeEventListener( listener2 ); - log.println(Thread.currentThread() + " is removing EL " + listener2); + System.out.println(Thread.currentThread() + " is removing EL " + listener2); return true; } // finished _removeEventListener() @@ -142,24 +142,32 @@ public class _XComponent { public boolean _dispose() { disposed = false; - log.println( "begin dispose" + Thread.currentThread()); + System.out.println( "begin dispose" + Thread.currentThread()); XDesktop oDesk = (XDesktop) tEnv.get("Desktop"); if (oDesk !=null) { oDesk.terminate(); } else { if (altDispose == null) + { oObj.dispose(); + } else + { altDispose.dispose(); + } } try { Thread.sleep(500) ; } catch (InterruptedException e) {} - if (Loutput[0]!=null) log.println(Loutput[0]); - if (Loutput[1]!=null) log.println(Loutput[1]); - log.println( "end dispose" + Thread.currentThread()); + if (Loutput[0]!=null){ + System.out.println(Loutput[0]); + } + if (Loutput[1]!=null) { + System.out.println(Loutput[1]); + } + System.out.println( "end dispose" + Thread.currentThread()); disposed = true; // check that dispose() works OK. diff --git a/framework/qa/complex/imageManager/interfaces/_XImageManager.java b/framework/qa/complex/imageManager/interfaces/_XImageManager.java index ccba1464c106..4c62039e348d 100755 --- a/framework/qa/complex/imageManager/interfaces/_XImageManager.java +++ b/framework/qa/complex/imageManager/interfaces/_XImageManager.java @@ -24,26 +24,26 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -package imageManager.interfaces; +package complex.imageManager.interfaces; import com.sun.star.graphic.XGraphic; import com.sun.star.ui.ImageType; import com.sun.star.ui.XImageManager; import lib.TestParameters; -import share.LogWriter; + /** * */ public class _XImageManager { - LogWriter log = null; + TestParameters tEnv = null; String[]imageNames = null; XGraphic[] xGraphicArray = null; public XImageManager oObj; - public _XImageManager(LogWriter log, TestParameters tEnv, XImageManager oObj) { - this.log = log; + public _XImageManager( TestParameters tEnv, XImageManager oObj) { + this.tEnv = tEnv; this.oObj = oObj; } @@ -52,7 +52,9 @@ public class _XImageManager { short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; imageNames = oObj.getAllImageNames(s); for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) + { System.out.println("###### Image: " + imageNames[i]); + } return imageNames != null; } @@ -71,10 +73,11 @@ public class _XImageManager { short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; try { // check the first image names, 10 at max for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) + { result &= oObj.hasImage(s, imageNames[i]); + } } catch(com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace((java.io.PrintWriter)log); result = false; } return result; diff --git a/framework/qa/complex/imageManager/interfaces/_XInitialization.java b/framework/qa/complex/imageManager/interfaces/_XInitialization.java index da957331671b..d1da1b2158e7 100755 --- a/framework/qa/complex/imageManager/interfaces/_XInitialization.java +++ b/framework/qa/complex/imageManager/interfaces/_XInitialization.java @@ -25,9 +25,9 @@ * ************************************************************************/ -package imageManager.interfaces; +package complex.imageManager.interfaces; + -import share.LogWriter; import com.sun.star.lang.XInitialization; @@ -48,12 +48,12 @@ import lib.TestParameters; */ public class _XInitialization { - LogWriter log = null; + TestParameters tEnv = null; public static XInitialization oObj = null; - public _XInitialization(LogWriter log, TestParameters tEnv, XInitialization oObj) { - this.log = log; + public _XInitialization(TestParameters tEnv, XInitialization oObj) { + this.tEnv = tEnv; this.oObj = oObj; } @@ -75,8 +75,7 @@ public class _XInitialization { } } catch (com.sun.star.uno.Exception e) { - log.println("Exception occured while method calling.") ; - e.printStackTrace((java.io.PrintWriter)log) ; + System.out.println("Exception occured while method calling.") ; result = false ; } diff --git a/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java b/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java index 7ea641ca63d5..bf8e1ca6f850 100755 --- a/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java +++ b/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java @@ -25,9 +25,8 @@ * ************************************************************************/ -package imageManager.interfaces; +package complex.imageManager.interfaces; -import share.LogWriter; import com.sun.star.lang.XTypeProvider; @@ -46,13 +45,13 @@ import lib.TestParameters; */ public class _XTypeProvider { - LogWriter log = null; + TestParameters tEnv = null; public static XTypeProvider oObj = null; public static Type[] types = null; - public _XTypeProvider(LogWriter log, TestParameters tEnv, XTypeProvider oObj) { - this.log = log; + public _XTypeProvider(TestParameters tEnv, XTypeProvider oObj) { + this.tEnv = tEnv; this.oObj = oObj; } @@ -63,9 +62,9 @@ public class _XTypeProvider { */ public boolean _getImplementationId() { boolean result = true; - log.println("testing getImplementationId() ... "); + System.out.println("testing getImplementationId() ... "); - log.println("The ImplementationId is "+oObj.getImplementationId()); + System.out.println("The ImplementationId is "+oObj.getImplementationId()); result = true; return result; @@ -74,24 +73,24 @@ public class _XTypeProvider { /** - * Ñalls the method and checks the return value.

+ * Calls the method and checks the return value.

* Has OK status if one of the return value equals to the * type com.sun.star.lang.XTypeProvider. */ public boolean _getTypes() { boolean result = false; - log.println("getting Types..."); + System.out.println("getting Types..."); types = oObj.getTypes(); for (int i=0;i"); } diff --git a/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java b/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java index a1e9e75cabd3..39e2fccfb09d 100755 --- a/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java +++ b/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java @@ -25,20 +25,18 @@ * ************************************************************************/ -package imageManager.interfaces; +package complex.imageManager.interfaces; + -import com.sun.star.lang.XServiceInfo; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.ui.XModuleUIConfigurationManagerSupplier; import com.sun.star.ui.XUIConfiguration; import com.sun.star.ui.XUIConfigurationListener; import lib.TestParameters; -import share.LogWriter; + public class _XUIConfiguration { - LogWriter log = null; + TestParameters tEnv = null; public XUIConfiguration oObj; XUIConfigurationListenerImpl xListener = null; @@ -51,8 +49,7 @@ public class _XUIConfiguration { } - public _XUIConfiguration(LogWriter log, TestParameters tEnv, XUIConfiguration oObj) { - this.log = log; + public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) { this.tEnv = tEnv; this.oObj = oObj; } diff --git a/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java b/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java index 0e029deb4204..12de107296e5 100755 --- a/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java +++ b/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java @@ -25,26 +25,23 @@ * ************************************************************************/ -package imageManager.interfaces; +package complex.imageManager.interfaces; import com.sun.star.embed.XStorage; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.ui.XModuleUIConfigurationManagerSupplier; import com.sun.star.ui.XUIConfigurationPersistence; import lib.TestParameters; -import share.LogWriter; + public class _XUIConfigurationPersistence { - LogWriter log = null; + TestParameters tEnv = null; public XUIConfigurationPersistence oObj; private XStorage xStore = null; - public _XUIConfigurationPersistence(LogWriter log, TestParameters tEnv, XUIConfigurationPersistence oObj) { - this.log = log; + public _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj) { + this.tEnv = tEnv; this.oObj = oObj; } @@ -58,7 +55,7 @@ public class _XUIConfigurationPersistence { oObj.reload(); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + } return true; } @@ -68,7 +65,7 @@ public class _XUIConfigurationPersistence { oObj.store(); } catch(com.sun.star.uno.Exception e) { - e.printStackTrace((java.io.PrintWriter)log); + } return true; } @@ -80,7 +77,7 @@ public class _XUIConfigurationPersistence { } catch(com.sun.star.uno.Exception e) { result = false; - e.printStackTrace((java.io.PrintWriter)log); + } return result; } diff --git a/framework/qa/complex/imageManager/interfaces/makefile.mk b/framework/qa/complex/imageManager/interfaces/makefile.mk index 039eba576069..f7b6f5ebf035 100755 --- a/framework/qa/complex/imageManager/interfaces/makefile.mk +++ b/framework/qa/complex/imageManager/interfaces/makefile.mk @@ -25,10 +25,10 @@ # #************************************************************************* -PRJ = ..$/..$/..$/.. +PRJ = ../../../.. TARGET = ImageManager PRJNAME = framework -PACKAGE = imageManager$/interfaces +PACKAGE = complex/imageManager/interfaces # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk @@ -37,10 +37,16 @@ PACKAGE = imageManager$/interfaces #----- compile .java files ----------------------------------------- JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = _XComponent.java _XUIConfiguration.java _XImageManager.java \ - _XUIConfigurationPersistence.java _XInitialization.java _XTypeProvider.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +JAVAFILES = \ +_XComponent.java \ +_XUIConfiguration.java \ +_XImageManager.java \ +_XUIConfigurationPersistence.java \ +_XInitialization.java \ +_XTypeProvider.java + +JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:b).class) #----- make a jar from compiled files ------------------------------ diff --git a/framework/qa/complex/imageManager/makefile.mk b/framework/qa/complex/imageManager/makefile.mk index 3b508b718d31..e455a297072d 100755 --- a/framework/qa/complex/imageManager/makefile.mk +++ b/framework/qa/complex/imageManager/makefile.mk @@ -25,55 +25,96 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = ImageManager -PRJNAME = framework -PACKAGE = imageManager - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -JARFILES = mysql.jar mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar -JAVAFILES = CheckImageManager.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_imageManager -#----- make a jar from compiled files ------------------------------ +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/imageManager -MAXLINELENGTH = 100000 +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckImageManager.java -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# --- Parameters for the test -------------------------------------- +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand \ - "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# subdirectories +SUBDIRS = interfaces -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# replace $/ with . in package name -CT_PACKAGE = -o $(PACKAGE:s\$/\.\) +.END -# start the runner application -CT_APP = org.openoffice.Runner - -# --- Targets ------------------------------------------------------ +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -.INCLUDE : target.mk +ALLTAR : javatest -RUN: run +.END -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckImageManager +# +# +# PRJ = ..$/..$/.. +# TARGET = ImageManager +# PRJNAME = framework +# PACKAGE = imageManager +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = mysql.jar mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar +# JAVAFILES = CheckImageManager.java +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand \ +# "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # replace $/ with . in package name +# CT_PACKAGE = -o $(PACKAGE:s\$/\.\) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .INCLUDE : target.mk +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_PACKAGE).CheckImageManager +# +# diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java index 12368c6e3a89..3a6fd7a67270 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java @@ -28,30 +28,19 @@ package complex.loadAllDocuments; import com.sun.star.beans.PropertyValue; -import com.sun.star.beans.XPropertySet; -import com.sun.star.comp.loader.FactoryHelper; import com.sun.star.frame.FrameSearchFlag; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XFrame; import com.sun.star.frame.XStorable; import com.sun.star.io.XInputStream; import com.sun.star.lang.XComponent; -import com.sun.star.lang.XInitialization; import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.lang.XServiceInfo; -import com.sun.star.lang.XSingleServiceFactory; -import com.sun.star.lang.XTypeProvider; -import com.sun.star.registry.XRegistryKey; -import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.XCloseable; import com.sun.star.ucb.XSimpleFileAccess; import complex.loadAllDocuments.helper.InteractionHandler; import complex.loadAllDocuments.helper.StatusIndicator; -import complex.loadAllDocuments.helper.StreamSimulator; - -import complexlib.ComplexTestCase; import helper.URLHelper; @@ -59,9 +48,19 @@ import java.io.File; import java.io.InputStreamReader; import java.util.Enumeration; -import java.util.StringTokenizer; import java.util.Vector; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import org.openoffice.test.OfficeFileUrl; +import static org.junit.Assert.*; +// ------------------------------------------ + //----------------------------------------------- /** @short Check the interface method XComponentLoader.loadComponentFromURL() @@ -80,7 +79,7 @@ import java.util.Vector; @todo We need a further test for accessing UNC pathes on windows! */ -public class CheckXComponentLoader extends ComplexTestCase +public class CheckXComponentLoader { //------------------------------------------- // some const @@ -96,7 +95,7 @@ public class CheckXComponentLoader extends ComplexTestCase /** File/URL separators. */ private static final String fs_url = "/"; - private static final String fs_sys = System.getProperty("file.separator"); + // private static final String fs_sys = System.getProperty("file.separator"); /** used for testing password protected files. */ private static final String SUFFIX_PASSWORD_TEMPFILE = "password_"; @@ -140,18 +139,18 @@ public class CheckXComponentLoader extends ComplexTestCase @return All test methods. @todo Think about selection of tests from outside ... */ - public String[] getTestMethodNames() - { - // TODO think about trigger of sub-tests from outside - return new String[] - { - "checkURLEncoding" , - "checkURLHandling" , - "checkUsingOfMediaDescriptor", - "checkStreamLoading" , - "checkLoadingWithPassword" - }; - } +// public String[] getTestMethodNames() +// { +// // TODO think about trigger of sub-tests from outside +// return new String[] +// { +// "checkURLEncoding" , +// "checkURLHandling" , +// "checkUsingOfMediaDescriptor", +// "checkStreamLoading" , +// "checkLoadingWithPassword" +// }; +// } //------------------------------------------- /** @short Create the environment for following tests. @@ -159,59 +158,51 @@ public class CheckXComponentLoader extends ComplexTestCase @descr Use either a component loader from desktop or from frame */ - public void before() + @Before public void before() { // get uno service manager from global test environment - m_xMSF = (XMultiServiceFactory)param.getMSF(); + m_xMSF = getMSF(); // create stream provider try { - m_xStreamProvider = (XSimpleFileAccess)UnoRuntime.queryInterface( - XSimpleFileAccess.class, - m_xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); + m_xStreamProvider = UnoRuntime.queryInterface(XSimpleFileAccess.class, m_xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); } catch(java.lang.Throwable ex) { - ex.printStackTrace(); - failed("Could not create a stream provider instance."); + fail("Could not create a stream provider instance."); } // create desktop instance try { - m_xDesktop = (XFrame)UnoRuntime.queryInterface( - XFrame.class, - m_xMSF.createInstance("com.sun.star.frame.Desktop")); + m_xDesktop = UnoRuntime.queryInterface(XFrame.class, m_xMSF.createInstance("com.sun.star.frame.Desktop")); } catch(java.lang.Throwable ex) { - ex.printStackTrace(); - failed("Could not create the desktop instance."); + fail("Could not create the desktop instance."); } // create frame instance - m_xFrame = m_xDesktop.findFrame("testFrame_componentLoader" , + m_xFrame = m_xDesktop.findFrame("testFrame_componentLoader", FrameSearchFlag.TASKS | FrameSearchFlag.CREATE); - if (m_xFrame==null) - failed("Couldn't create test frame."); + assertNotNull("Couldn't create test frame.", m_xFrame); // define default loader for testing // TODO think about using of bot loader instances! - m_xLoader = (XComponentLoader)UnoRuntime.queryInterface( - XComponentLoader.class, - m_xDesktop); - if (m_xLoader==null) - failed("Desktop service doesnt support needed component loader interface."); + m_xLoader = UnoRuntime.queryInterface(XComponentLoader.class, m_xDesktop); + assertNotNull("Desktop service doesnt support needed component loader interface.", m_xLoader); // get temp path for this environment - m_sTempPath = (String) param.get("TempPath"); - m_sTempPath = "."+fs_sys; + final String tempDirURL = util.utils.getOfficeTemp/*Dir*/(getMSF()); + m_sTempPath = tempDirURL; + // m_sTempPath = "."+fs_sys; // get all files from the given directory // TODO URLHelper should ignore directories! m_lTestFiles = new Vector(); - m_sTestDocPath = (String) param.get("TestDocumentPath"); + final String sTestDocURL = OfficeFileUrl.getAbsolute(new File("testdocuments")); + m_sTestDocPath = graphical.FileHelper.getSystemPathFromFileURL(sTestDocURL); try { File aBaseDir = new File(m_sTestDocPath); @@ -232,36 +223,35 @@ public class CheckXComponentLoader extends ComplexTestCase } String sCompletePath = aFile.getAbsolutePath(); - String sSubPath = sCompletePath.substring(nBasePathLength + 1); + String sSubPath = sCompletePath.substring(nBasePathLength); // Some test files are checked into CVS. ignore CVS helper files! - if (sSubPath.indexOf("CVS") > -1) - continue; +// if (sSubPath.indexOf("CVS") > -1) +// { +// continue; +// } m_lTestFiles.add(sSubPath); } } catch(java.lang.Throwable ex) { - ex.printStackTrace(); - failed("Couldn't find test documents."); + fail("Couldn't find test documents."); } } //------------------------------------------- /** @short close the environment. */ - public void after() + @After public void after() { - XCloseable xClose = (XCloseable)UnoRuntime.queryInterface( - XCloseable.class, - m_xFrame); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, m_xFrame); try { xClose.close(false); } catch(com.sun.star.util.CloseVetoException exVeto) - { failed("Test frame couldn't be closed successfully."); } + { fail("Test frame couldn't be closed successfully."); } m_xFrame = null; m_xLoader = null; @@ -270,7 +260,7 @@ public class CheckXComponentLoader extends ComplexTestCase //------------------------------------------- /** @short Look for files in the given directory for loading. */ - public void checkUsingOfMediaDescriptor() + @Test public void checkUsingOfMediaDescriptor() { InteractionHandler xHandler = new InteractionHandler(); StatusIndicator xIndicator = new StatusIndicator(StatusIndicator.SHOWSTATUS_LOG); @@ -292,17 +282,26 @@ public class CheckXComponentLoader extends ComplexTestCase Enumeration aSnapshot = m_lTestFiles.elements(); while (aSnapshot.hasMoreElements()) { - File aSysFile = new File(m_sTestDocPath+fs_sys+(String)aSnapshot.nextElement()); + File aSysFile = new File(m_sTestDocPath, (String)aSnapshot.nextElement()); String sURL = URLHelper.getFileURLFromSystemPath(aSysFile); - loadURL(m_xLoader, RESULT_VALID_DOC, sURL, "_blank", 0, lProps); - - // Its not needed to reset this using states! - // Its done internaly ... - if (!xIndicator.wasUsed()) - failed("External progress was not used for loading."); - if (xHandler.wasUsed()) - failed("External interaction handler was not used for loading."); + if (/*! (sURL.endsWith(".jpg") || + sURL.endsWith(".gif"))*/ + true + ) + { + loadURL(m_xLoader, RESULT_VALID_DOC, sURL, "_blank", 0, lProps); + // Its not needed to reset this using states! + // Its done internaly ... + if (!xIndicator.wasUsed()) + { + System.out.println("External progress was not used for loading."); + } + if (xHandler.wasUsed()) + { + System.out.println("External interaction handler was not used for loading."); + } + } } } @@ -313,17 +312,23 @@ public class CheckXComponentLoader extends ComplexTestCase String sPrefix ) { File aDir = new File(sTempPath); - if (!aDir.exists()) - failed("Could not access temp directory \""+sTempPath+"\"."); + aDir.mkdirs(); +// if (!aDir.exists()) +// { +// fail("Could not access temp directory \"" + sTempPath + "\"."); +// } + // TODO: create a temp file which not exist! for (int i=0; i<999999; ++i) { File aTempFile = new File(aDir, sSuffix+i+sPrefix); if (!aTempFile.exists()) + { return aTempFile.getAbsolutePath(); + } } - failed("Seems that all temp file names are currently in use!"); + fail("Seems that all temp file names are currently in use!"); return null; } @@ -360,25 +365,19 @@ public class CheckXComponentLoader extends ComplexTestCase { // load it xDoc = xLoader.loadComponentFromURL(sSourceURL, "_blank", 0, lLoadProps); - if (xDoc == null) - failed("Could create office document, which should be saved as temp one."); + assertNotNull("Could create office document, which should be saved as temp one.", xDoc); // save it as temp file - XStorable xStore = (XStorable)UnoRuntime.queryInterface( - XStorable.class, - xDoc); + XStorable xStore = UnoRuntime.queryInterface(XStorable.class, xDoc); xStore.storeAsURL(sTargetURL, lSaveProps); // Dont forget to close this file. Otherwise the temp file is locked! - XCloseable xClose = (XCloseable)UnoRuntime.queryInterface( - XCloseable.class, - xDoc); + XCloseable xClose = UnoRuntime.queryInterface(XCloseable.class, xDoc); xClose.close(false); } catch(java.lang.Throwable ex) { - ex.printStackTrace(); - failed("Could not create temp office document."); + fail("Could not create temp office document."); } } @@ -389,7 +388,7 @@ public class CheckXComponentLoader extends ComplexTestCase as password for the ftp connection, or - if none given a default one. */ - public void checkLoadingWithPassword() + @Test public void checkLoadingWithPassword() { String sTempFile = impl_getTempFileName(m_sTempPath, SUFFIX_PASSWORD_TEMPFILE, PREFIX_PASSWORD_TEMPFILE); File aTestFile = new File(sTempFile); @@ -414,14 +413,14 @@ public class CheckXComponentLoader extends ComplexTestCase lArgs2[0].Value = Boolean.TRUE; loadURL(m_xLoader, RESULT_VALID_DOC, sTestURL, "_blank", 0, lArgs1); - loadURL(m_xLoader, RESULT_EMPTY_DOC, sTestURL, "_blank", 0, lArgs2); +// TODO: wrong? loadURL(m_xLoader, RESULT_EMPTY_DOC, sTestURL, "_blank", 0, lArgs2); } /** * Check URL encoding. The first filename that matches "*.sxw" * is used as source for several encodings. */ - public void checkURLEncoding() { + @Test public void checkURLEncoding() { PropertyValue[] lProps = new PropertyValue[1]; lProps[0] = new PropertyValue(); @@ -432,21 +431,17 @@ public class CheckXComponentLoader extends ComplexTestCase InputStreamReader in = new InputStreamReader(System.in); String sSystemEncoding = in.getEncoding(); - log.println("This system's encoding: " + sSystemEncoding); + System.out.println("This system's encoding: " + sSystemEncoding); - if (m_lTestFiles == null) { - failed("Found an empty directory. There are no files for testing."); + assertNotNull("Found an empty directory. There are no files for testing.", m_lTestFiles); - return; - } // get a file name as byte array Enumeration aSnapshot = m_lTestFiles.elements(); byte[] baURL = null; while (aSnapshot.hasMoreElements()) { - File aFile = new File(m_sTestDocPath + fs_sys + - aSnapshot.nextElement()); + File aFile = new File(m_sTestDocPath, (String)aSnapshot.nextElement()); String sFile = URLHelper.getFileURLFromSystemPath(aFile); // take the first sxw file as stream @@ -457,11 +452,7 @@ public class CheckXComponentLoader extends ComplexTestCase } } - if (baURL == null) { - failed("Found no file to load. Cannot test."); - - return; - } + assertNotNull("Found no file to load. Cannot test.", baURL); //construct several different encoded strings String[] sEncoding = new String[] { @@ -477,7 +468,7 @@ public class CheckXComponentLoader extends ComplexTestCase for (int i = 0; i < sEncoding.length; i = i + 2) { try { String encURL = new String(baURL, sEncoding[i]); - log.println("ENC[" + sEncoding[i] + "]"); + System.out.println("ENC[" + sEncoding[i] + "]"); if (sEncoding[i + 1].equals("TRUE")) { loadURL(m_xLoader, RESULT_VALID_DOC, encURL, "_blank", 0, @@ -488,8 +479,8 @@ public class CheckXComponentLoader extends ComplexTestCase lProps); } } catch (java.io.UnsupportedEncodingException e) { - failed("Unsopported Encoding: " + sEncoding[i] + - "\n Not able to test encoding on this platform.", true); + fail("Unsopported Encoding: " + sEncoding[i] + + "\n Not able to test encoding on this platform."); } } } @@ -502,107 +493,107 @@ public class CheckXComponentLoader extends ComplexTestCase * 4. FTP URLs * 5. HTTP URLs */ - public void checkURLHandling() { - PropertyValue[] lProps = new PropertyValue[1]; - - lProps[0] = new PropertyValue(); - lProps[0].Name = "Hidden"; - lProps[0].Value = Boolean.TRUE; - - log.println("check possible but unsupported URLs"); - - String[] sIllegalArgs = new String[] { - "slot:5000", "slot:10909", ".uno:SaveAs", ".uno:Open", - }; - loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, - "_blank", 0, lProps); - - log.println("check stupid URLs"); - - sIllegalArgs = new String[] { - "slot:xxx", "slot:111111111", ".uno:save_as", ".uno:open_this", - ".UnO:*", - }; - loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, - "_blank", 0, lProps); - - String[] sEmptyDocs = new String[] { - "mailo:hansi.meier@germany.sun.com", "file:/c:\\test/file.cxx", - "file:///c|:\\test/file.cxx", "http_server://staroffice-doc\\", - "c:\\\\test///\\test.sxw", "news_:staroffice-doc", - "newsletter@blubber", "private_factory/swriter", - "private:factory//swriter", "private:factory/swriter/___", - "c:\\test\\test.sxw", "macro:///ImportWizard.Main.Main", - "macro:///Euro.AutoPilotRun.StartAutoPilot", - "service:com.sun.star.frame.Frame", - "mailto:steffen.grund@germany.sun.com", "news:staroffice-doc", - "macro:/ExportWizard", "macro://Euro.AutoPilotRun.StartAutoPilot", - "service:com.sun.star.frame." - }; - - //with cws_loadenv01 changed to IllegalArgumentException - loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sEmptyDocs, "_blank", 0, - lProps); - - log.println("check case senstive URLs"); - - sIllegalArgs = new String[] { - "sLot:5000", "sloT:10909", ".unO:SaveAs", ".uno:OPEN", - }; - loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, - "_blank", 0, lProps); - - sEmptyDocs = new String[] { - "private:factory/SWRITER", "private:factory/SWRITER/WEB", - "macro:///importwizard.main.main", - "Macro:///euro.autopilotrun.startautopilot", - "Service:Com.Sun.Star.Frame.Frame", - "Mailto:andreas.schluens@germany.sun.com", "neWs:staroffice-doc", - "News:Staroffice-doc" - }; - - //with cws_loadenv01 changed to IllegalArgumentException - loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sEmptyDocs, "_blank", 0, - lProps); - - log.println("check FTP URLs"); - - String sFTPURL = (String) param.get("FtpAccess"); - Enumeration aSnapshot = m_lTestFiles.elements(); - - while (aSnapshot.hasMoreElements()) { - String doc = (String) aSnapshot.nextElement(); - - - // if os is windows - doc = doc.replace('\\', '/'); - if (doc.indexOf("CVS")<0) { - loadURL(m_xLoader, RESULT_VALID_DOC, sFTPURL + "/" + doc, - "_blank", 0, lProps); - } - } - - log.println("check HTTP URLs"); - - String sHTTPURL = (String) param.get("HttpAccess"); - aSnapshot = m_lTestFiles.elements(); - - while (aSnapshot.hasMoreElements()) { - String doc = (String) aSnapshot.nextElement(); - - - // if os is windows - doc = doc.replace('\\', '/'); - if (doc.indexOf("CVS")<0) { - loadURL(m_xLoader, RESULT_VALID_DOC, sHTTPURL + "/" + doc, - "_blank", 0, lProps); - } - } - } +// public void checkURLHandling() { +// PropertyValue[] lProps = new PropertyValue[1]; +// +// lProps[0] = new PropertyValue(); +// lProps[0].Name = "Hidden"; +// lProps[0].Value = Boolean.TRUE; +// +// System.out.println("check possible but unsupported URLs"); +// +// String[] sIllegalArgs = new String[] { +// "slot:5000", "slot:10909", ".uno:SaveAs", ".uno:Open", +// }; +// loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, +// "_blank", 0, lProps); +// +// System.out.println("check stupid URLs"); +// +// sIllegalArgs = new String[] { +// "slot:xxx", "slot:111111111", ".uno:save_as", ".uno:open_this", +// ".UnO:*", +// }; +// loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, +// "_blank", 0, lProps); +// +// String[] sEmptyDocs = new String[] { +// "mailo:hansi.meier@germany.sun.com", "file:/c:\\test/file.cxx", +// "file:///c|:\\test/file.cxx", "http_server://staroffice-doc\\", +// "c:\\\\test///\\test.sxw", "news_:staroffice-doc", +// "newsletter@blubber", "private_factory/swriter", +// "private:factory//swriter", "private:factory/swriter/___", +// "c:\\test\\test.sxw", "macro:///ImportWizard.Main.Main", +// "macro:///Euro.AutoPilotRun.StartAutoPilot", +// "service:com.sun.star.frame.Frame", +// "mailto:steffen.grund@germany.sun.com", "news:staroffice-doc", +// "macro:/ExportWizard", "macro://Euro.AutoPilotRun.StartAutoPilot", +// "service:com.sun.star.frame." +// }; +// +// //with cws_loadenv01 changed to IllegalArgumentException +// loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sEmptyDocs, "_blank", 0, +// lProps); +// +// System.out.println("check case senstive URLs"); +// +// sIllegalArgs = new String[] { +// "sLot:5000", "sloT:10909", ".unO:SaveAs", ".uno:OPEN", +// }; +// loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sIllegalArgs, +// "_blank", 0, lProps); +// +// sEmptyDocs = new String[] { +// "private:factory/SWRITER", "private:factory/SWRITER/WEB", +// "macro:///importwizard.main.main", +// "Macro:///euro.autopilotrun.startautopilot", +// "Service:Com.Sun.Star.Frame.Frame", +// "Mailto:andreas.schluens@germany.sun.com", "neWs:staroffice-doc", +// "News:Staroffice-doc" +// }; +// +// //with cws_loadenv01 changed to IllegalArgumentException +// loadURL(m_xLoader, RESULT_ILLEGALARGUMENTEXCEPTION, sEmptyDocs, "_blank", 0, +// lProps); +// +// System.out.println("check FTP URLs"); +// +// String sFTPURL = (String) param.get("FtpAccess"); +// Enumeration aSnapshot = m_lTestFiles.elements(); +// +// while (aSnapshot.hasMoreElements()) { +// String doc = (String) aSnapshot.nextElement(); +// +// +// // if os is windows +// doc = doc.replace('\\', '/'); +// if (doc.indexOf("CVS")<0) { +// loadURL(m_xLoader, RESULT_VALID_DOC, sFTPURL + "/" + doc, +// "_blank", 0, lProps); +// } +// } +// +// System.out.println("check HTTP URLs"); +// +// String sHTTPURL = (String) param.get("HttpAccess"); +// aSnapshot = m_lTestFiles.elements(); +// +// while (aSnapshot.hasMoreElements()) { +// String doc = (String) aSnapshot.nextElement(); +// +// +// // if os is windows +// doc = doc.replace('\\', '/'); +// if (doc.indexOf("CVS")<0) { +// loadURL(m_xLoader, RESULT_VALID_DOC, sHTTPURL + "/" + doc, +// "_blank", 0, lProps); +// } +// } +// } /** TODo document me */ - public void checkStreamLoading() + @Test public void checkStreamLoading() { PropertyValue[] lProps = new PropertyValue[2]; @@ -616,11 +607,13 @@ public class CheckXComponentLoader extends ComplexTestCase Enumeration aSnapshot = m_lTestFiles.elements(); while (aSnapshot.hasMoreElements()) { - File aFile = new File(m_sTestDocPath + fs_sys + (String) aSnapshot.nextElement()); + File aFile = new File(m_sTestDocPath, (String) aSnapshot.nextElement()); String sURL = URLHelper.getFileURLFromSystemPath(aFile); - if (sURL.indexOf("CVS") > -1) - continue; +// if (sURL.indexOf("CVS") > -1) +// { +// continue; +// } try { @@ -628,12 +621,15 @@ public class CheckXComponentLoader extends ComplexTestCase lProps[1].Value = xStream; } catch(com.sun.star.uno.Exception e) - { failed("Could not open test file \""+sURL+"\" for stream test."); } + { + fail("Could not open test file \""+sURL+"\" for stream test."); + } // check different version of "private:stream" URL! loadURL(m_xLoader, RESULT_VALID_DOC, "private:stream" , "_blank", 0, lProps); - loadURL(m_xLoader, RESULT_VALID_DOC, "private:stream/", "_blank", 0, lProps); - } + // loadURL(m_xLoader, RESULT_VALID_DOC, "private:stream" , "_blank", 0, lProps); + // loadURL(m_xLoader, RESULT_VALID_DOC, "private:stream/", "_blank", 0, lProps); + } } /** @@ -664,10 +660,8 @@ public class CheckXComponentLoader extends ComplexTestCase } catch (com.sun.star.io.IOException exIO) { nResult = RESULT_IOEXCEPTION; } catch (com.sun.star.uno.RuntimeException exRuntime) { - exRuntime.printStackTrace(); nResult = RESULT_RUNTIMEEXCEPTION; } catch (Exception e) { - e.printStackTrace(); nResult = RESULT_EXCEPTION; } @@ -677,22 +671,22 @@ public class CheckXComponentLoader extends ComplexTestCase xDoc = null; } } catch (com.sun.star.uno.RuntimeException exClosing) { - log.println("exception during disposing of a document found!" + + System.out.println("exception during disposing of a document found!" + " Doesn't influence test - but should be checked."); } String sMessage = "URL[\"" + sURL + "\"]"; if (nResult == nRequiredResult) { - log.println(sMessage + " expected result [" + + System.out.println(sMessage + " expected result [" + convertResult2String(nResult) + "] "); } else { - failed(sMessage + " unexpected result [" + + fail(sMessage + " unexpected result [" + convertResult2String(nResult) + "] " + "\nrequired was [" + convertResult2String(nRequiredResult) + "]" + - "\nwe got [" + convertResult2String(nResult) + "]", - true); + "\nwe got [" + convertResult2String(nResult) + "]" + ); } } @@ -700,8 +694,9 @@ public class CheckXComponentLoader extends ComplexTestCase String[] sURL, String sTarget, int nFlags, PropertyValue[] lProps) { for (int i = 0; i < sURL.length; i++) - loadURL(m_xLoader, nRequiredResult, sURL[i], sTarget, nFlags, - lProps); + { + loadURL(m_xLoader, nRequiredResult, sURL[i], sTarget, nFlags, lProps); + } } /** @@ -730,4 +725,28 @@ public class CheckXComponentLoader extends ComplexTestCase return "unknown!"; } -} \ No newline at end of file + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass + public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); + +} diff --git a/framework/qa/complex/loadAllDocuments/TestDocument.java b/framework/qa/complex/loadAllDocuments/TestDocument.java new file mode 100644 index 000000000000..fe41a6161c4a --- /dev/null +++ b/framework/qa/complex/loadAllDocuments/TestDocument.java @@ -0,0 +1,41 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +package complex.loadAllDocuments; + +import java.io.File; +import org.openoffice.test.OfficeFileUrl; + +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("testdocuments", name)); + } + + private TestDocument() {} +} diff --git a/framework/qa/complex/loadAllDocuments/helper/makefile.mk b/framework/qa/complex/loadAllDocuments/helper/makefile.mk index 98c414c2c1f7..05a3c7a997ea 100644 --- a/framework/qa/complex/loadAllDocuments/helper/makefile.mk +++ b/framework/qa/complex/loadAllDocuments/helper/makefile.mk @@ -24,10 +24,10 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ = ..$/..$/..$/.. +PRJ = ../../../.. TARGET = CheckXComponentLoader PRJNAME = framework -PACKAGE = complex$/loadAllDocuments$/helper +PACKAGE = complex/loadAllDocuments/helper # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk @@ -35,10 +35,9 @@ PACKAGE = complex$/loadAllDocuments$/helper #----- compile .java files ----------------------------------------- -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ - Generator.jar +JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar JAVAFILES = InteractionHandler.java StatusIndicator.java StreamSimulator.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)/$(PACKAGE)/$(i:b).class) MAXLINELENGTH = 100000 diff --git a/framework/qa/complex/loadAllDocuments/makefile.mk b/framework/qa/complex/loadAllDocuments/makefile.mk index 02aacd36d20d..dd2d78984da6 100644 --- a/framework/qa/complex/loadAllDocuments/makefile.mk +++ b/framework/qa/complex/loadAllDocuments/makefile.mk @@ -24,68 +24,110 @@ # for a copy of the LGPLv3 License. # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = CheckXComponentLoader -PRJNAME = framework -PACKAGE = complex$/loadAllDocuments - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ - OOoRunner.jar mysql.jar -JAVAFILES = CheckXComponentLoader.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -SUBDIRS = helper - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -# --- Parameters for the test -------------------------------------- +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_loadAllDocuments -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/loadAllDocuments -# test base is java complex -CT_TESTBASE = -TestBase java_complex +# here store only Files which contain a @Test +JAVATESTFILES = \ + CheckXComponentLoader.java -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# start the runner application -CT_APP = org.openoffice.Runner +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# --- Targets ------------------------------------------------------ +# subdirectories +SUBDIRS = helper -.IF "$(depend)" == "" -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR -.ELSE -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLDEP -.ENDIF +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -.INCLUDE : target.mk +.END -$(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : $(JAVAFILES:b).props - cp $(JAVAFILES:b).props $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props - jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(JAVAFILES:b).props +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) -tdoc $(PWD)$/testdocuments +.END +# +# +# PRJ = ..$/..$/.. +# TARGET = CheckXComponentLoader +# PRJNAME = framework +# PACKAGE = complex$/loadAllDocuments +# +# # --- Settings ----------------------------------------------------- +# .INCLUDE: settings.mk +# +# +# #----- compile .java files ----------------------------------------- +# +# JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar \ +# OOoRunner.jar mysql.jar +# JAVAFILES = +# JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) +# +# SUBDIRS = helper +# +# #----- make a jar from compiled files ------------------------------ +# +# MAXLINELENGTH = 100000 +# +# JARCLASSDIRS = $(PACKAGE) +# JARTARGET = $(TARGET).jar +# JARCOMPRESS = TRUE +# +# # --- Parameters for the test -------------------------------------- +# +# # start an office if the parameter is set for the makefile +# .IF "$(OFFICE)" == "" +# CT_APPEXECCOMMAND = +# .ELSE +# CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" +# .ENDIF +# +# # test base is java complex +# CT_TESTBASE = -TestBase java_complex +# +# # test looks something like the.full.package.TestName +# CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# +# # start the runner application +# CT_APP = org.openoffice.Runner +# +# # --- Targets ------------------------------------------------------ +# +# .IF "$(depend)" == "" +# $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLTAR +# .ELSE +# $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : ALLDEP +# .ENDIF +# +# .INCLUDE : target.mk +# +# $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props : $(JAVAFILES:b).props +# cp $(JAVAFILES:b).props $(CLASSDIR)$/$(PACKAGE)$/$(JAVAFILES:b).props +# jar uf $(CLASSDIR)$/$(JARTARGET) -C $(CLASSDIR) $(PACKAGE)$/$(JAVAFILES:b).props +# +# RUN: run +# +# run: +# +java -cp $(CLASSPATH) $(CT_APP) $(CT_TESTBASE) $(CT_APPEXECCOMMAND) $(CT_TEST) -tdoc $(PWD)$/testdocuments +# +# +# diff --git a/framework/qa/complex/path_settings/PathSettingsTest.java b/framework/qa/complex/path_settings/PathSettingsTest.java index cc896a74ea16..36abfd55bbde 100755 --- a/framework/qa/complex/path_settings/PathSettingsTest.java +++ b/framework/qa/complex/path_settings/PathSettingsTest.java @@ -27,432 +27,992 @@ package complex.path_settings; import com.sun.star.beans.Property; +import com.sun.star.beans.PropertyVetoException; +import com.sun.star.beans.UnknownPropertyException; import com.sun.star.beans.XFastPropertySet; import com.sun.star.beans.XMultiPropertySet; import com.sun.star.beans.XPropertySet; import com.sun.star.beans.XPropertiesChangeListener; import com.sun.star.beans.XPropertyChangeListener; import com.sun.star.beans.XVetoableChangeListener; +import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.AnyConverter; -import complexlib.ComplexTestCase; -public class PathSettingsTest extends ComplexTestCase { +// ---------- junit imports ----------------- +import java.util.ArrayList; +import java.util.StringTokenizer; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + +public class PathSettingsTest +{ private static XMultiServiceFactory xMSF; - // the test object: an instance of the tested service - private static Object oObj = null; + private static Object aPathSettings = null; // the properties of the service - private static Property[] props = null; - private static String[] propNames = null; - private static String[] availablePropNames = new String[]{ - "Addin", - "AutoCorrect", - "Autotext", - "Backup", - "Basic", - "Bitmap", - "Config", - "Dictionary", - "Favorite", - "Filter", - "Gallery", - "Help", - "Linguistic", - "Module", - "Palette", - "Plugin", - "Temp", - "Template", - "UIConfig", - "UserConfig", - "UserDictionary", - "Work", -}; - private static String[] propVals = null; + private static Property[] xPropertyInfoOfPathSettings = null; + private static String[] aPathSettingNames = null; + private static String[] availablePropNames = new String[] + { + "Addin", + "AutoCorrect", + "AutoText", + "Backup", + "Basic", + "Bitmap", + "Config", + "Dictionary", + "Favorite", + "Filter", + "Fingerprint", + "Gallery", + "Graphic", + "Help", + "Linguistic", + "Module", + "Palette", + "Plugin", + "Storage", + "Temp", + "Template", + "UIConfig", + "UserConfig", + "Work", + }; + // every path name from availablePropNames exist in this characteristics + // name + // name_internal + // name_user + // name_writable + private static String[] availablePropNameExtensions = new String[] + { + "", + "_internal", + "_user", + "_writable" + }; + private static String[] aPathSettingValues = null; + ArrayList aListOfWorkingProperty; /** * A function to tell the framework, which test functions are available. * Right now, it's only 'checkComplexTemplateState'. * @return All test methods. */ - public String[] getTestMethodNames() { - return new String[]{"checkXFastPropertySet", - "checkXMultiPropertySet", - "checkXPropertySet" - }; - } - +// public String[] getTestMethodNames() { +// return new String[]{"checkXFastPropertySet", +// "checkXMultiPropertySet", +// "checkXPropertySet" +// }; +// } /** * Initialize before the tests start: this has to be done only once. - * This methods sets the 'oObj' and 'props' variables. + * This methods sets the 'aPathSettings' and 'xPropertyInfoOfPathSettings' variables. */ - public void before() { - try { - xMSF = (XMultiServiceFactory)param.getMSF(); -// oObj = xMSF.createInstance("com.sun.star.util.PathSettings"); - oObj = xMSF.createInstance("com.sun.star.comp.framework.PathSettings"); - System.out.println("Implementation: " + util.utils.getImplName(oObj)); - System.out.println("Service: "); - util.dbg.getSuppServices(oObj); - if (oObj == null) throw new com.sun.star.uno.Exception(); - XPropertySet xProp = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); - - props = xProp.getPropertySetInfo().getProperties(); - propNames = new String[props.length]; - propVals = new String[props.length]; + @Before + public void before() + { + try + { + xMSF = getMSF(); +// aPathSettings = xMSF.createInstance("com.sun.star.util.PathSettings"); + aPathSettings = xMSF.createInstance("com.sun.star.comp.framework.PathSettings"); + assertNotNull("Can't instantiate com.sun.star.util.PathSettings.", aPathSettings); +// System.out.println("Implementation: " + util.utils.getImplName(aPathSettings)); +// System.out.println("Service: "); + util.dbg.getSuppServices(aPathSettings); + final XPropertySet xPropSet_of_PathSettings = UnoRuntime.queryInterface(XPropertySet.class, aPathSettings); + + xPropertyInfoOfPathSettings = xPropSet_of_PathSettings.getPropertySetInfo().getProperties(); + aPathSettingNames = new String[xPropertyInfoOfPathSettings.length]; + aPathSettingValues = new String[xPropertyInfoOfPathSettings.length]; + + aListOfWorkingProperty = new ArrayList(); // get intitial values and create new ones - log.println("\n---- All properties ----"); - for (int i = 1; i < props.length; i++) { - propNames[i] = props[i].Name; - Object o = xProp.getPropertyValue(propNames[i]); - System.out.println("#### Object: " + o.getClass().getName() + " - " + o.toString()); - propVals[i] = AnyConverter.toString(o); - System.out.println("#### String " + propVals[i]); - log.println("Property Name: " + propNames[i]); - log.println("Property Value: " + propVals[i]); - } - log.println("---- Finish showing properties ----\n"); - } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(); - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Could not create an instance of the test object."); - } - catch(Exception e) { - e.printStackTrace(); - failed("What exception?"); + for (int i = 0; i < xPropertyInfoOfPathSettings.length; i++) + { + final String sName = xPropertyInfoOfPathSettings[i].Name; + // System.out.println(sName); + aPathSettingNames[i] = sName; + Object o = xPropSet_of_PathSettings.getPropertyValue(sName); + + String sValue = convertToString(o); + aPathSettingValues[i] = sValue; + aListOfWorkingProperty.add(xPropertyInfoOfPathSettings[i]); + } + } + catch (com.sun.star.uno.Exception e) + { + System.out.println(e.getClass().getName()); + System.out.println("Message: " + e.getMessage()); + // fail("Could not create an instance of the test object."); + } + catch (Exception e) + { + fail("What exception?"); } } + private String convertToString(Object o) + { + String sValue = ""; + try + { + if (AnyConverter.isString(o)) + { + sValue = AnyConverter.toString(o); + } + else if (AnyConverter.isArray(o)) + { + Object oValueList = AnyConverter.toArray(o); + String[] aValueList = (String[]) oValueList; + String sValues = ""; + for (int j = 0; j < aValueList.length; j++) + { + if (sValues.length() > 0) + { + sValues += ";"; + } + sValues += aValueList[j]; + } + sValue = sValues; + } + else + { + System.out.println("Can't convert Object to String"); + } + } + catch (com.sun.star.uno.Exception e) + { + /* ignore */ + } + return sValue; + } + /** - * This tests the XFastPropertySet interface implementation. + * Simple existance test, if this fails, the Lists must update */ - public void checkXFastPropertySet() + @Test + public void checkInternalListConsistence() { - log.println("---- Testing the XFastPropertySet interface ----"); - - // creating instances - XFastPropertySet xFPS = (XFastPropertySet) - UnoRuntime.queryInterface(XFastPropertySet.class, oObj); - - String name = null; - // do for all properties - for (int i = 0; i < props.length; i++) { - try { - Property property = props[i]; - name = property.Name; - int handle = property.Handle; - - // get property name and initial value - log.println("Test property with name: " + name); - String val = (String)xFPS.getFastPropertyValue(handle); - log.println("Property has initial value: '" + val + "'"); - - // set to a new correct value - String newVal = changeToCorrectValue(val); - log.println("Try to change to correct value '" + newVal + "'"); - xFPS.setFastPropertyValue(handle, newVal); + // check if all Properties are in the internal test list + for (int i = 0; i < xPropertyInfoOfPathSettings.length; i++) + { + final String sName = xPropertyInfoOfPathSettings[i].Name; + boolean bOccur = checkIfNameExistsInList(sName, availablePropNames, availablePropNameExtensions); + assertTrue("TEST IS WRONG, Name:='" + sName + "' doesn't exist in internal Test list.", bOccur); + } - // check the change - String checkVal = (String)xFPS.getFastPropertyValue(handle); - assure("Did not change value on property " + name + ".", checkVal.equals(newVal)); + // check if all properties in the internal list also exist in real life + for (int i = 0; i < availablePropNames.length; i++) + { + final String aListName = availablePropNames[i]; + for (int j = 0; j < availablePropNameExtensions.length; j++) + { + final String aSubListName = availablePropNameExtensions[j]; + final String aName = aListName + aSubListName; + boolean bOccur = checkIfNameExistsInList(aName, aPathSettingNames, new String[] + { + "" + } /* list must not empty! */); + assertTrue("TEST IS WRONG, Name:='" + aName + "' from the internal test list do not occur in real life path settings.", bOccur); + } + } + } - newVal = changeToIncorrectValue(val); - log.println("Try to change to incorrect value '" + newVal + "'"); - try { - xFPS.setFastPropertyValue(handle, newVal); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - log.println("Correctly thrown Exception caught."); + /** + * Simple O(n^n) check if a given String (_sNameMustOccur) exist in the given list(+SubList) values. + * @param _sNameMustOccur + * @param _aList + * @param _aSubList + * @return true, if name occur + */ + private boolean checkIfNameExistsInList(String _sNameMustOccur, String[] _aList, String[] _aSubList) + { + for (int i = 0; i < _aList.length; i++) + { + final String aListName = _aList[i]; + for (int j = 0; j < _aSubList.length; j++) + { + final String aSubListName = _aSubList[j]; + final String aName = aListName + aSubListName; + if (aName.equals(_sNameMustOccur)) + { + return true; } + } + } + return false; + } - // check if changed - checkVal = (String)xFPS.getFastPropertyValue(handle); - assure("Value did change on property " + name + " though it should not have.", - !checkVal.equals(newVal)); - - // set back to initial setting - xFPS.setFastPropertyValue(handle, val); - - // check if changed - checkVal = (String)xFPS.getFastPropertyValue(handle); - assure("Did not change value back to original on property " - + name, checkVal.equals(val)); - log.println("Test of property " + name + " finished\n"); + private String getPropertyValueAsString(String _sName) + { + final XPropertySet xPropSet_of_PathSettings = UnoRuntime.queryInterface(XPropertySet.class, aPathSettings); + String sValue = ""; + { + Object o; + try + { + o = xPropSet_of_PathSettings.getPropertyValue(_sName); + sValue = convertToString(o); + } + catch (UnknownPropertyException ex) + { } - catch(com.sun.star.uno.Exception e) { -// e.printStackTrace(); - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Unexpected exception on property " + name + "."); - continue; + catch (WrappedTargetException ex) + { } } - log.println("---- Test of XFastPropertySet finished ----\n"); + return sValue; } - - // ____________________ /** - * This tests the XMultiPropertySet interface implementation. + * Shows the path settings + * @throws UnknownPropertyException + * @throws WrappedTargetException */ - public void checkXMultiPropertySet() + @Test + public void showPathSettings() throws UnknownPropertyException, WrappedTargetException + { + System.out.println("\n---- All properties ----"); + final XPropertySet xPropSet_of_PathSettings = UnoRuntime.queryInterface(XPropertySet.class, aPathSettings); + +// for (int i = 0; i < xPropertyInfoOfPathSettings.length; i++) + for (int i = 0; i < aListOfWorkingProperty.size(); i++) + { + final String sName = aListOfWorkingProperty.get(i).Name; + // aPathSettingWorkingNames[i] = sName; +// System.out.print("PathSettings: Name:="); + System.out.print(sName); + Object o = xPropSet_of_PathSettings.getPropertyValue(sName); + + // System.out.println("#### Object: '" + o.getClass().getName() + "' - '" + o.toString() + "'"); + try + { + final String sValue = AnyConverter.toString(o); + // aPathSettingValues[i] = sValue; + // System.out.println("#### String " + sValue); + // System.out.println("Property Name: " + sName); + // System.out.println("Property Value: " + sValue); +// System.out.print(" ==> "); +// System.out.print(sValue); + } + catch (com.sun.star.uno.Exception e) + { +// System.out.print(" FAILED "); + } + System.out.println(); + } + System.out.println("---- Finish showing properties ----\n"); + } + + private boolean checkPaths(Object _o, Object _o2) { - log.println("---- Testing the XMultiPropertySet interface ----"); - XMultiPropertySet xMPS = (XMultiPropertySet) - UnoRuntime.queryInterface(XMultiPropertySet.class, oObj); - - String[] correctVals = new String[props.length]; - String[] incorrectVals = new String[props.length]; - - // get intitial values and create new ones - for (int i = 0; i < props.length; i++) { - correctVals[i] = changeToCorrectValue(propVals[i]); - incorrectVals[i] = changeToIncorrectValue(propVals[i]); - } - - try { - // add a change listener - MyChangeListener mListener = new MyChangeListener(); - xMPS.addPropertiesChangeListener(propNames, mListener); - - // first change props to correct values - log.println("Change to correct values."); - xMPS.setPropertyValues(propNames, correctVals); - assure("Could not change to correct values with XMultiPropoertySet.", - verifyPropertySet(xMPS,propNames,correctVals)>0); - - // second, change to incorrect values: expect an exception - log.println("Try to change to incorrect values."); - try { - xMPS.setPropertyValues(propNames, incorrectVals); - } - catch(com.sun.star.lang.IllegalArgumentException r) { - log.println("Correctly thrown Exception caught."); - } - assure("Did change to incorrect values with XMultiPropertySet," + - " but should not have.", - verifyPropertySet(xMPS,propNames,correctVals)>0); - - // third, change back to initial values - log.println("Change back to initial values."); - xMPS.setPropertyValues(propNames, propVals); - assure("Could not change back to initial values with" + - " XMultiPropertySet.", - verifyPropertySet(xMPS,propNames,propVals)>0); - - // fire the event for the listener - log.println("Fire event."); - xMPS.firePropertiesChangeEvent(propNames, mListener); - assure("Event was not fired on XMultiPropertySet.", - mListener.changePropertiesEventFired()); - } - catch(com.sun.star.uno.Exception e) { -// e.printStackTrace(); - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Unexpected exception on XMultiPropertySet."); - } - - // test finished - log.println("---- Test of XMultiPropertySet finished ----\n"); + String sLeftPath = ""; + String sRightPath = ""; + if (AnyConverter.isArray(_o)) + { + try + { + Object oValues = AnyConverter.toArray(_o); + sLeftPath = convertToString(oValues); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + } + } + else if (AnyConverter.isString(_o)) + { + try + { + sLeftPath = AnyConverter.toString(_o); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + } + } + + if (AnyConverter.isArray(_o2)) + { + try + { + Object oValues = AnyConverter.toArray(_o2); + sRightPath = convertToString(oValues); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + } + } + else if (AnyConverter.isString(_o2)) + { + try + { + sRightPath = AnyConverter.toString(_o2); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + } + } + return checkPaths(sLeftPath, sRightPath); } /** - * Verify if the values of xProp are the same as vals. - * @param xProp A XMultiPropertySet. - * @param propNames An array with property names. - * @param vals An array with values of the properties - * @return -1 if none are equal, 1 if all are equal, 0 if some were equal - * and some not. - * @throws com.sun.star.lang.IllegalArgumentException + * Check 2 given paths if the _aOtherPath exists in _aPath, _aPath could be a list separated by ';' + * @param _aPath + * @param _aOtherPath + * @return true, if _aOtherPath found */ - private int verifyPropertySet(XMultiPropertySet xProp, - String[] propNames, String[] vals) + private boolean checkPaths(String _aPath, String _aOtherPath) { - int ret=0; - if (vals.length != propNames.length) { - log.println("Length of array parameters must be equal."); - return ret; - } - for (int i = 0; i < vals.length; i++) { - Object[] objs = xProp.getPropertyValues(new String[]{propNames[i]}); - String retVal = (String)objs[0]; - boolean nCheck = retVal.equals(vals[i]); - if (!nCheck) { - log.println("Property '" + propNames[i] + - "' was supposed to have value:"); - log.println(vals[i]); - log.println("but has value:"); - log.println(retVal); - } - // initialize - if (i==0) { - ret = nCheck?1:-1; - continue; - } - // return 0 if equal state changes compared to initial value - if ((nCheck && ret<0) || (!nCheck && ret>0)) { - ret = 0; - } - } - return ret; + if (_aOtherPath.contains(";")) + { + StringTokenizer aToken = new StringTokenizer(_aOtherPath, ";"); + int nCount = 0; + int nFound = 0; + while (aToken.hasMoreElements()) + { + String sPath = (String)aToken.nextElement(); + nCount ++; + if (checkPaths(_aPath, sPath)) + { + nFound++; + } + } + if (nFound == nCount) + { + return true; + } + } + else if(_aPath.contains(";")) + { + StringTokenizer aToken = new StringTokenizer(_aPath, ";"); + while (aToken.hasMoreElements()) + { + String sToken = (String)aToken.nextElement(); + if (sToken.equals(_aOtherPath)) + { + return true; + } + } + return false; + } + else if (_aPath.equals(_aOtherPath)) + { + return true; + } + return false; } - - // ____________________ /** - * This tests the XPropertySet interface implementation. + * This tests the XFastPropertySet interface implementation. */ - public void checkXPropertySet() + @Test + public void checkXFastPropertySet() + { + System.out.println("---- Testing the XFastPropertySet interface ----"); + + + // do for all properties + // xPropertyInfoOfPathSettings.length + for (int i = 0; i < aListOfWorkingProperty.size(); i++) + { + final Property property = aListOfWorkingProperty.get(i); // xPropertyInfoOfPathSettings[i]; + String name = property.Name; + // get property name and initial value + System.out.println("Test property with name: " + name); + boolean bResult; + if (name.endsWith("_writable")) + { + bResult = checkStringProperty(property); + } + else if (name.endsWith("_user")) + { + bResult = checkStringListProperty(property); + } + else if (name.endsWith("_internal")) + { + bResult = checkStringListProperty(property); + } + else + { + // old path settings + bResult = checkStringProperty(property); + } + System.out.print(" Test of property " + name + " finished"); + if (bResult) + { + System.out.println(" [ok]"); + } + else + { + System.out.println(" [FAILED]"); + } + System.out.println(); + } + System.out.println("---- Test of XFastPropertySet finished ----\n"); + } + + private boolean checkStringListProperty(Property property) { - log.println("---- Testing the XPropertySet interface ----"); + // creating instances + boolean bResult = true; + XFastPropertySet xFPS = UnoRuntime.queryInterface(XFastPropertySet.class, aPathSettings); - XPropertySet xPS = (XPropertySet) - UnoRuntime.queryInterface(XPropertySet.class, oObj); + String name = property.Name; + int handle = property.Handle; - MyChangeListener mListener1 = new MyChangeListener(); - MyChangeListener mListener2 = new MyChangeListener(); + Object oValue; + try + { + oValue = xFPS.getFastPropertyValue(handle); + } + catch (UnknownPropertyException ex) + { + return false; + } + catch (WrappedTargetException ex) + { + return false; + } - for (int i=0; i 0) + { + val = aValues[0]; + } + else + { + val = null; + aNewValues = new String[1]; // create a String list + } + System.out.println(" Property has initial value: '" + val + "'"); - log.println("Remove Listener 1."); + // set to a new correct value + String newVal = changeToCorrectValue(val); + assertFalse("newVal must not equal val.", newVal.equals(val)); - xPS.removePropertyChangeListener(name, mListener1); - xPS.removeVetoableChangeListener(name, mListener1); + System.out.println(" Try to change to a correct value '" + newVal + "'"); + aNewValues[0] = newVal; - // change the property - log.println("Change value back."); - xPS.setPropertyValue(name, propVals[i]); - newVal = (String)xPS.getPropertyValue(name); - assure("Value did not change on property " + name, - newVal.equals(propVals[i])); + try + { + try + { + xFPS.setFastPropertyValue(handle, aNewValues); + } + catch (com.sun.star.lang.WrappedTargetException e) + { + System.out.println(" FAIL: setFastPropertyValue(handle:=" + handle + ", name:='" + name + "')" + e.getMessage()); + bResult = false; + } + + // Property_internal can't change we will not arrive bejond this line + + // check the change + Object oObj = xFPS.getFastPropertyValue(handle); + if (!checkPaths(oObj, aNewValues)) + { + System.out.println(" FAIL: Did not change value on property " + name + "."); + bResult = false; + } - assure("Listener was called, although it was removed on" + - " property " + name + ".", !checkListener(mListener1), true); - assure("Listener 2 was not called on property " + name + ".", - checkListener(mListener2), true); + // set back to initial setting + System.out.println(" Try to check"); + try + { + xFPS.setFastPropertyValue(handle, oValue); + } + catch (com.sun.star.beans.PropertyVetoException e) + { + // should not occur + System.out.println(" FAIL: PropertyVetoException caught: " + e.getMessage()); + bResult = false; + } } - catch(com.sun.star.uno.Exception e) { - e.printStackTrace(); - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Unexpcted exception on property " + name); - continue; + catch (com.sun.star.beans.PropertyVetoException e) + { + if (!name.endsWith("_internal")) + { + // should not occur + System.out.println(" FAIL: PropertyVetoException caught: " + e.getMessage()); + bResult = false; + } + else + { + System.out.println(" OK: PropertyVetoException caught: " + e.getMessage() + " it seems not allowed to change internal values."); + } } - log.println("Finish testing property '" + propNames[i] + "'\n"); - } - log.println("---- Test of XPropertySet finished ----\n"); + // check if changed + Object checkVal3 = xFPS.getFastPropertyValue(handle); + if (!checkPaths(checkVal3, oValues)) + { + System.out.println(" FAIL: Can't change value back to original on property " + name); + bResult = false; + } + } + catch (com.sun.star.uno.Exception e) + { + System.out.println(" FAIL: getFastPropertyValue(handle:=" + handle + ", name:='" + name + "')" + e.getMessage()); + bResult = false; + } + return bResult; } - private boolean checkListener(MyChangeListener ml) { - return ml.changePropertyEventFired() || - ml.changePropertiesEventFired() || - ml.vetoableChangeEventFired(); + private boolean checkStringProperty(Property property) + { + boolean bResult = true; + XFastPropertySet xFPS = UnoRuntime.queryInterface(XFastPropertySet.class, aPathSettings); + String name = property.Name; + int handle = property.Handle; + Object oValue; + try + { + oValue = xFPS.getFastPropertyValue(handle); + } + catch (UnknownPropertyException ex) + { + return false; + } + catch (WrappedTargetException ex) + { + return false; + } + + + try + { + String val = ""; + val = AnyConverter.toString(oValue); + System.out.println(" Property has initial value: '" + val + "'"); + + // set to a new correct value + String newVal = changeToCorrectValue(val); + System.out.println(" Try to change to a correct value '" + newVal + "'"); + xFPS.setFastPropertyValue(handle, newVal); + + // check the change + String checkVal = (String) xFPS.getFastPropertyValue(handle); + if (!checkPaths(checkVal, newVal)) + { + System.out.println(" FAIL: Did not change value on property " + name + "."); + bResult = false; + } + newVal = changeToIncorrectValue(val); + System.out.println(" Try to change to incorrect value '" + newVal + "'"); + try + { + xFPS.setFastPropertyValue(handle, newVal); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + System.out.println(" Correctly thrown Exception caught."); + } + + // check if changed + String checkVal2 = (String) xFPS.getFastPropertyValue(handle); + if (!checkPaths(checkVal2, checkVal)) + { + System.out.println(" FAIL: Value did change on property " + name + " though it should not have."); + bResult = false; + } + else + { + System.out.println(" OK: Incorrect value was not set."); + } + // set back to initial setting + System.out.println(" Set back to initial value."); + try + { + xFPS.setFastPropertyValue(handle, val); + } + catch (com.sun.star.lang.IllegalArgumentException e) + { + System.out.println(" IllegalArgumentException caught: " + e.getMessage()); + bResult = false; + } + // check if changed + String checkVal3 = (String) xFPS.getFastPropertyValue(handle); + if (!checkVal3.equals(val)) + { + if (!checkPaths(checkVal3, val)) + { + System.out.println(" FAIL: Can't change value back to original on property " + name); + System.out.println(" Value is: " + checkVal3); + + bResult = false; + } + else + { + System.out.println(" OK: the pathsettings contains the original path."); + System.out.println(" Value is: " + checkVal3); + System.out.println(" Value should be: " + val); + } + } + else + { + System.out.println(" OK: Change value back to original on property " + name); + } + } + catch (com.sun.star.uno.Exception e) + { + System.out.println(" FAIL: getFastPropertyValue(handle:=" + handle + ", name:='" + name + "')" + e.getMessage()); + bResult = false; + } + return bResult; } + // ____________________ + /** + * This tests the XMultiPropertySet interface implementation. + */ + + // The test checkXMultiPropertySet() has been marked as outdated! + +// @Test +// public void checkXMultiPropertySet() +// { +// System.out.println("---- Testing the XMultiPropertySet interface ----"); +// XMultiPropertySet xMPS = UnoRuntime.queryInterface(XMultiPropertySet.class, aPathSettings); +// +// // xPropertyInfoOfPathSettings.length +// String[] propertiesToTest = new String[1]; +// propertiesToTest[0] = availablePropNames[0]; +// +// String[] correctVals = new String[propertiesToTest.length]; +// String[] incorrectVals = new String[propertiesToTest.length]; +// +// String[] aPathSettingWorkingNames = null; +// aPathSettingWorkingNames = new String[propertiesToTest.length]; +// +// // get intitial values and create new ones +// for (int i = 0; i < propertiesToTest.length; i++) +// { +// // Property aProp = aListOfWorkingProperty.get(i); +// final String sName = propertiesToTest[i]; +// final String sValue = getPropertyValueAsString(sName); +// aPathSettingWorkingNames[i] = sName; +// correctVals[i] = changeToCorrectValue(sValue); +// incorrectVals[i] = changeToIncorrectValue(sValue); +// } +// +// try +// { +// // add a change listener +// MyChangeListener mListener = new MyChangeListener(); +// xMPS.addPropertiesChangeListener(aPathSettingWorkingNames, mListener); +// +// // first change xPropertyInfoOfPathSettings to correct values +// System.out.println("Change to correct values."); +// xMPS.setPropertyValues(aPathSettingWorkingNames, correctVals); +// assertTrue("Could not change to correct values with XMultiPropertySet.", +// verifyPropertySet(xMPS, aPathSettingWorkingNames, correctVals) > 0); +// +// // second, change to incorrect values: expect an exception +// System.out.println("Try to change to incorrect values."); +// try +// { +// xMPS.setPropertyValues(aPathSettingWorkingNames, incorrectVals); +// } +// catch (com.sun.star.lang.IllegalArgumentException r) +// { +// System.out.println("Correctly thrown Exception caught."); +// } +// assertTrue("Did change to incorrect values with XMultiPropertySet," +// + " but should not have.", +// verifyPropertySet(xMPS, aPathSettingWorkingNames, correctVals) > 0); +// +// // third, change back to initial values +// System.out.println("Change back to initial values."); +// xMPS.setPropertyValues(aPathSettingWorkingNames, aPathSettingValues); +// assertTrue("Could not change back to initial values with" +// + " XMultiPropertySet.", +// verifyPropertySet(xMPS, aPathSettingWorkingNames, aPathSettingValues) > 0); +// +// // fire the event for the listener +// System.out.println("Fire event."); +// xMPS.firePropertiesChangeEvent(aPathSettingWorkingNames, mListener); +// assertTrue("Event was not fired on XMultiPropertySet.", +// mListener.changePropertiesEventFired()); +// } +// catch (com.sun.star.uno.Exception e) +// { +//// e.printStackTrace(); +// System.out.println(e.getClass().getName()); +// System.out.println("Message: " + e.getMessage()); +// fail("Unexpected exception on XMultiPropertySet."); +// } +// +// // test finished +// System.out.println("---- Test of XMultiPropertySet finished ----\n"); +// } + + /** + * Verify if the values of xPropSet_of_PathSettings are the same as vals. + * @param xPropSet_of_PathSettings A XMultiPropertySet. + * @param aPathSettingWorkingNames An array with property names. + * @param vals An array with values of the properties + * @return -1 if none are equal, 1 if all are equal, 0 if some were equal + * and some not. + * @throws com.sun.star.lang.IllegalArgumentException + */ +// private int verifyPropertySet(XMultiPropertySet xProp, +// String[] propNames, String[] vals) +// { +// int ret = 0; +// if (vals.length != propNames.length) +// { +// System.out.println("Length of array parameters must be equal."); +// return ret; +// } +// for (int i = 0; i < vals.length; i++) +// { +// Object[] objs = xProp.getPropertyValues(new String[] +// { +// propNames[i] +// }); +// String retVal = (String) objs[0]; +// boolean nCheck = retVal.equals(vals[i]); +// if (!nCheck) +// { +// System.out.println("Property '" + propNames[i] +// + "' was supposed to have value:"); +// System.out.println(vals[i]); +// System.out.println("but has value:"); +// System.out.println(retVal); +// } +// // initialize +// if (i == 0) +// { +// ret = nCheck ? 1 : -1; +// continue; +// } +// // return 0 if equal state changes compared to initial value +// if ((nCheck && ret < 0) || (!nCheck && ret > 0)) +// { +// ret = 0; +// } +// } +// return ret; +// } + + // ____________________ + /** + * This tests the XPropertySet interface implementation. + */ + +// The test checkXPropertySet() has been marked as outdated! + + +// @Test +// public void checkXPropertySet() +// { +// System.out.println("---- Testing the XPropertySet interface ----"); +// +// XPropertySet xPS = UnoRuntime.queryInterface(XPropertySet.class, aPathSettings); +// +// MyChangeListener mListener1 = new MyChangeListener(); +// MyChangeListener mListener2 = new MyChangeListener(); +// +// for (int i = 0; i < xPropertyInfoOfPathSettings.length; i++) +// { +// // adding listeners +// String name = aPathSettingNames[i]; +// System.out.println("Testing property '" + name + "'"); +// try +// { +// System.out.println("Add 2 Listeners."); +// xPS.addPropertyChangeListener(name, mListener1); +// xPS.addVetoableChangeListener(name, mListener1); +// xPS.addPropertyChangeListener(name, mListener2); +// xPS.addVetoableChangeListener(name, mListener2); +// +// // change the property +// System.out.println("Change value."); +// String changeVal = changeToCorrectValue(aPathSettingValues[i]); +// xPS.setPropertyValue(name, changeVal); +// String newVal = (String) xPS.getPropertyValue(name); +// +// assertTrue("Value did not change on property " + name + ".", +// newVal.equals(changeVal)); +// +// assertTrue("Listener 1 was not called.", checkListener(mListener1)); +// assertTrue("Listener 2 was not called.", checkListener(mListener2)); +// +// mListener1.resetListener(); +// mListener2.resetListener(); +// +// System.out.println("Remove Listener 1."); +// +// xPS.removePropertyChangeListener(name, mListener1); +// xPS.removeVetoableChangeListener(name, mListener1); +// +// // change the property +// System.out.println("Change value back."); +// xPS.setPropertyValue(name, aPathSettingValues[i]); +// newVal = (String) xPS.getPropertyValue(name); +// assertTrue("Value did not change on property " + name, +// newVal.equals(aPathSettingValues[i])); +// +// assertTrue("Listener was called, although it was removed on" +// + " property " + name + ".", !checkListener(mListener1)); +// assertTrue("Listener 2 was not called on property " + name + ".", +// checkListener(mListener2)); +// } +// catch (com.sun.star.uno.Exception e) +// { +// System.out.println(e.getClass().getName()); +// System.out.println("Message: " + e.getMessage()); +// fail("Unexpcted exception on property " + name); +// } +// System.out.println("Finish testing property '" + aPathSettingNames[i] + "'\n"); +// } +// System.out.println("---- Test of XPropertySet finished ----\n"); +// +// } + +// private boolean checkListener(MyChangeListener ml) +// { +// return ml.changePropertyEventFired() +// || ml.changePropertiesEventFired() +// || ml.vetoableChangeEventFired(); +// } + // ____________________ /** * Change the given String to a correct path URL. * @return The changed path URL. */ - private String changeToCorrectValue(String path) { + private String changeToCorrectValue(String path) + { // the simplest possiblity - if ( path == null || path.equals("") ) { - return "file:///tmp"; + if (path == null || path.equals("")) + { + String sTempDir = System.getProperty("java.io.tmpdir"); + sTempDir = util.utils.getFullURL(sTempDir); + return sTempDir; // "file:///tmp"; } - return path + "/tmp"; + return graphical.FileHelper.appendPath(path, "tmp"); } - /** * Change the given String to an incorrect path URL. * @return The changed path URL. */ - private String changeToIncorrectValue(String path) { - // the simplest possiblity + private String changeToIncorrectValue(String path) + { + // return an illegal path return "fileblablabla"; } - /** - * Listener implementation which sets a flag when - * listener was called. - */ + * Listener implementation which sets a flag when + * listener was called. + */ public class MyChangeListener implements XPropertiesChangeListener, - XPropertyChangeListener, - XVetoableChangeListener { - - private boolean propChanged = false; - private boolean propertiesChanged = false; - private boolean disposeCalled = false; - private boolean vetoableChanged = false; - - public void propertiesChange( - com.sun.star.beans.PropertyChangeEvent[] e) { - propertiesChanged = true; - } - - public void vetoableChange(com.sun.star.beans.PropertyChangeEvent pE) - throws com.sun.star.beans.PropertyVetoException { - vetoableChanged = true; - } - - public void propertyChange(com.sun.star.beans.PropertyChangeEvent pE) { - propChanged = true; - } - - public void disposing(com.sun.star.lang.EventObject eventObject) { - disposeCalled = true; - } - - public void resetListener() { - propChanged = false; - propertiesChanged = false; - disposeCalled = false; - vetoableChanged = false; - } - - public boolean changePropertyEventFired() { - return propChanged; - } - public boolean changePropertiesEventFired() { - return propertiesChanged; - } - public boolean vetoableChangeEventFired() { - return vetoableChanged; - } + XPropertyChangeListener, + XVetoableChangeListener + { - }; + private boolean propChanged = false; + private boolean propertiesChanged = false; + private boolean disposeCalled = false; + private boolean vetoableChanged = false; + + public void propertiesChange( + com.sun.star.beans.PropertyChangeEvent[] e) + { + propertiesChanged = true; + } + + public void vetoableChange(com.sun.star.beans.PropertyChangeEvent pE) + throws com.sun.star.beans.PropertyVetoException + { + vetoableChanged = true; + } + + public void propertyChange(com.sun.star.beans.PropertyChangeEvent pE) + { + propChanged = true; + } + + public void disposing(com.sun.star.lang.EventObject eventObject) + { + disposeCalled = true; + } + + public void resetListener() + { + propChanged = false; + propertiesChanged = false; + disposeCalled = false; + vetoableChanged = false; + } + + public boolean changePropertyEventFired() + { + return propChanged; + } + + public boolean changePropertiesEventFired() + { + return propertiesChanged; + } + + public boolean vetoableChangeEventFired() + { + return vetoableChanged; + } + } + + private XMultiServiceFactory getMSF() + { + final XMultiServiceFactory xMSF1 = UnoRuntime.queryInterface(XMultiServiceFactory.class, connection.getComponentContext().getServiceManager()); + return xMSF1; + } + + // setup and close connections + @BeforeClass + public static void setUpConnection() throws Exception + { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass + public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + private static final OfficeConnection connection = new OfficeConnection(); } diff --git a/framework/qa/complex/path_settings/makefile.mk b/framework/qa/complex/path_settings/makefile.mk index 70af7817aca3..21586cc9435b 100755 --- a/framework/qa/complex/path_settings/makefile.mk +++ b/framework/qa/complex/path_settings/makefile.mk @@ -25,60 +25,41 @@ # #************************************************************************* -PRJ = ..$/..$/.. -TARGET = PathSettings -PRJNAME = $(TARGET) -PACKAGE = complex$/path_settings - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar mysql.jar -JAVAFILES = PathSettingsTest.java -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) - -#----- make a jar from compiled files ------------------------------ +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +# @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." +.ELSE -MAXLINELENGTH = 100000 +PRJ = ../../.. +PRJNAME = framework +TARGET = qa_complex_path_settings -JARCLASSDIRS = $(PACKAGE) -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = complex/path_settings -# --- Parameters for the test -------------------------------------- +# here store only Files which contain a @Test +JAVATESTFILES = \ + PathSettingsTest.java -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF +# put here all other files +JAVAFILES = $(JAVATESTFILES) -# test base is java complex -CT_TESTBASE = -TestBase java_complex +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).$(JAVAFILES:b) +# subdirectories +# SUBDIRS = helper -# start the runner application -CT_APP = org.openoffice.Runner +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -# --- Targets ------------------------------------------------------ +.END -.IF "$(depend)" == "" -ALL : ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF - -.INCLUDE : target.mk +.INCLUDE: settings.mk +.INCLUDE: target.mk +.INCLUDE: installationtest.mk -RUN: run +ALLTAR : javatest -run: - +java -version - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_TEST) +.END diff --git a/framework/qa/complex/path_substitution/PathSubstitutionTest.java b/framework/qa/complex/path_substitution/PathSubstitutionTest.java index 27fe6410eca0..aeea9907e6bc 100755 --- a/framework/qa/complex/path_substitution/PathSubstitutionTest.java +++ b/framework/qa/complex/path_substitution/PathSubstitutionTest.java @@ -29,16 +29,26 @@ package complex.path_substitution; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.XStringSubstitution; -import complexlib.ComplexTestCase; + import java.util.Vector; +// ---------- junit imports ----------------- +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; +// ------------------------------------------ + /** * */ -public class PathSubstitutionTest extends ComplexTestCase { +public class PathSubstitutionTest +{ private static XMultiServiceFactory xMSF; - // all substitution variables private VariableContainer substVars = null; @@ -47,14 +57,14 @@ public class PathSubstitutionTest extends ComplexTestCase { * Right now, it's only 'checkXStringSubstitution'. * @return All test methods. */ - public String[] getTestMethodNames() { - return new String[]{"checkXStringSubstitution"}; - } - +// public String[] getTestMethodNames() { +// return new String[]{"checkXStringSubstitution"}; +// } /** * Create an array with all substitution variables */ - private void initialize() { + @Before private void initialize() + { substVars = new VariableContainer(); substVars.add("$(prog)", false, true); substVars.add("$(inst)", false, true); @@ -64,65 +74,72 @@ public class PathSubstitutionTest extends ComplexTestCase { substVars.add("$(temp)", false, true); substVars.add("$(lang)", false, false); substVars.add("$(langid)", false, false); - substVars.add("$(vlang)", false,false); + substVars.add("$(vlang)", false, false); // path won't resubstitute - substVars.add("$(path)", false,false); + substVars.add("$(path)", false, false); } /** * One actual test: as the method 'getTestMethodNames()' tells. */ - public void checkXStringSubstitution() + @Test public void checkXStringSubstitution() { - xMSF = (XMultiServiceFactory)param.getMSF(); - log.println("---- Testing the XStringSubstitution interface ----"); - log.println("Create intance of test object.\n"); + xMSF = getMSF(); + System.out.println("---- Testing the XStringSubstitution interface ----"); + System.out.println("Create intance of test object.\n"); XStringSubstitution oObj = null; - try { + try + { Object x = xMSF.createInstance( - "com.sun.star.util.PathSubstitution"); - oObj = (XStringSubstitution) - UnoRuntime.queryInterface(XStringSubstitution.class, x); - if (oObj == null) throw new com.sun.star.uno.Exception(); - } - catch(com.sun.star.uno.Exception e) { - log.println(e.getClass().getName()); - log.println("Message: " + e.getMessage()); - failed("Could not create an instance of the test object."); + "com.sun.star.util.PathSubstitution"); + oObj = UnoRuntime.queryInterface(XStringSubstitution.class, x); + if (oObj == null) + { + throw new com.sun.star.uno.Exception(); + } + } + catch (com.sun.star.uno.Exception e) + { + System.out.println(e.getClass().getName()); + System.out.println("Message: " + e.getMessage()); + fail("Could not create an instance of the test object."); return; } - initialize(); +// initialize(); - for (int i=0; i - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.sequence; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.enumexample.XEnumSequence; -import com.sun.star.beans.PropertyState; -import com.sun.star.uno.UnoRuntime; -import complexlib.ComplexTestCase; - -/** - * The test is for bug 111128. The mapping of sequence between - * Java and C++ from the IDL definition was erroneous. This test checks, if - * the mapping works. - */ -public class CheckSequenceOfEnum extends ComplexTestCase { - - /** - * Return all test methods. - * @return The test methods. - */ - public String[] getTestMethodNames() { - return new String[]{"checkSequence"}; - } - - /** - * Check the sequence mapping between Java and C++. - * Since the Office does - * not use such a construct itself, a C++ component with an own defined - * interface is used for testing. - */ - public void checkSequence() { - try { - XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF(); - Object oObj = xMSF.createInstance("com.sun.star.enumexample.ChangeSequenceOrder"); - assure("Build the shared library 'changeSequenceOrder' in directory 'enumexample' and\n" - + "register the created zip 'EnumSequenceComponent' before executing this test.", oObj != null); - // build a first sequence - PropertyState[] aOriginalSequence = new PropertyState[] { - PropertyState.DIRECT_VALUE, - PropertyState.DEFAULT_VALUE, - PropertyState.AMBIGUOUS_VALUE - }; - XEnumSequence xSequence = (XEnumSequence)UnoRuntime.queryInterface(XEnumSequence.class, oObj); - PropertyState[] aChangedSequence = xSequence.getSequenceInChangedOrder(aOriginalSequence); - assure("Did not return a correct sequence.", checkSequence(aOriginalSequence, aChangedSequence)); - } - catch(Exception e) { - e.printStackTrace(); - failed("Exception!"); - } - } - - private boolean checkSequence(PropertyState[] aOriginalSequence, PropertyState[] aChangedSequence) { - boolean erg = true; - int length = aOriginalSequence.length; - for ( int i=0; i -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = CheckSequenceOfEnum -PRJNAME = $(TARGET) -PACKAGE = complex$/sequence - -# --- Settings ----------------------------------------------------- -.INCLUDE: settings.mk - - -#----- compile .java files ----------------------------------------- - -JARFILES = mysql.jar ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar CheckSequenceOfEnum.jar -JAVAFILES = CheckSequenceOfEnum.java - -ENUMSEQUENCEIDL = com.sun.star.enumexample.XEnumSequence - -#----- make a jar from compiled files ------------------------------ - -MAXLINELENGTH = 100000 - -JARCLASSDIRS = $(PACKAGE) com -JARTARGET = $(TARGET).jar -JARCOMPRESS = TRUE - -# --- Parameters for the test -------------------------------------- - -# start an office if the parameter is set for the makefile -.IF "$(OFFICE)" == "" -CT_APPEXECCOMMAND = -.ELSE -CT_APPEXECCOMMAND = -AppExecutionCommand "$(OFFICE)$/soffice -accept=socket,host=localhost,port=8100;urp;" -.ENDIF - -# test base is java complex -CT_TESTBASE = -TestBase java_complex - -# test looks something like the.full.package.TestName -CT_TEST = -o $(PACKAGE:s\$/\.\).CheckSequenceOfEnum - -# start the runner application -CT_APP = org.openoffice.Runner - -RDB = $(BIN)$/myudkapi.rdb -JAVADIR = $(OUT)$/misc$/java - -# --- Targets ------------------------------------------------------ - -.IF "$(depend)" == "" -ALL: GENJAVAFILES ALLTAR -.ELSE -ALL: ALLDEP -.ENDIF - - -.INCLUDE : target.mk - -$(RDB) : - +idlc -I$(IDL) -I$(SOLARIDLDIR) -O$(BIN) $? - +regmerge $@ /UCR $(BIN)$/{$(?:f:s/.idl/.urd/)} - +regmerge $@ / $(SOLARBINDIR)$/udkapi.rdb - touch $@ - -GENJAVAFILES : - -+$(MKDIR) $(CLASSDIR) >& $(NULLDEV) - -+$(MKDIR) $(JAVADIR) >& $(NULLDEV) - +javamaker -BUCR -nD -O$(CLASSDIR) $(RDB) -T$(ENUMSEQUENCEIDL) - -RUN: - +java -cp $(CLASSPATH) $(CT_APP) $(CT_APPEXECCOMMAND) $(CT_TESTBASE) $(CT_TEST) - -run: RUN diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index 5227cb9f302c..fe8af40f0850 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -973,6 +973,13 @@ sal_Bool PathSettings::impl_isValidPath(const OUStringList& lPath) const //----------------------------------------------------------------------------- sal_Bool PathSettings::impl_isValidPath(const ::rtl::OUString& sPath) const { + // allow empty path to reset a path. +// idea by LLA to support empty pathes +// if (sPath.getLength() == 0) +// { +// return sal_True; +// } + return (! INetURLObject(sPath).HasError()); } -- cgit From 305193791e7143970687ea4c0dc47dca02022b2c Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 29 Jun 2010 13:43:23 +0200 Subject: sb123:#i111449# makefile cleanups for qa/complex tests --- linguistic/qa/complex/linguistic/makefile.mk | 1 - sfx2/qa/complex/docinfo/makefile.mk | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index b0d274167b98..2d10ec4c832d 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -27,7 +27,6 @@ .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: - @echo "OOO_SUBSEQUENT_TESTS not set, do nothing." .ELSE PRJ = ../../.. diff --git a/sfx2/qa/complex/docinfo/makefile.mk b/sfx2/qa/complex/docinfo/makefile.mk index 51f2ddd02597..626b648a6d06 100644 --- a/sfx2/qa/complex/docinfo/makefile.mk +++ b/sfx2/qa/complex/docinfo/makefile.mk @@ -45,7 +45,7 @@ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) # Sample how to debug -JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y .END -- cgit From 5a55565739b5a13d395c690b871d108d11f419cd Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 1 Jul 2010 13:19:11 +0200 Subject: sb123:#i111449# cleanups in build.lst for qa/complex tests --- sfx2/prj/build.lst | 3 ++- ucb/prj/build.lst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index fdc2999a781e..3a99e7fae347 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -25,5 +25,6 @@ sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL sf sfx2\qa\cppunit nmake - all sf_qa_cppunit sf_util NULL sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL -sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_util NULL +sf sfx2\qa\complex\framework\DocHelper nmake - all sf_qa_complex_framework_dochelper sf_util NULL +sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst index cc40077674e0..fc66b41b74b2 100644 --- a/ucb/prj/build.lst +++ b/ucb/prj/build.lst @@ -19,4 +19,5 @@ uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL uc ucb\qa\complex\ucb nmake - all uc_complex_ucb uc_inc NULL # fails, please fix -# uc ucb\qa\complex\tdoc nmake - all uc_complex_tdoc uc_inc NULL +# uc ucb\qa\complex\tdoc\interfaces nmake - all uc_complex_tdoc_interfaces uc_inc NULL +# uc ucb\qa\complex\tdoc nmake - all uc_complex_tdoc uc_complex_tdoc_interfaces uc_inc NULL -- cgit From f438a3324ef83ed9af683283859c040783d180f6 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 8 Jul 2010 15:47:58 +0200 Subject: sb123:#i111449# make clear buildable. --- framework/prj/build.lst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 72adda8dde70..d306a99824c9 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -20,7 +20,7 @@ fr framework\source\uiconfiguration nmake - all fr_uiconfiguration f fr framework\source\accelerators nmake - all fr_accelerators fr_threadhelp fr_inc NULL fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL -fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL +# fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # complex tests fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL @@ -31,12 +31,13 @@ fr framework\qa\complex\accelerators nmake - all fr_qa_complex_accel f # unclear should be remove # fr framework\qa\complex\api_internal nmake - all fr_qa_complex_api_internal NULL # BUG! opens an error box -fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL +# fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL -fr framework\qa\complex\framework\autosave nmake - all fr_qa_complex_framework_autosave NULL +# GPF +# fr framework\qa\complex\framework\autosave nmake - all fr_qa_complex_framework_autosave NULL # much too complex, will not change to new junit # fr framework\qa\complex\framework\recovery nmake - all fr_qa_complex_framework_recovery NULL -- cgit From 73156a84f7adb85c7687404dc6a89f469378a0fd Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Thu, 8 Jul 2010 15:48:47 +0200 Subject: sb123:#i111449# make clear buildable. --- framework/prj/build.lst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/prj/build.lst b/framework/prj/build.lst index d306a99824c9..69bfe22833ab 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -20,7 +20,7 @@ fr framework\source\uiconfiguration nmake - all fr_uiconfiguration f fr framework\source\accelerators nmake - all fr_accelerators fr_threadhelp fr_inc NULL fr framework\source\tabwin nmake - all fr_tabwin fr_threadhelp fr_inc NULL fr framework\util nmake - all fr_util fr_constant fr_threadhelp fr_classes fr_loadenv fr_jobs fr_interaction fr_helper fr_dispatch fr_services fr_register fr_recording fr_layoutmanager fr_uielement fr_uifactory fr_xml fr_uiconfiguration fr_accelerators fr_tabwin NULL -# fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL +fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # complex tests fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL @@ -36,6 +36,7 @@ fr framework\qa\complex\desktop nmake - all fr_qa_complex_deskt fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL + # GPF # fr framework\qa\complex\framework\autosave nmake - all fr_qa_complex_framework_autosave NULL -- cgit From 2c2757665c4ab0aa78c80aa7d1e35e62dba64ee8 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 16 Jul 2010 10:49:53 +0200 Subject: sb123: #i111602# hack for Windows PCH problem --- desktop/qa/deployment_misc/makefile.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop/qa/deployment_misc/makefile.mk b/desktop/qa/deployment_misc/makefile.mk index b237a006783c..16223914e740 100644 --- a/desktop/qa/deployment_misc/makefile.mk +++ b/desktop/qa/deployment_misc/makefile.mk @@ -36,6 +36,12 @@ ENABLE_EXCEPTIONS := TRUE CFLAGSCXX += $(CPPUNIT_CFLAGS) +# TODO: On Windows, test_dp_version.cxx fails due to BOOL redefinition between +# windef.h and tools/solar.h caused by including "precompiled_desktop.hxx"; this +# hack to temporarily disable PCH will become unnecessary with the fix for issue +# 112600: +CFLAGSCXX += -DDISABLE_PCH_HACK + SHL1TARGET = $(TARGET) SHL1OBJS = $(SLO)$/test_dp_version.obj SHL1STDLIBS = $(CPPUNITLIB) $(DEPLOYMENTMISCLIB) $(SALLIB) -- cgit From 1a3272e96d39e9518b209570a259ed59c512e64d Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Tue, 20 Jul 2010 09:51:31 +0200 Subject: sb123: #i111449# loadComponentTest do not create file: directory any longer --- .../complex/loadAllDocuments/CheckXComponentLoader.java | 2 +- framework/qa/complex/loadAllDocuments/password_check.sxw | Bin 5128 -> 0 bytes .../loadAllDocuments/testdocuments/password_check.sxw | Bin 0 -> 5128 bytes 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 framework/qa/complex/loadAllDocuments/password_check.sxw create mode 100644 framework/qa/complex/loadAllDocuments/testdocuments/password_check.sxw diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java index 3a6fd7a67270..7eb4972d630a 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java @@ -195,7 +195,7 @@ public class CheckXComponentLoader // get temp path for this environment final String tempDirURL = util.utils.getOfficeTemp/*Dir*/(getMSF()); - m_sTempPath = tempDirURL; + m_sTempPath = graphical.FileHelper.getSystemPathFromFileURL(tempDirURL); // m_sTempPath = "."+fs_sys; // get all files from the given directory diff --git a/framework/qa/complex/loadAllDocuments/password_check.sxw b/framework/qa/complex/loadAllDocuments/password_check.sxw deleted file mode 100644 index ec545b99e22a..000000000000 Binary files a/framework/qa/complex/loadAllDocuments/password_check.sxw and /dev/null differ diff --git a/framework/qa/complex/loadAllDocuments/testdocuments/password_check.sxw b/framework/qa/complex/loadAllDocuments/testdocuments/password_check.sxw new file mode 100644 index 000000000000..ec545b99e22a Binary files /dev/null and b/framework/qa/complex/loadAllDocuments/testdocuments/password_check.sxw differ -- cgit From b7c1a7a78bcf1c1824e893e2b4f4620def043c9c Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Fri, 23 Jul 2010 12:20:26 +0200 Subject: sb123:#i111449# fix all run through problems for qa/complex tests --- framework/prj/build.lst | 30 ++++++++++++++-------- .../qa/complex/XUserInputInterception/makefile.mk | 7 +++++ linguistic/prj/build.lst | 2 +- sfx2/prj/build.lst | 9 ++++--- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 69bfe22833ab..9c1feb3e8f5b 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -23,19 +23,25 @@ fr framework\util nmake - all fr_util fr_constant fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # complex tests -fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL -fr framework\qa\complex\XUserInputInterception nmake - all fr_qa_complex_xuserinputinterception NULL -fr framework\qa\complex\accelerators\helper nmake - all fr_qa_complex_accel_helper NULL -fr framework\qa\complex\accelerators nmake - all fr_qa_complex_accel fr_qa_complex_accel_helper NULL +# fails on unxsoli4 +# fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL +# fr framework\qa\complex\XUserInputInterception nmake - all fr_qa_complex_xuserinputinterception NULL + +# subdir has to remove +# fr framework\qa\complex\accelerators\helper nmake - all fr_qa_complex_accel_helper NULL +# fr framework\qa\complex\accelerators nmake - all fr_qa_complex_accel fr_qa_complex_accel_helper NULL # unclear should be remove # fr framework\qa\complex\api_internal nmake - all fr_qa_complex_api_internal NULL + # BUG! opens an error box # fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL -fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL -fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL -fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL + +# subdir has to remove +# fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL +# fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL +# fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL # GPF # fr framework\qa\complex\framework\autosave nmake - all fr_qa_complex_framework_autosave NULL @@ -43,11 +49,13 @@ fr framework\qa\complex\disposing nmake - all fr_qa_complex_dispo # much too complex, will not change to new junit # fr framework\qa\complex\framework\recovery nmake - all fr_qa_complex_framework_recovery NULL -fr framework\qa\complex\imageManager\interfaces nmake - all fr_qa_complex_imageManager_interfaces NULL -fr framework\qa\complex\imageManager nmake - all fr_qa_complex_imageManager fr_qa_complex_imageManager_interfaces NULL +# subdir has to remove +# fr framework\qa\complex\imageManager\interfaces nmake - all fr_qa_complex_imageManager_interfaces NULL +# fr framework\qa\complex\imageManager nmake - all fr_qa_complex_imageManager fr_qa_complex_imageManager_interfaces NULL -fr framework\qa\complex\loadAllDocuments\helper nmake - all fr_qa_complex_loadAllDocuments_helper NULL -fr framework\qa\complex\loadAllDocuments nmake - all fr_qa_complex_loadAllDocuments fr_qa_complex_loadAllDocuments_helper NULL +# subdir has to remove +# fr framework\qa\complex\loadAllDocuments\helper nmake - all fr_qa_complex_loadAllDocuments_helper NULL +# fr framework\qa\complex\loadAllDocuments nmake - all fr_qa_complex_loadAllDocuments fr_qa_complex_loadAllDocuments_helper NULL # need cleanups # fr framework\qa\complex\path_settings nmake - all fr_qa_complex_path_settings NULL diff --git a/framework/qa/complex/XUserInputInterception/makefile.mk b/framework/qa/complex/XUserInputInterception/makefile.mk index fff9ea938f6b..d25ec9b4f6f7 100644 --- a/framework/qa/complex/XUserInputInterception/makefile.mk +++ b/framework/qa/complex/XUserInputInterception/makefile.mk @@ -24,10 +24,17 @@ # for a copy of the LGPLv3 License. # #************************************************************************* + .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: .ELSE +# we don't want something like this. +# .IF "$(OS)"=="LINUX" +# nothing .PHONY: +# @echo "Test marked as failed on this platform" +# .END + PRJ = ../../.. PRJNAME = framework TARGET = qa_complex_xuserinputinterception diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index d36b5d11cfcc..b85d4cfd9d73 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -7,4 +7,4 @@ lg linguistic\source nmake - all lg_src lg_inc NULL lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL # could be we need a Japanese office version -lg linguistic\qa\complex\linguistic nmake - all lg_qa_complex NULL +# lg linguistic\qa\complex\linguistic nmake - all lg_qa_complex NULL diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index 3a99e7fae347..7d2b52e3a9e7 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -24,7 +24,10 @@ sf sfx2\util sf sfx2\qa\unoapi nmake - all sf_qa_unoapi NULL sf sfx2\qa\cppunit nmake - all sf_qa_cppunit sf_util NULL -sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL -sf sfx2\qa\complex\framework\DocHelper nmake - all sf_qa_complex_framework_dochelper sf_util NULL -sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL +# fails on unxsoli4 +# sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL + +# subdir has to remove +# sf sfx2\qa\complex\framework\DocHelper nmake - all sf_qa_complex_framework_dochelper sf_util NULL +# sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL -- cgit From 9899711e43c99d81b9472c61c1190ab57230371d Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 27 Jul 2010 14:23:19 +0200 Subject: sb123: #i111449# disabled sfx2/qa/complex/docinfo again for now --- sfx2/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index 7d2b52e3a9e7..d2964afdc3ee 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -30,4 +30,4 @@ sf sfx2\qa\cppunit nmake - all sf_qa_cppunit sf_util NULL # subdir has to remove # sf sfx2\qa\complex\framework\DocHelper nmake - all sf_qa_complex_framework_dochelper sf_util NULL # sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL -sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL +# sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL -- cgit From b5ff94fde0cc506d9c3c17c2762101a0c7a657e4 Mon Sep 17 00:00:00 2001 From: Lars Langhans Date: Mon, 23 Aug 2010 10:38:44 +0200 Subject: sb123:#i111449# remove all subdirs in complex tests --- framework/prj/build.lst | 8 - framework/qa/complex/ModuleManager/makefile.mk | 3 - .../qa/complex/XUserInputInterception/makefile.mk | 3 - .../AcceleratorsConfigurationTest.java | 2 +- framework/qa/complex/accelerators/KeyMapping.java | 168 ++++++++ .../qa/complex/accelerators/helper/KeyMapping.java | 168 -------- framework/qa/complex/accelerators/makefile.mk | 6 +- framework/qa/complex/api_internal/makefile.mk | 3 - framework/qa/complex/broken_document/makefile.mk | 3 - .../qa/complex/contextMenuInterceptor/makefile.mk | 3 - framework/qa/complex/desktop/makefile.mk | 3 - framework/qa/complex/dispatches/Interceptor.java | 345 +++++++++++++++ .../qa/complex/dispatches/checkdispatchapi.java | 2 +- .../qa/complex/dispatches/helper/Interceptor.java | 345 --------------- framework/qa/complex/dispatches/makefile.mk | 6 +- framework/qa/complex/disposing/makefile.mk | 3 - .../qa/complex/framework/autosave/makefile.mk | 3 - .../qa/complex/imageManager/CheckImageManager.java | 12 +- framework/qa/complex/imageManager/_XComponent.java | 187 ++++++++ .../qa/complex/imageManager/_XImageManager.java | 117 +++++ .../qa/complex/imageManager/_XInitialization.java | 94 ++++ .../qa/complex/imageManager/_XTypeProvider.java | 102 +++++ .../qa/complex/imageManager/_XUIConfiguration.java | 82 ++++ .../imageManager/_XUIConfigurationPersistence.java | 93 ++++ .../imageManager/interfaces/_XComponent.java | 187 -------- .../imageManager/interfaces/_XImageManager.java | 117 ----- .../imageManager/interfaces/_XInitialization.java | 94 ---- .../imageManager/interfaces/_XTypeProvider.java | 102 ----- .../imageManager/interfaces/_XUIConfiguration.java | 82 ---- .../interfaces/_XUIConfigurationPersistence.java | 93 ---- framework/qa/complex/imageManager/makefile.mk | 11 +- .../loadAllDocuments/CheckXComponentLoader.java | 2 - .../loadAllDocuments/InteractionHandler.java | 155 +++++++ .../complex/loadAllDocuments/StatusIndicator.java | 237 +++++++++++ .../complex/loadAllDocuments/StreamSimulator.java | 474 +++++++++++++++++++++ .../helper/InteractionHandler.java | 155 ------- .../loadAllDocuments/helper/StatusIndicator.java | 237 ----------- .../loadAllDocuments/helper/StreamSimulator.java | 474 --------------------- framework/qa/complex/loadAllDocuments/makefile.mk | 9 +- framework/qa/complex/path_settings/makefile.mk | 3 - framework/qa/complex/path_substitution/makefile.mk | 3 - linguistic/qa/complex/linguistic/makefile.mk | 3 - sfx2/prj/build.lst | 2 - sfx2/qa/complex/framework/DialogThread.java | 95 +++++ .../complex/framework/DocHelper/DialogThread.java | 95 ----- .../complex/framework/DocHelper/WriterHelper.java | 287 ------------- sfx2/qa/complex/framework/WriterHelper.java | 287 +++++++++++++ sfx2/qa/complex/framework/makefile.mk | 6 +- ucb/prj/build.lst | 1 - ucb/qa/complex/tdoc/CheckContentProvider.java | 10 - .../tdoc/CheckTransientDocumentsContent.java | 1 + .../CheckTransientDocumentsContentProvider.java | 3 +- .../CheckTransientDocumentsDocumentContent.java | 1 + ucb/qa/complex/tdoc/_XChild.java | 104 +++++ .../complex/tdoc/_XCommandInfoChangeNotifier.java | 64 +++ ucb/qa/complex/tdoc/_XCommandProcessor.java | 286 +++++++++++++ ucb/qa/complex/tdoc/_XComponent.java | 171 ++++++++ ucb/qa/complex/tdoc/_XContent.java | 86 ++++ .../complex/tdoc/_XPropertiesChangeNotifier.java | 67 +++ ucb/qa/complex/tdoc/_XPropertyContainer.java | 102 +++++ .../tdoc/_XPropertySetInfoChangeNotifier.java | 67 +++ ucb/qa/complex/tdoc/_XServiceInfo.java | 99 +++++ ucb/qa/complex/tdoc/_XTypeProvider.java | 95 +++++ ucb/qa/complex/tdoc/interfaces/_XChild.java | 104 ----- .../interfaces/_XCommandInfoChangeNotifier.java | 64 --- .../tdoc/interfaces/_XCommandProcessor.java | 286 ------------- ucb/qa/complex/tdoc/interfaces/_XComponent.java | 171 -------- ucb/qa/complex/tdoc/interfaces/_XContent.java | 86 ---- .../interfaces/_XPropertiesChangeNotifier.java | 67 --- .../tdoc/interfaces/_XPropertyContainer.java | 102 ----- .../_XPropertySetInfoChangeNotifier.java | 67 --- ucb/qa/complex/tdoc/interfaces/_XServiceInfo.java | 99 ----- ucb/qa/complex/tdoc/interfaces/_XTypeProvider.java | 95 ----- ucb/qa/complex/tdoc/makefile.mk | 16 +- 74 files changed, 3616 insertions(+), 3669 deletions(-) create mode 100644 framework/qa/complex/accelerators/KeyMapping.java delete mode 100644 framework/qa/complex/accelerators/helper/KeyMapping.java create mode 100644 framework/qa/complex/dispatches/Interceptor.java delete mode 100644 framework/qa/complex/dispatches/helper/Interceptor.java create mode 100755 framework/qa/complex/imageManager/_XComponent.java create mode 100755 framework/qa/complex/imageManager/_XImageManager.java create mode 100755 framework/qa/complex/imageManager/_XInitialization.java create mode 100755 framework/qa/complex/imageManager/_XTypeProvider.java create mode 100755 framework/qa/complex/imageManager/_XUIConfiguration.java create mode 100755 framework/qa/complex/imageManager/_XUIConfigurationPersistence.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XComponent.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XImageManager.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XInitialization.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XTypeProvider.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java delete mode 100755 framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java create mode 100644 framework/qa/complex/loadAllDocuments/InteractionHandler.java create mode 100644 framework/qa/complex/loadAllDocuments/StatusIndicator.java create mode 100644 framework/qa/complex/loadAllDocuments/StreamSimulator.java delete mode 100644 framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java delete mode 100644 framework/qa/complex/loadAllDocuments/helper/StatusIndicator.java delete mode 100644 framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java create mode 100644 sfx2/qa/complex/framework/DialogThread.java delete mode 100644 sfx2/qa/complex/framework/DocHelper/DialogThread.java delete mode 100644 sfx2/qa/complex/framework/DocHelper/WriterHelper.java create mode 100644 sfx2/qa/complex/framework/WriterHelper.java create mode 100755 ucb/qa/complex/tdoc/_XChild.java create mode 100755 ucb/qa/complex/tdoc/_XCommandInfoChangeNotifier.java create mode 100755 ucb/qa/complex/tdoc/_XCommandProcessor.java create mode 100755 ucb/qa/complex/tdoc/_XComponent.java create mode 100755 ucb/qa/complex/tdoc/_XContent.java create mode 100755 ucb/qa/complex/tdoc/_XPropertiesChangeNotifier.java create mode 100755 ucb/qa/complex/tdoc/_XPropertyContainer.java create mode 100755 ucb/qa/complex/tdoc/_XPropertySetInfoChangeNotifier.java create mode 100755 ucb/qa/complex/tdoc/_XServiceInfo.java create mode 100755 ucb/qa/complex/tdoc/_XTypeProvider.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XChild.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XCommandInfoChangeNotifier.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XCommandProcessor.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XComponent.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XContent.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XPropertiesChangeNotifier.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XPropertyContainer.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XPropertySetInfoChangeNotifier.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XServiceInfo.java delete mode 100755 ucb/qa/complex/tdoc/interfaces/_XTypeProvider.java diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 9c1feb3e8f5b..153dea29af2c 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -27,8 +27,6 @@ fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # fr framework\qa\complex\ModuleManager nmake - all fr_qa_complex_modulemanager NULL # fr framework\qa\complex\XUserInputInterception nmake - all fr_qa_complex_xuserinputinterception NULL -# subdir has to remove -# fr framework\qa\complex\accelerators\helper nmake - all fr_qa_complex_accel_helper NULL # fr framework\qa\complex\accelerators nmake - all fr_qa_complex_accel fr_qa_complex_accel_helper NULL # unclear should be remove @@ -38,8 +36,6 @@ fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL -# subdir has to remove -# fr framework\qa\complex\dispatches\helper nmake - all fr_qa_complex_dispatches_helper NULL # fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL # fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL @@ -49,12 +45,8 @@ fr framework\qa\complex\desktop nmake - all fr_qa_complex_deskt # much too complex, will not change to new junit # fr framework\qa\complex\framework\recovery nmake - all fr_qa_complex_framework_recovery NULL -# subdir has to remove -# fr framework\qa\complex\imageManager\interfaces nmake - all fr_qa_complex_imageManager_interfaces NULL # fr framework\qa\complex\imageManager nmake - all fr_qa_complex_imageManager fr_qa_complex_imageManager_interfaces NULL -# subdir has to remove -# fr framework\qa\complex\loadAllDocuments\helper nmake - all fr_qa_complex_loadAllDocuments_helper NULL # fr framework\qa\complex\loadAllDocuments nmake - all fr_qa_complex_loadAllDocuments fr_qa_complex_loadAllDocuments_helper NULL # need cleanups diff --git a/framework/qa/complex/ModuleManager/makefile.mk b/framework/qa/complex/ModuleManager/makefile.mk index a27f0bcc36b4..4ad6d8929030 100644 --- a/framework/qa/complex/ModuleManager/makefile.mk +++ b/framework/qa/complex/ModuleManager/makefile.mk @@ -45,9 +45,6 @@ JAVAFILES = $(JAVATESTFILES) JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/framework/qa/complex/XUserInputInterception/makefile.mk b/framework/qa/complex/XUserInputInterception/makefile.mk index d25ec9b4f6f7..8b08bec171ee 100644 --- a/framework/qa/complex/XUserInputInterception/makefile.mk +++ b/framework/qa/complex/XUserInputInterception/makefile.mk @@ -52,9 +52,6 @@ JAVAFILES = $(JAVATESTFILES) JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java index 98e73189ea7e..b0d89ad81858 100644 --- a/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java +++ b/framework/qa/complex/accelerators/AcceleratorsConfigurationTest.java @@ -46,7 +46,7 @@ import com.sun.star.uno.XInterface; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.XChangesBatch; -import complex.accelerators.helper.KeyMapping; +// import complex.accelerators.KeyMapping; // ---------- junit imports ----------------- diff --git a/framework/qa/complex/accelerators/KeyMapping.java b/framework/qa/complex/accelerators/KeyMapping.java new file mode 100644 index 000000000000..d09a51162e7c --- /dev/null +++ b/framework/qa/complex/accelerators/KeyMapping.java @@ -0,0 +1,168 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.accelerators; + +import java.util.HashMap; + +class KeyIdentifierInfo +{ + protected String sIdentifier; + protected Short nCode; + + KeyIdentifierInfo(String sID, Short nC) + { + sIdentifier = sID; + nCode = nC; + } +} + +class IdentifierHashMap extends HashMap +{ + public void put(String sIdentifier, Short nCode) + { + super.put(sIdentifier, nCode); + } + public Short get(String sIdentifier) + { + return (Short)super.get(sIdentifier); + } +} + +class CodeHashMap extends HashMap +{ + public void put(Short nCode, String sIdentifier) + { + super.put(nCode, sIdentifier); + } + public String get(Short nCode) + { + return (String)super.get(nCode); + } +} + +public class KeyMapping +{ + private IdentifierHashMap aIdentifierHashMap; + private CodeHashMap aCodeHashMap; + + public KeyMapping() + { + KeyIdentifierInfo[] aInfoMap = { + new KeyIdentifierInfo("0", new Short(com.sun.star.awt.Key.NUM0)), + new KeyIdentifierInfo("1", new Short(com.sun.star.awt.Key.NUM1)), + new KeyIdentifierInfo("2", new Short(com.sun.star.awt.Key.NUM2)), + new KeyIdentifierInfo("3", new Short(com.sun.star.awt.Key.NUM3)), + new KeyIdentifierInfo("4", new Short(com.sun.star.awt.Key.NUM4)), + new KeyIdentifierInfo("5", new Short(com.sun.star.awt.Key.NUM5)), + new KeyIdentifierInfo("6", new Short(com.sun.star.awt.Key.NUM6)), + new KeyIdentifierInfo("7", new Short(com.sun.star.awt.Key.NUM7)), + new KeyIdentifierInfo("8", new Short(com.sun.star.awt.Key.NUM8)), + new KeyIdentifierInfo("9", new Short(com.sun.star.awt.Key.NUM9)), + new KeyIdentifierInfo("A", new Short(com.sun.star.awt.Key.A)), + new KeyIdentifierInfo("B", new Short(com.sun.star.awt.Key.B)), + new KeyIdentifierInfo("C", new Short(com.sun.star.awt.Key.C)), + new KeyIdentifierInfo("D", new Short(com.sun.star.awt.Key.D)), + new KeyIdentifierInfo("E", new Short(com.sun.star.awt.Key.E)), + new KeyIdentifierInfo("F", new Short(com.sun.star.awt.Key.F)), + new KeyIdentifierInfo("G", new Short(com.sun.star.awt.Key.G)), + new KeyIdentifierInfo("H", new Short(com.sun.star.awt.Key.H)), + new KeyIdentifierInfo("I", new Short(com.sun.star.awt.Key.I)), + new KeyIdentifierInfo("J", new Short(com.sun.star.awt.Key.J)), + new KeyIdentifierInfo("K", new Short(com.sun.star.awt.Key.K)), + new KeyIdentifierInfo("L", new Short(com.sun.star.awt.Key.L)), + new KeyIdentifierInfo("M", new Short(com.sun.star.awt.Key.M)), + new KeyIdentifierInfo("N", new Short(com.sun.star.awt.Key.N)), + new KeyIdentifierInfo("O", new Short(com.sun.star.awt.Key.O)), + new KeyIdentifierInfo("P", new Short(com.sun.star.awt.Key.P)), + new KeyIdentifierInfo("Q", new Short(com.sun.star.awt.Key.Q)), + new KeyIdentifierInfo("R", new Short(com.sun.star.awt.Key.R)), + new KeyIdentifierInfo("S", new Short(com.sun.star.awt.Key.S)), + new KeyIdentifierInfo("T", new Short(com.sun.star.awt.Key.T)), + new KeyIdentifierInfo("U", new Short(com.sun.star.awt.Key.U)), + new KeyIdentifierInfo("V", new Short(com.sun.star.awt.Key.V)), + new KeyIdentifierInfo("W", new Short(com.sun.star.awt.Key.W)), + new KeyIdentifierInfo("X", new Short(com.sun.star.awt.Key.X)), + new KeyIdentifierInfo("Y", new Short(com.sun.star.awt.Key.Y)), + new KeyIdentifierInfo("Z", new Short(com.sun.star.awt.Key.Z)), + new KeyIdentifierInfo("F1", new Short(com.sun.star.awt.Key.F1)), + new KeyIdentifierInfo("F2", new Short(com.sun.star.awt.Key.F2)), + new KeyIdentifierInfo("F3", new Short(com.sun.star.awt.Key.F3)), + new KeyIdentifierInfo("F4", new Short(com.sun.star.awt.Key.F4)), + new KeyIdentifierInfo("F5", new Short(com.sun.star.awt.Key.F5)), + new KeyIdentifierInfo("F6", new Short(com.sun.star.awt.Key.F6)), + new KeyIdentifierInfo("F7", new Short(com.sun.star.awt.Key.F7)), + new KeyIdentifierInfo("F8", new Short(com.sun.star.awt.Key.F8)), + new KeyIdentifierInfo("F9", new Short(com.sun.star.awt.Key.F9)), + new KeyIdentifierInfo("F10", new Short(com.sun.star.awt.Key.F10)), + new KeyIdentifierInfo("F11", new Short(com.sun.star.awt.Key.F11)), + new KeyIdentifierInfo("F12", new Short(com.sun.star.awt.Key.F12)), + new KeyIdentifierInfo("DOWN", new Short(com.sun.star.awt.Key.DOWN)), + new KeyIdentifierInfo("UP", new Short(com.sun.star.awt.Key.UP)), + new KeyIdentifierInfo("LEFT", new Short(com.sun.star.awt.Key.LEFT)), + new KeyIdentifierInfo("RIGHT", new Short(com.sun.star.awt.Key.RIGHT)), + new KeyIdentifierInfo("HOME", new Short(com.sun.star.awt.Key.HOME)), + new KeyIdentifierInfo("END", new Short(com.sun.star.awt.Key.END)), + new KeyIdentifierInfo("PAGEUP", new Short(com.sun.star.awt.Key.PAGEUP)), + new KeyIdentifierInfo("PAGEDOWN", new Short(com.sun.star.awt.Key.PAGEDOWN)), + new KeyIdentifierInfo("RETURN", new Short(com.sun.star.awt.Key.RETURN)), + new KeyIdentifierInfo("ESCAPE", new Short(com.sun.star.awt.Key.ESCAPE)), + new KeyIdentifierInfo("TAB", new Short(com.sun.star.awt.Key.TAB)), + new KeyIdentifierInfo("BACKSPACE", new Short(com.sun.star.awt.Key.BACKSPACE)), + new KeyIdentifierInfo("SPACE", new Short(com.sun.star.awt.Key.SPACE)), + new KeyIdentifierInfo("INSERT", new Short(com.sun.star.awt.Key.INSERT)), + new KeyIdentifierInfo("DELETE", new Short(com.sun.star.awt.Key.DELETE)), + new KeyIdentifierInfo("ADD", new Short(com.sun.star.awt.Key.ADD)), + new KeyIdentifierInfo("SUBTRACT", new Short(com.sun.star.awt.Key.SUBTRACT)), + new KeyIdentifierInfo("MULTIPLY", new Short(com.sun.star.awt.Key.MULTIPLY)), + new KeyIdentifierInfo("DIVIDE", new Short(com.sun.star.awt.Key.DIVIDE)), + new KeyIdentifierInfo("CUT", new Short(com.sun.star.awt.Key.CUT)), + new KeyIdentifierInfo("COPY", new Short(com.sun.star.awt.Key.COPY)), + new KeyIdentifierInfo("PASTE", new Short(com.sun.star.awt.Key.PASTE)), + new KeyIdentifierInfo("UNDO", new Short(com.sun.star.awt.Key.UNDO)), + new KeyIdentifierInfo("REPEAT", new Short(com.sun.star.awt.Key.REPEAT)) + }; + + aIdentifierHashMap = new IdentifierHashMap(); + aCodeHashMap = new CodeHashMap(); + for (int i = 0; i - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.accelerators.helper; - -import java.util.HashMap; - -class KeyIdentifierInfo -{ - protected String sIdentifier; - protected Short nCode; - - KeyIdentifierInfo(String sID, Short nC) - { - sIdentifier = sID; - nCode = nC; - } -} - -class IdentifierHashMap extends HashMap -{ - public void put(String sIdentifier, Short nCode) - { - super.put(sIdentifier, nCode); - } - public Short get(String sIdentifier) - { - return (Short)super.get(sIdentifier); - } -} - -class CodeHashMap extends HashMap -{ - public void put(Short nCode, String sIdentifier) - { - super.put(nCode, sIdentifier); - } - public String get(Short nCode) - { - return (String)super.get(nCode); - } -} - -public class KeyMapping -{ - private IdentifierHashMap aIdentifierHashMap; - private CodeHashMap aCodeHashMap; - - public KeyMapping() - { - KeyIdentifierInfo[] aInfoMap = { - new KeyIdentifierInfo("0", new Short(com.sun.star.awt.Key.NUM0)), - new KeyIdentifierInfo("1", new Short(com.sun.star.awt.Key.NUM1)), - new KeyIdentifierInfo("2", new Short(com.sun.star.awt.Key.NUM2)), - new KeyIdentifierInfo("3", new Short(com.sun.star.awt.Key.NUM3)), - new KeyIdentifierInfo("4", new Short(com.sun.star.awt.Key.NUM4)), - new KeyIdentifierInfo("5", new Short(com.sun.star.awt.Key.NUM5)), - new KeyIdentifierInfo("6", new Short(com.sun.star.awt.Key.NUM6)), - new KeyIdentifierInfo("7", new Short(com.sun.star.awt.Key.NUM7)), - new KeyIdentifierInfo("8", new Short(com.sun.star.awt.Key.NUM8)), - new KeyIdentifierInfo("9", new Short(com.sun.star.awt.Key.NUM9)), - new KeyIdentifierInfo("A", new Short(com.sun.star.awt.Key.A)), - new KeyIdentifierInfo("B", new Short(com.sun.star.awt.Key.B)), - new KeyIdentifierInfo("C", new Short(com.sun.star.awt.Key.C)), - new KeyIdentifierInfo("D", new Short(com.sun.star.awt.Key.D)), - new KeyIdentifierInfo("E", new Short(com.sun.star.awt.Key.E)), - new KeyIdentifierInfo("F", new Short(com.sun.star.awt.Key.F)), - new KeyIdentifierInfo("G", new Short(com.sun.star.awt.Key.G)), - new KeyIdentifierInfo("H", new Short(com.sun.star.awt.Key.H)), - new KeyIdentifierInfo("I", new Short(com.sun.star.awt.Key.I)), - new KeyIdentifierInfo("J", new Short(com.sun.star.awt.Key.J)), - new KeyIdentifierInfo("K", new Short(com.sun.star.awt.Key.K)), - new KeyIdentifierInfo("L", new Short(com.sun.star.awt.Key.L)), - new KeyIdentifierInfo("M", new Short(com.sun.star.awt.Key.M)), - new KeyIdentifierInfo("N", new Short(com.sun.star.awt.Key.N)), - new KeyIdentifierInfo("O", new Short(com.sun.star.awt.Key.O)), - new KeyIdentifierInfo("P", new Short(com.sun.star.awt.Key.P)), - new KeyIdentifierInfo("Q", new Short(com.sun.star.awt.Key.Q)), - new KeyIdentifierInfo("R", new Short(com.sun.star.awt.Key.R)), - new KeyIdentifierInfo("S", new Short(com.sun.star.awt.Key.S)), - new KeyIdentifierInfo("T", new Short(com.sun.star.awt.Key.T)), - new KeyIdentifierInfo("U", new Short(com.sun.star.awt.Key.U)), - new KeyIdentifierInfo("V", new Short(com.sun.star.awt.Key.V)), - new KeyIdentifierInfo("W", new Short(com.sun.star.awt.Key.W)), - new KeyIdentifierInfo("X", new Short(com.sun.star.awt.Key.X)), - new KeyIdentifierInfo("Y", new Short(com.sun.star.awt.Key.Y)), - new KeyIdentifierInfo("Z", new Short(com.sun.star.awt.Key.Z)), - new KeyIdentifierInfo("F1", new Short(com.sun.star.awt.Key.F1)), - new KeyIdentifierInfo("F2", new Short(com.sun.star.awt.Key.F2)), - new KeyIdentifierInfo("F3", new Short(com.sun.star.awt.Key.F3)), - new KeyIdentifierInfo("F4", new Short(com.sun.star.awt.Key.F4)), - new KeyIdentifierInfo("F5", new Short(com.sun.star.awt.Key.F5)), - new KeyIdentifierInfo("F6", new Short(com.sun.star.awt.Key.F6)), - new KeyIdentifierInfo("F7", new Short(com.sun.star.awt.Key.F7)), - new KeyIdentifierInfo("F8", new Short(com.sun.star.awt.Key.F8)), - new KeyIdentifierInfo("F9", new Short(com.sun.star.awt.Key.F9)), - new KeyIdentifierInfo("F10", new Short(com.sun.star.awt.Key.F10)), - new KeyIdentifierInfo("F11", new Short(com.sun.star.awt.Key.F11)), - new KeyIdentifierInfo("F12", new Short(com.sun.star.awt.Key.F12)), - new KeyIdentifierInfo("DOWN", new Short(com.sun.star.awt.Key.DOWN)), - new KeyIdentifierInfo("UP", new Short(com.sun.star.awt.Key.UP)), - new KeyIdentifierInfo("LEFT", new Short(com.sun.star.awt.Key.LEFT)), - new KeyIdentifierInfo("RIGHT", new Short(com.sun.star.awt.Key.RIGHT)), - new KeyIdentifierInfo("HOME", new Short(com.sun.star.awt.Key.HOME)), - new KeyIdentifierInfo("END", new Short(com.sun.star.awt.Key.END)), - new KeyIdentifierInfo("PAGEUP", new Short(com.sun.star.awt.Key.PAGEUP)), - new KeyIdentifierInfo("PAGEDOWN", new Short(com.sun.star.awt.Key.PAGEDOWN)), - new KeyIdentifierInfo("RETURN", new Short(com.sun.star.awt.Key.RETURN)), - new KeyIdentifierInfo("ESCAPE", new Short(com.sun.star.awt.Key.ESCAPE)), - new KeyIdentifierInfo("TAB", new Short(com.sun.star.awt.Key.TAB)), - new KeyIdentifierInfo("BACKSPACE", new Short(com.sun.star.awt.Key.BACKSPACE)), - new KeyIdentifierInfo("SPACE", new Short(com.sun.star.awt.Key.SPACE)), - new KeyIdentifierInfo("INSERT", new Short(com.sun.star.awt.Key.INSERT)), - new KeyIdentifierInfo("DELETE", new Short(com.sun.star.awt.Key.DELETE)), - new KeyIdentifierInfo("ADD", new Short(com.sun.star.awt.Key.ADD)), - new KeyIdentifierInfo("SUBTRACT", new Short(com.sun.star.awt.Key.SUBTRACT)), - new KeyIdentifierInfo("MULTIPLY", new Short(com.sun.star.awt.Key.MULTIPLY)), - new KeyIdentifierInfo("DIVIDE", new Short(com.sun.star.awt.Key.DIVIDE)), - new KeyIdentifierInfo("CUT", new Short(com.sun.star.awt.Key.CUT)), - new KeyIdentifierInfo("COPY", new Short(com.sun.star.awt.Key.COPY)), - new KeyIdentifierInfo("PASTE", new Short(com.sun.star.awt.Key.PASTE)), - new KeyIdentifierInfo("UNDO", new Short(com.sun.star.awt.Key.UNDO)), - new KeyIdentifierInfo("REPEAT", new Short(com.sun.star.awt.Key.REPEAT)) - }; - - aIdentifierHashMap = new IdentifierHashMap(); - aCodeHashMap = new CodeHashMap(); - for (int i = 0; i + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.dispatches; + +// __________ Imports __________ + +// structs, const, ... +import com.sun.star.beans.PropertyValue; + +// exceptions +import com.sun.star.frame.DispatchDescriptor; +import com.sun.star.frame.XDispatch; +import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.XDispatchProviderInterceptor; +import com.sun.star.frame.XInterceptorInfo; +import com.sun.star.frame.XStatusListener; + +// interfaces + + +// helper +import com.sun.star.util.URL; + +// others +//import java.lang.*; + +// __________ Implementation __________ + +/** + * implements a configurable interceptor for dispatch events. + */ +public class Interceptor implements XDispatchProvider, + XDispatch, + XDispatchProviderInterceptor, + XInterceptorInfo +{ + // ____________________ + + /** contains the list of interception URL schema's (wildcards are allowed there!) + supported by this interceptor. It can be set from outside. + If no external URLs are set, the default "*" is used instead. + That would have the same effect as if this implementation would not support the + interface XInterceptorInfo ! + */ + private String[] m_lURLs4InterceptionInfo = null; + + // ____________________ + + /** These URL's will be blocked by this interceptor. + Can be set from outside. Every queryDispatch() for these + set of URL's will be answered with an empty dispatch object! + If no external URLs are set the default "*" is used instead. + So every incoming URL will be blocked .-) + */ + private String[] m_lURLs4Blocking = null; + + // ____________________ + + /** Every dispatch interceptor knows it's master and slave interceptor + of the dispatch chain. These values must be stupid handled .-) + They have to be set and reset in case the right interface methods are called. + Nothing more. It's not allowed to dispose() it. + The slave can be used inside queryDispatch() to forward requests, + which are not handled by this interceptor instance. + */ + private XDispatchProvider m_xSlave = null; + private XDispatchProvider m_xMaster = null; + + // ____________________ + + /** counts calls of setSlave...(). + So the outside API test can use this value to know if this interceptor + was realy added to the interceptor chain of OOo. + */ + private int m_nRegistrationCount = 0; + + // ____________________ + + /** indicates if this interceptor object is currently part of the interceptor + chain of OOo. Only true if a valid slave or master dispatch is set on this + instance. + */ + private boolean m_bIsRegistered = false; + + + // ____________________ + + /** ctor + * It's initialize an object of this class with default values. + */ + public Interceptor() + { + } + + // ____________________ + + /** XInterceptorInfo */ + public synchronized String[] getInterceptedURLs() + { + return impl_getURLs4InterceptionInfo(); + } + + // ____________________ + + /** XDispatchProviderInterceptor */ + public synchronized XDispatchProvider getSlaveDispatchProvider() + { + System.out.println("Interceptor.getSlaveDispatchProvider() called"); + return m_xSlave; + } + + // ____________________ + + /** XDispatchProviderInterceptor */ + public synchronized XDispatchProvider getMasterDispatchProvider() + { + System.out.println("Interceptor.getMasterDispatchProvider() called"); + return m_xMaster; + } + + // ____________________ + + /** XDispatchProviderInterceptor */ + public synchronized void setSlaveDispatchProvider(XDispatchProvider xSlave) + { + System.out.println("Interceptor.setSlaveDispatchProvider("+xSlave+") called"); + + if (xSlave != null) + { + ++m_nRegistrationCount; + m_bIsRegistered = true; + } + else + { + m_bIsRegistered = false; + } + + m_xSlave = xSlave; + } + + // ____________________ + + /** XDispatchProviderInterceptor */ + public synchronized void setMasterDispatchProvider(XDispatchProvider xMaster) + { + System.out.println("Interceptor.setMasterDispatchProvider("+xMaster+") called"); + m_xMaster = xMaster; + } + + // ____________________ + + /** XDispatchProvider + */ + public synchronized XDispatch queryDispatch(URL aURL , + String sTargetFrameName, + int nSearchFlags ) + { + System.out.println("Interceptor.queryDispatch('"+aURL.Complete+"', '"+sTargetFrameName+"', "+nSearchFlags+") called"); + + if (impl_isBlockedURL(aURL.Complete)) + { + System.out.println("Interceptor.queryDispatch(): URL blocked => returns NULL"); + return null; + } + + if (m_xSlave != null) + { + System.out.println("Interceptor.queryDispatch(): ask slave ..."); + return m_xSlave.queryDispatch(aURL, sTargetFrameName, nSearchFlags); + } + + System.out.println("Interceptor.queryDispatch(): no idea => returns this"); + return this; + } + + // ____________________ + + /** XDispatchProvider + */ + public XDispatch[] queryDispatches(DispatchDescriptor[] lRequests) + { + int i = 0; + int c = lRequests.length; + + XDispatch[] lResults = new XDispatch[c]; + for (i=0; i - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.dispatches.helper; - -// __________ Imports __________ - -// structs, const, ... -import com.sun.star.beans.PropertyValue; - -// exceptions -import com.sun.star.frame.DispatchDescriptor; -import com.sun.star.frame.XDispatch; -import com.sun.star.frame.XDispatchProvider; -import com.sun.star.frame.XDispatchProviderInterceptor; -import com.sun.star.frame.XInterceptorInfo; -import com.sun.star.frame.XStatusListener; - -// interfaces - - -// helper -import com.sun.star.util.URL; - -// others -//import java.lang.*; - -// __________ Implementation __________ - -/** - * implements a configurable interceptor for dispatch events. - */ -public class Interceptor implements XDispatchProvider, - XDispatch, - XDispatchProviderInterceptor, - XInterceptorInfo -{ - // ____________________ - - /** contains the list of interception URL schema's (wildcards are allowed there!) - supported by this interceptor. It can be set from outside. - If no external URLs are set, the default "*" is used instead. - That would have the same effect as if this implementation would not support the - interface XInterceptorInfo ! - */ - private String[] m_lURLs4InterceptionInfo = null; - - // ____________________ - - /** These URL's will be blocked by this interceptor. - Can be set from outside. Every queryDispatch() for these - set of URL's will be answered with an empty dispatch object! - If no external URLs are set the default "*" is used instead. - So every incoming URL will be blocked .-) - */ - private String[] m_lURLs4Blocking = null; - - // ____________________ - - /** Every dispatch interceptor knows it's master and slave interceptor - of the dispatch chain. These values must be stupid handled .-) - They have to be set and reset in case the right interface methods are called. - Nothing more. It's not allowed to dispose() it. - The slave can be used inside queryDispatch() to forward requests, - which are not handled by this interceptor instance. - */ - private XDispatchProvider m_xSlave = null; - private XDispatchProvider m_xMaster = null; - - // ____________________ - - /** counts calls of setSlave...(). - So the outside API test can use this value to know if this interceptor - was realy added to the interceptor chain of OOo. - */ - private int m_nRegistrationCount = 0; - - // ____________________ - - /** indicates if this interceptor object is currently part of the interceptor - chain of OOo. Only true if a valid slave or master dispatch is set on this - instance. - */ - private boolean m_bIsRegistered = false; - - - // ____________________ - - /** ctor - * It's initialize an object of this class with default values. - */ - public Interceptor() - { - } - - // ____________________ - - /** XInterceptorInfo */ - public synchronized String[] getInterceptedURLs() - { - return impl_getURLs4InterceptionInfo(); - } - - // ____________________ - - /** XDispatchProviderInterceptor */ - public synchronized XDispatchProvider getSlaveDispatchProvider() - { - System.out.println("Interceptor.getSlaveDispatchProvider() called"); - return m_xSlave; - } - - // ____________________ - - /** XDispatchProviderInterceptor */ - public synchronized XDispatchProvider getMasterDispatchProvider() - { - System.out.println("Interceptor.getMasterDispatchProvider() called"); - return m_xMaster; - } - - // ____________________ - - /** XDispatchProviderInterceptor */ - public synchronized void setSlaveDispatchProvider(XDispatchProvider xSlave) - { - System.out.println("Interceptor.setSlaveDispatchProvider("+xSlave+") called"); - - if (xSlave != null) - { - ++m_nRegistrationCount; - m_bIsRegistered = true; - } - else - { - m_bIsRegistered = false; - } - - m_xSlave = xSlave; - } - - // ____________________ - - /** XDispatchProviderInterceptor */ - public synchronized void setMasterDispatchProvider(XDispatchProvider xMaster) - { - System.out.println("Interceptor.setMasterDispatchProvider("+xMaster+") called"); - m_xMaster = xMaster; - } - - // ____________________ - - /** XDispatchProvider - */ - public synchronized XDispatch queryDispatch(URL aURL , - String sTargetFrameName, - int nSearchFlags ) - { - System.out.println("Interceptor.queryDispatch('"+aURL.Complete+"', '"+sTargetFrameName+"', "+nSearchFlags+") called"); - - if (impl_isBlockedURL(aURL.Complete)) - { - System.out.println("Interceptor.queryDispatch(): URL blocked => returns NULL"); - return null; - } - - if (m_xSlave != null) - { - System.out.println("Interceptor.queryDispatch(): ask slave ..."); - return m_xSlave.queryDispatch(aURL, sTargetFrameName, nSearchFlags); - } - - System.out.println("Interceptor.queryDispatch(): no idea => returns this"); - return this; - } - - // ____________________ - - /** XDispatchProvider - */ - public XDispatch[] queryDispatches(DispatchDescriptor[] lRequests) - { - int i = 0; - int c = lRequests.length; - - XDispatch[] lResults = new XDispatch[c]; - for (i=0; i + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.imageManager; + +import com.sun.star.container.XNameContainer; +import com.sun.star.frame.XDesktop; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XEventListener; +import lib.TestParameters; + +/** +* Testing com.sun.star.lang.XComponent +* interface methods : +*

    +*
  • dispose()
  • +*
  • addEventListener()
  • +*
  • removeEventListener()
  • +*
+* After this interface test object must be recreated.

+* Multithreaded test ability not implemented yet. +* @see com.sun.star.lang.XComponent +*/ +public class _XComponent { + + public static XComponent oObj = null; + private XNameContainer xContainer = null; + private XComponent altDispose = null; + TestParameters tEnv = null; + boolean listenerDisposed[] = new boolean[2]; + String[] Loutput = new String[2]; + + /** + * Listener which added but not removed, and its method must be called + * on dispose call. + */ + public class MyEventListener implements XEventListener { + int number = 0; + String message = null; + public MyEventListener(int number, String message) { + this.message = message; + this.number = number; + } + public void disposing ( EventObject oEvent ) { + Loutput[number] = Thread.currentThread() + " is DISPOSING " + message + this; + listenerDisposed[number] = true; + } + }; + + XEventListener listener1 = new MyEventListener(0, "EV1"); + XEventListener listener2 = new MyEventListener(1, "EV2"); + + public _XComponent(TestParameters tEnv, XComponent oObj) { + this.tEnv = tEnv; + this.oObj = oObj; + } + + /** + * For the cfgmgr2.OSetElement tests: dispose the owner element. + */ + public void before() { + // do not dispose this component, but parent instead + altDispose = (XComponent)tEnv.get("XComponent.DisposeThis"); + + } + + /** + * Adds two listeners.

+ * Has OK status if then the first listener will receive an event + * on dispose method call. + */ + public boolean _addEventListener() { + + listenerDisposed[0] = false; + listenerDisposed[1] = false; + + oObj.addEventListener( listener1 ); + oObj.addEventListener( listener2 ); + + return true; + } // finished _addEventListener() + + /** + * Removes the second of two added listeners.

+ * Method tests to be completed successfully : + *

    + *
  • addEventListener : method must add two listeners.
  • + *

+ * Has OK status if no events will be sent to the second listener on + * dispose method call. + */ + public boolean _removeEventListener() { + if (disposed) + { + System.out.println("Hint: already disposed."); + return false; + } + // the second listener should not be called + oObj.removeEventListener( listener2 ); + System.out.println(Thread.currentThread() + " is removing EL " + listener2); + return true; + } // finished _removeEventListener() + + static boolean disposed = false; + + /** + * Disposes the object and then check appropriate listeners were + * called or not.

+ * Method tests to be completed successfully : + *

    + *
  • removeEventListener : method must remove one of two + * listeners.
  • + *

+ * Has OK status if liseter removed wasn't called and other listener + * was. + */ + public boolean _dispose() { + disposed = false; + + System.out.println( "begin dispose" + Thread.currentThread()); + XDesktop oDesk = (XDesktop) tEnv.get("Desktop"); + if (oDesk !=null) { + oDesk.terminate(); + } + else { + if (altDispose == null) + { + oObj.dispose(); + } + else + { + altDispose.dispose(); + } + } + + try { + Thread.sleep(500) ; + } catch (InterruptedException e) {} + if (Loutput[0]!=null){ + System.out.println(Loutput[0]); + } + if (Loutput[1]!=null) { + System.out.println(Loutput[1]); + } + System.out.println( "end dispose" + Thread.currentThread()); + disposed = true; + + // check that dispose() works OK. + return listenerDisposed[0] && !listenerDisposed[1]; + + } // finished _dispose() + + /** + * Forces object recreation. + */ + protected void after() { +// disposeEnvironment(); + } + +} // finished class _XComponent + + diff --git a/framework/qa/complex/imageManager/_XImageManager.java b/framework/qa/complex/imageManager/_XImageManager.java new file mode 100755 index 000000000000..5887fd8fa0d8 --- /dev/null +++ b/framework/qa/complex/imageManager/_XImageManager.java @@ -0,0 +1,117 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.imageManager; + +import com.sun.star.graphic.XGraphic; +import com.sun.star.ui.ImageType; +import com.sun.star.ui.XImageManager; +import lib.TestParameters; + + +/** + * + */ +public class _XImageManager { + + TestParameters tEnv = null; + String[]imageNames = null; + XGraphic[] xGraphicArray = null; + public XImageManager oObj; + + public _XImageManager( TestParameters tEnv, XImageManager oObj) { + + this.tEnv = tEnv; + this.oObj = oObj; + } + + public boolean _getAllImageNames() { + short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; + imageNames = oObj.getAllImageNames(s); + for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) + { + System.out.println("###### Image: " + imageNames[i]); + } + return imageNames != null; + } + + public boolean _getImages() { + short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; + try { + xGraphicArray = oObj.getImages(s, imageNames); + } + catch(com.sun.star.lang.IllegalArgumentException e) { + } + return xGraphicArray != null; + } + + public boolean _hasImage() { + boolean result = true; + short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; + try { // check the first image names, 10 at max + for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) + { + result &= oObj.hasImage(s, imageNames[i]); + } + } + catch(com.sun.star.lang.IllegalArgumentException e) { + result = false; + } + return result; + } + + public boolean _insertImages() { + try { + oObj.insertImages((short)imageNames.length, imageNames, xGraphicArray); + } + catch(com.sun.star.container.ElementExistException e) { + } + catch(com.sun.star.lang.IllegalArgumentException e) { + } + catch(com.sun.star.lang.IllegalAccessException e) { + } + return true; + } + + public boolean _removeImages() { + try { + oObj.removeImages((short)(imageNames.length-1), imageNames); + } + catch(com.sun.star.lang.IllegalArgumentException e) { + } + catch(com.sun.star.lang.IllegalAccessException e) { + } + return true; + } + + public boolean _replaceImages() { + return true; + } + + public boolean _reset() { + return true; + } +} diff --git a/framework/qa/complex/imageManager/_XInitialization.java b/framework/qa/complex/imageManager/_XInitialization.java new file mode 100755 index 000000000000..fcfaf5f981d3 --- /dev/null +++ b/framework/qa/complex/imageManager/_XInitialization.java @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.imageManager; + + + + +import com.sun.star.lang.XInitialization; +import lib.TestParameters; + +/** +* Testing com.sun.star.lang.XInitialization +* interface methods.

+* This test needs the following object relations : +*

    +*
  • 'XInitialization.args' (of type Object[]): +* (Optional) : argument for initialize +* method. If ommitet zero length array is used.
  • +*

      +* Test is multithread compilant.

      +* Till the present time there was no need to recreate environment +* after this test completion. +*/ +public class _XInitialization { + + + TestParameters tEnv = null; + public static XInitialization oObj = null; + + public _XInitialization(TestParameters tEnv, XInitialization oObj) { + + this.tEnv = tEnv; + this.oObj = oObj; + } + + /** + * Test calls the method with 0 length array and checks that + * no exceptions were thrown.

      + * Has OK status if no exceptions were thrown.

      + */ + public boolean _initialize() { + boolean result = true ; + + try { + Object[] args = (Object[]) tEnv.get("XInitialization.args"); + if (args==null) { + oObj.initialize(new Object[0]); + } else { + oObj.initialize(args); + } + + } catch (com.sun.star.uno.Exception e) { + System.out.println("Exception occured while method calling.") ; + result = false ; + } + + return result ; + } // finished _initialize() + + /** + * Disposes object environment. + */ + public void after() { +// disposeEnvironment() ; + } + +} // finished class _XInitialization + + diff --git a/framework/qa/complex/imageManager/_XTypeProvider.java b/framework/qa/complex/imageManager/_XTypeProvider.java new file mode 100755 index 000000000000..08b810198d9b --- /dev/null +++ b/framework/qa/complex/imageManager/_XTypeProvider.java @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.imageManager; + + + +import com.sun.star.lang.XTypeProvider; +import com.sun.star.uno.Type; +import lib.TestParameters; + +/** +* Testing com.sun.star.lang.XTypeProvider +* interface methods : +*

        +*
      • getTypes()
      • +*
      • getImplementationId()
      • +*

      +* Test is NOT multithread compilant.

      +* @see com.sun.star.lang.XTypeProvider +*/ +public class _XTypeProvider { + + + TestParameters tEnv = null; + public static XTypeProvider oObj = null; + public static Type[] types = null; + + public _XTypeProvider(TestParameters tEnv, XTypeProvider oObj) { + + this.tEnv = tEnv; + this.oObj = oObj; + } + + /** + * Just calls the method.

      + * Has OK status if no runtime exceptions occured. + */ + public boolean _getImplementationId() { + boolean result = true; + System.out.println("testing getImplementationId() ... "); + + System.out.println("The ImplementationId is "+oObj.getImplementationId()); + result = true; + + return result; + + } // end getImplementationId() + + + /** + * Calls the method and checks the return value.

      + * Has OK status if one of the return value equals to the + * type com.sun.star.lang.XTypeProvider. + */ + public boolean _getTypes() { + boolean result = false; + System.out.println("getting Types..."); + types = oObj.getTypes(); + for (int i=0;i"); + } + + return result; + + } // end getTypes() + +} + diff --git a/framework/qa/complex/imageManager/_XUIConfiguration.java b/framework/qa/complex/imageManager/_XUIConfiguration.java new file mode 100755 index 000000000000..ec9d5f3fc634 --- /dev/null +++ b/framework/qa/complex/imageManager/_XUIConfiguration.java @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.imageManager; + + +import com.sun.star.ui.XUIConfiguration; +import com.sun.star.ui.XUIConfigurationListener; +import lib.TestParameters; + + + +public class _XUIConfiguration { + + + TestParameters tEnv = null; + public XUIConfiguration oObj; + XUIConfigurationListenerImpl xListener = null; + + public static interface XUIConfigurationListenerImpl + extends XUIConfigurationListener { + public void reset(); + public void fireEvent(); + public boolean actionWasTriggered(); + } + + + public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) { + this.tEnv = tEnv; + this.oObj = oObj; + } + + public void before() { + xListener = (XUIConfigurationListenerImpl)tEnv.get( + "XUIConfiguration.XUIConfigurationListenerImpl"); + XUIConfigurationListener l; + } + + public boolean _addConfigurationListener() { + oObj.addConfigurationListener(xListener); + xListener.fireEvent(); + return xListener.actionWasTriggered(); + } + + public boolean _removeConfigurationListener() { + oObj.removeConfigurationListener(xListener); + xListener.reset(); + xListener.fireEvent(); + return !xListener.actionWasTriggered(); + } + + /** + * Dispose because the UIConfigurationManager has to be recreated + */ + public void after() { +// disposeEnvironment(); + } +} diff --git a/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java b/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java new file mode 100755 index 000000000000..1dec01ad0660 --- /dev/null +++ b/framework/qa/complex/imageManager/_XUIConfigurationPersistence.java @@ -0,0 +1,93 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.imageManager; + +import com.sun.star.embed.XStorage; +import com.sun.star.ui.XUIConfigurationPersistence; +import lib.TestParameters; + + + +public class _XUIConfigurationPersistence { + + + TestParameters tEnv = null; + public XUIConfigurationPersistence oObj; + private XStorage xStore = null; + + public _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj) { + + this.tEnv = tEnv; + this.oObj = oObj; + } + + public void before() { + xStore = (XStorage)tEnv.get("XUIConfigurationStorage.Storage"); + } + + public boolean _reload() { + try { + oObj.reload(); + } + catch(com.sun.star.uno.Exception e) { + + } + return true; + } + + public boolean _store() { + try { + oObj.store(); + } + catch(com.sun.star.uno.Exception e) { + + } + return true; + } + + public boolean _storeToStorage() { + boolean result = true; + try { + oObj.storeToStorage(xStore); + } + catch(com.sun.star.uno.Exception e) { + result = false; + + } + return result; + } + + public boolean _isModified() { + return !oObj.isModified(); + } + + public boolean _isReadOnly() { + return !oObj.isReadOnly(); + } + +} diff --git a/framework/qa/complex/imageManager/interfaces/_XComponent.java b/framework/qa/complex/imageManager/interfaces/_XComponent.java deleted file mode 100755 index 1d4db9d76fec..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XComponent.java +++ /dev/null @@ -1,187 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.imageManager.interfaces; - -import com.sun.star.container.XNameContainer; -import com.sun.star.frame.XDesktop; -import com.sun.star.lang.EventObject; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XEventListener; -import lib.TestParameters; - -/** -* Testing com.sun.star.lang.XComponent -* interface methods : -*

        -*
      • dispose()
      • -*
      • addEventListener()
      • -*
      • removeEventListener()
      • -*
      -* After this interface test object must be recreated.

      -* Multithreaded test ability not implemented yet. -* @see com.sun.star.lang.XComponent -*/ -public class _XComponent { - - public static XComponent oObj = null; - private XNameContainer xContainer = null; - private XComponent altDispose = null; - TestParameters tEnv = null; - boolean listenerDisposed[] = new boolean[2]; - String[] Loutput = new String[2]; - - /** - * Listener which added but not removed, and its method must be called - * on dispose call. - */ - public class MyEventListener implements XEventListener { - int number = 0; - String message = null; - public MyEventListener(int number, String message) { - this.message = message; - this.number = number; - } - public void disposing ( EventObject oEvent ) { - Loutput[number] = Thread.currentThread() + " is DISPOSING " + message + this; - listenerDisposed[number] = true; - } - }; - - XEventListener listener1 = new MyEventListener(0, "EV1"); - XEventListener listener2 = new MyEventListener(1, "EV2"); - - public _XComponent(TestParameters tEnv, XComponent oObj) { - this.tEnv = tEnv; - this.oObj = oObj; - } - - /** - * For the cfgmgr2.OSetElement tests: dispose the owner element. - */ - public void before() { - // do not dispose this component, but parent instead - altDispose = (XComponent)tEnv.get("XComponent.DisposeThis"); - - } - - /** - * Adds two listeners.

      - * Has OK status if then the first listener will receive an event - * on dispose method call. - */ - public boolean _addEventListener() { - - listenerDisposed[0] = false; - listenerDisposed[1] = false; - - oObj.addEventListener( listener1 ); - oObj.addEventListener( listener2 ); - - return true; - } // finished _addEventListener() - - /** - * Removes the second of two added listeners.

      - * Method tests to be completed successfully : - *

        - *
      • addEventListener : method must add two listeners.
      • - *

      - * Has OK status if no events will be sent to the second listener on - * dispose method call. - */ - public boolean _removeEventListener() { - if (disposed) - { - System.out.println("Hint: already disposed."); - return false; - } - // the second listener should not be called - oObj.removeEventListener( listener2 ); - System.out.println(Thread.currentThread() + " is removing EL " + listener2); - return true; - } // finished _removeEventListener() - - static boolean disposed = false; - - /** - * Disposes the object and then check appropriate listeners were - * called or not.

      - * Method tests to be completed successfully : - *

        - *
      • removeEventListener : method must remove one of two - * listeners.
      • - *

      - * Has OK status if liseter removed wasn't called and other listener - * was. - */ - public boolean _dispose() { - disposed = false; - - System.out.println( "begin dispose" + Thread.currentThread()); - XDesktop oDesk = (XDesktop) tEnv.get("Desktop"); - if (oDesk !=null) { - oDesk.terminate(); - } - else { - if (altDispose == null) - { - oObj.dispose(); - } - else - { - altDispose.dispose(); - } - } - - try { - Thread.sleep(500) ; - } catch (InterruptedException e) {} - if (Loutput[0]!=null){ - System.out.println(Loutput[0]); - } - if (Loutput[1]!=null) { - System.out.println(Loutput[1]); - } - System.out.println( "end dispose" + Thread.currentThread()); - disposed = true; - - // check that dispose() works OK. - return listenerDisposed[0] && !listenerDisposed[1]; - - } // finished _dispose() - - /** - * Forces object recreation. - */ - protected void after() { -// disposeEnvironment(); - } - -} // finished class _XComponent - - diff --git a/framework/qa/complex/imageManager/interfaces/_XImageManager.java b/framework/qa/complex/imageManager/interfaces/_XImageManager.java deleted file mode 100755 index 4c62039e348d..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XImageManager.java +++ /dev/null @@ -1,117 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.imageManager.interfaces; - -import com.sun.star.graphic.XGraphic; -import com.sun.star.ui.ImageType; -import com.sun.star.ui.XImageManager; -import lib.TestParameters; - - -/** - * - */ -public class _XImageManager { - - TestParameters tEnv = null; - String[]imageNames = null; - XGraphic[] xGraphicArray = null; - public XImageManager oObj; - - public _XImageManager( TestParameters tEnv, XImageManager oObj) { - - this.tEnv = tEnv; - this.oObj = oObj; - } - - public boolean _getAllImageNames() { - short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; - imageNames = oObj.getAllImageNames(s); - for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) - { - System.out.println("###### Image: " + imageNames[i]); - } - return imageNames != null; - } - - public boolean _getImages() { - short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; - try { - xGraphicArray = oObj.getImages(s, imageNames); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - } - return xGraphicArray != null; - } - - public boolean _hasImage() { - boolean result = true; - short s = ImageType.COLOR_NORMAL + ImageType.SIZE_DEFAULT; - try { // check the first image names, 10 at max - for (int i=0; i<(imageNames.length>10?10:imageNames.length); i++) - { - result &= oObj.hasImage(s, imageNames[i]); - } - } - catch(com.sun.star.lang.IllegalArgumentException e) { - result = false; - } - return result; - } - - public boolean _insertImages() { - try { - oObj.insertImages((short)imageNames.length, imageNames, xGraphicArray); - } - catch(com.sun.star.container.ElementExistException e) { - } - catch(com.sun.star.lang.IllegalArgumentException e) { - } - catch(com.sun.star.lang.IllegalAccessException e) { - } - return true; - } - - public boolean _removeImages() { - try { - oObj.removeImages((short)(imageNames.length-1), imageNames); - } - catch(com.sun.star.lang.IllegalArgumentException e) { - } - catch(com.sun.star.lang.IllegalAccessException e) { - } - return true; - } - - public boolean _replaceImages() { - return true; - } - - public boolean _reset() { - return true; - } -} diff --git a/framework/qa/complex/imageManager/interfaces/_XInitialization.java b/framework/qa/complex/imageManager/interfaces/_XInitialization.java deleted file mode 100755 index d1da1b2158e7..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XInitialization.java +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.imageManager.interfaces; - - - - -import com.sun.star.lang.XInitialization; -import lib.TestParameters; - -/** -* Testing com.sun.star.lang.XInitialization -* interface methods.

      -* This test needs the following object relations : -*

        -*
      • 'XInitialization.args' (of type Object[]): -* (Optional) : argument for initialize -* method. If ommitet zero length array is used.
      • -*

          -* Test is multithread compilant.

          -* Till the present time there was no need to recreate environment -* after this test completion. -*/ -public class _XInitialization { - - - TestParameters tEnv = null; - public static XInitialization oObj = null; - - public _XInitialization(TestParameters tEnv, XInitialization oObj) { - - this.tEnv = tEnv; - this.oObj = oObj; - } - - /** - * Test calls the method with 0 length array and checks that - * no exceptions were thrown.

          - * Has OK status if no exceptions were thrown.

          - */ - public boolean _initialize() { - boolean result = true ; - - try { - Object[] args = (Object[]) tEnv.get("XInitialization.args"); - if (args==null) { - oObj.initialize(new Object[0]); - } else { - oObj.initialize(args); - } - - } catch (com.sun.star.uno.Exception e) { - System.out.println("Exception occured while method calling.") ; - result = false ; - } - - return result ; - } // finished _initialize() - - /** - * Disposes object environment. - */ - public void after() { -// disposeEnvironment() ; - } - -} // finished class _XInitialization - - diff --git a/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java b/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java deleted file mode 100755 index bf8e1ca6f850..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XTypeProvider.java +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.imageManager.interfaces; - - - -import com.sun.star.lang.XTypeProvider; -import com.sun.star.uno.Type; -import lib.TestParameters; - -/** -* Testing com.sun.star.lang.XTypeProvider -* interface methods : -*

            -*
          • getTypes()
          • -*
          • getImplementationId()
          • -*

          -* Test is NOT multithread compilant.

          -* @see com.sun.star.lang.XTypeProvider -*/ -public class _XTypeProvider { - - - TestParameters tEnv = null; - public static XTypeProvider oObj = null; - public static Type[] types = null; - - public _XTypeProvider(TestParameters tEnv, XTypeProvider oObj) { - - this.tEnv = tEnv; - this.oObj = oObj; - } - - /** - * Just calls the method.

          - * Has OK status if no runtime exceptions occured. - */ - public boolean _getImplementationId() { - boolean result = true; - System.out.println("testing getImplementationId() ... "); - - System.out.println("The ImplementationId is "+oObj.getImplementationId()); - result = true; - - return result; - - } // end getImplementationId() - - - /** - * Calls the method and checks the return value.

          - * Has OK status if one of the return value equals to the - * type com.sun.star.lang.XTypeProvider. - */ - public boolean _getTypes() { - boolean result = false; - System.out.println("getting Types..."); - types = oObj.getTypes(); - for (int i=0;i"); - } - - return result; - - } // end getTypes() - -} - diff --git a/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java b/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java deleted file mode 100755 index 39e2fccfb09d..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XUIConfiguration.java +++ /dev/null @@ -1,82 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.imageManager.interfaces; - - -import com.sun.star.ui.XUIConfiguration; -import com.sun.star.ui.XUIConfigurationListener; -import lib.TestParameters; - - - -public class _XUIConfiguration { - - - TestParameters tEnv = null; - public XUIConfiguration oObj; - XUIConfigurationListenerImpl xListener = null; - - public static interface XUIConfigurationListenerImpl - extends XUIConfigurationListener { - public void reset(); - public void fireEvent(); - public boolean actionWasTriggered(); - } - - - public _XUIConfiguration(TestParameters tEnv, XUIConfiguration oObj) { - this.tEnv = tEnv; - this.oObj = oObj; - } - - public void before() { - xListener = (XUIConfigurationListenerImpl)tEnv.get( - "XUIConfiguration.XUIConfigurationListenerImpl"); - XUIConfigurationListener l; - } - - public boolean _addConfigurationListener() { - oObj.addConfigurationListener(xListener); - xListener.fireEvent(); - return xListener.actionWasTriggered(); - } - - public boolean _removeConfigurationListener() { - oObj.removeConfigurationListener(xListener); - xListener.reset(); - xListener.fireEvent(); - return !xListener.actionWasTriggered(); - } - - /** - * Dispose because the UIConfigurationManager has to be recreated - */ - public void after() { -// disposeEnvironment(); - } -} diff --git a/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java b/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java deleted file mode 100755 index 12de107296e5..000000000000 --- a/framework/qa/complex/imageManager/interfaces/_XUIConfigurationPersistence.java +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.imageManager.interfaces; - -import com.sun.star.embed.XStorage; -import com.sun.star.ui.XUIConfigurationPersistence; -import lib.TestParameters; - - - -public class _XUIConfigurationPersistence { - - - TestParameters tEnv = null; - public XUIConfigurationPersistence oObj; - private XStorage xStore = null; - - public _XUIConfigurationPersistence(TestParameters tEnv, XUIConfigurationPersistence oObj) { - - this.tEnv = tEnv; - this.oObj = oObj; - } - - public void before() { - xStore = (XStorage)tEnv.get("XUIConfigurationStorage.Storage"); - } - - public boolean _reload() { - try { - oObj.reload(); - } - catch(com.sun.star.uno.Exception e) { - - } - return true; - } - - public boolean _store() { - try { - oObj.store(); - } - catch(com.sun.star.uno.Exception e) { - - } - return true; - } - - public boolean _storeToStorage() { - boolean result = true; - try { - oObj.storeToStorage(xStore); - } - catch(com.sun.star.uno.Exception e) { - result = false; - - } - return result; - } - - public boolean _isModified() { - return !oObj.isModified(); - } - - public boolean _isReadOnly() { - return !oObj.isReadOnly(); - } - -} diff --git a/framework/qa/complex/imageManager/makefile.mk b/framework/qa/complex/imageManager/makefile.mk index e455a297072d..133e522b13b4 100755 --- a/framework/qa/complex/imageManager/makefile.mk +++ b/framework/qa/complex/imageManager/makefile.mk @@ -41,14 +41,17 @@ JAVATESTFILES = \ CheckImageManager.java # put here all other files -JAVAFILES = $(JAVATESTFILES) +JAVAFILES = $(JAVATESTFILES) \ + _XComponent.java \ + _XImageManager.java \ + _XInitialization.java \ + _XTypeProvider.java \ + _XUIConfiguration.java \ + _XUIConfigurationPersistence.java JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -SUBDIRS = interfaces - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java index 7eb4972d630a..1c67271fd6bb 100644 --- a/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java +++ b/framework/qa/complex/loadAllDocuments/CheckXComponentLoader.java @@ -39,8 +39,6 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.util.XCloseable; import com.sun.star.ucb.XSimpleFileAccess; -import complex.loadAllDocuments.helper.InteractionHandler; -import complex.loadAllDocuments.helper.StatusIndicator; import helper.URLHelper; diff --git a/framework/qa/complex/loadAllDocuments/InteractionHandler.java b/framework/qa/complex/loadAllDocuments/InteractionHandler.java new file mode 100644 index 000000000000..92d8f3c34543 --- /dev/null +++ b/framework/qa/complex/loadAllDocuments/InteractionHandler.java @@ -0,0 +1,155 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.loadAllDocuments; + +import com.sun.star.beans.PropertyValue; + +import com.sun.star.uno.Exception; +import com.sun.star.uno.RuntimeException; + +import com.sun.star.task.XInteractionHandler; +import com.sun.star.task.XInteractionAbort; +import com.sun.star.task.XInteractionRetry; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.AnyConverter; + +//import java.lang.*; + + +/** + * Implemets a simple interaction handler, + * which can abort all incoming interactions only ... but make it possible to + * log it. So it can be used for debug and test purposes. + */ +public class InteractionHandler implements XInteractionHandler +{ + // ____________________ + + /** + * @const RETRY_COUNT it defines the max count of + * retrying of an interaction + */ + private static final int RETRY_COUNT = 3; + + // ____________________ + + /** + * @member m_aRequest the origianl interaction request + * safed for later analyzing + * @member m_bWasUsed true if the interaction handler was used + * @member m_nTry count using of RETRY continuations + */ + private Object m_aRequest ; + private int m_nTry ; + private boolean m_bWasUsed ; + + + /** + * ctor + * It's initialize an object of this class with default values + * and set the protocol stack. So the outside code can check + * if this handler was used or not. + */ + public InteractionHandler() + { + m_aRequest = null ; + //m_aProtocol = aProtocol; + m_nTry = 0 ; + m_bWasUsed = false; + } + + /** + * Called to start the interaction, because the outside code whish to solve + * a detected problem or to inform the user about something. + * We safe the informations here and can handle two well known continuations + * only. + * [abort and retry]. + * + * @param xRequest + * describe the interaction + */ + public void handle(com.sun.star.task.XInteractionRequest xRequest) + { + m_bWasUsed = true; + + // first sav thje original request + // Our user can use this information later for some debug analyzing + Object aRequest = xRequest.getRequest(); + synchronized(this) + { + m_aRequest = aRequest; + } + + // analyze the possible continuations. + // We can abort all incoming interactions only. + // But additional we can try to continue it several times too. + // Of course after e.g. three loops we have to stop and abort it. + com.sun.star.task.XInteractionContinuation[] lContinuations = xRequest.getContinuations(); + + com.sun.star.task.XInteractionAbort xAbort = null; + com.sun.star.task.XInteractionRetry xRetry = null; + com.sun.star.uno.Type xAbortType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionAbort.class); + com.sun.star.uno.Type xRetryType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionRetry.class); + + for (int i=0; i + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.loadAllDocuments; + +// __________ Imports __________ + +// structs, const, ... +import com.sun.star.beans.PropertyValue; + +// exceptions +import com.sun.star.uno.Exception; +import com.sun.star.uno.RuntimeException; + +// interfaces +import com.sun.star.task.XStatusIndicator; + +// helper +import com.sun.star.uno.UnoRuntime; + +// others +//import java.lang.*; + +// __________ Implementation __________ + +/** + * Implemets a simple status indicator, which + * provide informations about state of a load request. + * It can be used as an argument e.g. for loadComponentFromURL(). + */ +public class StatusIndicator implements com.sun.star.task.XStatusIndicator +{ + // ____________________ + + /** + * @const SHOWSTATUS_NO don't show the status - but save information about using of this indicator object + * @const SHOWSTATUS_LOG the possible set protocol object will be used (it covers STDOUT, STDERR automaticly too) + * @const SHOWSTATUS_DIALOG the status will be shown inside a java dialog + * @const SHOWSTATUS_LINK the status will be notified to interested listener (one listener only!) + */ + public static final int SHOWSTATUS_NO = 0; + public static final int SHOWSTATUS_LOG = 1; + public static final int SHOWSTATUS_DIALOG = 4; + public static final int SHOWSTATUS_LINK = 8; + + // ____________________ + + /** + * @member m_sText text, which describe the current status + * @member m_nRange max value for any progress + * @member m_nValue the progress value + * @member m_nOut regulate, how the status will be shown + * @member m_aProtocol used for logging and transport information about used interface of this object + */ + private String m_sText ; + private int m_nRange ; + private int m_nValue ; + private int m_nOut ; +// private Protocol m_aProtocol ; + private boolean m_bWasUsed ; + + // ____________________ + + /** + * ctor + * It's initialize an object of this class with default values. + */ + public StatusIndicator( int nOut) + { + m_sText = new String() ; + m_nRange = 100 ; + m_nValue = 0 ; + m_nOut = nOut ; + //m_aProtocol = aProtocol ; + m_bWasUsed = false; +// aProtocol.resetUsingState(); + } + + // ____________________ + + /** + * It starts the progress and set the initial text and range. + * + * @param sText + * the initial text for showing + * + * @param nRange + * the new range for following progress + */ + public void start( /*IN*/String sText, /*IN*/int nRange ) + { + synchronized(this) + { + //m_aProtocol.log("start("+sText+","+nRange+")\n"); + m_bWasUsed = true; +// m_aProtocol.itWasUsed(); + + m_sText = sText ; + m_nRange = nRange; + m_nValue = 0 ; + } + impl_show(); + } + + // ____________________ + + /** + * Finish the progress and reset internal members. + */ + public void end() + { + synchronized(this) + { + //m_aProtocol.log("end()\n"); + m_bWasUsed = true; +// m_aProtocol.itWasUsed(); + + m_sText = new String(); + m_nRange = 100; + m_nValue = 0; + } + impl_show(); + } + + // ____________________ + + /** + * Set the new description text. + * + * @param sText + * the new text for showing + */ + public void setText( /*IN*/String sText ) + { + synchronized(this) + { + //m_aProtocol.log("setText("+sText+")\n"); + m_bWasUsed = true; +// m_aProtocol.itWasUsed(); + + m_sText = sText; + } + impl_show(); + } + + // ____________________ + + /** + * Set the new progress value. + * + * @param nValue + * the new progress value + * Must fit the range! + */ + public void setValue( /*IN*/int nValue ) + { + synchronized(this) + { + //m_aProtocol.log("setValue("+nValue+")\n"); + m_bWasUsed = true; +// m_aProtocol.itWasUsed(); + + if (nValue<=m_nRange) + m_nValue = nValue; + } + impl_show(); + } + + // ____________________ + + /** + * Reset text and progress value to her defaults. + */ + public void reset() + { + synchronized(this) + { + //m_aProtocol.log("reset()\n"); + m_bWasUsed = true; +// m_aProtocol.itWasUsed(); + + m_sText = new String(); + m_nValue = 0; + } + impl_show(); + } + + // ____________________ + + /** + * Internal helper to show the status. + * Currently it's implement as normal text out on stdout. + * But of course other thimngs are possible here too. + * e.g. a dialog + */ + private void impl_show() + { +/* synchronized(this) + { + if ((m_nOut & SHOWSTATUS_LOG) == SHOWSTATUS_LOG) + //m_aProtocol.log("\t["+m_nValue+"/"+m_nRange+"] "+m_sText+"\n"); + + //if ((m_nOut & SHOWSTATUS_DIALOG) == SHOWSTATUS_DIALOG) + // not supported yet! + + //if ((m_nOut & SHOWSTATUS_LINK) == SHOWSTATUS_LINK) + // not supported yet! + } */ + } + + public boolean wasUsed() { + return m_bWasUsed; + } +} diff --git a/framework/qa/complex/loadAllDocuments/StreamSimulator.java b/framework/qa/complex/loadAllDocuments/StreamSimulator.java new file mode 100644 index 000000000000..7b59c25d0a79 --- /dev/null +++ b/framework/qa/complex/loadAllDocuments/StreamSimulator.java @@ -0,0 +1,474 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.loadAllDocuments; + +import com.sun.star.uno.UnoRuntime; +import com.sun.star.ucb.XSimpleFileAccess; +import com.sun.star.lang.XMultiServiceFactory; + +/** + * Simulates an input and output stream and + * implements the interfaces XInputStream, XOutputStream. + * So it can be used for testing loading/saving of documents + * using streams instead of URLs. + */ +public class StreamSimulator implements com.sun.star.io.XInputStream , + com.sun.star.io.XOutputStream , + com.sun.star.io.XSeekable +{ + //_________________________________ + /** + * @member m_sFileName name of the corrsponding file on disk + * @member m_xInStream the internal input stream for reading + * @member m_xOutStream the internal input stream for writing + * @member m_xSeek points at runtime to m_xInStream or m_xOutStream and make it seekable + * + * @member m_bInWasUsed indicates, that the input stream interface was used + * @member m_bOutWasUsed indicates, that the output stream interface was used + */ + + private String m_sFileName ; + private com.sun.star.io.XInputStream m_xInStream ; + private com.sun.star.io.XOutputStream m_xOutStream ; + private com.sun.star.io.XSeekable m_xSeek ; + + public boolean m_bInWasUsed ; + public boolean m_bOutWasUsed ; + + /** + * construct a new instance of this class + * It set the name of the correspojnding file on disk, which + * should be source or target for the following operations on + * this object. And it regulate if it should function as + * input or output stream. + * + * @param sFileName + * name of the file on disk + * Will be used as source (if param bInput==true) + * or as target (if param bInput==false). + * + * @param bInput + * it specify, which interface should work at this object. + * => we simulate an input stream + * => we simulate an output stream + * + * @throw com.sun.star.io.NotConnectedException + * in case the internal streams to the file on disk couldn't + * be established. + * They are neccessary. Otherwhise this simulator can't + * really work. + */ + public StreamSimulator(XMultiServiceFactory xMSF, + String sFileName, boolean bInput) + throws com.sun.star.io.NotConnectedException + { + m_sFileName = sFileName ; + m_bInWasUsed = false ; + m_bOutWasUsed = false ; + + try + { + XSimpleFileAccess xHelper = (XSimpleFileAccess) + UnoRuntime.queryInterface(XSimpleFileAccess.class, + xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); + + if (xHelper == null) + throw new com.sun.star.io.NotConnectedException( + "ucb helper not available. Can't create streams."); + + if (bInput) + { + m_xInStream = xHelper.openFileRead(m_sFileName); + m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( + com.sun.star.io.XSeekable.class, + m_xInStream); + } + else + { + m_xOutStream = xHelper.openFileWrite(m_sFileName); + m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( + com.sun.star.io.XSeekable.class, + m_xOutStream); + } + } + catch(com.sun.star.uno.Exception exUno) + { + throw new com.sun.star.io.NotConnectedException( + "Could not open the file."); + } + } + + /** + * following methods simulates the XInputStream. + * The notice all actions inside the internal protocol + * and try to map all neccessary functions to the internal + * open in-stream. + */ + public int readBytes(byte[][] lData, int nBytesToRead ) + throws com.sun.star.io.NotConnectedException, + com.sun.star.io.BufferSizeExceededException, + com.sun.star.io.IOException + { + m_bInWasUsed = true; + + if (m_xInStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + int nRead = 0; + try + { + nRead = m_xInStream.readBytes(lData,nBytesToRead); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + + return nRead; + } + + public int readSomeBytes(byte[][] lData, int nMaxBytesToRead) + throws com.sun.star.io.NotConnectedException, + com.sun.star.io.BufferSizeExceededException , + com.sun.star.io.IOException + { + m_bInWasUsed = true; + + if (m_xInStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + int nRead = 0; + try + { + nRead = m_xInStream.readSomeBytes(lData,nMaxBytesToRead); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + return nRead; + } + + //_________________________________ + + public void skipBytes(int nBytesToSkip) + throws com.sun.star.io.NotConnectedException, + com.sun.star.io.BufferSizeExceededException , + com.sun.star.io.IOException + { + m_bInWasUsed = true; + + if (m_xInStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + try + { + m_xInStream.skipBytes(nBytesToSkip); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + } + + public int available() throws com.sun.star.io.NotConnectedException, + com.sun.star.io.IOException + { + m_bInWasUsed = true; + + if (m_xInStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + int nAvailable = 0; + try + { + nAvailable = m_xInStream.available(); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + return nAvailable; + } + + //_________________________________ + + public void closeInput() throws com.sun.star.io.NotConnectedException, + com.sun.star.io.IOException + { + m_bInWasUsed = true; + + if (m_xInStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + try + { + m_xInStream.closeInput(); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + } + + /** + * following methods simulates the XOutputStream. + * The notice all actions inside the internal protocol + * and try to map all neccessary functions to the internal + * open out-stream. + */ + public void writeBytes(byte[] lData) + throws com.sun.star.io.NotConnectedException, + com.sun.star.io.BufferSizeExceededException , + com.sun.star.io.IOException + { + m_bOutWasUsed = true; + + if (m_xOutStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + try + { + m_xOutStream.writeBytes(lData); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + } + + //_________________________________ + + public void flush() throws com.sun.star.io.NotConnectedException , + com.sun.star.io.BufferSizeExceededException , + com.sun.star.io.IOException + { + m_bOutWasUsed = true; + + if (m_xOutStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + try + { + m_xOutStream.flush(); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + } + + //_________________________________ + + public void closeOutput() throws com.sun.star.io.NotConnectedException , + com.sun.star.io.BufferSizeExceededException, + com.sun.star.io.IOException + { + m_bOutWasUsed = true; + + if (m_xOutStream == null) + { + throw new com.sun.star.io.NotConnectedException("stream not open"); + } + + try + { + m_xOutStream.closeOutput(); + } + catch (com.sun.star.io.NotConnectedException exConnect) { + } + catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + } + + /** + * following methods simulates the XSeekable. + * The notice all actions inside the internal protocol + * and try to map all neccessary functions to the internal + * open stream. + */ + public void seek(long nLocation ) + throws com.sun.star.lang.IllegalArgumentException, + com.sun.star.io.IOException + { + if (m_xInStream != null) + m_bInWasUsed = true; + else + if (m_xOutStream != null) + m_bOutWasUsed = true; +// else + //m_aProtocol.log("\tno stream open!\n"); + + if (m_xSeek == null) + { + throw new com.sun.star.io.IOException("stream not seekable"); + } + + try + { + m_xSeek.seek(nLocation); + } + catch (com.sun.star.lang.IllegalArgumentException exArg ) { + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + } + + public long getPosition() throws com.sun.star.io.IOException + { + + if (m_xInStream != null) + m_bInWasUsed = true; + else + if (m_xOutStream != null) + m_bOutWasUsed = true; +// else + //m_aProtocol.log("\tno stream open!\n"); + + if (m_xSeek == null) + { + throw new com.sun.star.io.IOException("stream not seekable"); + } + + long nPos = 0; + try + { + nPos = m_xSeek.getPosition(); + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + return nPos; + } + + //_________________________________ + + public long getLength() throws com.sun.star.io.IOException + { + + if (m_xInStream != null) + m_bInWasUsed = true; + else + if (m_xOutStream != null) + m_bOutWasUsed = true; +// else + //m_aProtocol.log("\tno stream open!\n"); + + if (m_xSeek == null) + { + throw new com.sun.star.io.IOException("stream not seekable"); + } + + long nLen = 0; + try + { + nLen = m_xSeek.getLength(); + } + catch (com.sun.star.io.IOException exIO ) { + } + catch (com.sun.star.uno.RuntimeException exRuntime) { + } + catch (com.sun.star.uno.Exception exUno ) { + } + + return nLen; + } +} diff --git a/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java b/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java deleted file mode 100644 index ff4bf87c4f23..000000000000 --- a/framework/qa/complex/loadAllDocuments/helper/InteractionHandler.java +++ /dev/null @@ -1,155 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.loadAllDocuments.helper; - -import com.sun.star.beans.PropertyValue; - -import com.sun.star.uno.Exception; -import com.sun.star.uno.RuntimeException; - -import com.sun.star.task.XInteractionHandler; -import com.sun.star.task.XInteractionAbort; -import com.sun.star.task.XInteractionRetry; - -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.AnyConverter; - -//import java.lang.*; - - -/** - * Implemets a simple interaction handler, - * which can abort all incoming interactions only ... but make it possible to - * log it. So it can be used for debug and test purposes. - */ -public class InteractionHandler implements XInteractionHandler -{ - // ____________________ - - /** - * @const RETRY_COUNT it defines the max count of - * retrying of an interaction - */ - private static final int RETRY_COUNT = 3; - - // ____________________ - - /** - * @member m_aRequest the origianl interaction request - * safed for later analyzing - * @member m_bWasUsed true if the interaction handler was used - * @member m_nTry count using of RETRY continuations - */ - private Object m_aRequest ; - private int m_nTry ; - private boolean m_bWasUsed ; - - - /** - * ctor - * It's initialize an object of this class with default values - * and set the protocol stack. So the outside code can check - * if this handler was used or not. - */ - public InteractionHandler() - { - m_aRequest = null ; - //m_aProtocol = aProtocol; - m_nTry = 0 ; - m_bWasUsed = false; - } - - /** - * Called to start the interaction, because the outside code whish to solve - * a detected problem or to inform the user about something. - * We safe the informations here and can handle two well known continuations - * only. - * [abort and retry]. - * - * @param xRequest - * describe the interaction - */ - public void handle(com.sun.star.task.XInteractionRequest xRequest) - { - m_bWasUsed = true; - - // first sav thje original request - // Our user can use this information later for some debug analyzing - Object aRequest = xRequest.getRequest(); - synchronized(this) - { - m_aRequest = aRequest; - } - - // analyze the possible continuations. - // We can abort all incoming interactions only. - // But additional we can try to continue it several times too. - // Of course after e.g. three loops we have to stop and abort it. - com.sun.star.task.XInteractionContinuation[] lContinuations = xRequest.getContinuations(); - - com.sun.star.task.XInteractionAbort xAbort = null; - com.sun.star.task.XInteractionRetry xRetry = null; - com.sun.star.uno.Type xAbortType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionAbort.class); - com.sun.star.uno.Type xRetryType = new com.sun.star.uno.Type(com.sun.star.task.XInteractionRetry.class); - - for (int i=0; i - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.loadAllDocuments.helper; - -// __________ Imports __________ - -// structs, const, ... -import com.sun.star.beans.PropertyValue; - -// exceptions -import com.sun.star.uno.Exception; -import com.sun.star.uno.RuntimeException; - -// interfaces -import com.sun.star.task.XStatusIndicator; - -// helper -import com.sun.star.uno.UnoRuntime; - -// others -//import java.lang.*; - -// __________ Implementation __________ - -/** - * Implemets a simple status indicator, which - * provide informations about state of a load request. - * It can be used as an argument e.g. for loadComponentFromURL(). - */ -public class StatusIndicator implements com.sun.star.task.XStatusIndicator -{ - // ____________________ - - /** - * @const SHOWSTATUS_NO don't show the status - but save information about using of this indicator object - * @const SHOWSTATUS_LOG the possible set protocol object will be used (it covers STDOUT, STDERR automaticly too) - * @const SHOWSTATUS_DIALOG the status will be shown inside a java dialog - * @const SHOWSTATUS_LINK the status will be notified to interested listener (one listener only!) - */ - public static final int SHOWSTATUS_NO = 0; - public static final int SHOWSTATUS_LOG = 1; - public static final int SHOWSTATUS_DIALOG = 4; - public static final int SHOWSTATUS_LINK = 8; - - // ____________________ - - /** - * @member m_sText text, which describe the current status - * @member m_nRange max value for any progress - * @member m_nValue the progress value - * @member m_nOut regulate, how the status will be shown - * @member m_aProtocol used for logging and transport information about used interface of this object - */ - private String m_sText ; - private int m_nRange ; - private int m_nValue ; - private int m_nOut ; -// private Protocol m_aProtocol ; - private boolean m_bWasUsed ; - - // ____________________ - - /** - * ctor - * It's initialize an object of this class with default values. - */ - public StatusIndicator( int nOut) - { - m_sText = new String() ; - m_nRange = 100 ; - m_nValue = 0 ; - m_nOut = nOut ; - //m_aProtocol = aProtocol ; - m_bWasUsed = false; -// aProtocol.resetUsingState(); - } - - // ____________________ - - /** - * It starts the progress and set the initial text and range. - * - * @param sText - * the initial text for showing - * - * @param nRange - * the new range for following progress - */ - public void start( /*IN*/String sText, /*IN*/int nRange ) - { - synchronized(this) - { - //m_aProtocol.log("start("+sText+","+nRange+")\n"); - m_bWasUsed = true; -// m_aProtocol.itWasUsed(); - - m_sText = sText ; - m_nRange = nRange; - m_nValue = 0 ; - } - impl_show(); - } - - // ____________________ - - /** - * Finish the progress and reset internal members. - */ - public void end() - { - synchronized(this) - { - //m_aProtocol.log("end()\n"); - m_bWasUsed = true; -// m_aProtocol.itWasUsed(); - - m_sText = new String(); - m_nRange = 100; - m_nValue = 0; - } - impl_show(); - } - - // ____________________ - - /** - * Set the new description text. - * - * @param sText - * the new text for showing - */ - public void setText( /*IN*/String sText ) - { - synchronized(this) - { - //m_aProtocol.log("setText("+sText+")\n"); - m_bWasUsed = true; -// m_aProtocol.itWasUsed(); - - m_sText = sText; - } - impl_show(); - } - - // ____________________ - - /** - * Set the new progress value. - * - * @param nValue - * the new progress value - * Must fit the range! - */ - public void setValue( /*IN*/int nValue ) - { - synchronized(this) - { - //m_aProtocol.log("setValue("+nValue+")\n"); - m_bWasUsed = true; -// m_aProtocol.itWasUsed(); - - if (nValue<=m_nRange) - m_nValue = nValue; - } - impl_show(); - } - - // ____________________ - - /** - * Reset text and progress value to her defaults. - */ - public void reset() - { - synchronized(this) - { - //m_aProtocol.log("reset()\n"); - m_bWasUsed = true; -// m_aProtocol.itWasUsed(); - - m_sText = new String(); - m_nValue = 0; - } - impl_show(); - } - - // ____________________ - - /** - * Internal helper to show the status. - * Currently it's implement as normal text out on stdout. - * But of course other thimngs are possible here too. - * e.g. a dialog - */ - private void impl_show() - { -/* synchronized(this) - { - if ((m_nOut & SHOWSTATUS_LOG) == SHOWSTATUS_LOG) - //m_aProtocol.log("\t["+m_nValue+"/"+m_nRange+"] "+m_sText+"\n"); - - //if ((m_nOut & SHOWSTATUS_DIALOG) == SHOWSTATUS_DIALOG) - // not supported yet! - - //if ((m_nOut & SHOWSTATUS_LINK) == SHOWSTATUS_LINK) - // not supported yet! - } */ - } - - public boolean wasUsed() { - return m_bWasUsed; - } -} diff --git a/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java b/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java deleted file mode 100644 index 2f09044960ad..000000000000 --- a/framework/qa/complex/loadAllDocuments/helper/StreamSimulator.java +++ /dev/null @@ -1,474 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.loadAllDocuments.helper; - -import com.sun.star.uno.UnoRuntime; -import com.sun.star.ucb.XSimpleFileAccess; -import com.sun.star.lang.XMultiServiceFactory; - -/** - * Simulates an input and output stream and - * implements the interfaces XInputStream, XOutputStream. - * So it can be used for testing loading/saving of documents - * using streams instead of URLs. - */ -public class StreamSimulator implements com.sun.star.io.XInputStream , - com.sun.star.io.XOutputStream , - com.sun.star.io.XSeekable -{ - //_________________________________ - /** - * @member m_sFileName name of the corrsponding file on disk - * @member m_xInStream the internal input stream for reading - * @member m_xOutStream the internal input stream for writing - * @member m_xSeek points at runtime to m_xInStream or m_xOutStream and make it seekable - * - * @member m_bInWasUsed indicates, that the input stream interface was used - * @member m_bOutWasUsed indicates, that the output stream interface was used - */ - - private String m_sFileName ; - private com.sun.star.io.XInputStream m_xInStream ; - private com.sun.star.io.XOutputStream m_xOutStream ; - private com.sun.star.io.XSeekable m_xSeek ; - - public boolean m_bInWasUsed ; - public boolean m_bOutWasUsed ; - - /** - * construct a new instance of this class - * It set the name of the correspojnding file on disk, which - * should be source or target for the following operations on - * this object. And it regulate if it should function as - * input or output stream. - * - * @param sFileName - * name of the file on disk - * Will be used as source (if param bInput==true) - * or as target (if param bInput==false). - * - * @param bInput - * it specify, which interface should work at this object. - * => we simulate an input stream - * => we simulate an output stream - * - * @throw com.sun.star.io.NotConnectedException - * in case the internal streams to the file on disk couldn't - * be established. - * They are neccessary. Otherwhise this simulator can't - * really work. - */ - public StreamSimulator(XMultiServiceFactory xMSF, - String sFileName, boolean bInput) - throws com.sun.star.io.NotConnectedException - { - m_sFileName = sFileName ; - m_bInWasUsed = false ; - m_bOutWasUsed = false ; - - try - { - XSimpleFileAccess xHelper = (XSimpleFileAccess) - UnoRuntime.queryInterface(XSimpleFileAccess.class, - xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess")); - - if (xHelper == null) - throw new com.sun.star.io.NotConnectedException( - "ucb helper not available. Can't create streams."); - - if (bInput) - { - m_xInStream = xHelper.openFileRead(m_sFileName); - m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( - com.sun.star.io.XSeekable.class, - m_xInStream); - } - else - { - m_xOutStream = xHelper.openFileWrite(m_sFileName); - m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface( - com.sun.star.io.XSeekable.class, - m_xOutStream); - } - } - catch(com.sun.star.uno.Exception exUno) - { - throw new com.sun.star.io.NotConnectedException( - "Could not open the file."); - } - } - - /** - * following methods simulates the XInputStream. - * The notice all actions inside the internal protocol - * and try to map all neccessary functions to the internal - * open in-stream. - */ - public int readBytes(byte[][] lData, int nBytesToRead ) - throws com.sun.star.io.NotConnectedException, - com.sun.star.io.BufferSizeExceededException, - com.sun.star.io.IOException - { - m_bInWasUsed = true; - - if (m_xInStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - int nRead = 0; - try - { - nRead = m_xInStream.readBytes(lData,nBytesToRead); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - - return nRead; - } - - public int readSomeBytes(byte[][] lData, int nMaxBytesToRead) - throws com.sun.star.io.NotConnectedException, - com.sun.star.io.BufferSizeExceededException , - com.sun.star.io.IOException - { - m_bInWasUsed = true; - - if (m_xInStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - int nRead = 0; - try - { - nRead = m_xInStream.readSomeBytes(lData,nMaxBytesToRead); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - return nRead; - } - - //_________________________________ - - public void skipBytes(int nBytesToSkip) - throws com.sun.star.io.NotConnectedException, - com.sun.star.io.BufferSizeExceededException , - com.sun.star.io.IOException - { - m_bInWasUsed = true; - - if (m_xInStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - try - { - m_xInStream.skipBytes(nBytesToSkip); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - } - - public int available() throws com.sun.star.io.NotConnectedException, - com.sun.star.io.IOException - { - m_bInWasUsed = true; - - if (m_xInStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - int nAvailable = 0; - try - { - nAvailable = m_xInStream.available(); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - return nAvailable; - } - - //_________________________________ - - public void closeInput() throws com.sun.star.io.NotConnectedException, - com.sun.star.io.IOException - { - m_bInWasUsed = true; - - if (m_xInStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - try - { - m_xInStream.closeInput(); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - } - - /** - * following methods simulates the XOutputStream. - * The notice all actions inside the internal protocol - * and try to map all neccessary functions to the internal - * open out-stream. - */ - public void writeBytes(byte[] lData) - throws com.sun.star.io.NotConnectedException, - com.sun.star.io.BufferSizeExceededException , - com.sun.star.io.IOException - { - m_bOutWasUsed = true; - - if (m_xOutStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - try - { - m_xOutStream.writeBytes(lData); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - } - - //_________________________________ - - public void flush() throws com.sun.star.io.NotConnectedException , - com.sun.star.io.BufferSizeExceededException , - com.sun.star.io.IOException - { - m_bOutWasUsed = true; - - if (m_xOutStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - try - { - m_xOutStream.flush(); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - } - - //_________________________________ - - public void closeOutput() throws com.sun.star.io.NotConnectedException , - com.sun.star.io.BufferSizeExceededException, - com.sun.star.io.IOException - { - m_bOutWasUsed = true; - - if (m_xOutStream == null) - { - throw new com.sun.star.io.NotConnectedException("stream not open"); - } - - try - { - m_xOutStream.closeOutput(); - } - catch (com.sun.star.io.NotConnectedException exConnect) { - } - catch (com.sun.star.io.BufferSizeExceededException exBuffer ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - } - - /** - * following methods simulates the XSeekable. - * The notice all actions inside the internal protocol - * and try to map all neccessary functions to the internal - * open stream. - */ - public void seek(long nLocation ) - throws com.sun.star.lang.IllegalArgumentException, - com.sun.star.io.IOException - { - if (m_xInStream != null) - m_bInWasUsed = true; - else - if (m_xOutStream != null) - m_bOutWasUsed = true; -// else - //m_aProtocol.log("\tno stream open!\n"); - - if (m_xSeek == null) - { - throw new com.sun.star.io.IOException("stream not seekable"); - } - - try - { - m_xSeek.seek(nLocation); - } - catch (com.sun.star.lang.IllegalArgumentException exArg ) { - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - } - - public long getPosition() throws com.sun.star.io.IOException - { - - if (m_xInStream != null) - m_bInWasUsed = true; - else - if (m_xOutStream != null) - m_bOutWasUsed = true; -// else - //m_aProtocol.log("\tno stream open!\n"); - - if (m_xSeek == null) - { - throw new com.sun.star.io.IOException("stream not seekable"); - } - - long nPos = 0; - try - { - nPos = m_xSeek.getPosition(); - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - return nPos; - } - - //_________________________________ - - public long getLength() throws com.sun.star.io.IOException - { - - if (m_xInStream != null) - m_bInWasUsed = true; - else - if (m_xOutStream != null) - m_bOutWasUsed = true; -// else - //m_aProtocol.log("\tno stream open!\n"); - - if (m_xSeek == null) - { - throw new com.sun.star.io.IOException("stream not seekable"); - } - - long nLen = 0; - try - { - nLen = m_xSeek.getLength(); - } - catch (com.sun.star.io.IOException exIO ) { - } - catch (com.sun.star.uno.RuntimeException exRuntime) { - } - catch (com.sun.star.uno.Exception exUno ) { - } - - return nLen; - } -} diff --git a/framework/qa/complex/loadAllDocuments/makefile.mk b/framework/qa/complex/loadAllDocuments/makefile.mk index dd2d78984da6..ebf0265620bf 100644 --- a/framework/qa/complex/loadAllDocuments/makefile.mk +++ b/framework/qa/complex/loadAllDocuments/makefile.mk @@ -41,14 +41,15 @@ JAVATESTFILES = \ CheckXComponentLoader.java # put here all other files -JAVAFILES = $(JAVATESTFILES) +JAVAFILES = $(JAVATESTFILES) \ + InteractionHandler.java \ + StatusIndicator.java \ + StreamSimulator.java \ + TestDocument.java JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/framework/qa/complex/path_settings/makefile.mk b/framework/qa/complex/path_settings/makefile.mk index 21586cc9435b..05900d46e190 100755 --- a/framework/qa/complex/path_settings/makefile.mk +++ b/framework/qa/complex/path_settings/makefile.mk @@ -47,9 +47,6 @@ JAVAFILES = $(JAVATESTFILES) JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/framework/qa/complex/path_substitution/makefile.mk b/framework/qa/complex/path_substitution/makefile.mk index 707a00c0b0f6..338affbf70d7 100755 --- a/framework/qa/complex/path_substitution/makefile.mk +++ b/framework/qa/complex/path_substitution/makefile.mk @@ -46,9 +46,6 @@ JAVAFILES = $(JAVATESTFILES) JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/linguistic/qa/complex/linguistic/makefile.mk b/linguistic/qa/complex/linguistic/makefile.mk index 2d10ec4c832d..43a88ee0a198 100644 --- a/linguistic/qa/complex/linguistic/makefile.mk +++ b/linguistic/qa/complex/linguistic/makefile.mk @@ -47,9 +47,6 @@ JAVAFILES = $(JAVATESTFILES) \ JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -# subdirectories -# SUBDIRS = helper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst index d2964afdc3ee..1e471312c6cf 100644 --- a/sfx2/prj/build.lst +++ b/sfx2/prj/build.lst @@ -27,7 +27,5 @@ sf sfx2\qa\cppunit nmake - all sf_qa_cppunit sf_util NULL # fails on unxsoli4 # sf sfx2\qa\complex\standalonedocumentinfo nmake - all sf_qa_complex_standalonedocumentinfo sf_util NULL -# subdir has to remove -# sf sfx2\qa\complex\framework\DocHelper nmake - all sf_qa_complex_framework_dochelper sf_util NULL # sf sfx2\qa\complex\framework nmake - all sf_qa_complex_framework sf_qa_complex_framework_dochelper NULL # sf sfx2\qa\complex\docinfo nmake - all sf_qa_complex_docinfo sf_util NULL diff --git a/sfx2/qa/complex/framework/DialogThread.java b/sfx2/qa/complex/framework/DialogThread.java new file mode 100644 index 000000000000..7151ccbb292d --- /dev/null +++ b/sfx2/qa/complex/framework/DialogThread.java @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.framework.DocHelper; + +import com.sun.star.beans.PropertyValue; +import com.sun.star.frame.XController; +import com.sun.star.frame.XDispatch; +import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.XModel; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.URL; +import com.sun.star.util.XURLTransformer; + +import java.lang.Thread; + + +/** + * This class opens a given dialog in a separate Thread by dispatching an url + * + */ +public class DialogThread extends Thread { + public XComponent m_xDoc = null; + public XMultiServiceFactory m_xMSF = null; + public String m_url = ""; + + public DialogThread(XComponent xDoc, XMultiServiceFactory msf, String url) { + this.m_xDoc = xDoc; + this.m_xMSF = msf; + this.m_url = url; + } + + public void run() { + XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, + m_xDoc); + + XController xController = aModel.getCurrentController(); + + //Opening Dialog + try { + XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( + XDispatchProvider.class, + xController.getFrame()); + XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( + XURLTransformer.class, + m_xMSF.createInstance( + "com.sun.star.util.URLTransformer")); + + // Because it's an in/out parameter + // we must use an array of URL objects. + URL[] aParseURL = new URL[1]; + aParseURL[0] = new URL(); + aParseURL[0].Complete = m_url; + xParser.parseStrict(aParseURL); + + URL aURL = aParseURL[0]; + XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", com.sun.star.frame.FrameSearchFlag.SELF | + com.sun.star.frame.FrameSearchFlag.CHILDREN); + PropertyValue[] dispatchArguments = new PropertyValue[0]; + + if (xDispatcher != null) { + xDispatcher.dispatch(aURL, dispatchArguments); + } else { + System.out.println("xDispatcher is null"); + } + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't open dialog"); + } + } +} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/DocHelper/DialogThread.java b/sfx2/qa/complex/framework/DocHelper/DialogThread.java deleted file mode 100644 index 7151ccbb292d..000000000000 --- a/sfx2/qa/complex/framework/DocHelper/DialogThread.java +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.framework.DocHelper; - -import com.sun.star.beans.PropertyValue; -import com.sun.star.frame.XController; -import com.sun.star.frame.XDispatch; -import com.sun.star.frame.XDispatchProvider; -import com.sun.star.frame.XModel; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.URL; -import com.sun.star.util.XURLTransformer; - -import java.lang.Thread; - - -/** - * This class opens a given dialog in a separate Thread by dispatching an url - * - */ -public class DialogThread extends Thread { - public XComponent m_xDoc = null; - public XMultiServiceFactory m_xMSF = null; - public String m_url = ""; - - public DialogThread(XComponent xDoc, XMultiServiceFactory msf, String url) { - this.m_xDoc = xDoc; - this.m_xMSF = msf; - this.m_url = url; - } - - public void run() { - XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class, - m_xDoc); - - XController xController = aModel.getCurrentController(); - - //Opening Dialog - try { - XDispatchProvider xDispProv = (XDispatchProvider) UnoRuntime.queryInterface( - XDispatchProvider.class, - xController.getFrame()); - XURLTransformer xParser = (com.sun.star.util.XURLTransformer) UnoRuntime.queryInterface( - XURLTransformer.class, - m_xMSF.createInstance( - "com.sun.star.util.URLTransformer")); - - // Because it's an in/out parameter - // we must use an array of URL objects. - URL[] aParseURL = new URL[1]; - aParseURL[0] = new URL(); - aParseURL[0].Complete = m_url; - xParser.parseStrict(aParseURL); - - URL aURL = aParseURL[0]; - XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", com.sun.star.frame.FrameSearchFlag.SELF | - com.sun.star.frame.FrameSearchFlag.CHILDREN); - PropertyValue[] dispatchArguments = new PropertyValue[0]; - - if (xDispatcher != null) { - xDispatcher.dispatch(aURL, dispatchArguments); - } else { - System.out.println("xDispatcher is null"); - } - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't open dialog"); - } - } -} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/DocHelper/WriterHelper.java b/sfx2/qa/complex/framework/DocHelper/WriterHelper.java deleted file mode 100644 index d3f19703bb9d..000000000000 --- a/sfx2/qa/complex/framework/DocHelper/WriterHelper.java +++ /dev/null @@ -1,287 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.framework.DocHelper; - -import com.sun.star.accessibility.AccessibleRole; -import com.sun.star.accessibility.XAccessible; -import com.sun.star.accessibility.XAccessibleAction; -import com.sun.star.accessibility.XAccessibleContext; -import com.sun.star.accessibility.XAccessibleSelection; -import com.sun.star.awt.XExtendedToolkit; -import com.sun.star.awt.XWindow; -import com.sun.star.frame.XDesktop; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.text.XTextDocument; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.util.XCloseable; - -import complex.framework.DocHelper.DialogThread; -import java.io.PrintWriter; - -import util.AccessibilityTools; -import util.WriterTools; - - -/** - * Methods to open Writer docs - * - */ -public class WriterHelper { - XMultiServiceFactory m_xMSF = null; - - /** Creates a new instance of WriterHelper - * @param m_xMSF The MultiServiceFactory gained from the office - */ - public WriterHelper(XMultiServiceFactory m_xMSF) { - this.m_xMSF = m_xMSF; - } - - /** Opens an empty document - * @return a reference to the opened document is returned - */ - public XTextDocument openEmptyDoc() { - return WriterTools.createTextDoc(m_xMSF); - } - - /** Closes a given XTextDocument - * @param xTextDoc the text document to be closed - * @return if an error occurs the errormessage is returned and an empty String if not - */ - public String closeDoc(XTextDocument xTextDoc) { - XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, xTextDoc); - String err = ""; - - try { - closer.close(true); - } catch (com.sun.star.util.CloseVetoException e) { - err = "couldn't close document " + e; - System.out.println(err); - } - - return err; - } - - private XTextDocument xLocalDoc = null; - /** a TextDocument is opened by pressing a button in a dialog given by uno-URL - * @param url the uno-URL of the dialog to be opened - * @param createButton the language dependend label of the button to be pressed - * @param destroyLocal if true the document that has been opened to dispatch the dialog is closed before the method returns, - * otherwise this document remains open - * @return returns the created Textdocument - */ - public XTextDocument openFromDialog(String url, String createButton, - boolean destroyLocal) { - xLocalDoc = WriterTools.createTextDoc(m_xMSF); - XComponent comp = UnoRuntime.queryInterface(XComponent.class, xLocalDoc); - DialogThread diagThread = new DialogThread(comp, m_xMSF, url); - diagThread.start(); - shortWait(); - - if (createButton.length() > 1) { - XExtendedToolkit tk = getToolkit(); - AccessibilityTools at = new AccessibilityTools(); - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); - - XAccessible xRoot = at.getAccessibleObject(xWindow); - XAccessibleContext buttonContext = at.getAccessibleObjectForRole( - xRoot, - AccessibleRole.PUSH_BUTTON, - createButton); - - XAccessibleAction buttonAction = UnoRuntime.queryInterface(XAccessibleAction.class, buttonContext); - - try { - System.out.println("Name: " + - buttonContext.getAccessibleName()); - buttonAction.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - System.out.println("Couldn't press button"); - } - - shortWait(); - } - - XDesktop xDesktop = getDesktop(); - - XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); - - if (destroyLocal) { - closeDoc(xLocalDoc); - xLocalDoc = null; - } - - return returnDoc; - } - public void closeFromDialog() - { - closeDoc(xLocalDoc); - xLocalDoc = null; - } - public void kill() - { - XDesktop xDesktop = getDesktop(); - xDesktop.terminate(); - } - - - public XTextDocument DocByAutopilot(XMultiServiceFactory msf, - int[] indexes, boolean destroyLocal, - String bName) { - XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF); - Object toolkit = null; - - try { - toolkit = msf.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - e.printStackTrace(); - } - - XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); - - shortWait(); - - AccessibilityTools at = new AccessibilityTools(); - - Object atw = tk.getActiveTopWindow(); - - XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); - - XAccessible xRoot = at.getAccessibleObject(xWindow); - - XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot, - AccessibleRole.MENU_BAR); - XAccessibleSelection sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); - - for (int k = 0; k < indexes.length; k++) { - try { - sel.selectAccessibleChild(indexes[k]); - shortWait(); - ARoot = ARoot.getAccessibleChild(indexes[k]) - .getAccessibleContext(); - sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - } - - shortWait(); - - atw = tk.getActiveTopWindow(); - - xWindow = UnoRuntime.queryInterface(XWindow.class, atw); - - xRoot = at.getAccessibleObject(xWindow); - - //at.printAccessibleTree(new PrintWriter(System.out),xRoot); - - XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName)); - - try { - action.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - - shortWait(); - - atw = tk.getActiveTopWindow(); - - xWindow = UnoRuntime.queryInterface(XWindow.class, atw); - - xRoot = at.getAccessibleObject(xWindow); - - at.printAccessibleTree(new PrintWriter(System.out),xRoot); - - action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes")); - - try { - if (action != null) action.doAccessibleAction(0); - } catch (com.sun.star.lang.IndexOutOfBoundsException e) { - } - - shortWait(); - - XDesktop xDesktop = getDesktop(); - - XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); - - if (destroyLocal) { - closeDoc(xLocalDoc); - } - - return returnDoc; - } - - /** - * Sleeps for 2 sec. to allow StarOffice to react - */ - private void shortWait() { - try { - Thread.sleep(4000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - - /** creates an instance of com.sun.star.awt.Toolkit to query the XExtendedToolkit - * interface - * @return returns the gained XExtendedToolkit Interface - */ - public XExtendedToolkit getToolkit() { - Object toolkit = null; - - try { - toolkit = m_xMSF.createInstance("com.sun.star.awt.Toolkit"); - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't get toolkit"); - e.printStackTrace(); - } - - XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); - - return tk; - } - - /** creates an instance of com.sun.star.frame.Desktop to query the XDesktop interface - * @return returns the gained XDesktop interface - */ - protected XDesktop getDesktop() { - Object desk = null; - - try { - desk = m_xMSF.createInstance("com.sun.star.frame.Desktop"); - } catch (com.sun.star.uno.Exception e) { - System.out.println("Couldn't get desktop"); - e.printStackTrace(); - } - - XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, desk); - - return xDesktop; - } -} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/WriterHelper.java b/sfx2/qa/complex/framework/WriterHelper.java new file mode 100644 index 000000000000..d3f19703bb9d --- /dev/null +++ b/sfx2/qa/complex/framework/WriterHelper.java @@ -0,0 +1,287 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.framework.DocHelper; + +import com.sun.star.accessibility.AccessibleRole; +import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleAction; +import com.sun.star.accessibility.XAccessibleContext; +import com.sun.star.accessibility.XAccessibleSelection; +import com.sun.star.awt.XExtendedToolkit; +import com.sun.star.awt.XWindow; +import com.sun.star.frame.XDesktop; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.text.XTextDocument; +import com.sun.star.uno.UnoRuntime; +import com.sun.star.util.XCloseable; + +import complex.framework.DocHelper.DialogThread; +import java.io.PrintWriter; + +import util.AccessibilityTools; +import util.WriterTools; + + +/** + * Methods to open Writer docs + * + */ +public class WriterHelper { + XMultiServiceFactory m_xMSF = null; + + /** Creates a new instance of WriterHelper + * @param m_xMSF The MultiServiceFactory gained from the office + */ + public WriterHelper(XMultiServiceFactory m_xMSF) { + this.m_xMSF = m_xMSF; + } + + /** Opens an empty document + * @return a reference to the opened document is returned + */ + public XTextDocument openEmptyDoc() { + return WriterTools.createTextDoc(m_xMSF); + } + + /** Closes a given XTextDocument + * @param xTextDoc the text document to be closed + * @return if an error occurs the errormessage is returned and an empty String if not + */ + public String closeDoc(XTextDocument xTextDoc) { + XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, xTextDoc); + String err = ""; + + try { + closer.close(true); + } catch (com.sun.star.util.CloseVetoException e) { + err = "couldn't close document " + e; + System.out.println(err); + } + + return err; + } + + private XTextDocument xLocalDoc = null; + /** a TextDocument is opened by pressing a button in a dialog given by uno-URL + * @param url the uno-URL of the dialog to be opened + * @param createButton the language dependend label of the button to be pressed + * @param destroyLocal if true the document that has been opened to dispatch the dialog is closed before the method returns, + * otherwise this document remains open + * @return returns the created Textdocument + */ + public XTextDocument openFromDialog(String url, String createButton, + boolean destroyLocal) { + xLocalDoc = WriterTools.createTextDoc(m_xMSF); + XComponent comp = UnoRuntime.queryInterface(XComponent.class, xLocalDoc); + DialogThread diagThread = new DialogThread(comp, m_xMSF, url); + diagThread.start(); + shortWait(); + + if (createButton.length() > 1) { + XExtendedToolkit tk = getToolkit(); + AccessibilityTools at = new AccessibilityTools(); + Object atw = tk.getActiveTopWindow(); + + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + XAccessible xRoot = at.getAccessibleObject(xWindow); + XAccessibleContext buttonContext = at.getAccessibleObjectForRole( + xRoot, + AccessibleRole.PUSH_BUTTON, + createButton); + + XAccessibleAction buttonAction = UnoRuntime.queryInterface(XAccessibleAction.class, buttonContext); + + try { + System.out.println("Name: " + + buttonContext.getAccessibleName()); + buttonAction.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + System.out.println("Couldn't press button"); + } + + shortWait(); + } + + XDesktop xDesktop = getDesktop(); + + XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); + + if (destroyLocal) { + closeDoc(xLocalDoc); + xLocalDoc = null; + } + + return returnDoc; + } + public void closeFromDialog() + { + closeDoc(xLocalDoc); + xLocalDoc = null; + } + public void kill() + { + XDesktop xDesktop = getDesktop(); + xDesktop.terminate(); + } + + + public XTextDocument DocByAutopilot(XMultiServiceFactory msf, + int[] indexes, boolean destroyLocal, + String bName) { + XTextDocument xLocalDoc = WriterTools.createTextDoc(m_xMSF); + Object toolkit = null; + + try { + toolkit = msf.createInstance("com.sun.star.awt.Toolkit"); + } catch (com.sun.star.uno.Exception e) { + e.printStackTrace(); + } + + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); + + shortWait(); + + AccessibilityTools at = new AccessibilityTools(); + + Object atw = tk.getActiveTopWindow(); + + XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + XAccessible xRoot = at.getAccessibleObject(xWindow); + + XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot, + AccessibleRole.MENU_BAR); + XAccessibleSelection sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); + + for (int k = 0; k < indexes.length; k++) { + try { + sel.selectAccessibleChild(indexes[k]); + shortWait(); + ARoot = ARoot.getAccessibleChild(indexes[k]) + .getAccessibleContext(); + sel = UnoRuntime.queryInterface(XAccessibleSelection.class, ARoot); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + } + + shortWait(); + + atw = tk.getActiveTopWindow(); + + xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + xRoot = at.getAccessibleObject(xWindow); + + //at.printAccessibleTree(new PrintWriter(System.out),xRoot); + + XAccessibleAction action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, bName)); + + try { + action.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + + shortWait(); + + atw = tk.getActiveTopWindow(); + + xWindow = UnoRuntime.queryInterface(XWindow.class, atw); + + xRoot = at.getAccessibleObject(xWindow); + + at.printAccessibleTree(new PrintWriter(System.out),xRoot); + + action = UnoRuntime.queryInterface(XAccessibleAction.class, at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON, "Yes")); + + try { + if (action != null) action.doAccessibleAction(0); + } catch (com.sun.star.lang.IndexOutOfBoundsException e) { + } + + shortWait(); + + XDesktop xDesktop = getDesktop(); + + XTextDocument returnDoc = UnoRuntime.queryInterface(XTextDocument.class, xDesktop.getCurrentComponent()); + + if (destroyLocal) { + closeDoc(xLocalDoc); + } + + return returnDoc; + } + + /** + * Sleeps for 2 sec. to allow StarOffice to react + */ + private void shortWait() { + try { + Thread.sleep(4000); + } catch (InterruptedException e) { + System.out.println("While waiting :" + e); + } + } + + /** creates an instance of com.sun.star.awt.Toolkit to query the XExtendedToolkit + * interface + * @return returns the gained XExtendedToolkit Interface + */ + public XExtendedToolkit getToolkit() { + Object toolkit = null; + + try { + toolkit = m_xMSF.createInstance("com.sun.star.awt.Toolkit"); + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't get toolkit"); + e.printStackTrace(); + } + + XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, toolkit); + + return tk; + } + + /** creates an instance of com.sun.star.frame.Desktop to query the XDesktop interface + * @return returns the gained XDesktop interface + */ + protected XDesktop getDesktop() { + Object desk = null; + + try { + desk = m_xMSF.createInstance("com.sun.star.frame.Desktop"); + } catch (com.sun.star.uno.Exception e) { + System.out.println("Couldn't get desktop"); + e.printStackTrace(); + } + + XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, desk); + + return xDesktop; + } +} \ No newline at end of file diff --git a/sfx2/qa/complex/framework/makefile.mk b/sfx2/qa/complex/framework/makefile.mk index 093bc828d4ef..325135b9133c 100644 --- a/sfx2/qa/complex/framework/makefile.mk +++ b/sfx2/qa/complex/framework/makefile.mk @@ -41,14 +41,14 @@ JAVATESTFILES = \ CheckGlobalEventBroadcaster_writer1.java JAVAFILES = $(JAVATESTFILES) \ - TestDocument.java + TestDocument.java \ + WriterHelper.java \ + DialogThread.java JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) -SUBDIRS = DocHelper - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst index fc66b41b74b2..8d8c87f3ae4b 100644 --- a/ucb/prj/build.lst +++ b/ucb/prj/build.lst @@ -19,5 +19,4 @@ uc ucb\qa\unoapi nmake - all uc_qa_unoapi NULL uc ucb\qa\complex\ucb nmake - all uc_complex_ucb uc_inc NULL # fails, please fix -# uc ucb\qa\complex\tdoc\interfaces nmake - all uc_complex_tdoc_interfaces uc_inc NULL # uc ucb\qa\complex\tdoc nmake - all uc_complex_tdoc uc_complex_tdoc_interfaces uc_inc NULL diff --git a/ucb/qa/complex/tdoc/CheckContentProvider.java b/ucb/qa/complex/tdoc/CheckContentProvider.java index d3dfd120611e..a039c0c14e87 100755 --- a/ucb/qa/complex/tdoc/CheckContentProvider.java +++ b/ucb/qa/complex/tdoc/CheckContentProvider.java @@ -42,16 +42,6 @@ import com.sun.star.ucb.XContentIdentifier; import com.sun.star.ucb.XContentIdentifierFactory; import com.sun.star.ucb.XContentProvider; import com.sun.star.uno.UnoRuntime; -import complex.tdoc.interfaces._XChild; -import complex.tdoc.interfaces._XCommandInfoChangeNotifier; -import complex.tdoc.interfaces._XComponent; -import complex.tdoc.interfaces._XServiceInfo; -import complex.tdoc.interfaces._XTypeProvider; -import complex.tdoc.interfaces._XCommandProcessor; -import complex.tdoc.interfaces._XContent; -import complex.tdoc.interfaces._XPropertiesChangeNotifier; -import complex.tdoc.interfaces._XPropertyContainer; -import complex.tdoc.interfaces._XPropertySetInfoChangeNotifier; import util.WriterTools; import org.junit.After; diff --git a/ucb/qa/complex/tdoc/CheckTransientDocumentsContent.java b/ucb/qa/complex/tdoc/CheckTransientDocumentsContent.java index 3320ef890841..ed121e92f9f1 100755 --- a/ucb/qa/complex/tdoc/CheckTransientDocumentsContent.java +++ b/ucb/qa/complex/tdoc/CheckTransientDocumentsContent.java @@ -51,6 +51,7 @@ import static org.junit.Assert.*; * */ public class CheckTransientDocumentsContent { + // TODO: document doesn't exists private final String testDocuments[] = new String[]{"sForm.sxw"};//, "chinese.sxw", "Iterator.sxw"}; private final int countDocs = testDocuments.length; private XMultiServiceFactory xMSF = null; diff --git a/ucb/qa/complex/tdoc/CheckTransientDocumentsContentProvider.java b/ucb/qa/complex/tdoc/CheckTransientDocumentsContentProvider.java index 9d3ea87b1d4a..d5aebc7fc3cd 100755 --- a/ucb/qa/complex/tdoc/CheckTransientDocumentsContentProvider.java +++ b/ucb/qa/complex/tdoc/CheckTransientDocumentsContentProvider.java @@ -56,7 +56,8 @@ import static org.junit.Assert.*; * */ public class CheckTransientDocumentsContentProvider { - private final String testDocuments[] = new String[]{"sForm.sxw", "chinese.sxw", "Iterator.sxw"}; + // TODO: document doesn't exists + private final String testDocuments[] = new String[]{/*"sForm.sxw",*/ "chinese.sxw", "Iterator.sxw"}; private final int countDocs = testDocuments.length; private XMultiServiceFactory xMSF = null; private XTextDocument[] xTextDoc = null; diff --git a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java index ad0001161c49..30411458daee 100755 --- a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java +++ b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java @@ -59,6 +59,7 @@ import static org.junit.Assert.*; * */ public class CheckTransientDocumentsDocumentContent { + // TODO: document doesn't exists private final String testDocuments = "sForm.sxw"; private final String folderName = "TestFolder"; private XMultiServiceFactory xMSF = null; diff --git a/ucb/qa/complex/tdoc/_XChild.java b/ucb/qa/complex/tdoc/_XChild.java new file mode 100755 index 000000000000..4ed71e62008a --- /dev/null +++ b/ucb/qa/complex/tdoc/_XChild.java @@ -0,0 +1,104 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.tdoc; + +import lib.MultiMethodTest; +import lib.Status; + +import com.sun.star.container.XChild; +import com.sun.star.container.XNamed; +import com.sun.star.uno.UnoRuntime; +import share.LogWriter; + +/* +* Testing com.sun.star.container.XChild +* interface methods : +*

            +*
          • getParent()
          • +*
          • setParent()
          • +*
          +* @see com.sun.star.container.XChild +*/ +public class _XChild { + + public XChild oObj = null; + public Object gotten = null; + public LogWriter log = null; + + + /** + * Test calls the method and checks return value and that + * no exceptions were thrown. Parent returned is stored.

          + * Has OK status if the method returns not null value + * and no exceptions were thrown.

          + */ + public boolean _getParent(boolean hasParent) { + gotten = oObj.getParent(); + if (!hasParent) + return gotten == null; + XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,gotten); + if (the_name != null) + log.println("Parent:"+the_name.getName()); + return gotten != null; + } + + /** + * Sets existing parent and checks that + * no exceptions were thrown.

          + * Has OK status if no exceptions were thrown.

          + * The following method tests are to be completed successfully before : + *

            + *
          • getParent() : to get the parent.
          • + *
          + */ + public boolean _setParent(boolean supported) { +// requiredMethod("getParent()") ; + + String parentComment = null;//String) tEnv.getObjRelation("cannotSwitchParent"); + + if (parentComment != null) { + log.println(parentComment); + return true; + } + + try { + oObj.setParent(gotten); + } + catch (com.sun.star.lang.NoSupportException ex) { + log.println("Exception occured during setParent() - " + (supported?"FAILED":"OK")); + if (supported) { + ex.printStackTrace((java.io.PrintWriter)log); + return false; + } + } + return true; + } + +} // finish class _XChild + + diff --git a/ucb/qa/complex/tdoc/_XCommandInfoChangeNotifier.java b/ucb/qa/complex/tdoc/_XCommandInfoChangeNotifier.java new file mode 100755 index 000000000000..ab32873e9ffb --- /dev/null +++ b/ucb/qa/complex/tdoc/_XCommandInfoChangeNotifier.java @@ -0,0 +1,64 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.tdoc; + +import com.sun.star.ucb.XCommandInfoChangeListener; +import com.sun.star.ucb.XCommandInfoChangeNotifier; +import share.LogWriter; + +/** + * + */ +public class _XCommandInfoChangeNotifier { + public XCommandInfoChangeNotifier oObj = null; + public LogWriter log = null; + private CommandInfoChangeListener listener = new CommandInfoChangeListener(); + + public boolean _addCommandInfoChangeListener() { + oObj.addCommandInfoChangeListener(listener); + return true; + } + + public boolean _removeCommandInfoChangeListener() { + oObj.removeCommandInfoChangeListener(listener); + return true; + } + + private class CommandInfoChangeListener implements XCommandInfoChangeListener { + boolean disposing = false; + boolean infoChanged = false; + + public void commandInfoChange(com.sun.star.ucb.CommandInfoChangeEvent commandInfoChangeEvent) { + infoChanged = true; + } + + public void disposing(com.sun.star.lang.EventObject eventObject) { + disposing = true; + } + + } +} diff --git a/ucb/qa/complex/tdoc/_XCommandProcessor.java b/ucb/qa/complex/tdoc/_XCommandProcessor.java new file mode 100755 index 000000000000..92411d05456f --- /dev/null +++ b/ucb/qa/complex/tdoc/_XCommandProcessor.java @@ -0,0 +1,286 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.tdoc; + +import com.sun.star.beans.Property; +import com.sun.star.beans.XPropertySetInfo; +import lib.MultiMethodTest; +import lib.StatusException; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.ucb.Command; +import com.sun.star.ucb.CommandAbortedException; +import com.sun.star.ucb.CommandInfo; +import com.sun.star.ucb.GlobalTransferCommandArgument; +import com.sun.star.ucb.NameClash; +import com.sun.star.ucb.TransferCommandOperation; +import com.sun.star.ucb.UnsupportedCommandException; +import com.sun.star.ucb.XCommandInfo; +import com.sun.star.ucb.XCommandProcessor; +import com.sun.star.uno.Exception; +import com.sun.star.uno.UnoRuntime; +import share.LogWriter; + +/** +* Tests XCommandProcessor. The TestCase can pass (but doesn't have +* to) "XCommandProcessor.AbortCommand" relation, to specify command to abort in +* abort() test. +* +* Testing com.sun.star.ucb.XCommandProcessor +* interface methods : +*
            +*
          • createCommandIdentifier()
          • +*
          • execute()
          • +*
          • abort()
          • +*

          +* This test needs the following object relations : +*

            +*
          • 'XCommandProcessor.AbortCommand' optional +* (of type com.sun.star.ucb.Command): +* specify command to abort in abort() test. +* If the relation is not specified the 'GlobalTransfer' +* command is used.
          • +*

              +* The following predefined files needed to complete the test: +*

                +*
              • poliball.gif : this file is required in case +* if the relation 'XCommandProcessor.AbortCommand' +* is not specified. This file is used by 'GlobalTransfer' +* command as a source file for copying.
              • +*

                  +* Test is NOT multithread compilant.

                  +* @see com.sun.star.ucb.XCommandProcessor +*/ +public class _XCommandProcessor { + + /** + * Conatins the tested object. + */ + public XCommandProcessor oObj; + public LogWriter log = null; + private XMultiServiceFactory xMSF = null; + + /** + * Contains the command id returned by createCommandIdentifier() + * . It is used in abort() test. + */ + int cmdId; + + public void before(XMultiServiceFactory _xMSF) { + xMSF = _xMSF; + } + + /** + * Tests createCommandIdentifier(). Calls it for two times + * and checks returned values.

                  + * Has OK status if values are unique correct idenifiers: not 0. + */ + public boolean _createCommandIdentifier() { + log.println("creating a command line identifier"); + + int testCmdId = oObj.createCommandIdentifier(); + cmdId = oObj.createCommandIdentifier(); + + if (cmdId == 0 || testCmdId == 0) { + log.println("createCommandLineIdentifier() returned 0 - FAILED"); + } + + if (cmdId == testCmdId) { + log.println("the command identifier is not unique"); + } + + return testCmdId != 0 && cmdId != 0 && cmdId != testCmdId; + } + + /** + * First executes 'geCommandInfo' command and examines returned + * command info information. Second tries to execute inproper + * command.

                  + * Has OK status if in the first case returned information + * contains info about 'getCommandInfo' command and in the second + * case an exception is thrown.

                  + */ + public boolean _execute() { + String[]commands = new String[] {"getCommandInfo", "getPropertySetInfo"}; + boolean returnVal = true; + for (int j=0; jabort method + * is called permanently. Then a "long" command (for example, + * "transfer") is started. I case if relation is not + * specified 'GlobalTransfer' command starts to + * copy a file to temporary directory (if the relation is present + * then the its command starts to work).

                  + * Has OK status if the command execution is aborted, i.e. + * CommandAbortedException is thrown.

                  + * The following method tests are to be completed successfully before : + *

                    + *
                  • createCommandIdentifier() : to have a unique + * identifier which is used to abourt started command.
                  • + *
                  + */ + public boolean _abort() { + //executeMethod("createCommandIdentifier()"); + +// Command command = null;//(Command)tEnv.getObjRelation( + //"XCommandProcessor.AbortCommand"); + Command command = new Command("getCommandInfo", -1, null); + + if (command == null) { + String commandName = "globalTransfer"; + + String srcURL = util.utils.getFullTestURL("solibrary.jar") ; + String tmpURL = util.utils.getOfficeTemp(xMSF) ; + log.println("Copying '" + srcURL + "' to '" + tmpURL) ; + + GlobalTransferCommandArgument arg = new + GlobalTransferCommandArgument( + TransferCommandOperation.COPY, srcURL, + tmpURL, "", NameClash.OVERWRITE); + + command = new Command(commandName, -1, arg); + } + + Thread aborter = new Thread() { + public void run() { + for (int i = 0; i < 10; i++) { + log.println("try to abort command"); + oObj.abort(cmdId); + try { + Thread.sleep(10); + } catch (InterruptedException e) { + } + } + } + }; + + aborter.start(); + + try { + Thread.sleep(15); + } catch (InterruptedException e) { + } + + log.println("executing command"); + try { + oObj.execute(command, cmdId, null); + log.println("Command execution completed"); + log.println("CommandAbortedException is not thrown"); + log.println("This is OK since there is no command implemented "+ + "that can be aborted"); + } catch (CommandAbortedException e) { + return true; + } catch (Exception e) { + log.println("Unexpected exception " + e.getMessage()); + e.printStackTrace((java.io.PrintWriter)log); + return false; + } + + try { + aborter.join(5000); + aborter.interrupt(); + } catch(java.lang.InterruptedException e) { + } + return true; + } +} diff --git a/ucb/qa/complex/tdoc/_XComponent.java b/ucb/qa/complex/tdoc/_XComponent.java new file mode 100755 index 000000000000..16d5c9bebeea --- /dev/null +++ b/ucb/qa/complex/tdoc/_XComponent.java @@ -0,0 +1,171 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.tdoc; + +import com.sun.star.container.XNameContainer; +import lib.MultiMethodTest; + +import com.sun.star.frame.XDesktop; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XComponent; +import com.sun.star.lang.XEventListener; +import share.LogWriter; + +/** +* Testing com.sun.star.lang.XComponent +* interface methods : +*
                    +*
                  • dispose()
                  • +*
                  • addEventListener()
                  • +*
                  • removeEventListener()
                  • +*
                  +* After this interface test object must be recreated.

                  +* Multithreaded test ability not implemented yet. +* @see com.sun.star.lang.XComponent +*/ +public class _XComponent { + + public static XComponent oObj = null; + private XNameContainer xContainer = null; + private XComponent altDispose = null; + public LogWriter log = null; + + boolean listenerDisposed[] = new boolean[2]; + String[] Loutput = new String[2]; + + /** + * Listener which added but not removed, and its method must be called + * on dispose call. + */ + public class MyEventListener implements XEventListener { + public void disposing ( EventObject oEvent ) { + Loutput[0] = Thread.currentThread() + " is DISPOSING EV1" + this; + listenerDisposed[0] = true; + } + }; + + /** + * Listener which added and then removed, and its method must not + * be called on dispose call. + */ + public class MyEventListener2 implements XEventListener { + public void disposing ( EventObject oEvent ) { + Loutput[0] = Thread.currentThread() + " is DISPOSING EV2" + this; + listenerDisposed[1] = true; + } + }; + + XEventListener listener1 = new MyEventListener(); + XEventListener listener2 = new MyEventListener2(); + + /** + * For the cfgmgr2.OSetElement tests: dispose the owner element. + */ + protected void before() { + // do not dispose this component, but parent instead +// altDispose = (XComponent)tEnv.getObjRelation("XComponent.DisposeThis"); + + } + + /** + * Adds two listeners.

                  + * Has OK status if then the first listener will receive an event + * on dispose method call. + */ + public boolean _addEventListener() { + + listenerDisposed[0] = false; + listenerDisposed[1] = false; + + oObj.addEventListener( listener1 ); + oObj.addEventListener( listener2 ); + + return true; + } // finished _addEventListener() + + /** + * Removes the second of two added listeners.

                  + * Method tests to be completed successfully : + *

                    + *
                  • addEventListener : method must add two listeners.
                  • + *

                  + * Has OK status if no events will be sent to the second listener on + * dispose method call. + */ + public boolean _removeEventListener() { +// executeMethod("addEventListener()"); + if (disposed) return true; + // the second listener should not be called + oObj.removeEventListener( listener2 ); + log.println(Thread.currentThread() + " is removing EL " + listener2); + return true; + } // finished _removeEventListener() + + static boolean disposed = false; + + /** + * Disposes the object and then check appropriate listeners were + * called or not.

                  + * Method tests to be completed successfully : + *

                    + *
                  • removeEventListener : method must remove one of two + * listeners.
                  • + *

                  + * Has OK status if liseter removed wasn't called and other listener + * was. + */ + public boolean _dispose() { + disposed = false; +// executeMethod("removeEventListener()"); + + log.println( "begin dispose" + Thread.currentThread()); + oObj.dispose(); + + try { + Thread.sleep(500) ; + } catch (InterruptedException e) {} + if (Loutput[0]!=null) log.println(Loutput[0]); + if (Loutput[1]!=null) log.println(Loutput[1]); + log.println( "end dispose" + Thread.currentThread()); + disposed = true; + + // check that dispose() works OK. + return listenerDisposed[0] && !listenerDisposed[1]; + + } // finished _dispose() + + /** + * Forces object recreation. + */ + protected void after() { +// disposeEnvironment(); + } + +} // finished class _XComponent + + diff --git a/ucb/qa/complex/tdoc/_XContent.java b/ucb/qa/complex/tdoc/_XContent.java new file mode 100755 index 000000000000..820d2cef0fc7 --- /dev/null +++ b/ucb/qa/complex/tdoc/_XContent.java @@ -0,0 +1,86 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.tdoc; + +import com.sun.star.ucb.XContent; +import com.sun.star.ucb.XContentEventListener; +import com.sun.star.ucb.XContentIdentifier; +import share.LogWriter; + +/** + * + * @author sg128468 + */ +public class _XContent { + public XContent oObj = null; + public LogWriter log = null; + private ContentListener listener = null; + + public boolean _addContentEventListener() { + listener = new ContentListener(); + oObj.addContentEventListener(listener); + return true; + } + public boolean _getContentType() { + String type = oObj.getContentType(); + log.println("Type: " + type); + return type != null && type.indexOf("vnd.sun.star.tdoc") != -1; + } + public boolean _getIdentifier() { + XContentIdentifier xIdent = oObj.getIdentifier(); + String id = xIdent.getContentIdentifier(); + String scheme = xIdent.getContentProviderScheme(); + log.println("Id: " + id); + log.println("Scheme: " + scheme); + return id != null && scheme != null && id.indexOf("vnd.sun.star.tdoc") != -1 && scheme.indexOf("vnd.sun.star.tdoc") != -1; + } + public boolean _removeContentEventListener() { + System.out.println("Event: " + (listener.disposed || listener.firedEvent)); + oObj.removeContentEventListener(listener); + return true; + } + + + private class ContentListener implements XContentEventListener { + private boolean disposed = false; + private boolean firedEvent = false; + + public void reset() { + disposed = false; + firedEvent = false; + } + + public void contentEvent(com.sun.star.ucb.ContentEvent contentEvent) { + firedEvent = true; + } + + public void disposing(com.sun.star.lang.EventObject eventObject) { + disposed = true; + } + + } +} diff --git a/ucb/qa/complex/tdoc/_XPropertiesChangeNotifier.java b/ucb/qa/complex/tdoc/_XPropertiesChangeNotifier.java new file mode 100755 index 000000000000..88e080cd9ec2 --- /dev/null +++ b/ucb/qa/complex/tdoc/_XPropertiesChangeNotifier.java @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.tdoc; + +import com.sun.star.beans.XPropertiesChangeListener; +import com.sun.star.beans.XPropertiesChangeNotifier; +import share.LogWriter; + +/** + * Check the XPropertiesChangeNotifier + */ +public class _XPropertiesChangeNotifier { + public XPropertiesChangeNotifier oObj = null; + public LogWriter log = null; + + PropertiesChangeListener listener = new PropertiesChangeListener(); + String[] args = null; + + + public boolean _addPropertiesChangeListener() { + oObj.addPropertiesChangeListener(args, listener); + return true; + } + + public boolean _removePropertiesChangeListener() { + oObj.removePropertiesChangeListener(args, listener); + return true; + } + + private class PropertiesChangeListener implements XPropertiesChangeListener { + public boolean disposed = false; + public boolean propChanged = false; + + public void disposing(com.sun.star.lang.EventObject eventObject) { + disposed = true; + } + + public void propertiesChange(com.sun.star.beans.PropertyChangeEvent[] propertyChangeEvent) { + propChanged = true; + } + + } +} diff --git a/ucb/qa/complex/tdoc/_XPropertyContainer.java b/ucb/qa/complex/tdoc/_XPropertyContainer.java new file mode 100755 index 000000000000..e425a703d403 --- /dev/null +++ b/ucb/qa/complex/tdoc/_XPropertyContainer.java @@ -0,0 +1,102 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.tdoc; + +import com.sun.star.beans.XPropertyContainer; +import share.LogWriter; + +/** + * + * @author sg128468 + */ +public class _XPropertyContainer { + public XPropertyContainer oObj = null; + public LogWriter log = null; + + public boolean _addProperty() { + boolean result = true; + // add illegal property + try { + oObj.addProperty("MyIllegalProperty", (short)0, null); + } + catch(com.sun.star.beans.PropertyExistException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + catch(com.sun.star.lang.IllegalArgumentException e) { + e.printStackTrace((java.io.PrintWriter)log); + log.println("'IllegalArgument' Unexpected but correct."); + } + catch(com.sun.star.beans.IllegalTypeException e) { + log.println("'IllegalType' Correctly thrown"); + } + // add valid property + try { + oObj.addProperty("MyLegalProperty", (short)0, "Just a value"); + } + catch(com.sun.star.beans.PropertyExistException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + catch(com.sun.star.lang.IllegalArgumentException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + catch(com.sun.star.beans.IllegalTypeException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + return result; + } + + public boolean _removeProperty() { + boolean result = true; + try { + oObj.removeProperty("MyIllegalProperty"); + } + catch(com.sun.star.beans.UnknownPropertyException e) { + log.println("'UnknownProperty' Correctly thrown"); + } + catch(com.sun.star.beans.NotRemoveableException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + try { + oObj.removeProperty("MyLegalProperty"); + } + catch(com.sun.star.beans.UnknownPropertyException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + catch(com.sun.star.beans.NotRemoveableException e) { + e.printStackTrace((java.io.PrintWriter)log); + result = false; + } + return result; + } + +} diff --git a/ucb/qa/complex/tdoc/_XPropertySetInfoChangeNotifier.java b/ucb/qa/complex/tdoc/_XPropertySetInfoChangeNotifier.java new file mode 100755 index 000000000000..4671a0d21571 --- /dev/null +++ b/ucb/qa/complex/tdoc/_XPropertySetInfoChangeNotifier.java @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package complex.tdoc; + +import com.sun.star.beans.XPropertySetInfoChangeListener; +import com.sun.star.beans.XPropertySetInfoChangeNotifier; +import share.LogWriter; + +/** + * + */ +public class _XPropertySetInfoChangeNotifier { + public XPropertySetInfoChangeNotifier oObj = null; + public LogWriter log = null; + + PropertySetInfoChangeListener listener = new PropertySetInfoChangeListener(); + String[] args = null; + + + public boolean _addPropertiesChangeListener() { + oObj.addPropertySetInfoChangeListener(listener); + return true; + } + + public boolean _removePropertiesChangeListener() { + oObj.removePropertySetInfoChangeListener(listener); + return true; + } + + private class PropertySetInfoChangeListener implements XPropertySetInfoChangeListener { + public boolean disposed = false; + public boolean propChanged = false; + + public void disposing(com.sun.star.lang.EventObject eventObject) { + disposed = true; + } + + public void propertySetInfoChange(com.sun.star.beans.PropertySetInfoChangeEvent propertySetInfoChangeEvent) { + } + + } + +} diff --git a/ucb/qa/complex/tdoc/_XServiceInfo.java b/ucb/qa/complex/tdoc/_XServiceInfo.java new file mode 100755 index 000000000000..9c2089f212f9 --- /dev/null +++ b/ucb/qa/complex/tdoc/_XServiceInfo.java @@ -0,0 +1,99 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.tdoc; + +import lib.MultiMethodTest; + +import com.sun.star.lang.XServiceInfo; +import share.LogWriter; + +/** +* Testing com.sun.star.lang.XServiceInfo +* interface methods : +*

                    +*
                  • getImplementationName()
                  • +*
                  • supportsService()
                  • +*
                  • getSupportedServiceNames()
                  • +*

                  +* Test is multithread compilant.

                  +* @see com.sun.star.lang.XServiceInfo +*/ +public class _XServiceInfo { + public static XServiceInfo oObj = null; + public static String[] names = null; + public LogWriter log = null; + + /** + * Just calls the method.

                  + * Has OK status if no runtime exceptions occured. + */ + public boolean _getImplementationName() { + boolean result = true; + log.println("testing getImplementationName() ... "); + + log.println("The ImplementationName ist "+oObj.getImplementationName()); + result=true; + + return result; + + } // end getImplementationName() + + + /** + * Just calls the method.

                  + * Has OK status if no runtime exceptions occured. + */ + public boolean _getSupportedServiceNames() { + boolean result = true; + log.println("getting supported Services..."); + names = oObj.getSupportedServiceNames(); + for (int i=0;igetSupportedServiceNames method and + * calls the supportsService methos with this + * name.

                  + * Has OK status if true value is + * returned. + */ + public boolean _supportsService() { + log.println("testing supportsService"); + names = oObj.getSupportedServiceNames(); + return oObj.supportsService(names[0]); + } // end supportsService() +} + diff --git a/ucb/qa/complex/tdoc/_XTypeProvider.java b/ucb/qa/complex/tdoc/_XTypeProvider.java new file mode 100755 index 000000000000..f8247e7016fe --- /dev/null +++ b/ucb/qa/complex/tdoc/_XTypeProvider.java @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package complex.tdoc; + +import lib.MultiMethodTest; + +import com.sun.star.lang.XTypeProvider; +import com.sun.star.uno.Type; +import share.LogWriter; + +/** +* Testing com.sun.star.lang.XTypeProvider +* interface methods : +*

                    +*
                  • getTypes()
                  • +*
                  • getImplementationId()
                  • +*

                  +* Test is NOT multithread compilant.

                  +* @see com.sun.star.lang.XTypeProvider +*/ +public class _XTypeProvider { + + public static XTypeProvider oObj = null; + public static Type[] types = null; + public LogWriter log = null; + + /** + * Just calls the method.

                  + * Has OK status if no runtime exceptions occured. + */ + public boolean _getImplementationId() { + boolean result = true; + log.println("testing getImplementationId() ... "); + + log.println("The ImplementationId is "+oObj.getImplementationId()); + result = true; + + return result; + + } // end getImplementationId() + + + /** + * ?alls the method and checks the return value.

                  + * Has OK status if one of the return value equals to the + * type com.sun.star.lang.XTypeProvider. + */ + public boolean _getTypes() { + boolean result = false; + log.println("getting Types..."); + types = oObj.getTypes(); + for (int i=0;i"); + } + + return result; + + } // end getTypes() + +} + diff --git a/ucb/qa/complex/tdoc/interfaces/_XChild.java b/ucb/qa/complex/tdoc/interfaces/_XChild.java deleted file mode 100755 index 351fc6f84aa1..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XChild.java +++ /dev/null @@ -1,104 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.tdoc.interfaces; - -import lib.MultiMethodTest; -import lib.Status; - -import com.sun.star.container.XChild; -import com.sun.star.container.XNamed; -import com.sun.star.uno.UnoRuntime; -import share.LogWriter; - -/* -* Testing com.sun.star.container.XChild -* interface methods : -*

                    -*
                  • getParent()
                  • -*
                  • setParent()
                  • -*
                  -* @see com.sun.star.container.XChild -*/ -public class _XChild { - - public XChild oObj = null; - public Object gotten = null; - public LogWriter log = null; - - - /** - * Test calls the method and checks return value and that - * no exceptions were thrown. Parent returned is stored.

                  - * Has OK status if the method returns not null value - * and no exceptions were thrown.

                  - */ - public boolean _getParent(boolean hasParent) { - gotten = oObj.getParent(); - if (!hasParent) - return gotten == null; - XNamed the_name = (XNamed) UnoRuntime.queryInterface(XNamed.class,gotten); - if (the_name != null) - log.println("Parent:"+the_name.getName()); - return gotten != null; - } - - /** - * Sets existing parent and checks that - * no exceptions were thrown.

                  - * Has OK status if no exceptions were thrown.

                  - * The following method tests are to be completed successfully before : - *

                    - *
                  • getParent() : to get the parent.
                  • - *
                  - */ - public boolean _setParent(boolean supported) { -// requiredMethod("getParent()") ; - - String parentComment = null;//String) tEnv.getObjRelation("cannotSwitchParent"); - - if (parentComment != null) { - log.println(parentComment); - return true; - } - - try { - oObj.setParent(gotten); - } - catch (com.sun.star.lang.NoSupportException ex) { - log.println("Exception occured during setParent() - " + (supported?"FAILED":"OK")); - if (supported) { - ex.printStackTrace((java.io.PrintWriter)log); - return false; - } - } - return true; - } - -} // finish class _XChild - - diff --git a/ucb/qa/complex/tdoc/interfaces/_XCommandInfoChangeNotifier.java b/ucb/qa/complex/tdoc/interfaces/_XCommandInfoChangeNotifier.java deleted file mode 100755 index 9800c5c0a398..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XCommandInfoChangeNotifier.java +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.tdoc.interfaces; - -import com.sun.star.ucb.XCommandInfoChangeListener; -import com.sun.star.ucb.XCommandInfoChangeNotifier; -import share.LogWriter; - -/** - * - */ -public class _XCommandInfoChangeNotifier { - public XCommandInfoChangeNotifier oObj = null; - public LogWriter log = null; - private CommandInfoChangeListener listener = new CommandInfoChangeListener(); - - public boolean _addCommandInfoChangeListener() { - oObj.addCommandInfoChangeListener(listener); - return true; - } - - public boolean _removeCommandInfoChangeListener() { - oObj.removeCommandInfoChangeListener(listener); - return true; - } - - private class CommandInfoChangeListener implements XCommandInfoChangeListener { - boolean disposing = false; - boolean infoChanged = false; - - public void commandInfoChange(com.sun.star.ucb.CommandInfoChangeEvent commandInfoChangeEvent) { - infoChanged = true; - } - - public void disposing(com.sun.star.lang.EventObject eventObject) { - disposing = true; - } - - } -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XCommandProcessor.java b/ucb/qa/complex/tdoc/interfaces/_XCommandProcessor.java deleted file mode 100755 index 2fc31a4bd586..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XCommandProcessor.java +++ /dev/null @@ -1,286 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.tdoc.interfaces; - -import com.sun.star.beans.Property; -import com.sun.star.beans.XPropertySetInfo; -import lib.MultiMethodTest; -import lib.StatusException; - -import com.sun.star.lang.XMultiServiceFactory; -import com.sun.star.ucb.Command; -import com.sun.star.ucb.CommandAbortedException; -import com.sun.star.ucb.CommandInfo; -import com.sun.star.ucb.GlobalTransferCommandArgument; -import com.sun.star.ucb.NameClash; -import com.sun.star.ucb.TransferCommandOperation; -import com.sun.star.ucb.UnsupportedCommandException; -import com.sun.star.ucb.XCommandInfo; -import com.sun.star.ucb.XCommandProcessor; -import com.sun.star.uno.Exception; -import com.sun.star.uno.UnoRuntime; -import share.LogWriter; - -/** -* Tests XCommandProcessor. The TestCase can pass (but doesn't have -* to) "XCommandProcessor.AbortCommand" relation, to specify command to abort in -* abort() test. -* -* Testing com.sun.star.ucb.XCommandProcessor -* interface methods : -*
                    -*
                  • createCommandIdentifier()
                  • -*
                  • execute()
                  • -*
                  • abort()
                  • -*

                  -* This test needs the following object relations : -*

                    -*
                  • 'XCommandProcessor.AbortCommand' optional -* (of type com.sun.star.ucb.Command): -* specify command to abort in abort() test. -* If the relation is not specified the 'GlobalTransfer' -* command is used.
                  • -*

                      -* The following predefined files needed to complete the test: -*

                        -*
                      • poliball.gif : this file is required in case -* if the relation 'XCommandProcessor.AbortCommand' -* is not specified. This file is used by 'GlobalTransfer' -* command as a source file for copying.
                      • -*

                          -* Test is NOT multithread compilant.

                          -* @see com.sun.star.ucb.XCommandProcessor -*/ -public class _XCommandProcessor { - - /** - * Conatins the tested object. - */ - public XCommandProcessor oObj; - public LogWriter log = null; - private XMultiServiceFactory xMSF = null; - - /** - * Contains the command id returned by createCommandIdentifier() - * . It is used in abort() test. - */ - int cmdId; - - public void before(XMultiServiceFactory _xMSF) { - xMSF = _xMSF; - } - - /** - * Tests createCommandIdentifier(). Calls it for two times - * and checks returned values.

                          - * Has OK status if values are unique correct idenifiers: not 0. - */ - public boolean _createCommandIdentifier() { - log.println("creating a command line identifier"); - - int testCmdId = oObj.createCommandIdentifier(); - cmdId = oObj.createCommandIdentifier(); - - if (cmdId == 0 || testCmdId == 0) { - log.println("createCommandLineIdentifier() returned 0 - FAILED"); - } - - if (cmdId == testCmdId) { - log.println("the command identifier is not unique"); - } - - return testCmdId != 0 && cmdId != 0 && cmdId != testCmdId; - } - - /** - * First executes 'geCommandInfo' command and examines returned - * command info information. Second tries to execute inproper - * command.

                          - * Has OK status if in the first case returned information - * contains info about 'getCommandInfo' command and in the second - * case an exception is thrown.

                          - */ - public boolean _execute() { - String[]commands = new String[] {"getCommandInfo", "getPropertySetInfo"}; - boolean returnVal = true; - for (int j=0; jabort method - * is called permanently. Then a "long" command (for example, - * "transfer") is started. I case if relation is not - * specified 'GlobalTransfer' command starts to - * copy a file to temporary directory (if the relation is present - * then the its command starts to work).

                          - * Has OK status if the command execution is aborted, i.e. - * CommandAbortedException is thrown.

                          - * The following method tests are to be completed successfully before : - *

                            - *
                          • createCommandIdentifier() : to have a unique - * identifier which is used to abourt started command.
                          • - *
                          - */ - public boolean _abort() { - //executeMethod("createCommandIdentifier()"); - -// Command command = null;//(Command)tEnv.getObjRelation( - //"XCommandProcessor.AbortCommand"); - Command command = new Command("getCommandInfo", -1, null); - - if (command == null) { - String commandName = "globalTransfer"; - - String srcURL = util.utils.getFullTestURL("solibrary.jar") ; - String tmpURL = util.utils.getOfficeTemp(xMSF) ; - log.println("Copying '" + srcURL + "' to '" + tmpURL) ; - - GlobalTransferCommandArgument arg = new - GlobalTransferCommandArgument( - TransferCommandOperation.COPY, srcURL, - tmpURL, "", NameClash.OVERWRITE); - - command = new Command(commandName, -1, arg); - } - - Thread aborter = new Thread() { - public void run() { - for (int i = 0; i < 10; i++) { - log.println("try to abort command"); - oObj.abort(cmdId); - try { - Thread.sleep(10); - } catch (InterruptedException e) { - } - } - } - }; - - aborter.start(); - - try { - Thread.sleep(15); - } catch (InterruptedException e) { - } - - log.println("executing command"); - try { - oObj.execute(command, cmdId, null); - log.println("Command execution completed"); - log.println("CommandAbortedException is not thrown"); - log.println("This is OK since there is no command implemented "+ - "that can be aborted"); - } catch (CommandAbortedException e) { - return true; - } catch (Exception e) { - log.println("Unexpected exception " + e.getMessage()); - e.printStackTrace((java.io.PrintWriter)log); - return false; - } - - try { - aborter.join(5000); - aborter.interrupt(); - } catch(java.lang.InterruptedException e) { - } - return true; - } -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XComponent.java b/ucb/qa/complex/tdoc/interfaces/_XComponent.java deleted file mode 100755 index 1716e51d1358..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XComponent.java +++ /dev/null @@ -1,171 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.tdoc.interfaces; - -import com.sun.star.container.XNameContainer; -import lib.MultiMethodTest; - -import com.sun.star.frame.XDesktop; -import com.sun.star.lang.EventObject; -import com.sun.star.lang.XComponent; -import com.sun.star.lang.XEventListener; -import share.LogWriter; - -/** -* Testing com.sun.star.lang.XComponent -* interface methods : -*
                            -*
                          • dispose()
                          • -*
                          • addEventListener()
                          • -*
                          • removeEventListener()
                          • -*
                          -* After this interface test object must be recreated.

                          -* Multithreaded test ability not implemented yet. -* @see com.sun.star.lang.XComponent -*/ -public class _XComponent { - - public static XComponent oObj = null; - private XNameContainer xContainer = null; - private XComponent altDispose = null; - public LogWriter log = null; - - boolean listenerDisposed[] = new boolean[2]; - String[] Loutput = new String[2]; - - /** - * Listener which added but not removed, and its method must be called - * on dispose call. - */ - public class MyEventListener implements XEventListener { - public void disposing ( EventObject oEvent ) { - Loutput[0] = Thread.currentThread() + " is DISPOSING EV1" + this; - listenerDisposed[0] = true; - } - }; - - /** - * Listener which added and then removed, and its method must not - * be called on dispose call. - */ - public class MyEventListener2 implements XEventListener { - public void disposing ( EventObject oEvent ) { - Loutput[0] = Thread.currentThread() + " is DISPOSING EV2" + this; - listenerDisposed[1] = true; - } - }; - - XEventListener listener1 = new MyEventListener(); - XEventListener listener2 = new MyEventListener2(); - - /** - * For the cfgmgr2.OSetElement tests: dispose the owner element. - */ - protected void before() { - // do not dispose this component, but parent instead -// altDispose = (XComponent)tEnv.getObjRelation("XComponent.DisposeThis"); - - } - - /** - * Adds two listeners.

                          - * Has OK status if then the first listener will receive an event - * on dispose method call. - */ - public boolean _addEventListener() { - - listenerDisposed[0] = false; - listenerDisposed[1] = false; - - oObj.addEventListener( listener1 ); - oObj.addEventListener( listener2 ); - - return true; - } // finished _addEventListener() - - /** - * Removes the second of two added listeners.

                          - * Method tests to be completed successfully : - *

                            - *
                          • addEventListener : method must add two listeners.
                          • - *

                          - * Has OK status if no events will be sent to the second listener on - * dispose method call. - */ - public boolean _removeEventListener() { -// executeMethod("addEventListener()"); - if (disposed) return true; - // the second listener should not be called - oObj.removeEventListener( listener2 ); - log.println(Thread.currentThread() + " is removing EL " + listener2); - return true; - } // finished _removeEventListener() - - static boolean disposed = false; - - /** - * Disposes the object and then check appropriate listeners were - * called or not.

                          - * Method tests to be completed successfully : - *

                            - *
                          • removeEventListener : method must remove one of two - * listeners.
                          • - *

                          - * Has OK status if liseter removed wasn't called and other listener - * was. - */ - public boolean _dispose() { - disposed = false; -// executeMethod("removeEventListener()"); - - log.println( "begin dispose" + Thread.currentThread()); - oObj.dispose(); - - try { - Thread.sleep(500) ; - } catch (InterruptedException e) {} - if (Loutput[0]!=null) log.println(Loutput[0]); - if (Loutput[1]!=null) log.println(Loutput[1]); - log.println( "end dispose" + Thread.currentThread()); - disposed = true; - - // check that dispose() works OK. - return listenerDisposed[0] && !listenerDisposed[1]; - - } // finished _dispose() - - /** - * Forces object recreation. - */ - protected void after() { -// disposeEnvironment(); - } - -} // finished class _XComponent - - diff --git a/ucb/qa/complex/tdoc/interfaces/_XContent.java b/ucb/qa/complex/tdoc/interfaces/_XContent.java deleted file mode 100755 index 4c84ecc1d8df..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XContent.java +++ /dev/null @@ -1,86 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.tdoc.interfaces; - -import com.sun.star.ucb.XContent; -import com.sun.star.ucb.XContentEventListener; -import com.sun.star.ucb.XContentIdentifier; -import share.LogWriter; - -/** - * - * @author sg128468 - */ -public class _XContent { - public XContent oObj = null; - public LogWriter log = null; - private ContentListener listener = null; - - public boolean _addContentEventListener() { - listener = new ContentListener(); - oObj.addContentEventListener(listener); - return true; - } - public boolean _getContentType() { - String type = oObj.getContentType(); - log.println("Type: " + type); - return type != null && type.indexOf("vnd.sun.star.tdoc") != -1; - } - public boolean _getIdentifier() { - XContentIdentifier xIdent = oObj.getIdentifier(); - String id = xIdent.getContentIdentifier(); - String scheme = xIdent.getContentProviderScheme(); - log.println("Id: " + id); - log.println("Scheme: " + scheme); - return id != null && scheme != null && id.indexOf("vnd.sun.star.tdoc") != -1 && scheme.indexOf("vnd.sun.star.tdoc") != -1; - } - public boolean _removeContentEventListener() { - System.out.println("Event: " + (listener.disposed || listener.firedEvent)); - oObj.removeContentEventListener(listener); - return true; - } - - - private class ContentListener implements XContentEventListener { - private boolean disposed = false; - private boolean firedEvent = false; - - public void reset() { - disposed = false; - firedEvent = false; - } - - public void contentEvent(com.sun.star.ucb.ContentEvent contentEvent) { - firedEvent = true; - } - - public void disposing(com.sun.star.lang.EventObject eventObject) { - disposed = true; - } - - } -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XPropertiesChangeNotifier.java b/ucb/qa/complex/tdoc/interfaces/_XPropertiesChangeNotifier.java deleted file mode 100755 index 790f295c7be5..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XPropertiesChangeNotifier.java +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.tdoc.interfaces; - -import com.sun.star.beans.XPropertiesChangeListener; -import com.sun.star.beans.XPropertiesChangeNotifier; -import share.LogWriter; - -/** - * Check the XPropertiesChangeNotifier - */ -public class _XPropertiesChangeNotifier { - public XPropertiesChangeNotifier oObj = null; - public LogWriter log = null; - - PropertiesChangeListener listener = new PropertiesChangeListener(); - String[] args = null; - - - public boolean _addPropertiesChangeListener() { - oObj.addPropertiesChangeListener(args, listener); - return true; - } - - public boolean _removePropertiesChangeListener() { - oObj.removePropertiesChangeListener(args, listener); - return true; - } - - private class PropertiesChangeListener implements XPropertiesChangeListener { - public boolean disposed = false; - public boolean propChanged = false; - - public void disposing(com.sun.star.lang.EventObject eventObject) { - disposed = true; - } - - public void propertiesChange(com.sun.star.beans.PropertyChangeEvent[] propertyChangeEvent) { - propChanged = true; - } - - } -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XPropertyContainer.java b/ucb/qa/complex/tdoc/interfaces/_XPropertyContainer.java deleted file mode 100755 index fd7ff94c8f8f..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XPropertyContainer.java +++ /dev/null @@ -1,102 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.tdoc.interfaces; - -import com.sun.star.beans.XPropertyContainer; -import share.LogWriter; - -/** - * - * @author sg128468 - */ -public class _XPropertyContainer { - public XPropertyContainer oObj = null; - public LogWriter log = null; - - public boolean _addProperty() { - boolean result = true; - // add illegal property - try { - oObj.addProperty("MyIllegalProperty", (short)0, null); - } - catch(com.sun.star.beans.PropertyExistException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - catch(com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace((java.io.PrintWriter)log); - log.println("'IllegalArgument' Unexpected but correct."); - } - catch(com.sun.star.beans.IllegalTypeException e) { - log.println("'IllegalType' Correctly thrown"); - } - // add valid property - try { - oObj.addProperty("MyLegalProperty", (short)0, "Just a value"); - } - catch(com.sun.star.beans.PropertyExistException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - catch(com.sun.star.lang.IllegalArgumentException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - catch(com.sun.star.beans.IllegalTypeException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - return result; - } - - public boolean _removeProperty() { - boolean result = true; - try { - oObj.removeProperty("MyIllegalProperty"); - } - catch(com.sun.star.beans.UnknownPropertyException e) { - log.println("'UnknownProperty' Correctly thrown"); - } - catch(com.sun.star.beans.NotRemoveableException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - try { - oObj.removeProperty("MyLegalProperty"); - } - catch(com.sun.star.beans.UnknownPropertyException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - catch(com.sun.star.beans.NotRemoveableException e) { - e.printStackTrace((java.io.PrintWriter)log); - result = false; - } - return result; - } - -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XPropertySetInfoChangeNotifier.java b/ucb/qa/complex/tdoc/interfaces/_XPropertySetInfoChangeNotifier.java deleted file mode 100755 index ec1d7d64ada5..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XPropertySetInfoChangeNotifier.java +++ /dev/null @@ -1,67 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package complex.tdoc.interfaces; - -import com.sun.star.beans.XPropertySetInfoChangeListener; -import com.sun.star.beans.XPropertySetInfoChangeNotifier; -import share.LogWriter; - -/** - * - */ -public class _XPropertySetInfoChangeNotifier { - public XPropertySetInfoChangeNotifier oObj = null; - public LogWriter log = null; - - PropertySetInfoChangeListener listener = new PropertySetInfoChangeListener(); - String[] args = null; - - - public boolean _addPropertiesChangeListener() { - oObj.addPropertySetInfoChangeListener(listener); - return true; - } - - public boolean _removePropertiesChangeListener() { - oObj.removePropertySetInfoChangeListener(listener); - return true; - } - - private class PropertySetInfoChangeListener implements XPropertySetInfoChangeListener { - public boolean disposed = false; - public boolean propChanged = false; - - public void disposing(com.sun.star.lang.EventObject eventObject) { - disposed = true; - } - - public void propertySetInfoChange(com.sun.star.beans.PropertySetInfoChangeEvent propertySetInfoChangeEvent) { - } - - } - -} diff --git a/ucb/qa/complex/tdoc/interfaces/_XServiceInfo.java b/ucb/qa/complex/tdoc/interfaces/_XServiceInfo.java deleted file mode 100755 index 761cca87998a..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XServiceInfo.java +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.tdoc.interfaces; - -import lib.MultiMethodTest; - -import com.sun.star.lang.XServiceInfo; -import share.LogWriter; - -/** -* Testing com.sun.star.lang.XServiceInfo -* interface methods : -*

                            -*
                          • getImplementationName()
                          • -*
                          • supportsService()
                          • -*
                          • getSupportedServiceNames()
                          • -*

                          -* Test is multithread compilant.

                          -* @see com.sun.star.lang.XServiceInfo -*/ -public class _XServiceInfo { - public static XServiceInfo oObj = null; - public static String[] names = null; - public LogWriter log = null; - - /** - * Just calls the method.

                          - * Has OK status if no runtime exceptions occured. - */ - public boolean _getImplementationName() { - boolean result = true; - log.println("testing getImplementationName() ... "); - - log.println("The ImplementationName ist "+oObj.getImplementationName()); - result=true; - - return result; - - } // end getImplementationName() - - - /** - * Just calls the method.

                          - * Has OK status if no runtime exceptions occured. - */ - public boolean _getSupportedServiceNames() { - boolean result = true; - log.println("getting supported Services..."); - names = oObj.getSupportedServiceNames(); - for (int i=0;igetSupportedServiceNames method and - * calls the supportsService methos with this - * name.

                          - * Has OK status if true value is - * returned. - */ - public boolean _supportsService() { - log.println("testing supportsService"); - names = oObj.getSupportedServiceNames(); - return oObj.supportsService(names[0]); - } // end supportsService() -} - diff --git a/ucb/qa/complex/tdoc/interfaces/_XTypeProvider.java b/ucb/qa/complex/tdoc/interfaces/_XTypeProvider.java deleted file mode 100755 index aef931bdeef1..000000000000 --- a/ucb/qa/complex/tdoc/interfaces/_XTypeProvider.java +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package complex.tdoc.interfaces; - -import lib.MultiMethodTest; - -import com.sun.star.lang.XTypeProvider; -import com.sun.star.uno.Type; -import share.LogWriter; - -/** -* Testing com.sun.star.lang.XTypeProvider -* interface methods : -*

                            -*
                          • getTypes()
                          • -*
                          • getImplementationId()
                          • -*

                          -* Test is NOT multithread compilant.

                          -* @see com.sun.star.lang.XTypeProvider -*/ -public class _XTypeProvider { - - public static XTypeProvider oObj = null; - public static Type[] types = null; - public LogWriter log = null; - - /** - * Just calls the method.

                          - * Has OK status if no runtime exceptions occured. - */ - public boolean _getImplementationId() { - boolean result = true; - log.println("testing getImplementationId() ... "); - - log.println("The ImplementationId is "+oObj.getImplementationId()); - result = true; - - return result; - - } // end getImplementationId() - - - /** - * ?alls the method and checks the return value.

                          - * Has OK status if one of the return value equals to the - * type com.sun.star.lang.XTypeProvider. - */ - public boolean _getTypes() { - boolean result = false; - log.println("getting Types..."); - types = oObj.getTypes(); - for (int i=0;i"); - } - - return result; - - } // end getTypes() - -} - diff --git a/ucb/qa/complex/tdoc/makefile.mk b/ucb/qa/complex/tdoc/makefile.mk index f5f2629f5592..01f8ec0f76fa 100755 --- a/ucb/qa/complex/tdoc/makefile.mk +++ b/ucb/qa/complex/tdoc/makefile.mk @@ -43,15 +43,21 @@ JAVATESTFILES = \ CheckTransientDocumentsDocumentContent.java JAVAFILES = $(JAVATESTFILES) \ - TestDocument.java + TestDocument.java \ + _XChild.java \ + _XCommandInfoChangeNotifier.java \ + _XCommandProcessor.java \ + _XComponent.java \ + _XContent.java \ + _XPropertiesChangeNotifier.java \ + _XPropertyContainer.java \ + _XPropertySetInfoChangeNotifier.java \ + _XServiceInfo.java \ + _XTypeProvider.java JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) - -JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class) -SUBDIRS = interfaces - # Sample how to debug # JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y -- cgit From 31ed63fa321419343c3732496f1705f594e499d6 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 28 Jun 2010 11:13:40 +0200 Subject: sb123: #i112746# disabled fwk.ModuleManager for now --- framework/qa/unoapi/framework.sce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/qa/unoapi/framework.sce b/framework/qa/unoapi/framework.sce index dad0c838de66..cb8b36605820 100755 --- a/framework/qa/unoapi/framework.sce +++ b/framework/qa/unoapi/framework.sce @@ -17,7 +17,7 @@ -o fwk.ServiceHandler -o fwk.URLTransformer -o fwk.MacrosMenuController --o fwk.ModuleManager +#i112746 -o fwk.ModuleManager -o fwk.UIElementFactoryManager -o fwk.UICommandDescription -o fwk.LayoutManager -- cgit From b9e345f57f4ecf2b27a71b0bea344ec83ecfd50a Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 28 Jun 2010 13:37:19 +0200 Subject: #i112747# - resovled ownership cicle (patch contributed by cmc). --- ucb/source/core/ucbstore.cxx | 39 ++++++++------------------------------- ucb/source/core/ucbstore.hxx | 6 ++---- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 9500db4f45b6..cd5cb7856d7a 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -274,8 +274,9 @@ UcbStore::createPropertySetRegistry( const OUString& ) { osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( !m_pImpl->m_xTheRegistry.is() ) - m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xSMgr, *this ); + m_pImpl->m_xTheRegistry = new PropertySetRegistry( m_xSMgr, getInitArgs() ); } + return m_pImpl->m_xTheRegistry; } @@ -293,22 +294,6 @@ void SAL_CALL UcbStore::initialize( const Sequence< Any >& aArguments ) m_pImpl->m_aInitArgs = aArguments; } -//========================================================================= -// -// New methods. -// -//========================================================================= - -void UcbStore::removeRegistry() -{ - if ( m_pImpl->m_xTheRegistry.is() ) - { - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - if ( m_pImpl->m_xTheRegistry.is() ) - m_pImpl->m_xTheRegistry = 0; - } -} - //========================================================================= const Sequence< Any >& UcbStore::getInitArgs() const { @@ -323,7 +308,7 @@ const Sequence< Any >& UcbStore::getInitArgs() const struct PropertySetRegistry_Impl { - UcbStore* m_pCreator; + const Sequence< Any > m_aInitArgs; PropertySetMap_Impl m_aPropSets; Reference< XMultiServiceFactory > m_xConfigProvider; Reference< XInterface > m_xRootReadAccess; @@ -332,18 +317,11 @@ struct PropertySetRegistry_Impl sal_Bool m_bTriedToGetRootReadAccess; // #82494# sal_Bool m_bTriedToGetRootWriteAccess; // #82494# - PropertySetRegistry_Impl( UcbStore& rCreator ) - : m_pCreator( &rCreator ), + PropertySetRegistry_Impl( const Sequence< Any > &rInitArgs ) + : m_aInitArgs( rInitArgs ), m_bTriedToGetRootReadAccess( sal_False ), m_bTriedToGetRootWriteAccess( sal_False ) { - m_pCreator->acquire(); - } - - ~PropertySetRegistry_Impl() - { - m_pCreator->removeRegistry(); - m_pCreator->release(); } }; @@ -359,9 +337,9 @@ struct PropertySetRegistry_Impl PropertySetRegistry::PropertySetRegistry( const Reference< XMultiServiceFactory >& rXSMgr, - UcbStore& rCreator ) + const Sequence< Any > &rInitArgs ) : m_xSMgr( rXSMgr ), - m_pImpl( new PropertySetRegistry_Impl( rCreator ) ) + m_pImpl( new PropertySetRegistry_Impl( rInitArgs ) ) { } @@ -1094,8 +1072,7 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider() osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); if ( !m_pImpl->m_xConfigProvider.is() ) { - const Sequence< Any >& rInitArgs - = m_pImpl->m_pCreator->getInitArgs(); + const Sequence< Any >& rInitArgs = m_pImpl->m_aInitArgs; if ( rInitArgs.getLength() > 0 ) { diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx index 8c339337f890..7a7a76cb1b99 100644 --- a/ucb/source/core/ucbstore.hxx +++ b/ucb/source/core/ucbstore.hxx @@ -93,9 +93,6 @@ public: throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - // New - void removeRegistry(); - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& getInitArgs() const; }; @@ -132,7 +129,8 @@ public: PropertySetRegistry( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr, - UcbStore& rCreator ); + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rInitArgs); virtual ~PropertySetRegistry(); // XInterface -- cgit From f2d46d70f58a92542e9c4e7d54fb8e32d0369012 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Mon, 28 Jun 2010 13:44:39 +0200 Subject: dv19#i29340# Implmented handler for NameClashResolveRequests --- uui/source/nameclashdlg.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx index dd4566e45b30..593398d53640 100755 --- a/uui/source/nameclashdlg.cxx +++ b/uui/source/nameclashdlg.cxx @@ -26,6 +26,7 @@ ************************************************************************/ #include "vcl/msgbox.hxx" +#include "osl/file.hxx" #include "ids.hrc" #include "nameclashdlg.hrc" @@ -89,10 +90,14 @@ NameClashDialog::NameClashDialog( Window* pParent, ResMgr* pResMgr, maBtnOverwrite.Hide(); } + rtl::OUString aPath; + if ( osl::FileBase::E_None != osl::FileBase::getSystemPathFromFileURL( rTargetFolderURL, aPath ) ) + aPath = rTargetFolderURL; + maSameName = String ( ResId( STR_SAME_NAME_USED, *pResMgr ) ); aInfo.SearchAndReplaceAscii( "%NAME", rClashingName ); - aInfo.SearchAndReplaceAscii( "%FOLDER", rTargetFolderURL ); + aInfo.SearchAndReplaceAscii( "%FOLDER", aPath ); maFTMessage.SetText( aInfo ); if ( rProposedNewName.getLength() ) maEDNewName.SetText( rProposedNewName ); -- cgit From 7cf95e512b371281073de2422aa30c5d3c35a3c0 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 28 Jun 2010 13:58:27 +0200 Subject: cws tl81: #i112695# crash in synonym sub-menu fixed --- sfx2/source/menu/mnumgr.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index b264a5b47861..bc765b95340c 100755 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -578,6 +578,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra return 0; } + void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow ) { PopupMenu *pSVMenu = new PopupMenu( rResId ); @@ -622,6 +623,12 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() ); aPop.RemoveDisabledEntries(); aPop.Execute( rPoint, pWindow ); + + // #i112646 avoid crash when context menu is closed. + // the (manually inserted) sub-menu needs to be destroyed before + // aPop gets destroyed. + delete pThesSubMenu; + pThesSubMenu = 0; } delete pThesSubMenu; @@ -631,3 +638,4 @@ Menu* SfxPopupMenuManager::GetSVMenu() { return (Menu*) GetMenu()->GetSVMenu(); } + -- cgit From 748cc4c7f3e05ef8d2cb90e33d311084a4d425dd Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 28 Jun 2010 15:25:14 +0200 Subject: cws tl81: #i112695# crash in synonym sub-menu fixed --- .../registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 9 --------- 1 file changed, 9 deletions(-) mode change 100644 => 100755 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu old mode 100644 new mode 100755 index ebed194fcffc..85bc336ddec0 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -2139,9 +2139,6 @@ ~Sentence case - - 1 - @@ -2163,17 +2160,11 @@ ~Capitalize Every Word - - 1 - ~tOGGLE cASE - - 1 - -- cgit From 1952b083e8c143114f475aa4dccbf165ed179537 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Mon, 28 Jun 2010 15:58:56 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for DOS --- basic/source/sbx/sbxbase.cxx | 7 ------- basic/source/sbx/sbxdate.cxx | 8 -------- idl/source/cmptools/lex.cxx | 8 -------- idl/source/prj/globals.cxx | 10 ---------- svx/inc/svx/svdmodel.hxx | 2 +- 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index b1815228cd99..60bb9fe505e7 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -48,18 +48,11 @@ TYPEINIT0(SbxBase) SbxAppData* GetSbxData_Impl() { -#ifndef DOS SbxAppData** ppData = (SbxAppData**) ::GetAppData( SHL_SBX ); SbxAppData* p = *ppData; if( !p ) p = *ppData = new SbxAppData; return p; -#else - SbxAppData** ppData; - SbxAppData* p; - p = *ppData = new SbxAppData; - return p; -#endif } SbxAppData::~SbxAppData() diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index ce532fed0482..8dffb2758749 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -90,7 +90,6 @@ double ImpGetDate( const SbxValues* p ) nRes = 0; else { -#ifndef DOS LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); SvNumberFormatter* pFormatter; @@ -141,9 +140,6 @@ double ImpGetDate( const SbxValues* p ) } delete pFormatter; -#else - SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0; -#endif } break; case SbxOBJECT: @@ -246,7 +242,6 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: -#ifndef DOS { if( !p->pString ) p->pString = new XubString; @@ -301,11 +296,8 @@ start: eLangType ); pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor ); delete pFormatter; -#endif break; -#ifndef DOS } -#endif case SbxOBJECT: { SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 38b8d8260bb2..579c81a5ec16 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -146,11 +146,7 @@ SvToken & SvToken::operator = ( const SvToken & rObj ) *************************************************************************/ void SvTokenStream::InitCtor() { -#ifdef DOS - SetCharSet( CHARSET_ANSI ); -#else SetCharSet( gsl_getSystemTextEncoding() ); -#endif aStrTrue = "TRUE"; aStrFalse = "FALSE"; nLine = nColumn = 0; @@ -251,11 +247,7 @@ void SvTokenStream::SetCharSet( CharSet nSet ) { nCharSet = nSet; -#ifdef DOS - pCharTab = SvChar::GetTable( nSet, CHARSET_ANSI ); -#else pCharTab = SvChar::GetTable( nSet, gsl_getSystemTextEncoding() ); -#endif } /************************************************************************* diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index 83a730e404ad..4956cc9392a0 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -35,15 +35,6 @@ #include /****************** G L O B A L S ****************************************/ -#ifdef DOS -static IdlDll * pApp = NULL; -IdlDll * GetIdlApp() -{ - if( !pApp ) - pApp = new IdlDll(); - return pApp; -} -#else IdlDll * GetIdlApp() { if( !(*(IdlDll**)GetAppData(SHL_IDL)) ) @@ -55,7 +46,6 @@ IdlDll * GetIdlApp() } return (*(IdlDll**)GetAppData(SHL_IDL)); } -#endif IdlDll::IdlDll() : pHashTable( NULL ) diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index 61edcd5c7fe7..2da51b798fa7 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -57,7 +57,7 @@ class OutputDevice; #define DEGREE_CHAR ((sal_Unicode)176) /* 0xB0 = Ansi */ #endif -#if defined(DOS) || defined(OS2) +#if defined(OS2) #define DEGREE_CHAR ((sal_Unicode)248) /* 0xF8 = IBM PC (Erw. ASCII) */ #endif -- cgit From b6e30719dde5f67290a1b77891d3435ee7da2f9e Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Tue, 29 Jun 2010 16:13:34 +0200 Subject: impress193: #i112647# Integrated diff from MAV. --- sfx2/source/view/frame2.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index d99ad8733e03..d43512ac791d 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI aLoadArgs = aArgs.getPropertyValues(); // load the doc into that frame - ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() ); - if ( sLoaderURL.getLength() == 0 ) - sLoaderURL = rDoc.GetFactory().GetFactoryURL(); - + ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sLoaderURL, -- cgit From 1cad7ac9a61f02d6eeb4053c93f7a8d01a7eff52 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 29 Jun 2010 17:52:44 +0200 Subject: #i112601# paint the correct page background --- svx/inc/svx/sdrmasterpagedescriptor.hxx | 3 +++ svx/inc/svx/svdpage.hxx | 1 + .../contact/viewcontactofmasterpagedescriptor.cxx | 18 +---------------- svx/source/svdraw/sdrmasterpagedescriptor.cxx | 23 ++++++++++++++++++++++ svx/source/svdraw/svdpage.cxx | 12 +++++++++++ svx/source/unodraw/UnoGraphicExporter.cxx | 14 +++++++++---- 6 files changed, 50 insertions(+), 21 deletions(-) diff --git a/svx/inc/svx/sdrmasterpagedescriptor.hxx b/svx/inc/svx/sdrmasterpagedescriptor.hxx index 612f2ab927ec..3a31c3d11206 100644 --- a/svx/inc/svx/sdrmasterpagedescriptor.hxx +++ b/svx/inc/svx/sdrmasterpagedescriptor.hxx @@ -35,6 +35,7 @@ // predeclarations class SdrObject; class SfxItemSet; +class SdrPageProperties; namespace sdr { @@ -89,6 +90,8 @@ namespace sdr // operators sal_Bool operator==(const MasterPageDescriptor& rCandidate) const; sal_Bool operator!=(const MasterPageDescriptor& rCandidate) const; + + const SdrPageProperties* getCorrectSdrPageProperties() const; }; } // end of namespace sdr diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index c601fddef181..784598d7d544 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -448,6 +448,7 @@ private: public: SdrPageProperties& getSdrPageProperties() { return *mpSdrPageProperties; } const SdrPageProperties& getSdrPageProperties() const { return *mpSdrPageProperties; } + const SdrPageProperties* getCorrectSdrPageProperties() const; protected: // new MasterPageDescriptorVector diff --git a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx index cbe9c4a9c615..6ca5f1c4d172 100644 --- a/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx +++ b/svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx @@ -62,23 +62,7 @@ namespace sdr { drawinglayer::primitive2d::Primitive2DSequence xRetval; drawinglayer::attribute::SdrFillAttribute aFill; - const SdrPage* pCorrectPage = &GetMasterPageDescriptor().GetOwnerPage(); - const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties(); - - if(XFILL_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) - { - pCorrectPage = &GetMasterPageDescriptor().GetUsedPage(); - pCorrectProperties = &pCorrectPage->getSdrPageProperties(); - } - - if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet()) - { - // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets, - // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all - // MasterPages should have a StyleSheet excactly for this reason, but historically - // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others). - pCorrectProperties = 0; - } + const SdrPageProperties* pCorrectProperties = GetMasterPageDescriptor().getCorrectSdrPageProperties(); if(pCorrectProperties) { diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index 67b2de8b693c..eb757a8ee41c 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -113,6 +113,29 @@ namespace sdr || &maUsedPage != &rCandidate.maUsedPage || maVisibleLayers != rCandidate.maVisibleLayers); } + + const SdrPageProperties* MasterPageDescriptor::getCorrectSdrPageProperties() const + { + const SdrPage* pCorrectPage = &GetOwnerPage(); + const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties(); + + if(XFILL_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) + { + pCorrectPage = &GetUsedPage(); + pCorrectProperties = &pCorrectPage->getSdrPageProperties(); + } + + if(pCorrectPage->IsMasterPage() && !pCorrectProperties->GetStyleSheet()) + { + // #i110846# Suppress SdrPage FillStyle for MasterPages without StyleSheets, + // else the PoolDefault (XFILL_COLOR and Blue8) will be used. Normally, all + // MasterPages should have a StyleSheet excactly for this reason, but historically + // e.g. the Notes MasterPage has no StyleSheet set (and there maybe others). + pCorrectProperties = 0; + } + + return pCorrectProperties; + } } // end of namespace sdr ////////////////////////////////////////////////////////////////////////////// diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 8da0b248f38b..592f41543132 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1979,6 +1979,18 @@ void SdrPage::ReplaceCommentByIndex(sal_uInt32 nIndex, const sdr::Comment& rNew) } } +const SdrPageProperties* SdrPage::getCorrectSdrPageProperties() const +{ + if(mpMasterPageDescriptor) + { + return mpMasterPageDescriptor->getCorrectSdrPageProperties(); + } + else + { + return &getSdrPageProperties(); + } +} + ////////////////////////////////////////////////////////////////////////////// // use new redirector instead of pPaintProc diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index b80be1076b7e..c58e86f77fc3 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -634,10 +634,16 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, { if( rSettings.mbExportOnlyBackground ) { - pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize())); - pTempBackgroundShape->SetMergedItemSet(pPage->getSdrPageProperties().GetItemSet()); - pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE)); - aShapes.push_back(pTempBackgroundShape); + const SdrPageProperties* pCorrectProperties = pPage->getCorrectSdrPageProperties(); + + if(pCorrectProperties) + { + pTempBackgroundShape = new SdrRectObj(Rectangle(Point(0,0), pPage->GetSize())); + pTempBackgroundShape->SetMergedItemSet(pCorrectProperties->GetItemSet()); + pTempBackgroundShape->SetMergedItem(XLineStyleItem(XLINE_NONE)); + pTempBackgroundShape->NbcSetStyleSheet(pCorrectProperties->GetStyleSheet(), true); + aShapes.push_back(pTempBackgroundShape); + } } else { -- cgit From 15e8727afc7cdac53b0aa100b681c451b98552a5 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Wed, 30 Jun 2010 09:48:27 +0200 Subject: codecleanup02: #i112685# Removed ifdefs and code for MAC --- connectivity/source/drivers/adabas/BDriver.cxx | 4 +--- desktop/source/app/app.cxx | 2 -- desktop/source/app/officeipcthread.cxx | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx index 8e36597b3e5c..fe6ce66bcb3f 100644 --- a/connectivity/source/drivers/adabas/BDriver.cxx +++ b/connectivity/source/drivers/adabas/BDriver.cxx @@ -48,9 +48,7 @@ #include #include -#if defined(MAC) -const char sNewLine = '\015'; -#elif defined(UNX) +#if defined(UNX) const char sNewLine = '\012'; #else const char sNewLine[] = "\015\012"; // \015\012 and not \n diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 6f00d47332ac..acb67f8f66d2 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2336,8 +2336,6 @@ void Desktop::OpenClients() aHelpURLBuffer.appendAscii("&System=UNX"); #elif defined WNT aHelpURLBuffer.appendAscii("&System=WIN"); -#elif defined MAC - aHelpURLBuffer.appendAscii("&System=MAC"); #elif defined OS2 aHelpURLBuffer.appendAscii("&System=OS2"); #endif diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index fc74c3fb4504..5527b8ea2aea 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -847,8 +847,6 @@ void SAL_CALL OfficeIPCThread::run() aHelpURLBuffer.appendAscii("&System=UNX"); #elif defined WNT aHelpURLBuffer.appendAscii("&System=WIN"); -#elif defined MAC - aHelpURLBuffer.appendAscii("&System=MAC"); #elif defined OS2 aHelpURLBuffer.appendAscii("&System=OS2"); #endif -- cgit From 6e04cd8c7992b96d4ed1e15e89f7e667b45ef16f Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Wed, 30 Jun 2010 09:55:36 +0200 Subject: codecleanup02: #i112685# Removed old stuff: SvEaMgr --- sfx2/inc/sfx2/docfile.hxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index 074f74cb0e72..f8e9372f03dc 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -62,7 +62,6 @@ class Timer; class SfxItemSet; class DateTime; class SvStringsDtor; -class SvEaMgr; #define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 ) @@ -207,8 +206,6 @@ public: SvStream* GetInStream(); SvStream* GetOutStream(); - SvEaMgr* GetEaMgr(); - sal_Bool Commit(); sal_Bool IsStorage(); -- cgit From 471be9b9377c5be7aeda0a9b3025b71e121abb83 Mon Sep 17 00:00:00 2001 From: Caol?n McNamara Date: Wed, 30 Jun 2010 15:58:17 +0100 Subject: cmcfixes76: #i112819# overly const member --- uui/source/iahndl.cxx | 6 +++--- uui/source/loginerr.hxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 uui/source/iahndl.cxx diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx old mode 100755 new mode 100644 index 0879e3574da3..3cdd595666cc --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -1338,7 +1338,7 @@ UUIInteractionHelper::handleGenericErrorRequest( { uno::Any aProductNameAny = ::utl::ConfigManager::GetConfigManager() - ->GetDirectConfigProperty( + .GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); aProductNameAny >>= aTitle; } @@ -1552,10 +1552,10 @@ UUIInteractionHelper::handleBrokenPackageRequest( return; uno::Any aProductNameAny = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); uno::Any aProductVersionAny = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); ::rtl::OUString aProductName, aProductVersion; if ( !( aProductNameAny >>= aProductName ) ) diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index ec1317dbd805..39bbfb7d820c 100755 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -68,7 +68,7 @@ public: const String& GetUserName() const { return m_aUserName; } const String& GetPassword() const { return m_aPassword; } const String& GetPasswordToModify() const { return m_aPasswordToModify; } - const bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; } + bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; } const String& GetPath() const { return m_aPath; } const String& GetErrorText() const { return m_aErrorText; } BOOL GetCanRememberPassword() const { return ( m_nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); } -- cgit From 966d524bff619cc7c6f709789353e7aa057be833 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 1 Jul 2010 09:13:15 +0200 Subject: codecleanup02: #i52551# Removed old stuff: VOS_NAMESPACE, use vos:: directly --- basic/inc/basic/process.hxx | 6 ++-- basic/source/app/process.cxx | 38 ++++++++++++------------- basic/source/classes/eventatt.cxx | 2 +- basic/source/classes/sbunoobj.cxx | 4 +-- basic/source/runtime/methods.cxx | 32 ++++++++++----------- connectivity/source/drivers/file/FResultSet.cxx | 4 +-- sfx2/source/dialog/filedlghelper.cxx | 2 +- 7 files changed, 44 insertions(+), 44 deletions(-) mode change 100644 => 100755 basic/source/classes/sbunoobj.cxx diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx index 20cdbe1d4aa4..9a593322b896 100644 --- a/basic/inc/basic/process.hxx +++ b/basic/inc/basic/process.hxx @@ -39,9 +39,9 @@ typedef Environment::value_type EnvironmentVariable; class Process { // Internal members and methods - NAMESPACE_VOS(OArgumentList) *pArgumentList; - NAMESPACE_VOS(OEnvironment) *pEnvList; - NAMESPACE_VOS(OProcess) *pProcess; + vos::OArgumentList *pArgumentList; + vos::OEnvironment *pEnvList; + vos::OProcess *pProcess; BOOL ImplIsRunning(); long ImplGetExitCode(); BOOL bWasGPF; diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx index c37af05ac8da..0eec05e1697c 100644 --- a/basic/source/app/process.cxx +++ b/basic/source/app/process.cxx @@ -72,9 +72,9 @@ BOOL Process::ImplIsRunning() { if ( pProcess && bHasBeenStarted ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) return TRUE; else return FALSE; @@ -87,9 +87,9 @@ long Process::ImplGetExitCode() { if ( pProcess ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); return aProcessInfo.Code; } @@ -124,7 +124,7 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nParamCount++; } } - pArgumentList = new NAMESPACE_VOS(OArgumentList)( pParamList, nCount ); + pArgumentList = new vos::OArgumentList( pParamList, nCount ); ::rtl::OUString *pEnvArray = NULL; @@ -143,12 +143,12 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nEnvCount++; aIter++; } - pEnvList = new NAMESPACE_VOS(OEnvironment)( pEnvArray, nEnvCount ); + pEnvList = new vos::OEnvironment( pEnvArray, nEnvCount ); } ::rtl::OUString aNormalizedAppPath; osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath ); - pProcess = new NAMESPACE_VOS(OProcess)( aNormalizedAppPath ); + pProcess = new vos::OProcess( aNormalizedAppPath ); bHasBeenStarted = FALSE; delete [] pParamList; @@ -170,20 +170,20 @@ BOOL Process::Start() #endif if ( pEnvList ) { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), *pArgumentList, - *pEnvList ) == NAMESPACE_VOS(OProcess)::E_None; + *pEnvList ) == vos::OProcess::E_None; } else { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), - *pArgumentList ) == NAMESPACE_VOS(OProcess)::E_None; + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), + *pArgumentList ) == vos::OProcess::E_None; } #ifdef WNT } diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 791e9fe5a8c1..78682a633fe3 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -255,7 +255,7 @@ Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent ) void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeException ) { // TODO: ??? - //NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + //vos::OGuard guard( Application::GetSolarMutex() ); //xSbxObj.Clear(); } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx old mode 100644 new mode 100755 index 849fd839bfd1..80b5721be65f --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3744,7 +3744,7 @@ BasicAllListener_Impl::~BasicAllListener_Impl() void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); if( xSbxObj.Is() ) { @@ -3809,7 +3809,7 @@ Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( // Methoden von XEventListener void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); xSbxObj.Clear(); } diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index dbeb7c619b9d..7f492ced6aeb 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -3371,8 +3371,8 @@ RTLFUNC(Shell) } else { - USHORT nOptions = NAMESPACE_VOS(OProcess)::TOption_SearchPath| - NAMESPACE_VOS(OProcess)::TOption_Detached; + USHORT nOptions = vos::OProcess::TOption_SearchPath| + vos::OProcess::TOption_Detached; String aCmdLine = rPar.Get(1)->GetString(); // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden if( nArgCount >= 4 ) @@ -3450,13 +3450,13 @@ RTLFUNC(Shell) switch( nWinStyle ) { case 2: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Minimized; + nOptions |= vos::OProcess::TOption_Minimized; break; case 3: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Maximized; + nOptions |= vos::OProcess::TOption_Maximized; break; case 10: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_FullScreen; + nOptions |= vos::OProcess::TOption_FullScreen; break; } @@ -3464,10 +3464,10 @@ RTLFUNC(Shell) if( nArgCount >= 5 ) bSync = rPar.Get(4)->GetBool(); if( bSync ) - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Wait; + nOptions |= vos::OProcess::TOption_Wait; } - NAMESPACE_VOS(OProcess)::TProcessOption eOptions = - (NAMESPACE_VOS(OProcess)::TProcessOption)nOptions; + vos::OProcess::TProcessOption eOptions = + (vos::OProcess::TProcessOption)nOptions; // #72471 Parameter aufbereiten @@ -3497,25 +3497,25 @@ RTLFUNC(Shell) } //const char* pParams = aParams.Len() ? aParams.GetStr() : 0; - NAMESPACE_VOS(OProcess)* pApp; - pApp = new NAMESPACE_VOS(OProcess)( aOUStrProgUNC ); + vos::OProcess* pApp; + pApp = new vos::OProcess( aOUStrProgUNC ); BOOL bSucc; if( nParamCount == 0 ) { - bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; } else { - NAMESPACE_VOS(OArgumentList) aArgList( pArgumentList, nParamCount ); - bSucc = pApp->execute( eOptions, aArgList ) == NAMESPACE_VOS(OProcess)::E_None; + vos::OArgumentList aArgList( pArgumentList, nParamCount ); + bSucc = pApp->execute( eOptions, aArgList ) == vos::OProcess::E_None; } /* if( nParamCount == 0 ) - pApp = new NAMESPACE_VOS(OProcess)( pProg ); + pApp = new vos::OProcess( pProg ); else - pApp = new NAMESPACE_VOS(OProcess)( pProg, pParamList, nParamCount ); - BOOL bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + pApp = new vos::OProcess( pProg, pParamList, nParamCount ); + BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; */ delete pApp; diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 3462422b99e6..94d65cc8a1bc 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1044,7 +1044,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, // INT32 nTempPos = m_nRowPos; // exclusiver zugriff auf die Tabelle - // NAMESPACE_VOS(OGuard)* pGuard = m_pTable->Lock(); + // vos::OGuard* pGuard = m_pTable->Lock(); if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount()) @@ -1402,7 +1402,7 @@ BOOL OResultSet::OpenImpl() m_nRowCountResult = -1; // exclusiver zugriff auf die Tabelle - // NAMESPACE_VOS(OGuard)* pGuard = pTable->Lock(); + // vos::OGuard* pGuard = pTable->Lock(); m_nLastVisitedPos = m_pTable->getCurrentLastPos(); switch(m_aSQLIterator.getStatementType()) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index d56c36bfd5ea..49c605cadf85 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2721,7 +2721,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) if ( sFolder.getLength() == 0 ) { // _rPath is not a valid path -> fallback to home directory - NAMESPACE_VOS( OSecurity ) aSecurity; + vos:: OSecurity aSecurity; aSecurity.getHomeDir( sFolder ); } mpImp->displayFolder( sFolder ); -- cgit From 88d0d8d5ccf1999ec7dc2f464b1e3a60f1b88cc5 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 1 Jul 2010 13:01:22 +0200 Subject: jl154: #i112673# ensure that client-facing PID remains the same across internal OOo restart on Mac OS X --- desktop/source/app/app.cxx | 109 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 82 insertions(+), 27 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index bba615e0ebbc..41d4406e03cd 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -28,6 +28,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_desktop.hxx" +#include +#include + #include #include #include "app.hxx" @@ -155,6 +158,11 @@ #include "langselect.hxx" +#if defined MACOSX +#include +#include +#endif + #define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII)) #define U2S(STRING) ::rtl::OUStringToOString(STRING, RTL_TEXTENCODING_UTF8) @@ -1101,28 +1109,79 @@ sal_Bool Desktop::SaveTasks() sal_False); } -#ifdef MACOSX -static void DoRestart() -{ - oslProcess process; - oslProcessError error; - OUString sExecutableFile; - - osl_getExecutableFile( &sExecutableFile.pData ); - - error = osl_executeProcess( - sExecutableFile.pData, - NULL, - 0, - 0, - NULL, - NULL, - NULL, - 0, - &process - ); -} +namespace { + +void restartOnMac(bool passArguments) { +#if defined MACOSX + OfficeIPCThread::DisableOfficeIPCThread(); + rtl::OUString execUrl; + OSL_VERIFY(osl_getExecutableFile(&execUrl.pData) == osl_Process_E_None); + rtl::OUString execPath; + rtl::OString execPath8; + if ((osl::FileBase::getSystemPathFromFileURL(execUrl, execPath) + != osl::FileBase::E_None) || + !execPath.convertToString( + &execPath8, osl_getThreadTextEncoding(), + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) + { + std::abort(); + } + std::vector< rtl::OString > args; + args.push_back(execPath8); + bool wait = false; + if (passArguments) { + sal_uInt32 n = osl_getCommandArgCount(); + for (sal_uInt32 i = 0; i < n; ++i) { + rtl::OUString arg; + OSL_VERIFY(osl_getCommandArg(i, &arg.pData) == osl_Process_E_None); + if (arg.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("-accept="))) { + wait = true; + } + rtl::OString arg8; + if (!arg.convertToString( + &arg8, osl_getThreadTextEncoding(), + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | + RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) + { + std::abort(); + } + args.push_back(arg8); + } + } + std::vector< char const * > argPtrs; + for (std::vector< rtl::OString >::iterator i(args.begin()); i != args.end(); + ++i) + { + argPtrs.push_back(i->getStr()); + } + argPtrs.push_back(0); + execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0])); + if (errno == ENOTSUP) { // happens when multithreaded on OS X < 10.6 + pid_t pid = fork(); + if (pid == 0) { + execv(execPath8.getStr(), const_cast< char ** >(&argPtrs[0])); + } else if (pid > 0) { + // Two simultaneously running soffice processes lead to two dock + // icons, so avoid waiting here unless it must be assumed that the + // process invoking soffice itself wants to wait for soffice to + // finish: + if (!wait) { + return; + } + int stat; + if (waitpid(pid, &stat, 0) == pid && WIFEXITED(stat)) { + _exit(WEXITSTATUS(stat)); + } + } + } + std::abort(); +#else + (void) passArguments; // avoid warnings #endif +} + +} USHORT Desktop::Exception(USHORT nError) { @@ -1193,9 +1252,7 @@ USHORT Desktop::Exception(USHORT nError) OfficeIPCThread::DisableOfficeIPCThread(); if( pSignalHandler ) DELETEZ( pSignalHandler ); -#ifdef MACOSX - DoRestart(); -#endif + restartOnMac(false); _exit( ExitHelper::E_CRASH_WITH_RESTART ); } else @@ -1693,9 +1750,7 @@ void Desktop::Main() RTL_LOGFILE_CONTEXT_TRACE( aLog, "FINISHED WITH Destop::Main" ); if ( bRestartRequested ) { -#ifdef MACOSX - DoRestart(); -#endif + restartOnMac(true); // wouldn't the solution be more clean if SalMain returns the exit code to the system? _exit( ExitHelper::E_NORMAL_RESTART ); } -- cgit From 6e819dc904924498d55857ec7d585bf7055a6953 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 1 Jul 2010 15:19:53 +0200 Subject: cws tl81: #i112788# patch was broken, old code restored --- editeng/source/editeng/impedit2.cxx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 778942730e71..148ca08816ae 100755 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -4209,18 +4209,8 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT DBG_ERROR("svx::ImpEditEngine::GetXPos(), index out of range!"); } -#if 0 + // old code restored see #i112788 (which leaves #i74188 unfixed again) long nPosInPortion = pLine->GetCharPosArray().GetObject( nPos ); -#else - // #i74188# (positioning the cursor after deleting components of combined indic characters) - SvxFont aTmpFont( pParaPortion->GetNode()->GetCharAttribs().GetDefFont() ); - SeekCursor( pParaPortion->GetNode(), nPos+1, aTmpFont ); - aTmpFont.SetPhysFont( GetRefDevice() ); - ImplInitDigitMode( GetRefDevice(), 0, 0, 0, aTmpFont.GetLanguage() ); - String sSegment(*pParaPortion->GetNode(), pLine->GetStart(), nPos+1); - long nPosInPortion = aTmpFont.QuickGetTextSize( GetRefDevice(), - sSegment, 0, nPos+1, NULL ).Width(); -#endif if ( !pPortion->IsRightToLeft() ) { -- cgit From 7e018ced84bd8a4400bf8c7ede4e1cb33e90aec9 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 1 Jul 2010 16:23:26 +0200 Subject: mib17: #111144# Enable calls to module function via Sheet object --- basic/inc/basic/sbmod.hxx | 3 + basic/source/classes/sbxmod.cxx | 359 ++++++++++++++++++++++++++ vbahelper/inc/vbahelper/vbacollectionimpl.hxx | 3 +- vbahelper/inc/vbahelper/vbahelper.hxx | 1 + vbahelper/source/vbahelper/vbaglobalbase.cxx | 24 +- vbahelper/source/vbahelper/vbahelper.cxx | 20 ++ 6 files changed, 404 insertions(+), 6 deletions(-) diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index cf888adf9dcf..aeed4c2b6347 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -28,6 +28,7 @@ #ifndef _SB_SBMOD_HXX #define _SB_SBMOD_HXX +#include #include #include #include @@ -57,6 +58,7 @@ class SbModule : public SbxObject SbModuleImpl* mpSbModuleImpl; // Impl data protected: + com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper; ::rtl::OUString aOUSource; String aComment; SbiImage* pImage; // the Image @@ -131,6 +133,7 @@ public: INT32 GetModuleType() { return mnType; } void SetModuleType( INT32 nType ) { mnType = nType; } bool GetIsProxyModule() { return bIsProxyModule; } + ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ); }; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 1b49a376c9bd..254e99c69da9 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -76,7 +76,20 @@ using namespace com::sun::star; #include #include #include +#include +#include +#include +#include +#include +#include +#include + using namespace ::com::sun::star; +using namespace com::sun::star::lang; +using namespace com::sun::star::reflection; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; + #include #include @@ -85,6 +98,340 @@ using namespace com::sun::star; #include #include #include +#include + +typedef ::cppu::WeakImplHelper1< XInvocation > DocObjectWrapper_BASE; +typedef ::std::map< sal_Int16, Any, ::std::less< sal_Int16 > > OutParamMap; +::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar ); +void unoToSbxValue( SbxVariable* pVar, const ::com::sun::star::uno::Any& aValue ); + +class DocObjectWrapper : public DocObjectWrapper_BASE +{ + Reference< XAggregation > m_xAggProxy; + Reference< XInvocation > m_xAggInv; + Reference< XTypeProvider > m_xAggregateTypeProv; + Sequence< Type > m_Types; + SbModule* m_pMod; + SbMethodRef getMethod( const rtl::OUString& aName ) throw (RuntimeException); + SbPropertyRef getProperty( const rtl::OUString& aName ) throw (RuntimeException); + String mName; // for debugging + +public: + DocObjectWrapper( SbModule* pMod ); + ~DocObjectWrapper(); + + virtual void SAL_CALL acquire() throw(); + virtual void SAL_CALL release() throw(); + + virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw ( com::sun::star::uno::RuntimeException ) + { + return m_xAggregateTypeProv->getImplementationId(); + + } + + virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (RuntimeException); + + virtual Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException); + virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException); + virtual Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException); + virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException); + virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException); + virtual Any SAL_CALL queryInterface( const Type& aType ) throw ( RuntimeException ); + + virtual Sequence< Type > SAL_CALL getTypes() throw ( RuntimeException ); +}; + +DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pVar->GetName() ) +{ + SbObjModule* pMod = PTR_CAST(SbObjModule,pVar); + if ( pMod ) + { + sal_Int16 nType = pMod->GetModuleType(); + if ( pMod->GetModuleType() == ModuleType::DOCUMENT ) + { + Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + // Use proxy factory service to create aggregatable proxy. + SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,pMod->GetObject() ); + Reference< XInterface > xIf; + if ( pUnoObj ) + { + Any aObj = pUnoObj->getUnoAny(); + aObj >>= xIf; + if ( xIf.is() ) + { + m_xAggregateTypeProv.set( xIf, UNO_QUERY ); + m_xAggInv.set( xIf, UNO_QUERY ); + } + } + if ( xIf.is() ) + { + try + { + Reference< XMultiComponentFactory > xMFac( xFactory, UNO_QUERY_THROW ); + Reference< XPropertySet> xPSMPropertySet( xMFac, UNO_QUERY_THROW ); + Reference< XComponentContext > xCtx; + xPSMPropertySet->getPropertyValue( + String( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xCtx; + Reference< XProxyFactory > xProxyFac( xMFac->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.reflection.ProxyFactory" ) ), xCtx ), UNO_QUERY_THROW ); + m_xAggProxy = xProxyFac->createProxy( xIf ); + } + catch( Exception& ) + { + OSL_ENSURE( false, "DocObjectWrapper::DocObjectWrapper: Caught exception!" ); + } + } + + if ( m_xAggProxy.is() ) + { + osl_incrementInterlockedCount( &m_refCount ); + + /* i35609 - Fix crash on Solaris. The setDelegator call needs + to be in its own block to ensure that all temporary Reference + instances that are acquired during the call are released + before m_refCount is decremented again */ + { + m_xAggProxy->setDelegator( static_cast< cppu::OWeakObject * >( this ) ); + } + + osl_decrementInterlockedCount( &m_refCount ); + } + } + } +} + +void SAL_CALL +DocObjectWrapper::acquire() throw () +{ + osl_incrementInterlockedCount( &m_refCount ); + OSL_TRACE("DocObjectWrapper::acquire(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount ); +} +void SAL_CALL +DocObjectWrapper::release() throw () +{ + if ( osl_decrementInterlockedCount( &m_refCount ) == 0 ) + { + OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount ); + delete this; + } + else + OSL_TRACE("DocObjectWrapper::release(%s) 0x%x refcount is now %d", rtl::OUStringToOString( mName, RTL_TEXTENCODING_UTF8 ).getStr(), this, m_refCount ); +} + +DocObjectWrapper::~DocObjectWrapper() +{ +} + +Sequence< Type > SAL_CALL DocObjectWrapper::getTypes() + throw ( RuntimeException ) +{ + if ( m_Types.getLength() == 0 ) + { + Sequence< Type > sTypes; + if ( m_xAggregateTypeProv.is() ) + sTypes = m_xAggregateTypeProv->getTypes(); + m_Types.realloc( sTypes.getLength() + 1 ); + Type* pPtr = m_Types.getArray(); + for ( int i=0; i SAL_CALL +DocObjectWrapper::getIntrospection( ) throw (RuntimeException) +{ + return NULL; +} + +Any SAL_CALL +DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< Any >& aParams, Sequence< ::sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam ) throw (IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException) +{ + if ( m_xAggInv.is() && m_xAggInv->hasMethod( aFunctionName ) ) + return m_xAggInv->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam ); + SbMethodRef pMethod = getMethod( aFunctionName ); + if ( !pMethod ) + throw RuntimeException(); + // check number of parameters + sal_Int32 nParamsCount = aParams.getLength(); + SbxInfo* pInfo = pMethod->GetInfo(); + if ( pInfo ) + { + sal_Int32 nSbxOptional = 0; + USHORT n = 1; + for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) ) + { + if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != 0 ) + ++nSbxOptional; + else + nSbxOptional = 0; + } + sal_Int32 nSbxCount = n - 1; + if ( nParamsCount < nSbxCount - nSbxOptional ) + { + throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "wrong number of parameters!" ) ), Reference< XInterface >() ); + } + } + // set parameters + SbxArrayRef xSbxParams; + if ( nParamsCount > 0 ) + { + xSbxParams = new SbxArray; + const Any* pParams = aParams.getConstArray(); + for ( sal_Int32 i = 0; i < nParamsCount; ++i ) + { + SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT ); + unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), pParams[i] ); + xSbxParams->Put( xSbxVar, static_cast< USHORT >( i ) + 1 ); + + // Enable passing by ref + if ( xSbxVar->GetType() != SbxVARIANT ) + xSbxVar->SetFlag( SBX_FIXED ); + } + } + if ( xSbxParams.Is() ) + pMethod->SetParameters( xSbxParams ); + + // call method + SbxVariableRef xReturn = new SbxVariable; + ErrCode nErr = SbxERR_OK; + + nErr = pMethod->Call( xReturn ); + Any aReturn; + // get output parameters + if ( xSbxParams.Is() ) + { + SbxInfo* pInfo_ = pMethod->GetInfo(); + if ( pInfo_ ) + { + OutParamMap aOutParamMap; + for ( USHORT n = 1, nCount = xSbxParams->Count(); n < nCount; ++n ) + { + const SbxParamInfo* pParamInfo = pInfo_->GetParam( n ); + if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 ) + { + SbxVariable* pVar = xSbxParams->Get( n ); + if ( pVar ) + { + SbxVariableRef xVar = pVar; + aOutParamMap.insert( OutParamMap::value_type( n - 1, sbxToUnoValue( xVar ) ) ); + } + } + } + sal_Int32 nOutParamCount = aOutParamMap.size(); + aOutParamIndex.realloc( nOutParamCount ); + aOutParam.realloc( nOutParamCount ); + sal_Int16* pOutParamIndex = aOutParamIndex.getArray(); + Any* pOutParam = aOutParam.getArray(); + for ( OutParamMap::iterator aIt = aOutParamMap.begin(); aIt != aOutParamMap.end(); ++aIt, ++pOutParamIndex, ++pOutParam ) + { + *pOutParamIndex = aIt->first; + *pOutParam = aIt->second; + } + } + } + + // get return value + aReturn = sbxToUnoValue( xReturn ); + + pMethod->SetParameters( NULL ); + + return aReturn; +} + +void SAL_CALL +DocObjectWrapper::setValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException) +{ + if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) ) + return m_xAggInv->setValue( aPropertyName, aValue ); + + SbPropertyRef pProperty = getProperty( aPropertyName ); + if ( !pProperty.Is() ) + throw UnknownPropertyException(); + unoToSbxValue( (SbxVariable*) pProperty, aValue ); +} + +Any SAL_CALL +DocObjectWrapper::getValue( const ::rtl::OUString& aPropertyName ) throw (UnknownPropertyException, RuntimeException) +{ + if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) ) + return m_xAggInv->getValue( aPropertyName ); + + SbPropertyRef pProperty = getProperty( aPropertyName ); + if ( !pProperty.Is() ) + throw UnknownPropertyException(); + + SbxVariable* pProp = ( SbxVariable* ) pProperty; + if ( pProp->GetType() == SbxEMPTY ) + pProperty->Broadcast( SBX_HINT_DATAWANTED ); + + Any aRet = sbxToUnoValue( pProp ); + return aRet; +} + +::sal_Bool SAL_CALL +DocObjectWrapper::hasMethod( const ::rtl::OUString& aName ) throw (RuntimeException) +{ + if ( m_xAggInv.is() && m_xAggInv->hasMethod( aName ) ) + return sal_True; + return getMethod( aName ).Is(); +} + +::sal_Bool SAL_CALL +DocObjectWrapper::hasProperty( const ::rtl::OUString& aName ) throw (RuntimeException) +{ + sal_Bool bRes = sal_False; + if ( m_xAggInv.is() && m_xAggInv->hasProperty( aName ) ) + bRes = sal_True; + else bRes = getProperty( aName ).Is(); + return bRes; +} + +Any SAL_CALL DocObjectWrapper::queryInterface( const Type& aType ) + throw ( RuntimeException ) +{ + Any aRet = DocObjectWrapper_BASE::queryInterface( aType ); + if ( aRet.hasValue() ) + return aRet; + else if ( m_xAggProxy.is() ) + aRet = m_xAggProxy->queryAggregation( aType ); + return aRet; +} + +SbMethodRef DocObjectWrapper::getMethod( const rtl::OUString& aName ) throw (RuntimeException) +{ + SbMethodRef pMethod = NULL; + if ( m_pMod ) + { + USHORT nSaveFlgs = m_pMod->GetFlags(); + // Limit search to this module + m_pMod->ResetFlag( SBX_GBLSEARCH ); + pMethod = (SbMethod*) m_pMod->SbModule::Find( aName, SbxCLASS_METHOD ); + m_pMod->SetFlags( nSaveFlgs ); + } + + return pMethod; +} + +SbPropertyRef DocObjectWrapper::getProperty( const rtl::OUString& aName ) throw (RuntimeException) +{ + SbPropertyRef pProperty = NULL; + if ( m_pMod ) + { + USHORT nSaveFlgs = m_pMod->GetFlags(); + // Limit search to this module. + m_pMod->ResetFlag( SBX_GBLSEARCH ); + pProperty = (SbProperty*)m_pMod->SbModule::Find( aName, SbxCLASS_PROPERTY ); + m_pMod->SetFlag( nSaveFlgs ); + } + + return pProperty; +} TYPEINIT1(SbModule,SbxObject) TYPEINIT1(SbMethod,SbxMethod) @@ -199,12 +546,24 @@ SbModule::SbModule( const String& rName, BOOL bVBACompat ) SbModule::~SbModule() { + OSL_TRACE("Module named %s is destructing", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr() ); if( pImage ) delete pImage; if( pBreaks ) delete pBreaks; if( pClassData ) delete pClassData; + mxWrapper = NULL; +} + +uno::Reference< script::XInvocation > +SbModule::GetUnoModule() +{ + if ( !mxWrapper.is() ) + mxWrapper = new DocObjectWrapper( this ); + + OSL_TRACE("Module named %s returning wrapper mxWrapper (0x%x)", rtl::OUStringToOString( GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), mxWrapper.get() ); + return mxWrapper; } BOOL SbModule::IsCompiled() const diff --git a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx index 36102116c7b3..5bd58b44adaf 100644 --- a/vbahelper/inc/vbahelper/vbacollectionimpl.hxx +++ b/vbahelper/inc/vbahelper/vbacollectionimpl.hxx @@ -133,11 +133,12 @@ protected: class VBAHELPER_DLLPUBLIC EnumerationHelperImpl : public EnumerationHelper_BASE { protected: + css::uno::WeakReference< ov::XHelperInterface > m_xParent; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::container::XEnumeration > m_xEnumeration; public: - EnumerationHelperImpl( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xContext( xContext ), m_xEnumeration( xEnumeration ) { } + EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) { } virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException) { return m_xEnumeration->hasMoreElements(); } }; diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx index 33613bb76091..a1eca84bbdf8 100644 --- a/vbahelper/inc/vbahelper/vbahelper.hxx +++ b/vbahelper/inc/vbahelper/vbahelper.hxx @@ -63,6 +63,7 @@ namespace ooo throw css::lang::IllegalArgumentException(); return aSomething; } + VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell ); VBAHELPER_DLLPUBLIC SfxObjectShell* getSfxObjShell( const css::uno::Reference< css::frame::XModel >& xModel ) throw ( css::uno::RuntimeException); VBAHELPER_DLLPUBLIC css::uno::Reference< css::uno::XInterface > createVBAUnoAPIService( SfxObjectShell* pShell, const sal_Char* _pAsciiName ) throw (css::uno::RuntimeException); diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index c7c33b93b1a3..b4b39344fd61 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -35,6 +35,9 @@ using namespace ooo::vba; rtl::OUString sApplication( RTL_CONSTASCII_USTRINGPARAM("Application") ); +// special key to return the Application +rtl::OUString sAppService( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Application") ); + VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName ) @@ -74,19 +77,30 @@ uno::Reference< uno::XInterface > SAL_CALL VbaGlobalsBase::createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (uno::Exception, uno::RuntimeException) { uno::Reference< uno::XInterface > xReturn; - - if ( hasServiceName( aServiceSpecifier ) ) + if ( aServiceSpecifier.equals( sAppService ) ) + { + // try to extract the Application from the context + uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); + xNameContainer->getByName( sApplication ) >>= xReturn; + } + else if ( hasServiceName( aServiceSpecifier ) ) xReturn = mxContext->getServiceManager()->createInstanceWithContext( aServiceSpecifier, mxContext ); return xReturn; } uno::Reference< uno::XInterface > SAL_CALL -VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException) +VbaGlobalsBase::createInstanceWithArguments( const ::rtl::OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) throw (uno::Exception, uno::RuntimeException) { uno::Reference< uno::XInterface > xReturn; - if ( hasServiceName( ServiceSpecifier ) ) - xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( ServiceSpecifier, Arguments, mxContext ); + if ( aServiceSpecifier.equals( sAppService ) ) + { + // try to extract the Application from the context + uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); + xNameContainer->getByName( sApplication ) >>= xReturn; + } + else if ( hasServiceName( aServiceSpecifier ) ) + xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceSpecifier, Arguments, mxContext ); return xReturn; } diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 1953d0772f3c..7cd82dff9536 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -1404,6 +1404,26 @@ void UserFormGeometryHelper::setHeight( double nHeight ) return points; } + uno::Reference< uno::XInterface > getUnoDocModule( const String& aModName, SfxObjectShell* pShell ) + { + uno::Reference< uno::XInterface > xIf; + if ( pShell ) + { + rtl::OUString sProj( RTL_CONSTASCII_USTRINGPARAM("Standard") ); + BasicManager* pBasMgr = pShell->GetBasicManager(); + if ( pBasMgr && pBasMgr->GetName().Len() ) + sProj = pShell->GetBasicManager()->GetName(); + StarBASIC* pBasic = pShell->GetBasicManager()->GetLib( sProj ); + if ( pBasic ) + { + SbModule* pMod = pBasic->FindModule( aModName ); + if ( pMod ) + xIf = pMod->GetUnoModule(); + } + } + return xIf; + } + SfxObjectShell* getSfxObjShell( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException) { SfxObjectShell* pFoundShell = NULL; -- cgit From d73100a4f9999f144ce5d9a8b64428fd9830da5e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 1 Jul 2010 18:24:05 +0200 Subject: sw33bf06: #i112566#: SfxViewShell_Impl::pPrinterController -> boost::shared_ptr --- sfx2/source/view/viewimp.hxx | 2 +- sfx2/source/view/viewprn.cxx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx index 1c9e219cf180..be20cd2f2a47 100644 --- a/sfx2/source/view/viewimp.hxx +++ b/sfx2/source/view/viewimp.hxx @@ -75,7 +75,7 @@ struct SfxViewShell_Impl ::svt::AcceleratorExecute* pAccExec; com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts; ::rtl::Reference< SfxClipboardChangeListener > xClipboardListener; - vcl::PrinterController* pPrinterController; + ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController; SfxViewShell_Impl(); }; diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index f62ae4c1ddc7..5b317e4b770b 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -332,7 +332,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt mpObjectShell->EnableSetModified( m_bOrigStatus ); if ( mpViewShell ) - mpViewShell->pImp->pPrinterController = 0; + { + mpViewShell->pImp->m_pPrinterController.reset(); + } } } @@ -643,7 +645,7 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro this, rProps ) ); - pImp->pPrinterController = pController.get(); + pImp->m_pPrinterController = pController; SfxObjectShell *pObjShell = GetObjectShell(); pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ), @@ -661,7 +663,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro Printer* SfxViewShell::GetActivePrinter() const { - return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0; + return (pImp->m_pPrinterController) + ? pImp->m_pPrinterController->getPrinter().get() : 0; } void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) -- cgit From 1f3d1cba85b041abc7a0211effa099b68747b66f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 2 Jul 2010 08:26:18 +0200 Subject: mib17: #111144# Fixed warning --- basic/source/classes/sbxmod.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 254e99c69da9..52076be8eece 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -147,7 +147,6 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV SbObjModule* pMod = PTR_CAST(SbObjModule,pVar); if ( pMod ) { - sal_Int16 nType = pMod->GetModuleType(); if ( pMod->GetModuleType() == ModuleType::DOCUMENT ) { Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); -- cgit From 444742b5201b4036245348f6232a677038b6f057 Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 2 Jul 2010 13:02:21 +0200 Subject: #i10000# internal dependency missing --- desktop/prj/build.lst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 8029b6ecc9f7..dc5d7a99b2d6 100644 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -3,7 +3,7 @@ dt desktop usr1 - all dt_mkout NULL dt desktop\inc nmake - all dt_inc NULL dt desktop\prj get - all dt_prj NULL dt desktop\res get - all dt_res NULL -dt desktop\source\app nmake - all dt_app dt_migr dt_inc NULL +dt desktop\source\app nmake - all dt_app dt_migr dt_inc dt_dp_misc NULL dt desktop\source\migration nmake - all dt_migr dt_inc NULL dt desktop\source\migration\services nmake - all dt_services dt_inc dt_dp_misc NULL dt desktop\source\so_comp nmake - all dt_so_comp dt_inc NULL @@ -35,7 +35,7 @@ dt desktop\source\deployment\registry\configuration nmake - all dt_dp_registry_c dt desktop\source\deployment\registry\help nmake - all dt_dp_registry_help dt_inc NULL dt desktop\source\deployment\registry\executable nmake - all dt_dp_registry_executable dt_inc NULL dt desktop\scripts nmake - u dt_scripts dt_inc NULL -dt desktop\util nmake - all dt_util dt_app dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL +dt desktop\util nmake - all dt_util dt_app dt_pagein.u dt_so_comp dt_spl dt_wrapper.w dt_officeloader.w dt_officeloader_unx.u dt_migr dt_rebase.w NULL dt desktop\zipintro nmake - all dt_zipintro NULL dt desktop\registry\data\org\openoffice\Office nmake - all sn_regconfig NULL dt desktop\source\registration\com\sun\star\servicetag\resources get - all sn_svctagres NULL -- cgit From d10b4bd6d31b59033804783def3a79652c90792c Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 2 Jul 2010 14:21:42 +0200 Subject: jl154 #i112883# prevent extension synchronization at OOo startup --- desktop/source/deployment/misc/dp_misc.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index fe3490903043..cfdac4068130 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -589,6 +589,11 @@ void TRACE(::rtl::OString const & sText) void syncRepositories(Reference const & xCmdEnv) { + OUString sDisable; + ::rtl::Bootstrap::get( OUSTR( "DISABLE_EXTENSION_SYNCHRONIZATION" ), sDisable, OUString() ); + if (sDisable.getLength() > 0) + return; + Reference xExtensionManager; //synchronize shared before bundled otherewise there are //more revoke and registration calls. -- cgit From de432231c123abae12659a4776047f11205f23db Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 2 Jul 2010 14:45:29 +0200 Subject: cws tl81: warning-free code --- editeng/source/editeng/editview.cxx | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 editeng/source/editeng/editview.cxx diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx old mode 100755 new mode 100644 index c07b84d0d0f2..664512df414e --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1265,7 +1265,6 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) String aDicName ( pInsertMenu->GetItemText(nId) ); uno::Reference< linguistic2::XDictionary > xDic; - uno::Reference< linguistic2::XDictionaryList > xDicList( SvxGetDictionaryList() ); if (xDicList.is()) xDic = xDicList->getDictionaryByName( aDicName ); -- cgit From 7fcdb05e4b2166c0190869926dcb5963e920bbea Mon Sep 17 00:00:00 2001 From: "Malte Timmermann [mt]" Date: Fri, 2 Jul 2010 17:02:05 +0200 Subject: fixes compile error --- basic/source/classes/sbunoobj.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 6c8eefda7f11..1b2b0048b34c 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -4201,7 +4201,7 @@ void SAL_CALL ModuleInvocationProxy::setValue( const ::rtl::OUString& rProperty, if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Set ") ); aPropertyFunctionName += m_aPrefix; @@ -4242,7 +4242,7 @@ Any SAL_CALL ModuleInvocationProxy::getValue( const ::rtl::OUString& rProperty ) if( !m_bProxyIsClassModuleObject ) throw UnknownPropertyException(); - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); ::rtl::OUString aPropertyFunctionName( RTL_CONSTASCII_USTRINGPARAM( "Property Get ") ); aPropertyFunctionName += m_aPrefix; @@ -4280,7 +4280,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, Sequence< Any >& ) throw( CannotConvertException, InvocationTargetException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); Any aRet; if( !m_xScopeObj.Is() ) -- cgit From 0d4968c436f15c385ac454adc0f642e13434d78a Mon Sep 17 00:00:00 2001 From: tono Date: Sat, 3 Jul 2010 00:04:42 +0900 Subject: i#112734: MinGW port fix: sfx2 --- sfx2/source/doc/syspathw32.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx index 73bd84f5249a..c0a163bed39c 100644 --- a/sfx2/source/doc/syspathw32.cxx +++ b/sfx2/source/doc/syspathw32.cxx @@ -74,7 +74,7 @@ typedef unsigned short sal_uInt16; extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize) { #ifdef WNT - return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, pFolder, nSize ); + return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, reinterpret_cast(pFolder), nSize ); #else (void)pFolder; (void)nSize; -- cgit From 2d0afbadabf572c04eab99876b71d99d0b7a59be Mon Sep 17 00:00:00 2001 From: tono Date: Sat, 3 Jul 2010 00:12:58 +0900 Subject: i#112777: DEV300_m84 MinGW basic/source/runtime build fail --- basic/source/runtime/dllmgr.cxx | 2 +- basic/source/runtime/wnt-mingw.s | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx index bc08a8cb64bc..04f1ee0a8acc 100644 --- a/basic/source/runtime/dllmgr.cxx +++ b/basic/source/runtime/dllmgr.cxx @@ -684,7 +684,7 @@ Dll * SbiDllMgr::Impl::getDll(rtl::OUString const & name) { Dlls::iterator i(dlls.find(name)); if (i == dlls.end()) { i = dlls.insert(Dlls::value_type(name, new Dll)).first; - HMODULE h = LoadLibraryW(name); + HMODULE h = LoadLibraryW(reinterpret_cast(name.getStr())); if (h == 0) { dlls.erase(i); return 0; diff --git a/basic/source/runtime/wnt-mingw.s b/basic/source/runtime/wnt-mingw.s index 7868ddd386f0..8c332c1a8ce8 100644 --- a/basic/source/runtime/wnt-mingw.s +++ b/basic/source/runtime/wnt-mingw.s @@ -44,8 +44,8 @@ _DllMgr_callFp: shr ecx, 2 rep movsd $1: call DWORD PTR [ebp+8] - ; for extra safety, do not trust esp after call (in case the Basic Declare - ; signature is wrong): + # for extra safety, do not trust esp after call (in case the Basic Declare + # signature is wrong): mov edi, [ebp-8] mov esi, [ebp-4] mov esp, ebp -- cgit From d66c407d55c485552a47ce0a4951e64083460773 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Sun, 4 Jul 2010 11:38:02 +0200 Subject: #i110653# - bumped minor version to 3 --- desktop/util/ooverinfo2.rc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/desktop/util/ooverinfo2.rc b/desktop/util/ooverinfo2.rc index f149ec6474e7..8bc39767f04a 100644 --- a/desktop/util/ooverinfo2.rc +++ b/desktop/util/ooverinfo2.rc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -25,26 +25,26 @@ * *************************************************************************/ -#define VERSION 3 -#define SUBVERSION 2 -//#define VERVARIANT 0 +#define VERSION 3 +#define SUBVERSION 3 +//#define VERVARIANT 0 // .0 + VER_CONCEPT // .100 + VER_ALPHA // .200 + VER_BETA // .300 + VER_GAMMA // .500 + VER_FINAL -//#define VER_CONCEPT 0 -//#define VER_BETA 6 -#define VER_FINAL 0 +//#define VER_CONCEPT 0 +//#define VER_BETA 6 +#define VER_FINAL 0 -#define VER_DAY 1 -#define VER_MONTH 9 -#define VER_YEAR 2009 +#define VER_DAY 1 +#define VER_MONTH 1 +#define VER_YEAR 2010 // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// language/character set specification table +// language/character set specification table // ----------------------------------------------------------------------- -- cgit From 460e23cc97d0fe644ceb77d8a8935017b9e71283 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 5 Jul 2010 08:06:21 +0200 Subject: cws tl82: #i112898# memory leak fixed --- linguistic/source/lngsvcmgr.cxx | 34 ++++++++++++++++++++++------------ linguistic/source/lngsvcmgr.hxx | 2 ++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 90e433f50f07..3f53b0a391fb 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -45,6 +45,8 @@ #include #include +#include + #include "lngsvcmgr.hxx" #include "lngopt.hxx" #include "misc.hxx" @@ -605,6 +607,14 @@ LngSvcMgr::LngSvcMgr() : EnableNotification( aNames ); } +void LngSvcMgr::clearSvcInfoArray(SvcInfoArray* pInfo) +{ + if (pInfo) + { + std::for_each(pInfo->begin(), pInfo->end(), boost::checked_deleter()); + delete pInfo; + } +} LngSvcMgr::~LngSvcMgr() { @@ -612,10 +622,10 @@ LngSvcMgr::~LngSvcMgr() // will be freed in the destructor of the respective Reference's // xSpellDsp, xGrammarDsp, xHyphDsp, xThesDsp - delete pAvailSpellSvcs; - delete pAvailGrammarSvcs; - delete pAvailHyphSvcs; - delete pAvailThesSvcs; + clearSvcInfoArray(pAvailSpellSvcs); + clearSvcInfoArray(pAvailGrammarSvcs); + clearSvcInfoArray(pAvailHyphSvcs); + clearSvcInfoArray(pAvailThesSvcs); } @@ -652,7 +662,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailSpellSvcs; pAvailSpellSvcs = 0; + clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; OUString aNode( aSpellCheckerList ); if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText )) @@ -677,7 +687,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; + clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; OUString aNode( aGrammarCheckerList ); if (lcl_SeqHasString( aGrammarCheckerListEntries, aKeyText )) @@ -705,7 +715,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailHyphSvcs; pAvailHyphSvcs = 0; + clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; OUString aNode( aHyphenatorList ); if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText )) @@ -730,7 +740,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() )) { // delete old cached data, needs to be acquired new on demand - delete pAvailThesSvcs; pAvailThesSvcs = 0; + clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; OUString aNode( aThesaurusList ); if (lcl_SeqHasString( aThesaurusListEntries, aKeyText )) @@ -1402,7 +1412,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailSpellSvcs; pAvailSpellSvcs = 0; + clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; GetAvailableSpellSvcs_Impl(); pInfoArray = pAvailSpellSvcs; } @@ -1410,7 +1420,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; + clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; GetAvailableGrammarSvcs_Impl(); pInfoArray = pAvailGrammarSvcs; } @@ -1418,7 +1428,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailHyphSvcs; pAvailHyphSvcs = 0; + clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; GetAvailableHyphSvcs_Impl(); pInfoArray = pAvailHyphSvcs; } @@ -1426,7 +1436,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - delete pAvailThesSvcs; pAvailThesSvcs = 0; + clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; GetAvailableThesSvcs_Impl(); pInfoArray = pAvailThesSvcs; } diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 953e531960bf..bb6f6cf93732 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -143,6 +143,8 @@ class LngSvcMgr : void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, const SvcInfoArray &rAvailSvcs ); + static void clearSvcInfoArray(SvcInfoArray *pInfo); + // utl::ConfigItem (to allow for listening of changes of relevant properties) virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); virtual void Commit(); -- cgit From 985a3c7cc96f260024c8fbdb64c988fc5660e9a7 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 5 Jul 2010 11:20:24 +0200 Subject: ooo33gsl02: #i112873# change NativeWidget methods to be prepared for mapmodes --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 12 ++++++------ desktop/source/splash/splash.cxx | 10 ++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 1a66ff38e4a4..87f70e449b9d 100755 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -1147,13 +1147,13 @@ void ExtMgrDialog::Resize() { ImplControlValue aValue; bool bNativeOK; - Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) ); - Region aNativeControlRegion, aNativeContentRegion; + Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() ); + Rectangle aNativeControlRegion, aNativeContentRegion; if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, CTRL_STATE_ENABLED, aValue, rtl::OUString(), aNativeControlRegion, aNativeContentRegion ) ) != FALSE ) { - nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight(); + nProgressHeight = aNativeControlRegion.GetHeight(); } } @@ -1590,13 +1590,13 @@ void UpdateRequiredDialog::Resize() { ImplControlValue aValue; bool bNativeOK; - Region aControlRegion( Rectangle( (const Point&)Point(), m_aProgressBar.GetSizePixel() ) ); - Region aNativeControlRegion, aNativeContentRegion; + Rectangle aControlRegion( Point( 0, 0 ), m_aProgressBar.GetSizePixel() ); + Rectangle aNativeControlRegion, aNativeContentRegion; if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, CTRL_STATE_ENABLED, aValue, rtl::OUString(), aNativeControlRegion, aNativeContentRegion ) ) != FALSE ) { - nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight(); + nProgressHeight = aNativeControlRegion.GetHeight(); } } diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 381a98ce008f..c6a185b8e54d 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -640,20 +640,18 @@ void SplashScreen::Paint( const Rectangle&) ImplControlValue aValue( _iProgress * _barwidth / _iMax); Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) ); - Region aControlRegion( aDrawRect ); - Region aNativeControlRegion, aNativeContentRegion; + Rectangle aNativeControlRegion, aNativeContentRegion; - if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aControlRegion, + if( GetNativeControlRegion( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, CTRL_STATE_ENABLED, aValue, rtl::OUString(), aNativeControlRegion, aNativeContentRegion ) ) { - long nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight(); + long nProgressHeight = aNativeControlRegion.GetHeight(); aDrawRect.Top() -= (nProgressHeight - _barheight)/2; aDrawRect.Bottom() += (nProgressHeight - _barheight)/2; - aControlRegion = Region( aDrawRect ); } - if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aControlRegion, + if( (bNativeOK = DrawNativeControl( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL, aDrawRect, CTRL_STATE_ENABLED, aValue, _sProgressText )) != FALSE ) { return; -- cgit From 215824566279c83bf1f299f4268e6f29f538e525 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Mon, 5 Jul 2010 12:51:25 +0200 Subject: dv19#i29340# Implmented handler for NameClashResolveRequests --- uui/source/iahndl.hxx | 3 --- uui/source/ids.hrc | 41 +++-------------------------------------- 2 files changed, 3 insertions(+), 41 deletions(-) mode change 100644 => 100755 uui/source/iahndl.hxx mode change 100644 => 100755 uui/source/ids.hrc diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx old mode 100644 new mode 100755 index 581099462845..6402653d3bda --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -215,8 +215,6 @@ private: com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); -// @@@ Todo #i29340#: activate! -#if 0 void handleNameClashResolveRequest( com::sun::star::ucb::NameClashResolveRequest const & rRequest, @@ -225,7 +223,6 @@ private: com::sun::star::task::XInteractionContinuation > > const & rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); -#endif bool handleMasterPasswordRequest( diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc old mode 100644 new mode 100755 index 8f3c2a062129..0ff381ba955e --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -52,44 +52,6 @@ #define STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13) #define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14) // RID_UUI_START + 15, 16, 17 are misused by syncaccess/source/ui/resids.hrc -#define RID_UUI_ERRHDL (RID_UUI_START + 20) -#define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) -#define DLG_UUI_PASSWORD (RID_UUI_START + 22) -#define DLG_UUI_PASSWORD_CRT (RID_UUI_START + 23) -#define STR_ERROR_PASSWORD_WRONG (RID_UUI_START + 24) -#define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 25) -#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26) -#define DLG_UUI_UNKNOWNAUTH_CRT (RID_UUI_START + 27) -#define DLG_UUI_SSLWARN (RID_UUI_START + 28) -#define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29) -#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30) -#define STR_UNKNOWNUSER (RID_UUI_START + 31) -#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32) -#define STR_OPENLOCKED_MSG (RID_UUI_START + 33) -#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34) -#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35) -#define STR_FILECHANGED_TITLE (RID_UUI_START + 36) -#define STR_FILECHANGED_MSG (RID_UUI_START + 37) -#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38) -#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39) -#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40) -#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41) -#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42) -#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43) -#define STR_LOCKFAILED_MSG (RID_UUI_START + 44) -#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45) -#define STR_TRYLATER_TITLE (RID_UUI_START + 46) -#define STR_TRYLATER_MSG (RID_UUI_START + 47) -#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48) -#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49) -#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50) -#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51) -#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) -#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53) -#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54) -#define STR_RENAME_OR_REPLACE (RID_UUI_START + 55) -#define STR_NAME_CLASH_RENAME_ONLY (RID_UUI_START + 56) -#define STR_SAME_NAME_USED (RID_UUI_START + 57) #define RID_UUI_ERRHDL (RID_UUI_START + 20) #define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) @@ -129,6 +91,9 @@ #define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 55) #define STR_ENTER_PASSWORD_TO_OPEN (RID_UUI_START + 56) #define STR_ENTER_PASSWORD_TO_MODIFY (RID_UUI_START + 57) +#define STR_RENAME_OR_REPLACE (RID_UUI_START + 58) +#define STR_NAME_CLASH_RENAME_ONLY (RID_UUI_START + 59) +#define STR_SAME_NAME_USED (RID_UUI_START + 60) #define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) #define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) -- cgit From ba994212ea43ea8f0e93a038646ca960221ad16d Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 5 Jul 2010 13:58:36 +0200 Subject: mib17: #i100659# Changed module variable handling --- basic/inc/basic/sbmod.hxx | 5 ++++- basic/source/classes/sbxmod.cxx | 28 ++++++++++++++++++++++++++++ basic/source/comp/sbcomp.cxx | 1 + basic/source/runtime/step2.cxx | 23 +++++++++++++++++------ 4 files changed, 50 insertions(+), 7 deletions(-) diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index aeed4c2b6347..932a828ac753 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -33,6 +33,7 @@ #include #include #include +#include class SbMethod; class SbProperty; @@ -56,6 +57,7 @@ class SbModule : public SbxObject friend class SbClassModuleObject; SbModuleImpl* mpSbModuleImpl; // Impl data + std::vector< String > mModuleVariableNames; protected: com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper; @@ -133,7 +135,8 @@ public: INT32 GetModuleType() { return mnType; } void SetModuleType( INT32 nType ) { mnType = nType; } bool GetIsProxyModule() { return bIsProxyModule; } - ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); + void AddVarName( const String& aName ); + void RemoveVars(); ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); bool createCOMWrapperForIface( ::com::sun::star::uno::Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ); }; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 52076be8eece..de8071dacfa7 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -147,6 +147,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV SbObjModule* pMod = PTR_CAST(SbObjModule,pVar); if ( pMod ) { + sal_Int16 nType = pMod->GetModuleType(); if ( pMod->GetModuleType() == ModuleType::DOCUMENT ) { Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); @@ -1242,6 +1243,33 @@ void SbModule::RunInit() } // Mit private/dim deklarierte Variablen loeschen + +void SbModule::AddVarName( const String& aName ) +{ + // see if the name is added allready + std::vector< String >::iterator it_end = mModuleVariableNames.end(); + for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it ) + { + if ( aName == *it ) + return; + } + mModuleVariableNames.push_back( aName ); +} + +void SbModule::RemoveVars() +{ + std::vector< String >::iterator it_end = mModuleVariableNames.end(); + for ( std::vector< String >::iterator it = mModuleVariableNames.begin(); it != it_end; ++it ) + { + // We don't want a Find being called in a derived class ( e.g. + // SbUserform because it could trigger say an initialise event + // which would cause basic to be re-run in the middle of the init ( and remember RemoveVars is called from compile and we don't want code to run as part of the compile ) + SbxVariableRef p = SbModule::Find( *it, SbxCLASS_PROPERTY ); + if( p.Is() ) + Remove (p); + } +} + void SbModule::ClearPrivateVars() { for( USHORT i = 0 ; i < pProps->Count() ; i++ ) diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 6e4f7ddf126e..50dc6f847076 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -131,6 +131,7 @@ BOOL SbModule::Compile() if( bRet ) { pBasic->ClearAllModuleVars(); + RemoveVars(); // remove 'this' Modules variables // clear all method statics for( USHORT i = 0; i < pMethods->Count(); i++ ) { diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index 8e72fd2ac3c6..c9f344c57d32 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -1158,15 +1158,26 @@ void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 ) StepPUBLIC_Impl( nOp1, nOp2, true ); String aName( pImg->GetString( static_cast( nOp1 ) ) ); - SbxDataType t = (SbxDataType)(SbxDataType)(nOp2 & 0xffff);; - BOOL bFlag = rBasic.IsSet( SBX_NO_MODIFY ); + SbxDataType t = (SbxDataType)(nOp2 & 0xffff);; + + // Store module scope variables at module scope + // in non vba mode these are stored at the library level :/ + // not sure if this really should not be enabled for ALL basic + SbxObject* pStorage = &rBasic; + if ( SbiRuntime::isVBAEnabled() ) + { + pStorage = pMod; + pMod->AddVarName( aName ); + } + + BOOL bFlag = pStorage->IsSet( SBX_NO_MODIFY ); rBasic.SetFlag( SBX_NO_MODIFY ); - SbxVariableRef p = rBasic.Find( aName, SbxCLASS_PROPERTY ); + SbxVariableRef p = pStorage->Find( aName, SbxCLASS_PROPERTY ); if( p.Is() ) - rBasic.Remove (p); - p = rBasic.Make( aName, SbxCLASS_PROPERTY, t ); + pStorage->Remove (p); + p = pStorage->Make( aName, SbxCLASS_PROPERTY, t ); if( !bFlag ) - rBasic.ResetFlag( SBX_NO_MODIFY ); + pStorage->ResetFlag( SBX_NO_MODIFY ); if( p ) { p->SetFlag( SBX_DONTSTORE ); -- cgit From 2bf85bbf3fee31633ed398b5e3aa631f28e7c62d Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 5 Jul 2010 15:46:50 +0200 Subject: jl154 #i112934# replace old license headers introduced by CWS jl152 --- desktop/source/deployment/manager/dp_properties.cxx | 2 +- desktop/source/deployment/manager/dp_properties.hxx | 5 +---- .../deployment/registry/configuration/dp_configurationbackenddb.cxx | 5 +---- .../deployment/registry/configuration/dp_configurationbackenddb.hxx | 5 +---- .../source/deployment/registry/executable/dp_executablebackenddb.cxx | 5 +---- .../source/deployment/registry/executable/dp_executablebackenddb.hxx | 5 +---- desktop/source/deployment/registry/help/dp_helpbackenddb.cxx | 5 +---- desktop/source/deployment/registry/help/dp_helpbackenddb.hxx | 5 +---- desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx | 5 +---- desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx | 5 +---- desktop/source/migration/services/cexportsoo3.cxx | 5 +---- desktop/source/migration/services/oo3extensionmigration.cxx | 5 +---- desktop/source/migration/services/oo3extensionmigration.hxx | 5 +---- 13 files changed, 13 insertions(+), 49 deletions(-) mode change 100644 => 100755 desktop/source/migration/services/oo3extensionmigration.cxx mode change 100644 => 100755 desktop/source/migration/services/oo3extensionmigration.hxx diff --git a/desktop/source/deployment/manager/dp_properties.cxx b/desktop/source/deployment/manager/dp_properties.cxx index df579944c6e4..9a181d1573e5 100644 --- a/desktop/source/deployment/manager/dp_properties.cxx +++ b/desktop/source/deployment/manager/dp_properties.cxx @@ -2,7 +2,7 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * diff --git a/desktop/source/deployment/manager/dp_properties.hxx b/desktop/source/deployment/manager/dp_properties.hxx index 97fc8b8c5394..a1b953ce8376 100644 --- a/desktop/source/deployment/manager/dp_properties.hxx +++ b/desktop/source/deployment/manager/dp_properties.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_manager.h,v $ - * $Revision: 1.17 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx index 845ba88cb813..2a02c6d8efa0 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx index 1b6c4f8973a4..7023897bd8de 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx index 976a6281a2bd..ff1044910985 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx index 4f17eeda24a6..80cd33771a34 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx index 3bf67e0c050b..8ec9a39d5050 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx index edf7dfdfc284..c7b730fd1b99 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx index ce0d3029084d..9a84a7286027 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_package.cxx,v $ - * $Revision: 1.34.16.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx index 9d227f8b64b8..7feaeba5568b 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: dp_backend.h,v $ - * $Revision: 1.18 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/cexportsoo3.cxx b/desktop/source/migration/services/cexportsoo3.cxx index 20b8232044e9..695b6b810808 100755 --- a/desktop/source/migration/services/cexportsoo3.cxx +++ b/desktop/source/migration/services/cexportsoo3.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: cexports.cxx,v $ - * $Revision: 1.9 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx old mode 100644 new mode 100755 index 2e3a8d1d518c..3e9836fa2e84 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: extensionmigration.cxx,v $ - * $Revision: 1.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx old mode 100644 new mode 100755 index 03995652888c..fb58692c81ee --- a/desktop/source/migration/services/oo3extensionmigration.hxx +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: extensionmigration.hxx,v $ - * $Revision: 1.2 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify -- cgit From bb09a0aa845e46c538bd62d0c7d95a57e4d1a7d9 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 6 Jul 2010 08:08:39 +0200 Subject: mib17: #i100659# Removed warning --- basic/source/classes/sbxmod.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index de8071dacfa7..51af5685d888 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -147,7 +147,6 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar ), mName( pV SbObjModule* pMod = PTR_CAST(SbObjModule,pVar); if ( pMod ) { - sal_Int16 nType = pMod->GetModuleType(); if ( pMod->GetModuleType() == ModuleType::DOCUMENT ) { Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); -- cgit From 2e76bcf66763f6bc0a83e7e2979c901f1093cdab Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Tue, 6 Jul 2010 08:42:32 +0200 Subject: dv19#i112822# Applied patch to remove dialog, removed resources used by this dialog, too --- uui/source/iahndl-authentication.cxx | 1 - uui/source/ids.hrc | 2 - uui/source/makefile.mk | 2 - uui/source/passcrtdlg.cxx | 128 ----------------------------------- uui/source/passcrtdlg.hrc | 43 ------------ uui/source/passcrtdlg.hxx | 63 ----------------- uui/source/passcrtdlg.src | 108 ----------------------------- 7 files changed, 347 deletions(-) delete mode 100644 uui/source/passcrtdlg.cxx delete mode 100644 uui/source/passcrtdlg.hrc delete mode 100644 uui/source/passcrtdlg.hxx delete mode 100644 uui/source/passcrtdlg.src diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 73fa61f31ff4..6d65eb67055e 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -52,7 +52,6 @@ #include "logindlg.hxx" #include "masterpasscrtdlg.hxx" #include "masterpassworddlg.hxx" -#include "passcrtdlg.hxx" #include "passworddlg.hxx" #include "iahndl.hxx" diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 0ff381ba955e..9be81479ef59 100755 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -56,7 +56,6 @@ #define RID_UUI_ERRHDL (RID_UUI_START + 20) #define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) #define DLG_UUI_PASSWORD (RID_UUI_START + 22) -#define DLG_UUI_PASSWORD_CRT (RID_UUI_START + 23) #define STR_ERROR_PASSWORD_TO_OPEN_WRONG (RID_UUI_START + 24) #define STR_ERROR_PASSWORD_TO_MODIFY_WRONG (RID_UUI_START + 25) #define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26) @@ -181,7 +180,6 @@ #define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START + 3) #define HID_DLG_FILTER_SELECT (HID_UUI_START + 4) #define HID_DLG_PASSWORD_UUI (HID_UUI_START + 5) -#define HID_DLG_PASSWORD_CRT (HID_UUI_START + 6) #define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START + 7) #define HID_DLG_SSLWARN_UUI (HID_UUI_START + 8) #define HID_XMLSECDLG_MACROWARN (HID_UUI_START + 9) diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk index ebe61b2c570e..e09f5c01e967 100755 --- a/uui/source/makefile.mk +++ b/uui/source/makefile.mk @@ -48,7 +48,6 @@ SLOFILES = \ $(SLO)$/masterpasscrtdlg.obj \ $(SLO)$/openlocked.obj \ $(SLO)$/passworddlg.obj \ - $(SLO)$/passcrtdlg.obj \ $(SLO)$/fltdlg.obj \ $(SLO)$/interactionhandler.obj \ $(SLO)$/requeststringresolver.obj \ @@ -72,7 +71,6 @@ SRC1FILES = \ masterpasscrtdlg.src \ openlocked.src \ passworddlg.src \ - passcrtdlg.src \ passworderrs.src \ fltdlg.src \ unknownauthdlg.src\ diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx deleted file mode 100644 index 1fc6024bcd19..000000000000 --- a/uui/source/passcrtdlg.cxx +++ /dev/null @@ -1,128 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include -#include - -#ifndef UUI_IDS_HRC -#include -#endif -#ifndef UUI_PASSCRTDLG_HRC -#include -#endif -#include - -// PasswordCreateDialog--------------------------------------------------- - -// ----------------------------------------------------------------------- - -IMPL_LINK( PasswordCreateDialog, EditHdl_Impl, Edit *, EMPTYARG ) -{ - aOKBtn.Enable( aEDPasswordCrt.GetText().Len() >= nMinLen ); - return 0; -} - -// ----------------------------------------------------------------------- - -IMPL_LINK( PasswordCreateDialog, OKHdl_Impl, OKButton *, EMPTYARG ) -{ - // compare both passwords and show message box if there are not equal!! - if( aEDPasswordCrt.GetText() == aEDPasswordRepeat.GetText() ) - EndDialog( RET_OK ); - else - { - String aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr )); - ErrorBox aErrorBox( this, WB_OK, aErrorMsg ); - aErrorBox.Execute(); - aEDPasswordCrt.SetText( String() ); - aEDPasswordRepeat.SetText( String() ); - aEDPasswordCrt.GrabFocus(); - } - return 1; -} - -// ----------------------------------------------------------------------- - -PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr, bool bMSCryptoMode) - :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD_CRT, *pResMgr ) ) - ,aFTPasswordCrt ( this, ResId( FT_PASSWORD_CRT, *pResMgr ) ) - ,aEDPasswordCrt ( this, ResId( ED_PASSWORD_CRT, *pResMgr ) ) - ,aFTPasswordRepeat ( this, ResId( FT_PASSWORD_REPEAT, *pResMgr ) ) - ,aEDPasswordRepeat ( this, ResId( ED_PASSWORD_REPEAT, *pResMgr ) ) - ,aFTWarning ( this, ResId( bMSCryptoMode ? FT_MSPASSWORD_WARNING : FT_PASSWORD_WARNING, *pResMgr ) ) - ,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr ) ) - ,aOKBtn ( this, ResId( BTN_PASSCRT_OK, *pResMgr ) ) - ,aCancelBtn ( this, ResId( BTN_PASSCRT_CANCEL, *pResMgr ) ) - ,aHelpBtn ( this, ResId( BTN_PASSCRT_HELP, *pResMgr ) ) - ,pResourceMgr ( pResMgr ) - ,nMinLen(1) // if it should be changed for ODF, it must stay 1 for bMSCryptoMode -{ - FreeResource(); - - aOKBtn.SetClickHdl( LINK( this, PasswordCreateDialog, OKHdl_Impl ) ); - aEDPasswordCrt.SetModifyHdl( LINK( this, PasswordCreateDialog, EditHdl_Impl ) ); - - aOKBtn.Enable( sal_False ); - - if ( bMSCryptoMode ) - { - aEDPasswordCrt.SetMaxTextLen( 15 ); - aEDPasswordRepeat.SetMaxTextLen( 15 ); - } - - long nLabelWidth = aFTWarning.GetSizePixel().Width(); - long nLabelHeight = aFTWarning.GetSizePixel().Height(); - long nTextWidth = aFTWarning.GetCtrlTextWidth( aFTWarning.GetText() ); - long nTextHeight = aFTWarning.GetTextHeight(); - - Rectangle aLabelRect( aFTWarning.GetPosPixel(), aFTWarning.GetSizePixel() ); - Rectangle aRect = aFTWarning.GetTextRect( aLabelRect, aFTWarning.GetText() ); - - long nNewLabelHeight = 0; - for( nNewLabelHeight = ( nTextWidth / nLabelWidth + 1 ) * nTextHeight; - nNewLabelHeight < aRect.GetHeight(); - nNewLabelHeight += nTextHeight ) {} ; - - long nDelta = nNewLabelHeight - nLabelHeight; - - Size aNewDlgSize = GetSizePixel(); - aNewDlgSize.Height() += nDelta; - SetSizePixel( aNewDlgSize ); - - Size aNewWarningSize = aFTWarning.GetSizePixel(); - aNewWarningSize.Height() = nNewLabelHeight; - aFTWarning.SetPosSizePixel( aFTWarning.GetPosPixel(), aNewWarningSize ); - - Window* pControls[] = { &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn }; - const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] ); - for ( int i = 0; i < nCCount; ++i ) - { - Point aNewPos =(*pControls[i]).GetPosPixel(); - aNewPos.Y() += nDelta; - pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() ); - } -} diff --git a/uui/source/passcrtdlg.hrc b/uui/source/passcrtdlg.hrc deleted file mode 100644 index 5a999aa99209..000000000000 --- a/uui/source/passcrtdlg.hrc +++ /dev/null @@ -1,43 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef UUI_PASSCRTDLG_HRC -#define UUI_PASSCRTDLG_HRC - -// local identifiers -#define BTN_PASSCRT_CANCEL 1 -#define ED_PASSWORD_CRT 2 -#define FT_PASSWORD_REPEAT 3 -#define FT_PASSWORD_WARNING 4 -#define ED_PASSWORD_REPEAT 5 -#define FL_FIXED_LINE_1 6 -#define BTN_PASSCRT_OK 7 -#define BTN_PASSCRT_HELP 8 -#define FT_PASSWORD_CRT 9 -#define FT_MSPASSWORD_WARNING 10 - -#endif // UUI_PASSCRTDLG_HRC diff --git a/uui/source/passcrtdlg.hxx b/uui/source/passcrtdlg.hxx deleted file mode 100644 index 8ad19c59924d..000000000000 --- a/uui/source/passcrtdlg.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef UUI_PASSCRTDLG_HXX -#define UUI_PASSCRTDLG_HXX - -#include -#include -#include -#include -#include -#include - -//============================================================================ -class PasswordCreateDialog : public ModalDialog -{ - FixedText aFTPasswordCrt; - Edit aEDPasswordCrt; - FixedText aFTPasswordRepeat; - Edit aEDPasswordRepeat; - FixedText aFTWarning; - FixedLine aFixedLine1; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - ResMgr* pResourceMgr; - sal_uInt16 nMinLen; - - DECL_LINK( OKHdl_Impl, OKButton * ); - DECL_LINK( EditHdl_Impl, Edit * ); - -public: - PasswordCreateDialog( Window* pParent, ResMgr * pResMgr, bool bMSCryptoMode = false ); - - String GetPassword() const { return aEDPasswordCrt.GetText(); } -}; - -#endif // UUI_PASSCRTDLG_HXX diff --git a/uui/source/passcrtdlg.src b/uui/source/passcrtdlg.src deleted file mode 100644 index a74752ed589e..000000000000 --- a/uui/source/passcrtdlg.src +++ /dev/null @@ -1,108 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#define __RSC - -#ifndef UUI_IDS_HRC -#include -#endif -#ifndef UUI_PASSCRTDLG_HRC -#include "passcrtdlg.hrc" -#endif - -ModalDialog DLG_UUI_PASSWORD_CRT -{ - HelpId = HID_DLG_PASSWORD_CRT ; - Border = TRUE ; - Moveable = TRUE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT( 145, 129 ); - FixedText FT_PASSWORD_CRT - { - Pos = MAP_APPFONT( 3, 4 ); - Size = MAP_APPFONT( 139, 9 ); - Text [ en-US ] = "Enter password"; - }; - Edit ED_PASSWORD_CRT - { - Border = TRUE ; - Pos = MAP_APPFONT( 3, 17 ); - Size = MAP_APPFONT( 139, 13 ); - PassWord = TRUE ; - }; - Edit ED_PASSWORD_REPEAT - { - Border = TRUE ; - Pos = MAP_APPFONT( 3, 47 ); - Size = MAP_APPFONT( 139, 13 ); - PassWord = TRUE ; - }; - OKButton BTN_PASSCRT_OK - { - Pos = MAP_APPFONT( 27, 110 ); - Size = MAP_APPFONT( 37, 15 ); - DefButton = TRUE ; - }; - CancelButton BTN_PASSCRT_CANCEL - { - Pos = MAP_APPFONT( 66, 110 ); - Size = MAP_APPFONT( 37, 15 ); - }; - HelpButton BTN_PASSCRT_HELP - { - Pos = MAP_APPFONT( 105, 110 ); - Size = MAP_APPFONT( 37, 15 ); - }; - FixedText FT_PASSWORD_REPEAT - { - Pos = MAP_APPFONT( 3, 34 ); - Size = MAP_APPFONT( 139, 9 ); - Text [ en-US ] = "Reenter password"; - }; - FixedText FT_PASSWORD_WARNING - { - Pos = MAP_APPFONT( 4, 64 ); - Size = MAP_APPFONT( 137, 40 ); - Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive."; - WordBreak = TRUE; - }; - FixedText FT_MSPASSWORD_WARNING - { - Pos = MAP_APPFONT( 4, 64 ); - Size = MAP_APPFONT( 137, 40 ); - Text [ en-US ] = "WARNING: If you lose or forget the password, it cannot be recovered. It is advisable to keep passwords in a safe place. Passwords are case-sensitive and at most fifteen characters long."; - WordBreak = TRUE; - }; - FixedLine FL_FIXED_LINE_1 - { - Pos = MAP_APPFONT( 0, 104 ); - Size = MAP_APPFONT( 145, 6 ); - }; - Text [ en-US ] = "Enter Password"; -}; - -- cgit From 7bb10e673560b6f174f9a1026db51f6c83494e3b Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 6 Jul 2010 12:03:07 +0200 Subject: cws tl83: #i112277# security tab page change --- sfx2/source/dialog/securitypage.cxx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index d32ee843cbf2..2ac8f6a43fee 100755 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -245,6 +245,36 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE ); m_aRecordChangesCB.SetToggleHdl( LINK( this, SfxSecurityPage_Impl, RecordChangesCBToggleHdl ) ); m_aChangeProtectionPB.SetClickHdl( LINK( this, SfxSecurityPage_Impl, ChangeProtectionPBHdl ) ); + + + // #i112277: for the time being (OOO 3.3) the following options should not + // be available. In the long run however it is planned to implement the yet + // missing functionality. Thus now we hide them and move the remaining ones up. + m_aNewPasswordToOpenFL.Hide(); + m_aNewPasswordToOpenFT.Hide(); + m_aNewPasswordToOpenED.Hide(); + m_aConfirmPasswordToOpenFT.Hide(); + m_aConfirmPasswordToOpenED.Hide(); + m_aNewPasswordInfoFT.Hide(); + m_aNewPasswordToModifyFL.Hide(); + m_aNewPasswordToModifyFT.Hide(); + m_aNewPasswordToModifyED.Hide(); + m_aConfirmPasswordToModifyFT.Hide(); + m_aConfirmPasswordToModifyED.Hide(); + const long nDelta = m_aOptionsFL.GetPosPixel().Y() - m_aNewPasswordToOpenFL.GetPosPixel().Y(); + Point aPos; + aPos = m_aOptionsFL.GetPosPixel(); + aPos.Y() -= nDelta; + m_aOptionsFL.SetPosPixel( aPos ); + aPos = m_aOpenReadonlyCB.GetPosPixel(); + aPos.Y() -= nDelta; + m_aOpenReadonlyCB.SetPosPixel( aPos ); + aPos = m_aRecordChangesCB.GetPosPixel(); + aPos.Y() -= nDelta; + m_aRecordChangesCB.SetPosPixel( aPos ); + aPos = m_aChangeProtectionPB.GetPosPixel(); + aPos.Y() -= nDelta; + m_aChangeProtectionPB.SetPosPixel( aPos ); } -- cgit From ea5ba44eab63c55d02d57aeb03edc672f2258cb6 Mon Sep 17 00:00:00 2001 From: Caol?n McNamara Date: Tue, 6 Jul 2010 11:15:38 +0100 Subject: cmcfixes76: #i112819# oops, revert part of wrong patch to fix overly const member --- uui/source/iahndl.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 3cdd595666cc..0879e3574da3 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -1338,7 +1338,7 @@ UUIInteractionHelper::handleGenericErrorRequest( { uno::Any aProductNameAny = ::utl::ConfigManager::GetConfigManager() - .GetDirectConfigProperty( + ->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); aProductNameAny >>= aTitle; } @@ -1552,10 +1552,10 @@ UUIInteractionHelper::handleBrokenPackageRequest( return; uno::Any aProductNameAny = - ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); uno::Any aProductVersionAny = - ::utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( + ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); ::rtl::OUString aProductName, aProductVersion; if ( !( aProductNameAny >>= aProductName ) ) -- cgit From dba973219b95c52db4fd632ab642628d36084bdd Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 6 Jul 2010 15:59:41 +0200 Subject: mib17: #162898# Special handling for ByVal followed by StrPtr --- basic/source/comp/exprtree.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 0cf0d9870378..9b6f419e15ce 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -971,11 +971,16 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else { bool bByVal = false; + bool bByValBlockLValueError = false; if( eTok == BYVAL ) { bByVal = true; pParser->Next(); eTok = pParser->Peek(); + + // Special handling for VBA function "StrPtr" that's accepted as lvalue + if( eTok == SYMBOL && pParser->GetSym().EqualsIgnoreCaseAscii( "StrPtr" ) ) + bByValBlockLValueError = true; } if( bAssumeExprLParenMode ) @@ -1011,7 +1016,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa if( bByVal ) { - if( !pExpr->IsLvalue() ) + if( !pExpr->IsLvalue() && !bByValBlockLValueError ) pParser->Error( SbERR_LVALUE_EXPECTED ); else pExpr->SetByVal(); -- cgit From 7bf7e8dcafe955b9cacda7d043f75359ce811696 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Tue, 6 Jul 2010 17:06:55 +0200 Subject: native318 #i112699# switching to ooo 3.4 --- sysui/desktop/debian/makefile.mk | 20 ++++++++++---------- sysui/desktop/productversion.mk | 2 +- sysui/desktop/slackware/makefile.mk | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sysui/desktop/debian/makefile.mk b/sysui/desktop/debian/makefile.mk index f0f4e4288639..45e0f331f714 100644 --- a/sysui/desktop/debian/makefile.mk +++ b/sysui/desktop/debian/makefile.mk @@ -45,7 +45,7 @@ TARGET=debian .IF "$(PKGFORMAT)"!="$(PKGFORMAT:s/deb//)" -DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i3.3-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb) +DEBFILES=$(foreach,i,{$(PRODUCTLIST)} $(PKGDIR)$/$i3.4-$(TARGET)-menus_$(PKGVERSION.$i)-$(PKGREV)_all.deb) .ENDIF @@ -60,22 +60,22 @@ ALLTAR : $(DEBFILES) %/DEBIAN/control : $$(@:f) @$(MKDIRHIER) $(@:d) $*$/etc $*$/usr/share/applnk/Office $*$/usr/lib/menu - ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//)) $*$/etc$/ - /bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.3//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh" - @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.3//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.3//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.3//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/3.3//) - echo "Package: $(*:f:s/_/ /:1:s/3.3//)" > $@ - cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.3//))/" >> $@ - echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.3//))-$(PKGREV)" >> $@ + ln -sf /opt/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//)) $*$/etc$/ + /bin/sh -c -x "cd $(COMMONMISC)$/$(*:f:s/-/ /:1:s/3.4//) && DESTDIR=$(shell @cd $*; pwd) ICON_PREFIX=$(ICONPREFIX) KDEMAINDIR=/usr GNOMEDIR=/usr create_tree.sh" + @cat openoffice.org-debian-menus | sed -e 's/%PRODUCTNAME/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.4//)) $(PRODUCTVERSION.$(*:f:s/-/ /:1:s/3.4//))/' -e 's/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/' -e 's/%ICONPREFIX/$(ICONPREFIX.$(*:f:s/-/ /:1:s/3.4//))/' > $*$/usr/lib/menu/$(*:f:s/_/ /:1:s/3.4//) + echo "Package: $(*:f:s/_/ /:1:s/3.4//)" > $@ + cat $(@:f) | tr -d "\015" | sed "s/%productname/$(PRODUCTNAME.$(*:f:s/-/ /:1:s/3.4//))/" >> $@ + echo "Version: $(PKGVERSION.$(*:f:s/-/ /:1:s/3.4//))-$(PKGREV)" >> $@ @du -k -s $* | awk -F ' ' '{ printf "Installed-Size: %s\n", $$1 ; }' >> $@ %/DEBIAN/postinst : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@ %/DEBIAN/postrm : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@ %/DEBIAN/prerm : $$(@:f) - @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.3//))/g" > $@ + @cat $< | tr -d "\015" | sed -e "s/%PREFIX/$(UNIXFILENAME.$(*:f:s/-/ /:1:s/3.4//))/g" > $@ # --- packaging --------------------------------------------------- diff --git a/sysui/desktop/productversion.mk b/sysui/desktop/productversion.mk index 24b1a2db042d..09141b2276bd 100644 --- a/sysui/desktop/productversion.mk +++ b/sysui/desktop/productversion.mk @@ -46,7 +46,7 @@ PKGDIR=$(BIN) PRODUCTLIST = openoffice.org broffice.org # default values to minimize maintainance effort -PRODUCTVERSION = 3.3 +PRODUCTVERSION = 3.4 PRODUCTVERSIONSHORT = 3 PKGVERSION = $(PRODUCTVERSION) # gnome-vfs treats everything behind the last '.' as an icon extension, diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk index 6fde1caf6528..eeeb141c6397 100644 --- a/sysui/desktop/slackware/makefile.mk +++ b/sysui/desktop/slackware/makefile.mk @@ -40,7 +40,7 @@ TARGET=slackware # --- Files -------------------------------------------------------- -MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.3-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz +MENUFILES=$(PKGDIR)$/{$(PRODUCTLIST)}3.4-$(TARGET)-menus-$(PKGVERSION)-noarch-$(PKGREV).tgz # --- Targets ------------------------------------------------------- @@ -59,26 +59,26 @@ $(MISC)/$(TARGET)/usr/share/applications/ : # FIXME: removal of *-extension.* only to create identical packages to OOF680 %/usr/share/applications : @$(MKDIRHIER) $@ - /bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/3.3//)) KDEMAINDIR=/opt/kde .$/create_tree.sh" + /bin/sh -c "cd $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.4//); DESTDIR=$(shell @cd $*; pwd) GNOMEDIR="" ICON_PREFIX=$(ICONPREFIX.$(*:b:s/-/ /:1:s/3.4//)) KDEMAINDIR=/opt/kde .$/create_tree.sh" $(RM) $*$/opt$/kde$/share$/icons$/*$/*$/*$/*-extension.png $(RM) $*$/opt$/kde$/share$/mimelnk$/application$/*-extension.desktop $(RM) $*$/usr$/share$/applications$/*.desktop $(RM) $*$/usr$/bin$/soffice %$/install$/doinst.sh : update-script - @echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" > $@ - @echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//)) )" >> $@ + @echo "( cd etc ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//)) )" > $@ + @echo "( cd etc ; ln -snf /opt/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//):s/-//) $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//)) )" >> $@ @echo "( cd usr/bin ; rm -rf soffice )" >> $@ - @echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/program/soffice soffice )" >> $@ - @echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.3//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))-$i )") >> $@ + @echo "( cd usr/bin ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/program/soffice soffice )" >> $@ + @echo -e $(foreach,i,$(shell @cat $(COMMONMISC)$/$(*:b:s/-/ /:1:s/3.4//)/launcherlist) "\n( cd usr/share/applications ; rm -rf $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))-$i )\n( cd usr/share/applications ; ln -sf /etc/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/share/xdg/$i $(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))-$i )") >> $@ @cat $< >> $@ %$/install$/slack-desc : slack-desc @$(MKDIRHIER) $(@:d) - @sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/3.3//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/3.3//))/g" \ - -e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.3//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/3.3//))/g" \ - -e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.3//))/g" \ - -e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.3//))/g" $< > $@ + @sed -e "s/PKGNAME/$(*:b:s/-/ /:1:s/3.4//)-$(TARGET)-menus/g" -e "s/PKGVERSION/$(PKGVERSION.$(*:b:s/-/ /:1:s/3.4//))/g" \ + -e "s/LONGPRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.4//)) $(PRODUCTVERSION.$(*:b:s/-/ /:1:s/3.4//))/g" \ + -e "s/PRODUCTNAME/$(PRODUCTNAME.$(*:b:s/-/ /:1:s/3.4//))/g" \ + -e "s/UNIXFILENAME/$(UNIXFILENAME.$(*:b:s/-/ /:1:s/3.4//))/g" $< > $@ # needed to satisfy the slackware package tools - they need # the entries like this -- cgit From b687b636115b17970db28c389a8d28040ace86d1 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 6 Jul 2010 18:07:29 +0200 Subject: mib17: #162576# handle VBA UserForm_Resize and UserForm_Layout events --- basic/inc/basic/sbobjmod.hxx | 12 ++- basic/source/classes/sb.cxx | 21 ++---- basic/source/classes/sbxmod.cxx | 158 +++++++++++++++++++++++++++------------ basic/source/runtime/methods.cxx | 3 +- 4 files changed, 127 insertions(+), 67 deletions(-) diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index 3d638a475f9a..9ff46d1931f3 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -36,6 +36,7 @@ #ifndef _SB_OBJMOD_HXX #define _SB_OBJMOD_HXX +#include #include #include #include @@ -60,10 +61,12 @@ public: void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ; }; +class FormObjEventListenerImpl; + class SbUserFormModule : public SbObjModule { com::sun::star::script::ModuleInfo m_mInfo; - css::uno::Reference m_DialogListener; + ::rtl::Reference< FormObjEventListenerImpl > m_DialogListener; css::uno::Reference m_xDialog; css::uno::Reference m_xModel; String sFormName; @@ -76,16 +79,19 @@ class SbUserFormModule : public SbObjModule public: TYPEINFO(); SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); + virtual ~SbUserFormModule(); virtual SbxVariable* Find( const XubString& rName, SbxClassType t ); void ResetApiObj(); void Unload(); - void load(); + void Load(); void triggerMethod( const String& ); void triggerMethod( const String&, css::uno::Sequence< css::uno::Any >& ); void triggerActivateEvent(); - void triggerDeActivateEvent(); + void triggerDeactivateEvent(); void triggerInitializeEvent(); void triggerTerminateEvent(); + void triggerLayoutEvent(); + void triggerResizeEvent(); class SbUserFormModuleInstance* CreateInstance(); }; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 924a3ef2807f..9012471cac0a 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -339,27 +339,18 @@ SbxBase* SbFormFactory::Create( UINT16, UINT32 ) SbxObject* SbFormFactory::CreateObject( const String& rClassName ) { - static String aLoadMethodName( RTL_CONSTASCII_USTRINGPARAM("load") ); - - SbxObject* pRet = NULL; - SbModule* pMod = pMOD; - if( pMod ) + if( SbModule* pMod = pMOD ) { - SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT ); - if( pVar ) + if( SbxVariable* pVar = pMod->Find( rClassName, SbxCLASS_OBJECT ) ) { - SbxBase* pObj = pVar->GetObject(); - SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pObj ); - - if( pFormModule != NULL ) + if( SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pVar->GetObject() ) ) { - pFormModule->load(); - SbUserFormModuleInstance* pFormInstance = pFormModule->CreateInstance(); - pRet = pFormInstance; + pFormModule->Load(); + return pFormModule->CreateInstance(); } } } - return pRet; + return 0; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 51af5685d888..30d856fda40e 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -95,6 +96,7 @@ using namespace com::sun::star::script; #include #include #include +#include #include #include #include @@ -1985,9 +1987,9 @@ SbObjModule::Find( const XubString& rName, SbxClassType t ) return pVar; } -typedef ::cppu::WeakImplHelper1< awt::XTopWindowListener > EventListener_BASE; +typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE; -class FormObjEventListenerImpl : public EventListener_BASE +class FormObjEventListenerImpl : public FormObjEventListener_BASE { SbUserFormModule* mpUserForm; uno::Reference< lang::XComponent > mxComponent; @@ -1997,39 +1999,57 @@ class FormObjEventListenerImpl : public EventListener_BASE sal_Bool mbShowing; FormObjEventListenerImpl(); // not defined FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined + public: - FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False ) + FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : + mpUserForm( pUserForm ), mxComponent( xComponent) , + mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False ) { if ( mxComponent.is() ) { - uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );; - OSL_TRACE("*********** Registering the listener"); - xList->addTopWindowListener( this ); + OSL_TRACE("*********** Registering the listeners"); + try + { + uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->addTopWindowListener( this ); + } + catch( uno::Exception& ) {} + try + { + uno::Reference< awt::XWindow >( mxComponent, uno::UNO_QUERY_THROW )->addWindowListener( this ); + } + catch( uno::Exception& ) {} } } - ~FormObjEventListenerImpl() + virtual ~FormObjEventListenerImpl() { removeListener(); } - sal_Bool isShowing() { return mbShowing; } + + sal_Bool isShowing() const { return mbShowing; } + void removeListener() { - try + if ( mxComponent.is() && !mbDisposed ) { - if ( mxComponent.is() && !mbDisposed ) + OSL_TRACE("*********** Removing the listeners"); + try { - uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );; - OSL_TRACE("*********** Removing the listener"); - xList->removeTopWindowListener( this ); - mxComponent = NULL; + uno::Reference< awt::XTopWindow >( mxComponent, uno::UNO_QUERY_THROW )->removeTopWindowListener( this ); } + catch( uno::Exception& ) {} + try + { + uno::Reference< awt::XWindow >( mxComponent, uno::UNO_QUERY_THROW )->removeWindowListener( this ); + } + catch( uno::Exception& ) {} } - catch( uno::Exception& ) {} + mxComponent.clear(); } + virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { - if ( mpUserForm ) + if ( mpUserForm ) { mbOpened = sal_True; mbShowing = sal_True; @@ -2076,12 +2096,23 @@ public: } //liuchen 2009-7-21 - virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { mbOpened = sal_False; mbShowing = sal_False; } - virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) {} - virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException){} + virtual void SAL_CALL windowClosed( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) + { + mbOpened = sal_False; + mbShowing = sal_False; + } + + virtual void SAL_CALL windowMinimized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) + { + } + + virtual void SAL_CALL windowNormalized( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) + { + } + virtual void SAL_CALL windowActivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { - if ( mpUserForm ) + if ( mpUserForm ) { mbActivated = sal_True; if ( mbOpened ) @@ -2094,18 +2125,38 @@ public: virtual void SAL_CALL windowDeactivated( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) { - if ( mpUserForm ) - mpUserForm->triggerDeActivateEvent(); + if ( mpUserForm ) + mpUserForm->triggerDeactivateEvent(); } + virtual void SAL_CALL windowResized( const awt::WindowEvent& /*e*/ ) throw (uno::RuntimeException) + { + if ( mpUserForm ) + { + mpUserForm->triggerResizeEvent(); + mpUserForm->triggerLayoutEvent(); + } + } + + virtual void SAL_CALL windowMoved( const awt::WindowEvent& /*e*/ ) throw (uno::RuntimeException) + { + if ( mpUserForm ) + mpUserForm->triggerLayoutEvent(); + } + + virtual void SAL_CALL windowShown( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) + { + } + + virtual void SAL_CALL windowHidden( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) + { + } - virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException) + virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { OSL_TRACE("** Userform/Dialog disposing"); mbDisposed = true; - uno::Any aSource; - aSource <<= Source; - mxComponent = NULL; + mxComponent.clear(); if ( mpUserForm ) mpUserForm->ResetApiObj(); } @@ -2119,6 +2170,10 @@ SbUserFormModule::SbUserFormModule( const String& rName, const com::sun::star::s m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW ); } +SbUserFormModule::~SbUserFormModule() +{ +} + void SbUserFormModule::ResetApiObj() { if ( m_xDialog.is() ) // probably someone close the dialog window @@ -2181,23 +2236,22 @@ void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any void SbUserFormModule::triggerActivateEvent( void ) { - OSL_TRACE("**** entering SbUserFormModule::triggerActivate"); - triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_activate") ) ); - OSL_TRACE("**** leaving SbUserFormModule::triggerActivate"); + OSL_TRACE("**** entering SbUserFormModule::triggerActivate"); + triggerMethod( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UserForm_Activate") ) ); + OSL_TRACE("**** leaving SbUserFormModule::triggerActivate"); } -void SbUserFormModule::triggerDeActivateEvent( void ) +void SbUserFormModule::triggerDeactivateEvent( void ) { - OSL_TRACE("**** SbUserFormModule::triggerDeActivate"); - triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_DeActivate") ) ); + OSL_TRACE("**** SbUserFormModule::triggerDeactivate"); + triggerMethod( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Userform_Deactivate") ) ); } void SbUserFormModule::triggerInitializeEvent( void ) - { if ( mbInit ) return; - OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent"); + OSL_TRACE("**** SbUserFormModule::triggerInitializeEvent"); static String aInitMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Initialize") ); triggerMethod( aInitMethodName ); mbInit = true; @@ -2205,12 +2259,24 @@ void SbUserFormModule::triggerInitializeEvent( void ) void SbUserFormModule::triggerTerminateEvent( void ) { - OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent"); + OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent"); static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") ); triggerMethod( aTermMethodName ); mbInit=false; } +void SbUserFormModule::triggerLayoutEvent( void ) +{ + static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Layout") ); + triggerMethod( aMethodName ); +} + +void SbUserFormModule::triggerResizeEvent( void ) +{ + static String aMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Resize") ); + triggerMethod( aMethodName ); +} + SbUserFormModuleInstance* SbUserFormModule::CreateInstance() { SbUserFormModuleInstance* pInstance = new SbUserFormModuleInstance( this, GetName(), m_mInfo, IsVBACompat() ); @@ -2238,7 +2304,7 @@ SbxVariable* SbUserFormModuleInstance::Find( const XubString& rName, SbxClassTyp } -void SbUserFormModule::load() +void SbUserFormModule::Load() { OSL_TRACE("** load() "); // forces a load @@ -2276,21 +2342,20 @@ void SbUserFormModule::Unload() if( pMeth ) { OSL_TRACE("Attempting too run the UnloadObjectMethod"); - m_xDialog = NULL; //release ref to the uno object + m_xDialog.clear(); //release ref to the uno object SbxValues aVals; - FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() ); bool bWaitForDispose = true; // assume dialog is showing - if ( pFormListener ) + if ( m_DialogListener.get() ) { - bWaitForDispose = pFormListener->isShowing(); + bWaitForDispose = m_DialogListener->isShowing(); OSL_TRACE("Showing %d", bWaitForDispose ); } pMeth->Get( aVals); - if ( !bWaitForDispose ) - { - // we've either already got a dispose or we'er never going to get one + if ( !bWaitForDispose ) + { + // we've either already got a dispose or we'er never going to get one ResetApiObj(); - } // else wait for dispose + } // else wait for dispose OSL_TRACE("UnloadObject completed ( we hope )"); } } @@ -2328,9 +2393,8 @@ void SbUserFormModule::InitObject() pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.UserForm")), aArgs ) ) ); uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW ); // remove old listener if it exists - FormObjEventListenerImpl* pFormListener = dynamic_cast< FormObjEventListenerImpl* >( m_DialogListener.get() ); - if ( pFormListener ) - pFormListener->removeListener(); + if ( m_DialogListener.get() ) + m_DialogListener->removeListener(); m_DialogListener = new FormObjEventListenerImpl( this, xComponent ); triggerInitializeEvent(); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 36fbda5c9097..1a60a5d79a45 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4134,8 +4134,7 @@ RTLFUNC(Load) { if( pObj->IsA( TYPE( SbUserFormModule ) ) ) { - SbUserFormModule* pFormModule = ( SbUserFormModule* )pObj; - pFormModule->load(); + ((SbUserFormModule*)pObj)->Load(); } else if( pObj->IsA( TYPE( SbxObject ) ) ) { -- cgit From c449069c0608be9f263392589cb2c91e44bc9e8b Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 6 Jul 2010 19:34:53 +0200 Subject: mib17: #i112634# add VBA sheet event handling, based on a patch from Noel Power --- oovbaapi/ooo/vba/excel/XApplication.idl | 1 + oovbaapi/ooo/vba/excel/makefile.mk | 2 +- oovbaapi/ooo/vba/word/makefile.mk | 2 +- sfx2/inc/sfx2/objsh.hxx | 1 + sfx2/source/doc/objserv.cxx | 24 +++ sfx2/source/view/viewprn.cxx | 18 ++ vbahelper/inc/vbahelper/vbaeventshelperbase.hxx | 165 +++++++++++++++ vbahelper/prj/d.lst | 1 + vbahelper/source/vbahelper/makefile.mk | 2 + vbahelper/source/vbahelper/vbaeventshelperbase.cxx | 229 +++++++++++++++++++++ 10 files changed, 443 insertions(+), 2 deletions(-) create mode 100755 vbahelper/inc/vbahelper/vbaeventshelperbase.hxx create mode 100755 vbahelper/source/vbahelper/vbaeventshelperbase.cxx diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl index 39693a37511c..6f513ae64577 100644 --- a/oovbaapi/ooo/vba/excel/XApplication.idl +++ b/oovbaapi/ooo/vba/excel/XApplication.idl @@ -64,6 +64,7 @@ interface XApplication [attribute] any CutCopyMode; [attribute] any StatusBar; [attribute] long Cursor; + [attribute] boolean EnableEvents; void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException); diff --git a/oovbaapi/ooo/vba/excel/makefile.mk b/oovbaapi/ooo/vba/excel/makefile.mk index 12dcf025e489..251588086701 100644 --- a/oovbaapi/ooo/vba/excel/makefile.mk +++ b/oovbaapi/ooo/vba/excel/makefile.mk @@ -29,7 +29,7 @@ PRJ=..$/..$/.. PRJNAME=oovapi TARGET=excel -PACKAGE=ooo$/vba$/Excel +PACKAGE=ooo$/vba$/excel # --- Settings ----------------------------------------------------- .INCLUDE : $(PRJ)$/util$/makefile.pmk diff --git a/oovbaapi/ooo/vba/word/makefile.mk b/oovbaapi/ooo/vba/word/makefile.mk index e3a19e678414..543e99f7c538 100644 --- a/oovbaapi/ooo/vba/word/makefile.mk +++ b/oovbaapi/ooo/vba/word/makefile.mk @@ -29,7 +29,7 @@ PRJ=..$/..$/.. PRJNAME=oovapi TARGET=word -PACKAGE=ooo$/vba$/Word +PACKAGE=ooo$/vba$/word # --- Settings ----------------------------------------------------- .INCLUDE : $(PRJ)$/util$/makefile.pmk diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index d514235cbfa2..49223c23de75 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -292,6 +292,7 @@ public: sal_Bool IsReadOnlyUI() const; void SetNoName(); sal_Bool IsInModalMode() const; + sal_Bool IsInPrepareClose() const; //Added by PengYunQuan for Validity Cell Range Picker diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index c063546da1c7..ae3b527ff7a6 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -100,6 +100,7 @@ #include #include #include +#include #include "helpid.hrc" @@ -489,6 +490,22 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_SAVEASDOC: case SID_SAVEDOC: { + // ask VBA emulation at document model whether to save the document + if( nId == SID_SAVEDOC || nId == SID_SAVEASDOC ) try + { + Reference< script::vba::XCoreEventProcessor > xEventProcessor( GetModel(), UNO_QUERY_THROW ); + xEventProcessor->processCoreVbaEvent( nId ); + } + catch( util::VetoException& ) + { + // VBA event handler indicates to cancel saving the document + rReq.SetReturnValue( SfxBoolItem( 0, TRUE ) ); + return; + } + catch( Exception& ) + { + } + //!! detaillierte Auswertung eines Fehlercodes SfxObjectShellRef xLock( this ); @@ -895,6 +912,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) rReq.Done(); } +//------------------------------------------------------------------------- + +sal_Bool SfxObjectShell::IsInPrepareClose() const +{ + return pImp->bInPrepareClose; +} + //-------------------------------------------------------------------- void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index f62ae4c1ddc7..faf392c90f32 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -29,6 +29,7 @@ #include "precompiled_sfx2.hxx" #include +#include #include #include "com/sun/star/view/XRenderable.hpp" @@ -697,6 +698,23 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) case SID_PRINTDOCDIRECT: { SfxObjectShell* pDoc = GetObjectShell(); + + // ask VBA emulation at document model whether to print the document + try + { + uno::Reference< script::vba::XCoreEventProcessor > xEventProcessor( pDoc->GetModel(), uno::UNO_QUERY_THROW ); + xEventProcessor->processCoreVbaEvent( nId ); + } + catch( util::VetoException& ) + { + // VBA event handler indicates to cancel printing the document + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); + return; + } + catch( uno::Exception& ) + { + } + bool bDetectHidden = ( !bSilent && pDoc ); if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) break; diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx new file mode 100755 index 000000000000..a84b0e28f9db --- /dev/null +++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef VBAHELPER_VBAEVENTSHELPERBASE_HXX +#define VBAHELPER_VBAEVENTSHELPERBASE_HXX + +#include +#include +#include +#include +#include +#include "vbahelper/vbahelper.hxx" + +namespace com { namespace sun { namespace star { + namespace uno { class XComponentContext; } +} } } + +// ============================================================================ + +typedef ::cppu::WeakImplHelper2< css::script::vba::XEventProcessor, css::lang::XEventListener > VbaEventsHelperBase_BASE; + +class VBAHELPER_DLLPUBLIC VbaEventsHelperBase : public VbaEventsHelperBase_BASE +{ +public: + VbaEventsHelperBase( + const css::uno::Sequence< css::uno::Any >& rArgs, + const css::uno::Reference< css::uno::XComponentContext >& xContext ); + virtual ~VbaEventsHelperBase(); + + // XEventProcessor + virtual void SAL_CALL setIgnoreEvents( sal_Bool bIgnoreEvents ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getIgnoreEvents() throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasVbaEventHandler( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual void SAL_CALL processVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::script::provider::ScriptFrameworkErrorException, css::util::VetoException, css::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const css::lang::EventObject& aSource ) throw (css::uno::RuntimeException); + +protected: + // ------------------------------------------------------------------------ + + enum EventHandlerType { EVENTHANDLER_GLOBAL, EVENTHANDLER_DOCUMENT }; + struct EventHandlerInfo + { + sal_Int32 mnEventId; + ::rtl::OUString maMacroName; + EventHandlerType meType; + sal_Int32 mnCancelIndex; + css::uno::Any maUserData; + }; + + /** Registers a supported event handler. + + @param nEventId Event identifier from com.sun.star.script.vba.EventIdentifier. + @param pcMacroName Name of the associated VBA event handler macro. + @param eType Document event or global event. + @param nCancelIndex 0-based index of Cancel parameter, or -1. + @param rUserData User data for free usage in derived implementations. */ + void registerEventHandler( + sal_Int32 nEventId, + const sal_Char* pcMacroName, + EventHandlerType eType = EVENTHANDLER_DOCUMENT, + sal_Int32 nCancelIndex = -1, + const css::uno::Any& rUserData = css::uno::Any() ); + + /** Throws, if the passed sequence does not contain a value at the specified index. */ + static inline void checkArgument( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException) + { if( rArgs.getLength() <= nIndex ) throw css::lang::IllegalArgumentException(); } + + /** Throws, if the passed sequence does not contain a value of a specific at the specified index. */ + template< typename Type > + static inline void checkArgumentType( const css::uno::Sequence< css::uno::Any >& rArgs, sal_Int32 nIndex ) throw (css::lang::IllegalArgumentException) + { if( (rArgs.getLength() <= nIndex) || !rArgs[ nIndex ].has< Type >() ) throw css::lang::IllegalArgumentException(); } + + // ------------------------------------------------------------------------ + + struct EventQueueEntry + { + sal_Int32 mnEventId; + css::uno::Sequence< css::uno::Any > maArgs; + inline /*implicit*/ EventQueueEntry( sal_Int32 nEventId ) : mnEventId( nEventId ) {} + inline EventQueueEntry( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) : mnEventId( nEventId ), maArgs( rArgs ) {} + }; + typedef ::std::deque< EventQueueEntry > EventQueue; + + /** Derived classes return whether event processing is enabled. Throws if + the instance is in an invalid state. */ + virtual bool implEventsEnabled() throw (css::uno::RuntimeException) = 0; + + /** Derived classes do additional prpeparations and return whether the + event handler has to be called. */ + virtual bool implPrepareEvent( + EventQueue& rEventQueue, + const EventHandlerInfo& rInfo, + const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException) = 0; + + /** Derived classes have to return the argument list for the specified VBA event handler. */ + virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList( + const EventHandlerInfo& rInfo, + const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException) = 0; + + /** Derived classes may do additional postprocessing. Called even if the + event handler does not exist, or if an error occured during execution. */ + virtual void implPostProcessEvent( + EventQueue& rEventQueue, + const EventHandlerInfo& rInfo, + bool bSuccess, + bool bCancel ) throw (css::uno::RuntimeException) = 0; + + /** Derived classes have to return the name of the Basic document module. */ + virtual ::rtl::OUString implGetDocumentModuleName( + const EventHandlerInfo& rInfo, + const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException) = 0; + +private: + /** Returns the event handler info struct for the specified event, or throws. */ + const EventHandlerInfo& getEventHandlerInfo( sal_Int32 nEventId ) const throw (css::lang::IllegalArgumentException); + + /** Searches the event handler in the document and returns its full script path. */ + ::rtl::OUString getEventHandlerPath( + const EventHandlerInfo& rInfo, + const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException); + + /** Removes this instance from all broadcasters. */ + void stopListening(); + +protected: + css::uno::Reference< css::frame::XModel > mxModel; + SfxObjectShell* mpShell; + +private: + typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerMap; + + EventHandlerMap maEvents; + bool mbIgnoreEvents; + bool mbDisposed; +}; + +// ============================================================================ + +#endif diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst index d683e97c8b90..2d20ab1f982d 100644 --- a/vbahelper/prj/d.lst +++ b/vbahelper/prj/d.lst @@ -26,3 +26,4 @@ mkdir: %_DEST%\inc%_EXT%\basic ..\inc\vbahelper\vbatextframe.hxx %_DEST%\inc%_EXT%\vbahelper\vbatextframe.hxx ..\inc\vbahelper\vbashaperange.hxx %_DEST%\inc%_EXT%\vbahelper\vbashaperange.hxx ..\inc\vbahelper\vbapagesetupbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbapagesetupbase.hxx +..\inc\vbahelper\vbaeventshelperbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaeventshelperbase.hxx diff --git a/vbahelper/source/vbahelper/makefile.mk b/vbahelper/source/vbahelper/makefile.mk index 47ad44b3d0ed..22ed40a3adfa 100644 --- a/vbahelper/source/vbahelper/makefile.mk +++ b/vbahelper/source/vbahelper/makefile.mk @@ -65,6 +65,8 @@ SLOFILES=\ $(SLO)$/vbashaperange.obj \ $(SLO)$/vbatextframe.obj \ $(SLO)$/vbapagesetupbase.obj \ + $(SLO)$/vbaeventshelperbase.obj + # --- Targets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx new file mode 100755 index 000000000000..ea5448482a89 --- /dev/null +++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx @@ -0,0 +1,229 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbahelper/vbaeventshelperbase.hxx" +#include + +using namespace ::com::sun::star; +using namespace ::ooo::vba; + +// ============================================================================ + +VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& /*xContext*/ ) : + mpShell( 0 ), + mbIgnoreEvents( false ), + mbDisposed( false ) +{ + try + { + mxModel = getXSomethingFromArgs< frame::XModel >( rArgs, 0, false ); + mpShell = getSfxObjShell( mxModel ); + + // add dispose listener + uno::Reference< lang::XComponent > xComponent( mxModel, uno::UNO_QUERY_THROW ); + xComponent->addEventListener( this ); + } + catch( uno::Exception& ) + { + } +} + +VbaEventsHelperBase::~VbaEventsHelperBase() +{ + stopListening(); +} + +void SAL_CALL VbaEventsHelperBase::setIgnoreEvents( sal_Bool bIgnoreEvents ) throw (uno::RuntimeException) +{ + mbIgnoreEvents = bIgnoreEvents; +} + +sal_Bool SAL_CALL VbaEventsHelperBase::getIgnoreEvents() throw (uno::RuntimeException) +{ + return mbIgnoreEvents; +} + +sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs ) + throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + // getEventHandlerInfo() throws, if unknown event dentifier has been passed + const EventHandlerInfo& rInfo = getEventHandlerInfo( nEventId ); + // getEventHandlerPath() searches for the macro in the document + return getEventHandlerPath( rInfo, rArgs ).getLength() > 0; +} + +void SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs ) + throw (lang::IllegalArgumentException, script::provider::ScriptFrameworkErrorException, util::VetoException, uno::RuntimeException) +{ + /* Derived classes may add new event identifiers to be processed while + processing the original event. All unprocessed events are collected in + a queue. First element in the queue is the next event to be processed. */ + EventQueue aEventQueue; + aEventQueue.push_back( EventQueueEntry( nEventId, rArgs ) ); + + /* bEnabled will track if event processing is enabled. Every event handler + may disable handling of other events. */ + bool bEnabled = !mbIgnoreEvents; + + /* bCancel will contain the current Cancel value. It is possible that + multiple events will try to modify the Cancel value. Every event + handler receives the Cancel value of the previous event handler. */ + bool bCancel = false; + + /* bSuccess will change to true if at least one event handler has been + executed successfully. */ + bool bSuccess = false; + + /* Loop as long as there are more events to be processed, and as event + handling is still enabled. Derived classes may add new events to be + processed in the virtual implPrepareEvent() function. */ + while( bEnabled && !aEventQueue.empty() ) + { + /* Check that all class members are available, and that we are not + disposed (this may have happened at any time during execution of + the last event handler). */ + if( mbDisposed || !mxModel.is() || !mpShell ) + throw uno::RuntimeException(); + + // get info for next event + const EventHandlerInfo& rInfo = getEventHandlerInfo( aEventQueue.front().mnEventId ); + uno::Sequence< uno::Any > aEventArgs = aEventQueue.front().maArgs; + aEventQueue.pop_front(); + + // let derived classes decide whether event processing is still enabled + bEnabled = implEventsEnabled(); + // let derived classes prepare the event, they may add new events for next iteration + if( bEnabled && implPrepareEvent( aEventQueue, rInfo, aEventArgs ) ) + { + // search the event handler macro in the document + ::rtl::OUString aMacroPath = getEventHandlerPath( rInfo, aEventArgs ); + bool bEventSuccess = false; + if( aMacroPath.getLength() > 0 ) + { + // build the argument list + uno::Sequence< uno::Any > aVbaArgs = implBuildArgumentList( rInfo, aEventArgs ); + // insert current cancel value + if( rInfo.mnCancelIndex >= 0 ) + { + if( rInfo.mnCancelIndex >= aVbaArgs.getLength() ) + throw lang::IllegalArgumentException(); + aVbaArgs[ rInfo.mnCancelIndex ] <<= bCancel; + } + // execute the event handler + uno::Any aRet, aCaller; + bEventSuccess = executeMacro( mpShell, aMacroPath, aVbaArgs, aRet, aCaller ); + // extract new cancel value + if( rInfo.mnCancelIndex >= 0 ) + { + if( rInfo.mnCancelIndex >= aVbaArgs.getLength() ) + throw lang::IllegalArgumentException(); + // cancel value may be boolean or any integer type, Any(bool) does not extract to sal_Int32 + bool bNewCancel = false; + sal_Int32 nNewCancel = 0; + if( aVbaArgs[ rInfo.mnCancelIndex ] >>= bNewCancel ) + bCancel = bNewCancel; + else if( aVbaArgs[ rInfo.mnCancelIndex ] >>= nNewCancel ) + bCancel = nNewCancel != 0; + } + } + // post processing (also, if event handler does not exist, or on error + implPostProcessEvent( aEventQueue, rInfo, bEventSuccess, bCancel ); + // global success, if at least one event handler succeeded + bSuccess |= bEventSuccess; + } + } + + // if event handlers want to cancel the event, do so regardless of any errors + if( bCancel ) + throw util::VetoException(); + + // if no event handler finished successfully, throw + if( !bSuccess ) + throw script::provider::ScriptFrameworkErrorException(); +} + +void SAL_CALL VbaEventsHelperBase::disposing( const lang::EventObject& /*aSource*/ ) throw (uno::RuntimeException) +{ + OSL_TRACE( "VbaEventsHelperBase::disposing" ); + stopListening(); + mbDisposed = true; +} + +// protected ------------------------------------------------------------------ + +void VbaEventsHelperBase::registerEventHandler( sal_Int32 nEventId, + const sal_Char* pcMacroName, EventHandlerType eType, sal_Int32 nCancelIndex, const uno::Any& rUserData ) +{ + EventHandlerInfo& rInfo = maEvents[ nEventId ]; + rInfo.mnEventId = nEventId; + rInfo.maMacroName = ::rtl::OUString::createFromAscii( pcMacroName ); + rInfo.meType = eType; + rInfo.mnCancelIndex = nCancelIndex; + rInfo.maUserData = rUserData; +} + +// private -------------------------------------------------------------------- + +const VbaEventsHelperBase::EventHandlerInfo& VbaEventsHelperBase::getEventHandlerInfo( + sal_Int32 nEventId ) const throw (lang::IllegalArgumentException) +{ + EventHandlerMap::const_iterator aIt = maEvents.find( nEventId ); + if( aIt == maEvents.end() ) + throw lang::IllegalArgumentException(); + return aIt->second; +} + +::rtl::OUString VbaEventsHelperBase::getEventHandlerPath( const EventHandlerInfo& rInfo, + const uno::Sequence< uno::Any >& rArgs ) const throw (lang::IllegalArgumentException) +{ + ::rtl::OUString aMacroName; + switch( rInfo.meType ) + { + case EVENTHANDLER_GLOBAL: + aMacroName = rInfo.maMacroName; + break; + case EVENTHANDLER_DOCUMENT: + aMacroName = ::rtl::OUStringBuffer( implGetDocumentModuleName( rInfo, rArgs ) ). + append( sal_Unicode( '.' ) ).append( rInfo.maMacroName ).makeStringAndClear(); + break; + } + return resolveVBAMacro( mpShell, aMacroName ).ResolvedMacro(); +} + +void VbaEventsHelperBase::stopListening() +{ + if( !mbDisposed ) try + { + uno::Reference< lang::XComponent > xComponent( mxModel, uno::UNO_QUERY_THROW ); + xComponent->removeEventListener( this ); + } + catch( uno::Exception& ) + { + } +} + +// ============================================================================ -- cgit From 3ad81df579c34873878d09b8a45a59717d44b614 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 7 Jul 2010 08:44:22 +0200 Subject: cws tl82: automatic and silent conversion of user dictionaries to human readable UTF-8 format (DIC_VERSION_7) --- linguistic/source/dicimp.cxx | 115 ++++++++++++------------------------------- 1 file changed, 31 insertions(+), 84 deletions(-) diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index fe53bf344ac3..01c6838a4d3d 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -438,101 +438,48 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) return static_cast< ULONG >(-1); SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - ULONG nErr = sal::static_int_cast< ULONG >(-1); - rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); - if (nDicVersion >= DIC_VERSION_6) - eEnc = RTL_TEXTENCODING_UTF8; - - if (nDicVersion == DIC_VERSION_7) + // + // Always write as the latest version, i.e. DIC_VERSION_7 + // + rtl_TextEncoding eEnc = RTL_TEXTENCODING_UTF8; + pStream->WriteLine(ByteString (pVerOOo7)); + if (0 != (nErr = pStream->GetError())) + return nErr; + if (nLanguage == LANGUAGE_NONE) + pStream->WriteLine(ByteString("lang: ")); + else { - pStream->WriteLine(ByteString (pVerOOo7)); - if (0 != (nErr = pStream->GetError())) - return nErr; - - if (nLanguage == LANGUAGE_NONE) - pStream->WriteLine(ByteString("lang: ")); - else - { - ByteString aLine("lang: "); - aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc); - pStream->WriteLine( aLine ); - } - if (0 != (nErr = pStream->GetError())) - return nErr; - - if (eDicType == DictionaryType_POSITIVE) - pStream->WriteLine(ByteString("type: positive")); - else - pStream->WriteLine(ByteString("type: negative")); - if (0 != (nErr = pStream->GetError())) - return nErr; - - pStream->WriteLine(ByteString("---")); - if (0 != (nErr = pStream->GetError())) - return nErr; - - const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - for (INT32 i = 0; i < nCount; i++) - { - ByteString aOutStr = formatForSave(pEntry[i], eEnc); - pStream->WriteLine (aOutStr); - if (0 != (nErr = pStream->GetError())) - return nErr; - } + ByteString aLine("lang: "); + aLine += ByteString( String( MsLangId::convertLanguageToIsoString( nLanguage ) ), eEnc); + pStream->WriteLine( aLine ); } + if (0 != (nErr = pStream->GetError())) + return nErr; + if (eDicType == DictionaryType_POSITIVE) + pStream->WriteLine(ByteString("type: positive")); else + pStream->WriteLine(ByteString("type: negative")); + if (0 != (nErr = pStream->GetError())) + return nErr; + pStream->WriteLine(ByteString("---")); + if (0 != (nErr = pStream->GetError())) + return nErr; + const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); + for (INT32 i = 0; i < nCount; i++) { - sal_Char aWordBuf[BUFSIZE]; - - // write version - const sal_Char *pVerStr = NULL; - if (DIC_VERSION_6 == nDicVersion) - pVerStr = pVerStr6; - else - pVerStr = eDicType == DictionaryType_POSITIVE ? pVerStr2 : pVerStr5; - strcpy( aWordBuf, pVerStr ); // #100211# - checked - USHORT nLen = sal::static_int_cast< USHORT >(strlen( aWordBuf )); - *pStream << nLen; + ByteString aOutStr = formatForSave(pEntry[i], eEnc); + pStream->WriteLine (aOutStr); if (0 != (nErr = pStream->GetError())) return nErr; - pStream->Write(aWordBuf, nLen); - if (0 != (nErr = pStream->GetError())) - return nErr; - - *pStream << nLanguage; - if (0 != (nErr = pStream->GetError())) - return nErr; - *pStream << (sal_Char) (eDicType == DictionaryType_NEGATIVE ? TRUE : FALSE); - if (0 != (nErr = pStream->GetError())) - return nErr; - - const uno::Reference< XDictionaryEntry > *pEntry = aEntries.getConstArray(); - for (INT32 i = 0; i < nCount; i++) - { - ByteString aOutStr = formatForSave(pEntry[i], eEnc); - - // the old format would fail (mis-calculation of nLen) and write - // uninitialized junk for combined len >= BUFSIZE - we truncate - // silently here, but BUFSIZE is large anyway. - nLen = aOutStr.Len(); - if (nLen >= BUFSIZE) - nLen = BUFSIZE - 1; - - *pStream << nLen; - if (0 != (nErr = pStream->GetError())) - return nErr; - pStream->Write(aOutStr.GetBuffer(), nLen); - if (0 != (nErr = pStream->GetError())) - return nErr; - } } - //! get return value before Stream is destroyed - ULONG nError = pStream->GetError(); + //If we are migrating from an older version, then on first successful + //write, we're now converted to the latest version, i.e. DIC_VERSION_7 + nDicVersion = DIC_VERSION_7; - return nError; + return nErr; } void DictionaryNeo::launchEvent(INT16 nEvent, -- cgit From 9b3ed7aa9162094b99fd3341c0432c94e659420b Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 7 Jul 2010 09:07:34 +0200 Subject: dba33g: handle of next and prior for count function corrected --- connectivity/source/drivers/file/FResultSet.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 265084be697f..421225b34935 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1200,7 +1200,9 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, break; } - if (m_nRowPos == 0) + if ( m_nRowPos < 0 ) + goto Error; + else if (m_nRowPos == 0) { // COUNT(*) in Ergebnisrow packen // (muss die erste und einzige Variable in der Row sein) -- cgit From b8d18edc25262dcd77c160d2910ac77e2d683a18 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 7 Jul 2010 09:32:11 +0200 Subject: mib17: #162901# fix Remove --- vbahelper/source/msforms/vbacontrols.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx index 1284b36be463..b7fad7d9372d 100644 --- a/vbahelper/source/msforms/vbacontrols.cxx +++ b/vbahelper/source/msforms/vbacontrols.cxx @@ -349,13 +349,16 @@ void SAL_CALL ScVbaControls::Remove( const uno::Any& StringKeyOrIndex ) } catch( uno::RuntimeException& ) { - throw; + // the exceptions are not rethrown, impossibility to find or remove the control is currently not reported + // since in most cases it means just that the controls is already not there, the VBA seems to do it in the same way + + // throw; } catch( uno::Exception& e ) { - throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ), - uno::Reference< uno::XInterface >(), - uno::makeAny( e ) ); + // throw lang::WrappedTargetException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Can not create AXControl!" ) ), + // uno::Reference< uno::XInterface >(), + // uno::makeAny( e ) ); } } -- cgit From ed07c51161b6ac904a42a6ce14ba52283ccbde0b Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 7 Jul 2010 13:51:44 +0200 Subject: jl154: #i112449# Fix flicker on restart. Backing window won't get created if restart is required --- desktop/source/app/app.cxx | 262 ++++++++++++++++++++++----------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 41d4406e03cd..7e78d7e43ec2 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1335,6 +1335,9 @@ void Desktop::Main() std::auto_ptr pLanguageOptions; std::auto_ptr pPathOptions; + sal_Bool bRestartRequested( sal_False ); + sal_Bool bUseSystemFileDialog(sal_True); + int nAcquireCount( 0 ); Reference < css::document::XEventListener > xGlobalBroadcaster; try { @@ -1528,58 +1531,80 @@ void Desktop::Main() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" ); - if ( - (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && - (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && - (!bExistsRecoveryData ) && - (!bExistsSessionData ) && - (!Application::AnyInput( INPUT_APPEVENT ) ) - ) + Reference< ::com::sun::star::task::XRestartManager > xRestartManager; { - RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); - Reference< XFrame > xDesktopFrame( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - if (xDesktopFrame.is()) + ::comphelper::ComponentContext aContext( xSMgr ); + xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); + } + + // check whether the shutdown is caused by restart + bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + + if ( pCmdLineArgs->IsHeadless() ) + { + // Ensure that we use not the system file dialogs as + // headless mode relies on Application::EnableHeadlessMode() + // which does only work for VCL dialogs!! + SvtMiscOptions aMiscOptions; + bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); + aMiscOptions.SetUseSystemFileDialog( sal_False ); + } + + if ( !bRestartRequested ) + { + if ( + (pCmdLineArgs->IsEmptyOrAcceptOnly() ) && + (SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::E_SSTARTMODULE)) && + (!bExistsRecoveryData ) && + (!bExistsSessionData ) && + (!Application::AnyInput( INPUT_APPEVENT ) ) + ) { -// SetSplashScreenProgress(60); - Reference< XFrame > xBackingFrame; - Reference< ::com::sun::star::awt::XWindow > xContainerWindow; - - xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); - if (xBackingFrame.is()) - xContainerWindow = xBackingFrame->getContainerWindow(); - if (xContainerWindow.is()) + RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ create BackingComponent" ); + Reference< XFrame > xDesktopFrame( xSMgr->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); + if (xDesktopFrame.is()) { - // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" - // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, - // otherwise documents loaded into this frame will later on miss functionality depending on the style. - Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); - OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); - pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); - - SetSplashScreenProgress(75); - Sequence< Any > lArgs(1); - lArgs[0] <<= xContainerWindow; - - Reference< XController > xBackingComp( - xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), - UNO_QUERY); -// SetSplashScreenProgress(80); - if (xBackingComp.is()) + // SetSplashScreenProgress(60); + Reference< XFrame > xBackingFrame; + Reference< ::com::sun::star::awt::XWindow > xContainerWindow; + + xBackingFrame = xDesktopFrame->findFrame(OUString( RTL_CONSTASCII_USTRINGPARAM( "_blank" )), 0); + if (xBackingFrame.is()) + xContainerWindow = xBackingFrame->getContainerWindow(); + if (xContainerWindow.is()) { - Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); - // Attention: You MUST(!) call setComponent() before you call attachFrame(). - // Because the backing component set the property "IsBackingMode" of the frame - // to true inside attachFrame(). But setComponent() reset this state everytimes ... - xBackingFrame->setComponent(xBackingWin, xBackingComp); - SetSplashScreenProgress(100); - xBackingComp->attachFrame(xBackingFrame); - CloseSplashScreen(); - xContainerWindow->setVisible(sal_True); + // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" + // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, + // otherwise documents loaded into this frame will later on miss functionality depending on the style. + Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); + OSL_ENSURE( pContainerWindow, "Desktop::Main: no implementation access to the frame's container window!" ); + pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); + + SetSplashScreenProgress(75); + Sequence< Any > lArgs(1); + lArgs[0] <<= xContainerWindow; + + Reference< XController > xBackingComp( + xSMgr->createInstanceWithArguments(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.StartModule") ), lArgs), + UNO_QUERY); + // SetSplashScreenProgress(80); + if (xBackingComp.is()) + { + Reference< ::com::sun::star::awt::XWindow > xBackingWin(xBackingComp, UNO_QUERY); + // Attention: You MUST(!) call setComponent() before you call attachFrame(). + // Because the backing component set the property "IsBackingMode" of the frame + // to true inside attachFrame(). But setComponent() reset this state everytimes ... + xBackingFrame->setComponent(xBackingWin, xBackingComp); + SetSplashScreenProgress(100); + xBackingComp->attachFrame(xBackingFrame); + CloseSplashScreen(); + xContainerWindow->setVisible(sal_True); + } } } + RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" ); } - RTL_LOGFILE_CONTEXT_TRACE( aLog, "} create BackingComponent" ); } } catch ( com::sun::star::lang::WrappedTargetException& wte ) @@ -1614,107 +1639,82 @@ void Desktop::Main() aOptions.SetVCLSettings(); // SetSplashScreenProgress(60); - Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); - - sal_Bool bTerminateRequested = sal_False; - - // Preload function depends on an initialized sfx application! - SetSplashScreenProgress(75); - - sal_Bool bUseSystemFileDialog(sal_True); - if ( pCmdLineArgs->IsHeadless() ) + if ( !bRestartRequested ) { - // Ensure that we use not the system file dialogs as - // headless mode relies on Application::EnableHeadlessMode() - // which does only work for VCL dialogs!! - SvtMiscOptions aMiscOptions; - bUseSystemFileDialog = aMiscOptions.UseSystemFileDialog(); - aMiscOptions.SetUseSystemFileDialog( sal_False ); - } + Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) ); - // use system window dialogs - Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); + sal_Bool bTerminateRequested = sal_False; -// SetSplashScreenProgress(80); + // Preload function depends on an initialized sfx application! + SetSplashScreenProgress(75); - if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && - !pCmdLineArgs->IsNoQuickstart() ) - InitializeQuickstartMode( xSMgr ); + // use system window dialogs + Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG ); - RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" ); - try - { - Reference< XDesktop > xDesktop( xSMgr->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); - if ( xDesktop.is() ) - xDesktop->addTerminateListener( new OfficeIPCThreadController ); - SetSplashScreenProgress(100); - } - catch ( com::sun::star::uno::Exception& e ) - { - FatalError( MakeStartupErrorMessage(e.Message) ); - return; - } - /* - catch ( ... ) - { - FatalError( MakeStartupErrorMessage( - OUString::createFromAscii( - "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged."))); - return; - } - */ + // SetSplashScreenProgress(80); - // Release solar mutex just before we wait for our client to connect - int nAcquireCount = 0; - ::vos::IMutex& rMutex = Application::GetSolarMutex(); - if ( rMutex.tryToAcquire() ) - nAcquireCount = Application::ReleaseSolarMutex() - 1; + if ( !bTerminateRequested && !pCmdLineArgs->IsInvisible() && + !pCmdLineArgs->IsNoQuickstart() ) + InitializeQuickstartMode( xSMgr ); - // Post user event to startup first application component window - // We have to send this OpenClients message short before execute() to - // minimize the risk that this message overtakes type detection contruction!! - Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) ); + RTL_LOGFILE_CONTEXT( aLog2, "desktop (cd100003) createInstance com.sun.star.frame.Desktop" ); + try + { + Reference< XDesktop > xDesktop( xSMgr->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ))), UNO_QUERY ); + if ( xDesktop.is() ) + xDesktop->addTerminateListener( new OfficeIPCThreadController ); + SetSplashScreenProgress(100); + } + catch ( com::sun::star::uno::Exception& e ) + { + FatalError( MakeStartupErrorMessage(e.Message) ); + return; + } + /* + catch ( ... ) + { + FatalError( MakeStartupErrorMessage( + OUString::createFromAscii( + "Unknown error during startup (TD/Desktop service).\nInstallation could be damaged."))); + return; + } + */ - // Post event to enable acceptors - Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) ); + // Post user event to startup first application component window + // We have to send this OpenClients message short before execute() to + // minimize the risk that this message overtakes type detection contruction!! + Application::PostUserEvent( LINK( this, Desktop, OpenClients_Impl ) ); - // The configuration error handler currently is only for startup - aConfigErrHandler.deactivate(); + // Post event to enable acceptors + Application::PostUserEvent( LINK( this, Desktop, EnableAcceptors_Impl) ); - // Acquire solar mutex just before we enter our message loop - if ( nAcquireCount ) - Application::AcquireSolarMutex( nAcquireCount ); + // The configuration error handler currently is only for startup + aConfigErrHandler.deactivate(); - // call Application::Execute to process messages in vcl message loop - RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); + // call Application::Execute to process messages in vcl message loop + RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; - try - { - // The JavaContext contains an interaction handler which is used when - // the creation of a Java Virtual Machine fails - com::sun::star::uno::ContextLayer layer2( - new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); + try + { + // The JavaContext contains an interaction handler which is used when + // the creation of a Java Virtual Machine fails + com::sun::star::uno::ContextLayer layer2( + new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); - if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) Execute(); + } + catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) + { + OfficeIPCThread::SetDowning(); + FatalError( MakeStartupErrorMessage(exFilterCfg.Message) ); + } + catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg) + { + OfficeIPCThread::SetDowning(); + FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); + } } - catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) - { - OfficeIPCThread::SetDowning(); - FatalError( MakeStartupErrorMessage(exFilterCfg.Message) ); - } - catch(const com::sun::star::configuration::CorruptedConfigurationException& exAnyCfg) - { - OfficeIPCThread::SetDowning(); - FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); - } - - // check whether the shutdown is caused by restart - sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); if (xGlobalBroadcaster.is()) { -- cgit From cbd90787ccc28ff36fb439ae3e012d28688b2ecd Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 7 Jul 2010 14:58:53 +0200 Subject: mib17: #162916# No error if byval in calls isn't followed by lvalue --- basic/source/classes/disas.cxx | 2 ++ basic/source/comp/exprtree.cxx | 14 ++------------ basic/source/comp/sbcomp.cxx | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx index 7317005d74fe..87b4cad4e94b 100644 --- a/basic/source/classes/disas.cxx +++ b/basic/source/classes/disas.cxx @@ -153,6 +153,7 @@ static const char* pOp3[] = { "DCREATE_REDIMP", // Change dimensions of a user defined Object-Array (+StringId+StringId) "FIND_CM", // Search inside a class module (CM) to enable global search in time "PUBLIC_P", // Module global Variable (persisted between calls)(+StringID+Typ) + "FIND_STATIC", // local static var lookup (+StringID+Typ) }; static const char** pOps[3] = { pOp1, pOp2, pOp3 }; @@ -220,6 +221,7 @@ static const Func pOperand3[] = { &SbiDisas::Str2Op, // Redimensionate User defined Object-Array (+StringId+StringId) &SbiDisas::VarOp, // FIND_CM &SbiDisas::VarDefOp, // PUBLIC_P + &SbiDisas::VarOp, // FIND_STATIC }; // TODO: Why as method? Isn't a simple define sufficient? diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 9b6f419e15ce..42969b98d0d8 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -971,16 +971,11 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else { bool bByVal = false; - bool bByValBlockLValueError = false; if( eTok == BYVAL ) { bByVal = true; pParser->Next(); eTok = pParser->Peek(); - - // Special handling for VBA function "StrPtr" that's accepted as lvalue - if( eTok == SYMBOL && pParser->GetSym().EqualsIgnoreCaseAscii( "StrPtr" ) ) - bByValBlockLValueError = true; } if( bAssumeExprLParenMode ) @@ -1014,13 +1009,8 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa else pExpr = new SbiExpression( pParser ); - if( bByVal ) - { - if( !pExpr->IsLvalue() && !bByValBlockLValueError ) - pParser->Error( SbERR_LVALUE_EXPECTED ); - else - pExpr->SetByVal(); - } + if( bByVal && pExpr->IsLvalue() ) + pExpr->SetByVal(); //pExpr = bConst ? new SbiConstExpression( pParser ) // : new SbiExpression( pParser ); diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index 50dc6f847076..faabba046c99 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -67,7 +67,7 @@ void dbg_SaveDisassembly( SbModule* pModule ) ( OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); if( xSFI.is() ) { - String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/BasicAsm_") ); + String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/zBasic.Asm/Asm_") ); StarBASIC* pBasic = (StarBASIC*)pModule->GetParent(); if( pBasic ) { -- cgit From 6a95ce1c7f61f5cd7684486937fc30f095ce2a29 Mon Sep 17 00:00:00 2001 From: ka Date: Wed, 7 Jul 2010 20:39:52 +0200 Subject: avmedia102: try use gconfvideosink at preferred video sink --- avmedia/source/framework/mediacontrol.cxx | 4 --- avmedia/source/gstreamer/gstplayer.cxx | 54 +++++++++++++++---------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index a71b5268abd7..2eb18cb164d9 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -91,8 +91,6 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle ) { - - maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), String( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) ); maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN ); @@ -103,8 +101,6 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : } else { - maTimeSlider.SetBackground(); - maVolumeSlider.SetBackground(); mpZoomListBox->SetBackground(); maZoomToolBox.SetBackground(); diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 71ac656a7b2c..f082cfc5c513 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -279,49 +279,50 @@ double SAL_CALL Player::getMediaTime() void SAL_CALL Player::setStopTime( double /* fTime */ ) throw( uno::RuntimeException ) { + OSL_TRACE( "GStreamer method avmedia::gst::Player::setStopTime needs to be implemented" ); + + /* Currently no need for implementation since higher levels of code don't use this method at all + !!! TODO: needs to be implemented if this functionality is needed at a later point of time if( implInitPlayer() ) { - // TBD!!! } + + */ } // ------------------------------------------------------------------------------ double SAL_CALL Player::getStopTime() throw( uno::RuntimeException ) { - double fRet = 0.0; - - if( implInitPlayer() ) - { - // TBD!!! - fRet = getDuration(); - } + /* + Currently no need for implementation since higher levels of code don't set a stop time ATM + !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time + */ - return( fRet ); + return( getDuration() ); } // ------------------------------------------------------------------------------ void SAL_CALL Player::setRate( double /* fRate */ ) throw( uno::RuntimeException ) { - if( implInitPlayer() ) - { - // TBD!!! - } + OSL_TRACE( "GStreamer method avmedia::gst::Player::setRate needs to be implemented" ); + + /* Currently no need for implementation since higher levels of code don't use this method at all + !!! TODO: needs to be implemented if this functionality is needed at a later point of time + */ } // ------------------------------------------------------------------------------ double SAL_CALL Player::getRate() throw( uno::RuntimeException ) { - double fRet = 1.0; - - if( implInitPlayer() ) - { - // TBD!!!; - } + /* + Currently no need for implementation since higher levels of code don't set a different rate than 1 ATM + !!! TODO: needs to be fully implemented if this functionality is needed at a later point of time + */ - return( fRet ); + return( 1.0 ); } // ------------------------------------------------------------------------------ @@ -443,14 +444,13 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( } else { - GstElement* pVideoSink = gst_element_factory_make( "xvimagesink", NULL ); - - if( !pVideoSink ) - { - pVideoSink = gst_element_factory_make( "ximagesink", NULL ); - } + // try to use gconf user configurable video sink first + GstElement* pVideoSink = gst_element_factory_make( "gconfvideosink", NULL ); - if( pVideoSink ) + if( ( NULL != pVideoSink ) || + ( NULL != ( pVideoSink = gst_element_factory_make( "autovideosink", NULL ) ) ) || + ( NULL != ( pVideoSink = gst_element_factory_make( "xvimagesink", NULL ) ) ) || + ( NULL != ( pVideoSink = gst_element_factory_make( "ximagesink", NULL ) ) ) ) { GstState aOldState = GST_STATE_NULL; -- cgit From 4cda571eda7bd9abe5f95d13a6d0b0cb93ed24b0 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 8 Jul 2010 12:27:24 +0200 Subject: renaissance1: resolved merge conflicts, cleanup. --- desktop/source/app/check_ext_deps.cxx | 0 desktop/source/deployment/gui/dp_gui.hrc | 0 desktop/source/deployment/gui/dp_gui_dialog.src | 0 desktop/source/deployment/gui/dp_gui_dialog2.cxx | 0 desktop/source/deployment/gui/dp_gui_dialog2.hxx | 0 .../deployment/gui/dp_gui_extensioncmdqueue.cxx | 0 .../deployment/gui/dp_gui_extensioncmdqueue.hxx | 0 desktop/source/deployment/gui/dp_gui_service.cxx | 0 desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 0 desktop/source/deployment/gui/dp_gui_theextmgr.hxx | 0 desktop/source/deployment/inc/dp_update.hxx | 0 desktop/source/deployment/misc/dp_update.cxx | 0 desktop/source/migration/migration.cxx | 0 oovbaapi/ooo/vba/XVBAAppService.idl | 0 oovbaapi/ooo/vba/XVBADocService.idl | 0 oovbaapi/ooo/vba/excel/SheetObject.idl | 0 oovbaapi/ooo/vba/excel/SheetObjects.idl | 0 oovbaapi/ooo/vba/excel/XHyperlinks.idl | 0 sfx2/inc/brokenpackageint.hxx | 0 sfx2/inc/sfx2/objsh.hxx | 0 sfx2/inc/sfx2/securitypage.hxx | 0 sfx2/inc/sfx2/sfx.hrc | 0 sfx2/inc/sfx2/titledockwin.hxx | 10 +++++++++ sfx2/sdi/sfx.sdi | 0 sfx2/source/appl/appuno.cxx | 0 sfx2/source/dialog/dinfdlg.cxx | 0 sfx2/source/dialog/dinfdlg.src | 0 sfx2/source/dialog/makefile.mk | 0 sfx2/source/dialog/securitypage.cxx | 0 sfx2/source/dialog/securitypage.hrc | 0 sfx2/source/dialog/securitypage.src | 0 sfx2/source/dialog/titledockwin.cxx | 24 +++++++++------------- sfx2/source/doc/objxtor.cxx | 0 sfx2/source/inc/helpid.hrc | 0 svx/inc/svx/svxids.hrc | 0 uui/source/cookiedg.cxx | 0 uui/source/cookiedg.hxx | 0 uui/source/iahndl-authentication.cxx | 0 uui/source/ids.hrc | 0 uui/source/logindlg.cxx | 0 uui/source/logindlg.hrc | 0 uui/source/logindlg.hxx | 0 uui/source/logindlg.src | 0 uui/source/loginerr.hxx | 0 uui/source/passworddlg.cxx | 0 uui/source/passworddlg.hxx | 0 uui/source/passworddlg.src | 0 uui/source/passworderrs.src | 0 vbahelper/source/msforms/vbasystemaxcontrol.cxx | 0 vbahelper/source/msforms/vbasystemaxcontrol.hxx | 0 50 files changed, 20 insertions(+), 14 deletions(-) mode change 100644 => 100755 desktop/source/app/check_ext_deps.cxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui.hrc mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_dialog.src mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_dialog2.cxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_dialog2.hxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_service.cxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_theextmgr.cxx mode change 100644 => 100755 desktop/source/deployment/gui/dp_gui_theextmgr.hxx mode change 100644 => 100755 desktop/source/deployment/inc/dp_update.hxx mode change 100644 => 100755 desktop/source/deployment/misc/dp_update.cxx mode change 100644 => 100755 desktop/source/migration/migration.cxx mode change 100644 => 100755 oovbaapi/ooo/vba/XVBAAppService.idl mode change 100644 => 100755 oovbaapi/ooo/vba/XVBADocService.idl mode change 100644 => 100755 oovbaapi/ooo/vba/excel/SheetObject.idl mode change 100644 => 100755 oovbaapi/ooo/vba/excel/SheetObjects.idl mode change 100644 => 100755 oovbaapi/ooo/vba/excel/XHyperlinks.idl mode change 100644 => 100755 sfx2/inc/brokenpackageint.hxx mode change 100644 => 100755 sfx2/inc/sfx2/objsh.hxx mode change 100644 => 100755 sfx2/inc/sfx2/securitypage.hxx mode change 100644 => 100755 sfx2/inc/sfx2/sfx.hrc mode change 100644 => 100755 sfx2/sdi/sfx.sdi mode change 100644 => 100755 sfx2/source/appl/appuno.cxx mode change 100644 => 100755 sfx2/source/dialog/dinfdlg.cxx mode change 100644 => 100755 sfx2/source/dialog/dinfdlg.src mode change 100644 => 100755 sfx2/source/dialog/makefile.mk mode change 100644 => 100755 sfx2/source/dialog/securitypage.cxx mode change 100644 => 100755 sfx2/source/dialog/securitypage.hrc mode change 100644 => 100755 sfx2/source/dialog/securitypage.src mode change 100644 => 100755 sfx2/source/doc/objxtor.cxx mode change 100644 => 100755 sfx2/source/inc/helpid.hrc mode change 100644 => 100755 svx/inc/svx/svxids.hrc mode change 100644 => 100755 uui/source/cookiedg.cxx mode change 100644 => 100755 uui/source/cookiedg.hxx mode change 100644 => 100755 uui/source/iahndl-authentication.cxx mode change 100644 => 100755 uui/source/ids.hrc mode change 100644 => 100755 uui/source/logindlg.cxx mode change 100644 => 100755 uui/source/logindlg.hrc mode change 100644 => 100755 uui/source/logindlg.hxx mode change 100644 => 100755 uui/source/logindlg.src mode change 100644 => 100755 uui/source/loginerr.hxx mode change 100644 => 100755 uui/source/passworddlg.cxx mode change 100644 => 100755 uui/source/passworddlg.hxx mode change 100644 => 100755 uui/source/passworddlg.src mode change 100644 => 100755 uui/source/passworderrs.src mode change 100644 => 100755 vbahelper/source/msforms/vbasystemaxcontrol.cxx mode change 100644 => 100755 vbahelper/source/msforms/vbasystemaxcontrol.hxx diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui.hrc b/desktop/source/deployment/gui/dp_gui.hrc old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.hxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/inc/dp_update.hxx b/desktop/source/deployment/inc/dp_update.hxx old mode 100644 new mode 100755 diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx old mode 100644 new mode 100755 diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx old mode 100644 new mode 100755 diff --git a/oovbaapi/ooo/vba/XVBAAppService.idl b/oovbaapi/ooo/vba/XVBAAppService.idl old mode 100644 new mode 100755 diff --git a/oovbaapi/ooo/vba/XVBADocService.idl b/oovbaapi/ooo/vba/XVBADocService.idl old mode 100644 new mode 100755 diff --git a/oovbaapi/ooo/vba/excel/SheetObject.idl b/oovbaapi/ooo/vba/excel/SheetObject.idl old mode 100644 new mode 100755 diff --git a/oovbaapi/ooo/vba/excel/SheetObjects.idl b/oovbaapi/ooo/vba/excel/SheetObjects.idl old mode 100644 new mode 100755 diff --git a/oovbaapi/ooo/vba/excel/XHyperlinks.idl b/oovbaapi/ooo/vba/excel/XHyperlinks.idl old mode 100644 new mode 100755 diff --git a/sfx2/inc/brokenpackageint.hxx b/sfx2/inc/brokenpackageint.hxx old mode 100644 new mode 100755 diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx old mode 100644 new mode 100755 diff --git a/sfx2/inc/sfx2/securitypage.hxx b/sfx2/inc/sfx2/securitypage.hxx old mode 100644 new mode 100755 diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc old mode 100644 new mode 100755 diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx index ebb4497a0ba2..2728cc621138 100644 --- a/sfx2/inc/sfx2/titledockwin.hxx +++ b/sfx2/inc/sfx2/titledockwin.hxx @@ -100,6 +100,11 @@ namespace sfx2 ToolBox& GetToolBox() { return m_aToolbox; } const ToolBox& GetToolBox() const { return m_aToolbox; } + /** Return the border that is painted around the inner window as + decoration. + */ + SvBorder GetDecorationBorder (void) const { return m_aBorder; } + protected: // Window overridables virtual void Paint( const Rectangle& i_rArea ); @@ -153,6 +158,11 @@ namespace sfx2 since the last Paint(). */ bool m_bLayoutPending; + + /** Height of the title bar. Calculated in impl_layout(). + */ + int m_nTitleBarHeight; + }; //...................................................................................................................... diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi old mode 100644 new mode 100755 diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/securitypage.hrc b/sfx2/source/dialog/securitypage.hrc old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src old mode 100644 new mode 100755 diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index 58a61d66ba8b..4be0948d8047 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -51,6 +51,7 @@ namespace sfx2 ,m_aContentWindow( this, WB_DIALOGCONTROL ) ,m_aBorder( 3, 1, 3, 3 ) ,m_bLayoutPending( false ) + ,m_nTitleBarHeight(0) { impl_construct(); } @@ -139,23 +140,23 @@ namespace sfx2 Size aWindowSize( GetOutputSizePixel() ); // position the tool box - int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() ); - if ( aToolBoxSize.Height() > nTitleBarHeight ) - nTitleBarHeight = aToolBoxSize.Height(); + m_nTitleBarHeight = GetSettings().GetStyleSettings().GetTitleHeight(); + if ( aToolBoxSize.Height() > m_nTitleBarHeight ) + m_nTitleBarHeight = aToolBoxSize.Height(); m_aToolbox.SetPosSizePixel( Point( aWindowSize.Width() - aToolBoxSize.Width(), - ( nTitleBarHeight - aToolBoxSize.Height() ) / 2 + ( m_nTitleBarHeight - aToolBoxSize.Height() ) / 2 ), aToolBoxSize ); // Place the content window. - if ( nTitleBarHeight < aToolBoxSize.Height() ) - nTitleBarHeight = aToolBoxSize.Height(); - aWindowSize.Height() -= nTitleBarHeight; + if ( m_nTitleBarHeight < aToolBoxSize.Height() ) + m_nTitleBarHeight = aToolBoxSize.Height(); + aWindowSize.Height() -= m_nTitleBarHeight; m_aContentWindow.SetPosSizePixel( - Point( m_aBorder.Left(), nTitleBarHeight + m_aBorder.Top() ), + Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ), Size( aWindowSize.Width() - m_aBorder.Left() - m_aBorder.Right(), aWindowSize.Height() - m_aBorder.Top() - m_aBorder.Bottom() @@ -175,11 +176,6 @@ namespace sfx2 Push( PUSH_FONT | PUSH_FILLCOLOR | PUSH_LINECOLOR ); - int nTitleBarHeight( GetSettings().GetStyleSettings().GetTitleHeight() ); - const Size aToolBoxSize = m_aToolbox.CalcWindowSizePixel(); - if ( aToolBoxSize.Height() > nTitleBarHeight ) - nTitleBarHeight = aToolBoxSize.Height(); - SetFillColor( GetSettings().GetStyleSettings().GetDialogColor() ); SetLineColor(); @@ -194,7 +190,7 @@ namespace sfx2 int nInnerLeft = nOuterLeft + m_aBorder.Left() - 1; int nOuterRight = aWindowSize.Width() - 1; int nInnerRight = nOuterRight - m_aBorder.Right() + 1; - int nInnerTop = nTitleBarHeight + m_aBorder.Top() - 1; + int nInnerTop = m_nTitleBarHeight + m_aBorder.Top() - 1; int nOuterBottom = aWindowSize.Height() - 1; int nInnerBottom = nOuterBottom - m_aBorder.Bottom() + 1; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx old mode 100644 new mode 100755 diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc old mode 100644 new mode 100755 diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc old mode 100644 new mode 100755 diff --git a/uui/source/cookiedg.cxx b/uui/source/cookiedg.cxx old mode 100644 new mode 100755 diff --git a/uui/source/cookiedg.hxx b/uui/source/cookiedg.hxx old mode 100644 new mode 100755 diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx old mode 100644 new mode 100755 diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc old mode 100644 new mode 100755 diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx old mode 100644 new mode 100755 diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc old mode 100644 new mode 100755 diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx old mode 100644 new mode 100755 diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src old mode 100644 new mode 100755 diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx old mode 100644 new mode 100755 diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx old mode 100644 new mode 100755 diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx old mode 100644 new mode 100755 diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src old mode 100644 new mode 100755 diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src old mode 100644 new mode 100755 diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.cxx b/vbahelper/source/msforms/vbasystemaxcontrol.cxx old mode 100644 new mode 100755 diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.hxx b/vbahelper/source/msforms/vbasystemaxcontrol.hxx old mode 100644 new mode 100755 -- cgit From bf97aef60b98b7c72ebd494845d0bdfa0c54ef84 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 8 Jul 2010 12:45:25 +0200 Subject: dba33g: assertion when closing stream, only close either the input stream or output stream --- connectivity/source/commontools/FValue.cxx | 100 ++++++++++++++++----- .../source/drivers/hsqldb/HStorageAccess.cxx | 10 +-- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 13 +-- 3 files changed, 89 insertions(+), 34 deletions(-) diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 2884e6179aaa..bb3ce9dbb13b 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -258,6 +258,7 @@ void ORowSetValue::setTypeKind(sal_Int32 _eType) (*this) = getAny(); break; default: + (*this) = getAny(); OSL_ENSURE(0,"ORowSetValue:operator==(): UNSPUPPORTED TYPE!"); } } @@ -344,6 +345,12 @@ void ORowSetValue::free() TRACE_FREE( Any ) m_aValue.m_pValue = NULL; break; + default: + OSL_ENSURE(m_aValue.m_pString,"String pointer is null!"); + delete (Any*)m_aValue.m_pValue; + TRACE_FREE( Any ) + m_aValue.m_pValue = NULL; + break; } m_bNull = sal_True; @@ -849,7 +856,9 @@ bool ORowSetValue::operator==(const ORowSetValue& _rRH) const bRet = false; break; default: + bRet = false; OSL_ENSURE(0,"ORowSetValue::operator==(): UNSPUPPORTED TYPE!"); + break; } return bRet; } @@ -942,6 +951,8 @@ Any ORowSetValue::makeAny() const break; default: OSL_ENSURE(0,"ORowSetValue::makeAny(): UNSPUPPORTED TYPE!"); + rValue = getAny(); + break; } } return rValue; @@ -1032,6 +1043,12 @@ Any ORowSetValue::makeAny() const } } break; + default: + { + Any aValue = getAny(); + aValue >>= aRet; + break; + } } } return aRet; @@ -1104,8 +1121,11 @@ sal_Bool ORowSetValue::getBool() const bRet = m_bSigned ? (m_aValue.m_nInt32 != 0) : (*static_cast(m_aValue.m_pValue) != sal_Int64(0)); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= bRet; + break; + } } } return bRet; @@ -1174,8 +1194,11 @@ sal_Int8 ORowSetValue::getInt8() const nRet = static_cast(*static_cast(m_aValue.m_pValue)); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1244,8 +1267,11 @@ sal_Int16 ORowSetValue::getInt16() const nRet = static_cast(*static_cast(m_aValue.m_pValue)); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1314,8 +1340,11 @@ sal_Int32 ORowSetValue::getInt32() const nRet = static_cast(*static_cast(m_aValue.m_pValue)); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1384,8 +1413,11 @@ sal_Int64 ORowSetValue::getLong() const nRet = *(sal_Int64*)m_aValue.m_pValue; break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1458,8 +1490,11 @@ float ORowSetValue::getFloat() const nRet = float(*(sal_Int64*)m_aValue.m_pValue); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1534,8 +1569,11 @@ double ORowSetValue::getDouble() const nRet = double(*(sal_Int64*)m_aValue.m_pValue); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aValue = getAny(); + aValue >>= nRet; + break; + } } } return nRet; @@ -1626,6 +1664,11 @@ void ORowSetValue::setFromDouble(const double& _rVal,sal_Int32 _nDatatype) TRACE_ALLOC( sal_Int64 ) } break; + default: + { + m_aValue.m_pValue = new Any(_rVal); + break; + } } m_eTypeKind = _nDatatype; } @@ -1692,7 +1735,11 @@ Sequence ORowSetValue::getSequence() const aSeq = *static_cast< Sequence*>(m_aValue.m_pValue); break; default: - ; + { + Any aValue = getAny(); + aValue >>= aSeq; + break; + } } } return aSeq; @@ -1734,8 +1781,11 @@ Sequence ORowSetValue::getSequence() const } break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aAnyValue = getAny(); + aAnyValue >>= aValue; + break; + } } } return aValue; @@ -1776,8 +1826,11 @@ Sequence ORowSetValue::getSequence() const aValue = *static_cast< ::com::sun::star::util::Time*>(m_aValue.m_pValue); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aAnyValue = getAny(); + aAnyValue >>= aValue; + break; + } } } return aValue; @@ -1826,8 +1879,11 @@ Sequence ORowSetValue::getSequence() const aValue = *static_cast< ::com::sun::star::util::DateTime*>(m_aValue.m_pValue); break; default: - OSL_ENSURE(0,"Illegal conversion!"); - break; + { + Any aAnyValue = getAny(); + aAnyValue >>= aValue; + break; + } } } return aValue; @@ -2094,7 +2150,7 @@ void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const break; default: OSL_ENSURE( false, "ORowSetValue::fill: unsupported type!" ); - bReadData = false; + (*this) = _rValueSource.getObject(); break; } if ( bReadData && _bNullable && _rValueSource.wasNull() ) diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx index 1452df992a74..e7fab6acb6c0 100644 --- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx @@ -234,7 +234,7 @@ jint read_from_storage_stream_into_buffer( JNIEnv * env, jobject /*obj_this*/,js if ( xIn.is() ) { jsize nLen = env->GetArrayLength(buffer); - if ( nLen < len ) + if ( nLen < len || len <= 0 ) { ThrowException( env, "java/io/IOException", @@ -439,21 +439,17 @@ void write_to_storage_stream_from_buffer( JNIEnv* env, jobject /*obj_this*/, jst if ( xOut.is() ) { jbyte *buf = env->GetByteArrayElements(buffer,NULL); -#ifdef HSQLDB_DBG - OSL_ENSURE(len <= env->GetArrayLength(buffer),"Length is greater than the buffer!"); -#endif - if (JNI_FALSE != env->ExceptionCheck()) { env->ExceptionClear(); OSL_ENSURE(0,"ExceptionClear"); } OSL_ENSURE(buf,"buf is NULL"); - if ( buf ) + if ( buf && len > 0 && len <= env->GetArrayLength(buffer)) { Sequence< ::sal_Int8 > aData(buf + off,len); - xOut->writeBytes(aData); env->ReleaseByteArrayElements(buffer, buf, JNI_ABORT); + xOut->writeBytes(aData); #ifdef HSQLDB_DBG if ( logger ) logger->write( aData.getConstArray(), len ); diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index afb4d0da2640..fe4e5d9ca12e 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -61,13 +61,14 @@ namespace connectivity { try { - m_xStream.clear(); - m_xSeek.clear(); + m_xStream.clear(); + m_xSeek.clear(); if ( m_xInputStream.is() ) { m_xInputStream->closeInput(); - m_xInputStream.clear(); + m_xInputStream.clear(); } + /* this is done implicity by the closing of the input stream if ( m_xOutputStream.is() ) { m_xOutputStream->closeOutput(); @@ -83,11 +84,13 @@ namespace connectivity OSL_UNUSED( e ); OSL_ENSURE(0,"Could not dispose OutputStream"); } - m_xOutputStream.clear(); + m_xOutputStream.clear(); } + */ } - catch(Exception& ) + catch(Exception& ex) { + OSL_UNUSED( ex ); OSL_ENSURE(0,"Exception catched!"); } } -- cgit From 8300ef8db57da4dbf65a5b10323e1c909c41490b Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 8 Jul 2010 12:46:25 +0200 Subject: dba33g: assertion when closing stream, only close either the input stream or output stream --- connectivity/source/drivers/hsqldb/HStorageMap.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx index fe4e5d9ca12e..57ed88b1dda8 100644 --- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx +++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx @@ -68,8 +68,8 @@ namespace connectivity m_xInputStream->closeInput(); m_xInputStream.clear(); } - /* this is done implicity by the closing of the input stream - if ( m_xOutputStream.is() ) + // this is done implicity by the closing of the input stream + else if ( m_xOutputStream.is() ) { m_xOutputStream->closeOutput(); try @@ -86,7 +86,6 @@ namespace connectivity } m_xOutputStream.clear(); } - */ } catch(Exception& ex) { -- cgit From dd6ba6b64aec20d37a402bee233e742e29285e88 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 8 Jul 2010 21:33:48 +0200 Subject: mib17: #162917# let basic byte use one byte, let olebridge convert sequence to safearray correctly --- basic/source/classes/sbunoobj.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 basic/source/classes/sbunoobj.cxx diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx old mode 100644 new mode 100755 index e51a0c09270b..df13bc7ec571 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -911,7 +911,7 @@ Type getUnoTypeForSbxBaseType( SbxDataType eType ) case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break; //case SbxDATAOBJECT: break; case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break; - case SbxBYTE: aRetType = ::getCppuType( (sal_Int16*)0 ); break; + case SbxBYTE: aRetType = ::getCppuType( (sal_Int8*)0 ); break; case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; //case SbxLONG64: break; -- cgit From 47ad9825590f931c574f83602b0745a122a79485 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 8 Jul 2010 22:10:20 +0200 Subject: hg commig -mmib17: --- vbahelper/source/msforms/vbacontrols.cxx | 20 ++++++++++++++------ vbahelper/source/msforms/vbauserform.cxx | 4 +++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx index b7fad7d9372d..8d01687ef905 100644 --- a/vbahelper/source/msforms/vbacontrols.cxx +++ b/vbahelper/source/msforms/vbacontrols.cxx @@ -74,12 +74,20 @@ private: public: ControlArrayWrapper( const uno::Reference< awt::XControl >& xDialog ) { - mxDialog.set( xDialog, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls(); + try + { + mxDialog.set( xDialog, uno::UNO_QUERY_THROW ); + uno::Sequence< uno::Reference< awt::XControl > > sXControls = mxDialog->getControls(); - msNames.realloc( sXControls.getLength() ); - for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i ) - SetArrayElementTo( sXControls[ i ], i ); + msNames.realloc( sXControls.getLength() ); + for ( sal_Int32 i = 0; i < sXControls.getLength(); ++i ) + SetArrayElementTo( sXControls[ i ], i ); + } + catch( uno::Exception& ) + { + // accept the case when the dialog already does not exist + // in this case the wrapper should work in dummy mode + } } static rtl::OUString getControlName( const uno::Reference< awt::XControl >& xCtrl ) @@ -186,7 +194,7 @@ ScVbaControls::ScVbaControls( const uno::Reference< XHelperInterface >& xParent, const css::uno::Reference< awt::XControl >& xDialog ) : ControlsImpl_BASE( xParent, xContext, lcl_controlsWrapper( xDialog ) ) { - mxDialog.set( xDialog, uno::UNO_QUERY_THROW ); + mxDialog.set( xDialog, uno::UNO_QUERY ); } uno::Reference< container::XEnumeration > diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index 1ce403fc19c3..2a4cecfc2338 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -185,7 +185,9 @@ ScVbaUserForm::hasMethod( const ::rtl::OUString& /*aName*/ ) throw (uno::Runtime uno::Any SAL_CALL ScVbaUserForm::Controls( const uno::Any& index ) throw (uno::RuntimeException) { - uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); + // if the dialog already closed we should do nothing, but the VBA will call methods of the Controls objects + // thus we have to provide a dummy object in this case + uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY ); uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, xDialogControl ) ); if ( index.hasValue() ) return uno::makeAny( xControls->Item( index, uno::Any() ) ); -- cgit From cfc1d8bdffb17985e35d8ae5b987acc1de664354 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 9 Jul 2010 07:19:45 +0200 Subject: dba33g: #i110825# applay patch to removed unused code --- connectivity/source/commontools/FValue.cxx | 15 +++++++++++---- connectivity/source/drivers/jdbc/Boolean.cxx | 17 ----------------- connectivity/source/drivers/jdbc/Object.cxx | 8 -------- connectivity/source/drivers/jdbc/String.cxx | 20 -------------------- connectivity/source/inc/java/lang/Boolean.hxx | 1 - connectivity/source/inc/java/lang/Object.hxx | 2 -- connectivity/source/inc/java/lang/String.hxx | 1 - 7 files changed, 11 insertions(+), 53 deletions(-) diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index bb3ce9dbb13b..aca181916b47 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -345,11 +345,18 @@ void ORowSetValue::free() TRACE_FREE( Any ) m_aValue.m_pValue = NULL; break; + case DataType::BIT: + case DataType::TINYINT: + case DataType::SMALLINT: + case DataType::BOOLEAN: + break; default: - OSL_ENSURE(m_aValue.m_pString,"String pointer is null!"); - delete (Any*)m_aValue.m_pValue; - TRACE_FREE( Any ) - m_aValue.m_pValue = NULL; + if ( m_aValue.m_pValue ) + { + delete (Any*)m_aValue.m_pValue; + TRACE_FREE( Any ) + m_aValue.m_pValue = NULL; + } break; } diff --git a/connectivity/source/drivers/jdbc/Boolean.cxx b/connectivity/source/drivers/jdbc/Boolean.cxx index 2df75283a14b..fd52f3092c0e 100644 --- a/connectivity/source/drivers/jdbc/Boolean.cxx +++ b/connectivity/source/drivers/jdbc/Boolean.cxx @@ -49,20 +49,3 @@ jclass java_lang_Boolean::getMyClass() const { return st_getMyClass(); } - -java_lang_Boolean::java_lang_Boolean( sal_Bool _par0 ): java_lang_Object( NULL, (jobject)NULL ) -{ - SDBThreadAttach t; - // Java-Call fuer den Konstruktor absetzen - // temporaere Variable initialisieren - static const char * cSignature = "(Z)V"; - jobject tempObj; - static jmethodID mID(NULL); - obtainMethodId(t.pEnv, "",cSignature, mID); - tempObj = t.pEnv->NewObject( getMyClass(), mID, _par0 ); - saveRef( t.pEnv, tempObj ); - t.pEnv->DeleteLocalRef( tempObj ); - // und aufraeumen -} - - diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 4866781d23dd..4f5670ace8aa 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -166,14 +166,6 @@ void java_lang_Object::saveRef( JNIEnv * pXEnv, jobject myObj ) } -java_lang_Class * java_lang_Object::getClass() -{ - SDBThreadAttach t; - static jmethodID mID(NULL); - jobject out = callObjectMethod(t.pEnv,"getClass","()Ljava/lang/Class;", mID); - return out ? new java_lang_Class( t.pEnv, out ) : NULL; -} - ::rtl::OUString java_lang_Object::toString() const { static jmethodID mID(NULL); diff --git a/connectivity/source/drivers/jdbc/String.cxx b/connectivity/source/drivers/jdbc/String.cxx index e6102fc3a471..f32b0cce4325 100644 --- a/connectivity/source/drivers/jdbc/String.cxx +++ b/connectivity/source/drivers/jdbc/String.cxx @@ -51,26 +51,6 @@ jclass java_lang_String::st_getMyClass() return theClass; } -//-------------------------------------------------------------------------- -java_lang_String::java_lang_String( const ::rtl::OUString& _par0 ): java_lang_Object( NULL, (jobject)NULL ) -{ - SDBThreadAttach t; - if( !t.pEnv ) - return; - jvalue args[1]; - // Parameter konvertieren - args[0].l = convertwchar_tToJavaString(t.pEnv,_par0); - // Java-Call fuer den Konstruktor absetzen - // temporaere Variable initialisieren - static const char * cSignature = "(Ljava/lang/String;)V"; - jobject tempObj; - static jmethodID mID(NULL); - obtainMethodId(t.pEnv, "",cSignature, mID); - tempObj = t.pEnv->NewObjectA( getMyClass(), mID, args ); - saveRef( t.pEnv, tempObj ); - t.pEnv->DeleteLocalRef( tempObj ); - t.pEnv->DeleteLocalRef((jstring)args[0].l); -} //-------------------------------------------------------------------------- java_lang_String::operator ::rtl::OUString() { diff --git a/connectivity/source/inc/java/lang/Boolean.hxx b/connectivity/source/inc/java/lang/Boolean.hxx index f1f8081d9780..35655f8c1934 100644 --- a/connectivity/source/inc/java/lang/Boolean.hxx +++ b/connectivity/source/inc/java/lang/Boolean.hxx @@ -44,7 +44,6 @@ namespace connectivity // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: java_lang_Boolean( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){} - java_lang_Boolean( sal_Bool _par0 ); static jclass st_getMyClass(); }; } diff --git a/connectivity/source/inc/java/lang/Object.hxx b/connectivity/source/inc/java/lang/Object.hxx index f0bacc2ee840..c00c5e67e06d 100644 --- a/connectivity/source/inc/java/lang/Object.hxx +++ b/connectivity/source/inc/java/lang/Object.hxx @@ -118,8 +118,6 @@ namespace connectivity void clearObject(JNIEnv& rEnv); void clearObject(); - java_lang_Class * getClass(); - virtual ::rtl::OUString toString() const; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xFactory; } diff --git a/connectivity/source/inc/java/lang/String.hxx b/connectivity/source/inc/java/lang/String.hxx index 64584dab5e76..3e4bfd6c1399 100644 --- a/connectivity/source/inc/java/lang/String.hxx +++ b/connectivity/source/inc/java/lang/String.hxx @@ -42,7 +42,6 @@ namespace connectivity // ein Konstruktor, der fuer das Returnen des Objektes benoetigt wird: java_lang_String( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){} - java_lang_String( const ::rtl::OUString& _par0 ); operator ::rtl::OUString(); static jclass st_getMyClass(); -- cgit From 4efd2d986e38cd362d6771c175dcfa33a3856c96 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 9 Jul 2010 10:55:23 +0200 Subject: cws tl83: #i113004# crash when spell checking in sd fixed --- editeng/source/editeng/impedit4.cxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) mode change 100755 => 100644 editeng/source/editeng/impedit4.cxx diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx old mode 100755 new mode 100644 index 482cd6d71338..5a54c054016b --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1458,7 +1458,11 @@ Reference< XSpellChecker1 > ImpEditEngine::GetSpeller() SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs ) { - pSpellInfo = new SpellInfo; + if (!pSpellInfo) + pSpellInfo = new SpellInfo; + else + *pSpellInfo = SpellInfo(); // reset to default values + pSpellInfo->bMultipleDoc = bMultipleDocs; EditSelection aSentenceSel( SelectSentence( rSel ) ); // pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() ); @@ -2023,7 +2027,6 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView, #else bool bRet = false; EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() ); - //the pSpellInfo has to be created on demand if(!pSpellInfo) pSpellInfo = CreateSpellInfo( aCurSel, true ); pSpellInfo->aCurSentenceStart = aCurSel.Min(); @@ -2191,8 +2194,12 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, { #ifdef SVX_LIGHT #else + // Note: rNewPortions.size() == 0 is valid and happens when the whole + // sentence got removed in the dialog + DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized"); - if(pSpellInfo) + if (pSpellInfo && + pSpellInfo->aLastSpellPortions.size() > 0) // no portions -> no text to be changed { // get current paragraph length to calculate later on how the sentence length changed, // in order to place the cursor at the end of the sentence again @@ -2202,6 +2209,10 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, UndoActionStart( EDITUNDO_INSERT ); if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size()) { + DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" ); + DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(), + "aLastSpellPortions and aLastSpellContentSelections size mismatch" ); + //the simple case: the same number of elements on both sides //each changed element has to be applied to the corresponding source element svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end(); @@ -2252,6 +2263,8 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, } else { + DBG_ASSERT( pSpellInfo->aLastSpellContentSelections.size() > 0, "aLastSpellContentSelections should not be empty here" ); + //select the complete sentence SpellContentSelections::const_iterator aCurrentEndPosition = pSpellInfo->aLastSpellContentSelections.end(); --aCurrentEndPosition; -- cgit From 084fbb9e5e3c5cba2f00b7eaf9dad5b61ff62b6f Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 9 Jul 2010 14:49:18 +0200 Subject: dba33g: #i112213# handle chart import for columns --- connectivity/source/drivers/ado/AResultSet.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connectivity/source/drivers/ado/AResultSet.cxx b/connectivity/source/drivers/ado/AResultSet.cxx index c71d620d527c..0c5db12c3355 100644 --- a/connectivity/source/drivers/ado/AResultSet.cxx +++ b/connectivity/source/drivers/ado/AResultSet.cxx @@ -692,6 +692,10 @@ void SAL_CALL OResultSet::cancelRowUpdates( ) throw(SQLException, RuntimeExcept void SAL_CALL OResultSet::moveToInsertRow( ) throw(SQLException, RuntimeException) { + // ::osl::MutexGuard aGuard( m_aMutex ); + //checkDisposed(OResultSet_BASE::rBHelper.bDisposed); + // if ( getResultSetConcurrency() == ResultSetConcurrency::READ_ONLY ) + // throw SQLException(); } // ------------------------------------------------------------------------- @@ -977,7 +981,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& ro sal_Int32 OResultSet::getResultSetConcurrency() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { - sal_Int32 nValue=0; + sal_Int32 nValue=ResultSetConcurrency::READ_ONLY; LockTypeEnum eRet; if(!SUCCEEDED(m_pRecordSet->get_LockType(&eRet))) { -- cgit From bb51dc29f50476471308159c97c25fa059dcd17a Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Sat, 10 Jul 2010 17:13:52 +0200 Subject: mib17: #i110746# fixed memory leaks --- vbahelper/inc/vbahelper/vbaglobalbase.hxx | 4 +-- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 1 - vbahelper/source/vbahelper/vbaglobalbase.cxx | 33 ++++++++++++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/vbahelper/inc/vbahelper/vbaglobalbase.hxx b/vbahelper/inc/vbahelper/vbaglobalbase.hxx index e75cbb7e7af8..61aaa1d65657 100644 --- a/vbahelper/inc/vbahelper/vbaglobalbase.hxx +++ b/vbahelper/inc/vbahelper/vbaglobalbase.hxx @@ -32,16 +32,16 @@ typedef InheritedHelperInterfaceImpl1< ov::XGlobalsBase > Globals_BASE; class VBAHELPER_DLLPUBLIC VbaGlobalsBase : public Globals_BASE - { protected: + rtl::OUString msDocCtxName; bool hasServiceName( const rtl::OUString& serviceName ); void init( const css::uno::Sequence< css::beans::PropertyValue >& aInitArgs ); public: VbaGlobalsBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName ); - virtual ~VbaGlobalsBase(){}; + virtual ~VbaGlobalsBase(); // XMultiServiceFactory virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw (css::uno::Exception, css::uno::RuntimeException); virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) throw (css::uno::Exception, css::uno::RuntimeException); diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 213133998def..8af75a6bd043 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -182,7 +182,6 @@ VbaApplicationBase::VbaApplicationBase( const uno::Reference< uno::XComponentCon VbaApplicationBase::~VbaApplicationBase() { - m_pImpl = 0; delete m_pImpl; } diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index b4b39344fd61..e0df37583df5 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -41,19 +41,44 @@ rtl::OUString sAppService( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Application") ); VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const rtl::OUString& sDocCtxName ) -: Globals_BASE( xParent, xContext ) +: Globals_BASE( xParent, xContext ), msDocCtxName( sDocCtxName ) { // overwrite context with custom one ( that contains the application ) + // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least thats what the code appears like it wants to do ) + uno::Any aSrvMgr; + if ( xContext.is() && xContext->getServiceManager().is() ) + { + aSrvMgr = uno::makeAny( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.stoc.OServiceManagerWrapper") ), xContext ) ); + } + ::cppu::ContextEntry_Init aHandlerContextInfo[] = { ::cppu::ContextEntry_Init( sApplication, uno::Any() ), ::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ), + ::cppu::ContextEntry_Init( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.lang.theServiceManager" ) ), aSrvMgr ) }; - - mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), xContext ); - + // don't pass a delegate, this seems to introduce yet another cyclic dependency ( and + // some strange behavior + mxContext = ::cppu::createComponentContext( aHandlerContextInfo, sizeof( aHandlerContextInfo ) / sizeof( aHandlerContextInfo[0] ), NULL ); } +VbaGlobalsBase::~VbaGlobalsBase() +{ + try + { + uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); + if ( xNameContainer.is() ) + { + // release document reference ( we don't wan't the component context trying to dispose that ) + xNameContainer->removeByName( msDocCtxName ); + // release application reference, as it is holding onto the context + xNameContainer->removeByName( sApplication ); + } + } + catch ( const uno::Exception& ) + { + } +} void VbaGlobalsBase::init( const uno::Sequence< beans::PropertyValue >& aInitArgs ) -- cgit From f24b1da07ebfbc95e76af93fc9c7133f7d52daa5 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 10 Jul 2010 18:21:24 +0200 Subject: CWS changehid: #i111874#: change code to support HelpIds as byte strings --- avmedia/inc/helpids.hrc | 24 +- avmedia/source/framework/mediacontrol.cxx | 36 +- avmedia/source/framework/mediaplayer.cxx | 3 +- avmedia/source/viewer/mediawindow_impl.cxx | 3 +- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 18 +- .../source/deployment/gui/dp_gui_extlistbox.cxx | 3 +- desktop/source/deployment/gui/license_dialog.cxx | 3 +- desktop/source/inc/helpid.hrc | 69 +- desktop/source/migration/wizard.cxx | 12 +- editeng/inc/helpid.hrc | 64 +- editeng/source/editeng/editview.cxx | 6 +- editeng/source/misc/svxacorr.cxx | 31 +- formula/inc/formula/IFunctionDescription.hxx | 2 +- formula/inc/formula/formdata.hxx | 1 - formula/inc/formula/formula.hxx | 6 +- formula/inc/helpids.hrc | 46 +- formula/source/ui/dlg/FormulaHelper.cxx | 2 +- formula/source/ui/dlg/formula.cxx | 34 +- formula/source/ui/dlg/funcpage.cxx | 10 +- formula/source/ui/dlg/funcpage.hxx | 1 - formula/source/ui/dlg/funcutl.cxx | 2 - formula/source/ui/dlg/parawin.cxx | 20 +- fpicker/source/office/OfficeControlAccess.cxx | 22 +- fpicker/source/office/iodlg.cxx | 74 +- fpicker/source/office/iodlg.hrc | 32 +- framework/inc/helpid.hrc | 16 +- framework/inc/uielement/commandinfo.hxx | 2 + framework/inc/uielement/toolbarmerger.hxx | 1 + framework/inc/uielement/toolbarsmenucontroller.hxx | 2 +- framework/source/services/backingcomp.cxx | 3 +- framework/source/services/menudocumenthandler.cxx | 903 --------------------- .../source/uielement/macrosmenucontroller.cxx | 9 +- framework/source/uielement/menubarmanager.cxx | 5 - framework/source/uielement/statusbarmanager.cxx | 11 - framework/source/uielement/statusbarwrapper.cxx | 3 +- framework/source/uielement/toolbarmanager.cxx | 13 +- framework/source/uielement/toolbarmerger.cxx | 12 +- .../source/uielement/toolbarsmenucontroller.cxx | 18 +- idl/source/prj/command.cxx | 2 + sfx2/inc/sfx2/basedlgs.hxx | 3 - sfx2/inc/sfx2/dispatch.hxx | 4 +- sfx2/inc/sfx2/filedlghelper.hxx | 2 +- sfx2/inc/sfx2/mnumgr.hxx | 2 +- sfx2/inc/sfx2/msg.hxx | 5 + sfx2/inc/sfx2/opengrf.hxx | 2 +- sfx2/inc/sfx2/sfxcommands.h | 345 ++++++++ sfx2/inc/sfx2/sfxdlg.hxx | 4 +- sfx2/inc/sfxhelp.hxx | 13 +- sfx2/sdi/sfx.sdi | 2 +- sfx2/source/appl/app.src | 163 ---- sfx2/source/appl/appserv.cxx | 9 +- sfx2/source/appl/newhelp.cxx | 59 +- sfx2/source/appl/opengrf.cxx | 2 +- sfx2/source/appl/sfxhelp.cxx | 367 +++------ sfx2/source/control/dispatch.cxx | 25 +- sfx2/source/control/msg.cxx | 15 +- sfx2/source/dialog/about.cxx | 4 +- sfx2/source/dialog/basedlgs.cxx | 45 +- sfx2/source/dialog/dialog.hrc | 1 - sfx2/source/dialog/dialog.src | 17 +- sfx2/source/dialog/dockwin.cxx | 56 +- sfx2/source/dialog/filedlghelper.cxx | 37 +- sfx2/source/dialog/filedlgimpl.hxx | 4 +- sfx2/source/dialog/navigat.cxx | 3 +- sfx2/source/dialog/newstyle.src | 3 +- sfx2/source/dialog/tabdlg.cxx | 20 +- sfx2/source/dialog/templdlg.cxx | 61 +- sfx2/source/dialog/templdlg.src | 4 +- sfx2/source/doc/doc.hrc | 1 - sfx2/source/doc/doc.src | 8 - sfx2/source/doc/doctdlg.src | 3 +- sfx2/source/doc/docvor.cxx | 5 +- sfx2/source/doc/docvor.src | 2 +- sfx2/source/doc/iframe.cxx | 2 +- sfx2/source/doc/new.cxx | 3 +- sfx2/source/doc/new.src | 4 +- sfx2/source/doc/objcont.cxx | 11 - sfx2/source/doc/querytemplate.cxx | 5 +- sfx2/source/inc/helpid.hrc | 623 +++++++------- sfx2/source/menu/menu.src | 7 +- sfx2/source/menu/mnumgr.cxx | 7 +- sfx2/source/menu/virtmenu.cxx | 26 +- sfx2/source/statbar/stbitem.cxx | 5 + sfx2/source/toolbox/tbxitem.cxx | 3 +- sfx2/source/view/frame2.cxx | 11 +- svx/inc/fmhelp.hrc | 142 ++-- svx/inc/globlmn_tmpl.hrc | 187 +---- svx/inc/helpid.hrc | 495 ++++++----- svx/inc/svx/dialogs.hrc | 4 - svx/inc/svx/exthelpid.hrc | 13 +- svx/inc/svx/simptabl.hxx | 3 +- svx/inc/svx/svxcommands.h | 604 ++++++++++++++ svx/inc/svx/svxdlg.hxx | 8 +- svx/prj/d.lst | 1 + svx/source/dialog/bmpmask.src | 2 +- svx/source/dialog/ctredlin.cxx | 15 +- svx/source/dialog/dlgctl3d.cxx | 9 +- svx/source/dialog/fontwork.src | 2 +- svx/source/dialog/hyprlink.src | 4 +- svx/source/dialog/srchdlg.cxx | 2 +- svx/source/dialog/srchdlg.src | 3 +- svx/source/engine3d/float3d.src | 4 +- svx/source/fmcomp/fmgridif.cxx | 5 +- svx/source/fmcomp/gridctrl.cxx | 21 +- svx/source/fmcomp/gridctrl.src | 44 +- svx/source/form/datanavi.cxx | 3 +- svx/source/form/filtnav.cxx | 6 +- svx/source/form/filtnav.src | 4 - svx/source/form/fmPropBrw.cxx | 3 +- svx/source/form/fmexpl.cxx | 3 +- svx/source/form/fmexpl.src | 62 +- svx/source/form/formshell.src | 6 +- svx/source/form/navigatortree.cxx | 3 +- svx/source/form/tabwin.cxx | 6 +- svx/source/form/tbxform.cxx | 3 +- svx/source/gallery2/galbrws1.cxx | 6 +- svx/source/gallery2/galbrws2.cxx | 6 +- svx/source/gallery2/galctrl.cxx | 12 +- svx/source/gallery2/gallery.src | 2 +- svx/source/stbctrls/insctrl.cxx | 2 - svx/source/stbctrls/pszctrl.cxx | 20 +- svx/source/stbctrls/xmlsecctrl.cxx | 8 +- svx/source/tbxctrls/extrusioncontrols.cxx | 36 +- svx/source/tbxctrls/fillctrl.cxx | 6 +- svx/source/tbxctrls/fontworkgallery.cxx | 24 +- svx/source/tbxctrls/grafctrl.cxx | 5 +- svx/source/tbxctrls/linectrl.cxx | 6 +- svx/source/tbxctrls/makefile.mk | 1 - svx/source/tbxctrls/tbcontrl.cxx | 12 +- svx/source/tbxctrls/tbxdraw.src | 265 ------ svx/source/toolbars/extrusionbar.src | 59 -- svx/source/toolbars/fontworkbar.src | 34 - .../chinese_dictionarydialog.cxx | 18 +- .../chinese_translationdialog.cxx | 9 +- uui/source/ids.hrc | 25 +- 135 files changed, 2282 insertions(+), 3468 deletions(-) delete mode 100644 framework/source/services/menudocumenthandler.cxx create mode 100644 sfx2/inc/sfx2/sfxcommands.h create mode 100644 svx/inc/svx/svxcommands.h delete mode 100644 svx/source/tbxctrls/tbxdraw.src diff --git a/avmedia/inc/helpids.hrc b/avmedia/inc/helpids.hrc index 2d7ccd764762..902230466053 100644 --- a/avmedia/inc/helpids.hrc +++ b/avmedia/inc/helpids.hrc @@ -30,17 +30,17 @@ #include -#define HID_AVMEDIA_TOOLBOXITEM_PLAY (HID_AVMEDIA_START+0) -#define HID_AVMEDIA_TOOLBOXITEM_PAUSE (HID_AVMEDIA_START+1) -#define HID_AVMEDIA_TOOLBOXITEM_STOP (HID_AVMEDIA_START+2) -#define HID_AVMEDIA_TOOLBOXITEM_MUTE (HID_AVMEDIA_START+3) -#define HID_AVMEDIA_TOOLBOXITEM_LOOP (HID_AVMEDIA_START+4) -#define HID_AVMEDIA_TOOLBOXITEM_OPEN (HID_AVMEDIA_START+5) -#define HID_AVMEDIA_TOOLBOXITEM_INSERT (HID_AVMEDIA_START+6) -#define HID_AVMEDIA_ZOOMLISTBOX (HID_AVMEDIA_START+7) -#define HID_AVMEDIA_TIMESLIDER (HID_AVMEDIA_START+8) -#define HID_AVMEDIA_TIMEEDIT (HID_AVMEDIA_START+9) -#define HID_AVMEDIA_VOLUMESLIDER (HID_AVMEDIA_START+10) -#define HID_AVMEDIA_PLAYERWINDOW (HID_AVMEDIA_START+11) +#define HID_AVMEDIA_TOOLBOXITEM_PLAY "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PLAY" +#define HID_AVMEDIA_TOOLBOXITEM_PAUSE "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PAUSE" +#define HID_AVMEDIA_TOOLBOXITEM_STOP "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_STOP" +#define HID_AVMEDIA_TOOLBOXITEM_MUTE "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_MUTE" +#define HID_AVMEDIA_TOOLBOXITEM_LOOP "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_LOOP" +#define HID_AVMEDIA_TOOLBOXITEM_OPEN "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_OPEN" +#define HID_AVMEDIA_TOOLBOXITEM_INSERT "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_INSERT" +#define HID_AVMEDIA_ZOOMLISTBOX "AVMEDIA_HID_AVMEDIA_ZOOMLISTBOX" +#define HID_AVMEDIA_TIMESLIDER "AVMEDIA_HID_AVMEDIA_TIMESLIDER" +#define HID_AVMEDIA_TIMEEDIT "AVMEDIA_HID_AVMEDIA_TIMEEDIT" +#define HID_AVMEDIA_VOLUMESLIDER "AVMEDIA_HID_AVMEDIA_VOLUMESLIDER" +#define HID_AVMEDIA_PLAYERWINDOW "AVMEDIA_HID_AVMEDIA_PLAYERWINDOW" #endif // _AVMEDIA_HELPIDS_HRC diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx index 781f2b7d290d..a71b5268abd7 100644 --- a/avmedia/source/framework/mediacontrol.cxx +++ b/avmedia/source/framework/mediacontrol.cxx @@ -94,12 +94,10 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, implGetImage( AVMEDIA_IMG_OPEN ), String( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, ""/*HID_AVMEDIA_TOOLBOXITEM_OPEN*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, implGetImage( AVMEDIA_IMG_INSERT ), String( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, ""/*HID_AVMEDIA_TOOLBOXITEM_INSERT*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT ); maPlayToolBox.InsertSeparator(); } @@ -119,22 +117,18 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : } maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, implGetImage( AVMEDIA_IMG_PLAY ), String( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), TIB_CHECKABLE ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, ""/*HID_AVMEDIA_TOOLBOXITEM_PLAY*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, implGetImage( AVMEDIA_IMG_PAUSE ), String( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), TIB_CHECKABLE ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, ""/*HID_AVMEDIA_TOOLBOXITEM_PAUSE*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE ); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_STOP, implGetImage( AVMEDIA_IMG_STOP ), String( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), TIB_CHECKABLE ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, ""/*HID_AVMEDIA_TOOLBOXITEM_STOP*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP ); maPlayToolBox.InsertSeparator(); maPlayToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, implGetImage( AVMEDIA_IMG_ENDLESS ), String( AVMEDIA_RESID( AVMEDIA_STR_ENDLESS ) ) ); - // FIXME: HELPID - maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, ""/*HID_AVMEDIA_TOOLBOXITEM_LOOP*/ ); + maPlayToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP ); if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle ) maPlayToolBox.InsertSeparator(); @@ -147,8 +141,7 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maTimeSlider.SetSlideHdl( LINK( this, MediaControl, implTimeHdl ) ); maTimeSlider.SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) ); maTimeSlider.SetRange( Range( 0, AVMEDIA_TIME_RANGE ) ); - // FIXME: HELPID - maTimeSlider.SetHelpId( ""/*HID_AVMEDIA_TIMESLIDER*/ ); + maTimeSlider.SetHelpId( HID_AVMEDIA_TIMESLIDER ); maTimeSlider.SetUpdateMode( true ); maTimeSlider.SetSizePixel( Size( 128, maPlayToolBox.GetSizePixel().Height() ) ); maTimeSlider.Show(); @@ -158,8 +151,7 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maTimeEdit.SetUpdateMode( true ); maTimeEdit.SetSizePixel( Size( maTimeEdit.GetTextWidth( aTimeText ) + 8, maPlayToolBox.GetSizePixel().Height() ) ); maTimeEdit.SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() ); - // FIXME: HELPID - maTimeEdit.SetHelpId( ""/*HID_AVMEDIA_TIMEEDIT*/ ); + maTimeEdit.SetHelpId( HID_AVMEDIA_TIMEEDIT ); maTimeEdit.Disable(); maTimeEdit.Show(); maMinSize.Width() += maTimeEdit.GetSizePixel().Width(); @@ -168,8 +160,7 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maMuteToolBox.InsertSeparator(); maMuteToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, implGetImage( AVMEDIA_IMG_MUTE ), String( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) ); - // FIXME: HELPID - maMuteToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, ""/*HID_AVMEDIA_TOOLBOXITEM_MUTE*/ ); + maMuteToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE ); maMuteToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); maMuteToolBox.SetSizePixel( maMuteToolBox.CalcWindowSizePixel() ); @@ -180,8 +171,7 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : maVolumeSlider.SetEndSlideHdl( LINK( this, MediaControl, implVolumeEndHdl ) ); maVolumeSlider.SetRange( Range( AVMEDIA_DB_RANGE, 0 ) ); maVolumeSlider.SetUpdateMode( true ); - // FIXME: HELPID - maVolumeSlider.SetHelpId( ""/*HID_AVMEDIA_VOLUMESLIDER*/ ); + maVolumeSlider.SetHelpId( HID_AVMEDIA_VOLUMESLIDER ); maVolumeSlider.SetSizePixel( Size( 48, maPlayToolBox.GetSizePixel().Height() ) ); maVolumeSlider.Show(); maMinSize.Width() += maVolumeSlider.GetSizePixel().Width(); @@ -192,12 +182,10 @@ MediaControl::MediaControl( Window* pParent, MediaControlStyle eControlStyle ) : mpZoomListBox->InsertEntry( String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_200 ) ), AVMEDIA_ZOOMLEVEL_200 ); mpZoomListBox->InsertEntry( String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_FIT ) ), AVMEDIA_ZOOMLEVEL_FIT ); mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) ); - // FIXME: HELPID - mpZoomListBox->SetHelpId( ""/*HID_AVMEDIA_ZOOMLISTBOX*/ ); + mpZoomListBox->SetHelpId( HID_AVMEDIA_ZOOMLISTBOX ); maZoomToolBox.InsertItem( AVMEDIA_TOOLBOXITEM_ZOOM, String( AVMEDIA_RESID( AVMEDIA_STR_ZOOM ) ) ); - // FIXME: HELPID - maZoomToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, ""/*HID_AVMEDIA_ZOOMLISTBOX*/ ); + maZoomToolBox.SetHelpId( AVMEDIA_TOOLBOXITEM_ZOOM, HID_AVMEDIA_ZOOMLISTBOX ); maZoomToolBox.SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, mpZoomListBox ); maZoomToolBox.SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) ); diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index c66f88817fe3..caab783c6a7c 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -124,8 +124,7 @@ void MediaFloater::ToggleFloatingMode() Window* pWindow = mpMediaWindow->getWindow(); if( pWindow ) - // FIXME: HELPID - pWindow->SetHelpId( ""/*HID_AVMEDIA_PLAYERWINDOW*/ ); + pWindow->SetHelpId( HID_AVMEDIA_PLAYERWINDOW ); mpMediaWindow->show(); } diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 14d174beec80..553eea6196c1 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -179,8 +179,7 @@ MediaWindowImpl::MediaWindowImpl( Window* pParent, MediaWindow* pMediaWindow, bo mpEmptyBmpEx( NULL ), mpAudioBmpEx( NULL ) { - // FIXME: HELPID - maChildWindow.SetHelpId( ""/*HID_AVMEDIA_PLAYERWINDOW*/ ); + maChildWindow.SetHelpId( HID_AVMEDIA_PLAYERWINDOW ); maChildWindow.Hide(); if( mpMediaWindowControl ) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index fa61c437e1ba..2d0733dfbae3 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -183,14 +183,10 @@ ExtBoxWithBtns_Impl::ExtBoxWithBtns_Impl( ExtMgrDialog* pParent, TheExtensionMan m_pEnableBtn = new PushButton( this, WB_TABSTOP ); m_pRemoveBtn = new PushButton( this, WB_TABSTOP ); - // FIXME: HELPID - SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX*/ ); - // FIXME: HELPID - m_pOptionsBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_OPTIONS*/ ); - // FIXME: HELPID - m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_DISABLE*/ ); - // FIXME: HELPID - m_pRemoveBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_REMOVE*/ ); + SetHelpId( HID_EXTENSION_MANAGER_LISTBOX ); + m_pOptionsBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_OPTIONS ); + m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE ); + m_pRemoveBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_REMOVE ); m_pOptionsBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleOptionsBtn ) ); m_pEnableBtn->SetClickHdl( LINK( this, ExtBoxWithBtns_Impl, HandleEnableBtn ) ); @@ -298,14 +294,12 @@ void ExtBoxWithBtns_Impl::SetButtonStatus( const TEntry_Impl pEntry ) if ( ( pEntry->m_eState == REGISTERED ) || ( pEntry->m_eState == NOT_AVAILABLE ) ) { m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); - // FIXME: HELPID - m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_DISABLE*/ ); + m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_DISABLE ); } else { m_pEnableBtn->SetText( DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); - // FIXME: HELPID - m_pEnableBtn->SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX_ENABLE*/ ); + m_pEnableBtn->SetHelpId( HID_EXTENSION_MANAGER_LISTBOX_ENABLE ); } if ( ( pEntry->m_eState == NOT_AVAILABLE ) || pEntry->m_bMissingDeps ) diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 3e5db094d032..2e02a90f59fd 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -186,8 +186,7 @@ ExtensionBox_Impl::ExtensionBox_Impl( Dialog* pParent, TheExtensionManager *pMan m_pScrollBar( NULL ), m_pManager( pManager ) { - // FIXME: HELPID - SetHelpId( ""/*HID_EXTENSION_MANAGER_LISTBOX*/ ); + SetHelpId( HID_EXTENSION_MANAGER_LISTBOX ); m_pScrollBar = new ScrollBar( this, WB_VERT ); m_pScrollBar->SetScrollHdl( LINK( this, ExtensionBox_Impl, ScrollHdl ) ); diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 9e837f235db1..50992eb07a97 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -221,8 +221,7 @@ LicenseDialogImpl::LicenseDialogImpl( FreeResource(); - // FIXME: HELPID - m_acceptButton.SetUniqueId(""/*UID_BTN_LICENSE_ACCEPT*/); + m_acceptButton.SetUniqueId(UID_BTN_LICENSE_ACCEPT); m_fiArrow1.Show(true); m_fiArrow2.Show(false); m_mlLicense.SetText(sLicenseText); diff --git a/desktop/source/inc/helpid.hrc b/desktop/source/inc/helpid.hrc index 2619c4398881..1dfae71768b3 100644 --- a/desktop/source/inc/helpid.hrc +++ b/desktop/source/inc/helpid.hrc @@ -30,49 +30,40 @@ #include "svl/solar.hrc" -#define HID_GLOBAL_FALLBACK 0xFFFFFFFF +#define HID_PACKAGE_MANAGER "DESKTOP_HID_PACKAGE_MANAGER" +#define HID_PACKAGE_MANAGER_TREELISTBOX "DESKTOP_HID_PACKAGE_MANAGER_TREELISTBOX" +#define HID_PACKAGE_MANAGER_PROGRESS "DESKTOP_HID_PACKAGE_MANAGER_PROGRESS" +#define HID_PACKAGE_MANAGER_PROGRESS_CANCEL "DESKTOP_HID_PACKAGE_MANAGER_PROGRESS_CANCEL" +#define HID_PACKAGE_MANAGER_MENU_ITEM "DESKTOP_HID_PACKAGE_MANAGER_MENU_ITEM" -#define HID_PACKAGE_MANAGER (HID_DESKTOP_START + 0) -#define HID_PACKAGE_MANAGER_TREELISTBOX (HID_DESKTOP_START + 1) -#define HID_PACKAGE_MANAGER_PROGRESS (HID_DESKTOP_START + 2) -#define HID_PACKAGE_MANAGER_PROGRESS_CANCEL (HID_DESKTOP_START + 3) -#define HID_PACKAGE_MANAGER_MENU_ITEM (HID_DESKTOP_START + 4) +#define HID_FIRSTSTART_DIALOG "DESKTOP_HID_FIRSTSTART_DIALOG" +#define HID_FIRSTSTART_WELCOME "DESKTOP_HID_FIRSTSTART_WELCOME" +#define HID_FIRSTSTART_LICENSE "DESKTOP_HID_FIRSTSTART_LICENSE" +#define HID_FIRSTSTART_MIGRATION "DESKTOP_HID_FIRSTSTART_MIGRATION" +#define HID_FIRSTSTART_REGISTRATION "DESKTOP_HID_FIRSTSTART_REGISTRATION" +#define HID_FIRSTSTART_USER "DESKTOP_HID_FIRSTSTART_USER" +#define HID_FIRSTSTART_PREV "DESKTOP_HID_FIRSTSTART_PREV" +#define HID_FIRSTSTART_NEXT "DESKTOP_HID_FIRSTSTART_NEXT" +#define HID_FIRSTSTART_CANCEL "DESKTOP_HID_FIRSTSTART_CANCEL" +#define HID_FIRSTSTART_FINISH "DESKTOP_HID_FIRSTSTART_FINISH" +#define UID_FIRSTSTART_HELP "DESKTOP_UID_FIRSTSTART_HELP" +#define UID_BTN_LICENSE_ACCEPT "DESKTOP_UID_BTN_LICENSE_ACCEPT" +#define HID_FIRSTSTART_UPDATE_CHECK "DESKTOP_HID_FIRSTSTART_UPDATE_CHECK" +#define HID_DEPLOYMENT_GUI_UPDATE "DESKTOP_HID_DEPLOYMENT_GUI_UPDATE" +#define HID_DEPLOYMENT_GUI_UPDATEINSTALL "DESKTOP_HID_DEPLOYMENT_GUI_UPDATEINSTALL" +#define HID_DEPLOYMENT_GUI_UPDATE_PUBLISHER "DESKTOP_HID_DEPLOYMENT_GUI_UPDATE_PUBLISHER" +#define HID_DEPLOYMENT_GUI_UPDATE_RELEASENOTES "DESKTOP_HID_DEPLOYMENT_GUI_UPDATE_RELEASENOTES" +#define HID_DEPLOYMENT_GUI_UPDATE_AVAILABLE_UPDATES "DESKTOP_HID_DEPLOYMENT_GUI_UPDATE_AVAILABLE_UPDATES" -#define HID_FIRSTSTART_DIALOG (HID_DESKTOP_START + 5) -#define HID_FIRSTSTART_WELCOME (HID_DESKTOP_START + 6) -#define HID_FIRSTSTART_LICENSE (HID_DESKTOP_START + 7) -#define HID_FIRSTSTART_MIGRATION (HID_DESKTOP_START + 8) -#define HID_FIRSTSTART_REGISTRATION (HID_DESKTOP_START + 9) -#define HID_FIRSTSTART_USER (HID_DESKTOP_START + 10) -#define HID_FIRSTSTART_PREV (HID_DESKTOP_START + 11) -#define HID_FIRSTSTART_NEXT (HID_DESKTOP_START + 12) -#define HID_FIRSTSTART_CANCEL (HID_DESKTOP_START + 13) -#define HID_FIRSTSTART_FINISH (HID_DESKTOP_START + 14) -#define UID_FIRSTSTART_HELP (HID_DESKTOP_START + 15) -#define UID_BTN_LICENSE_ACCEPT (HID_DESKTOP_START + 16) -#define HID_FIRSTSTART_UPDATE_CHECK (HID_DESKTOP_START + 17) -#define HID_DEPLOYMENT_GUI_UPDATE (HID_DESKTOP_START + 18) -#define HID_DEPLOYMENT_GUI_UPDATEINSTALL (HID_DESKTOP_START + 19) -#define HID_DEPLOYMENT_GUI_UPDATE_PUBLISHER (HID_DESKTOP_START + 20) -#define HID_DEPLOYMENT_GUI_UPDATE_RELEASENOTES (HID_DESKTOP_START + 21) -#define HID_DEPLOYMENT_GUI_UPDATE_AVAILABLE_UPDATES (HID_DESKTOP_START + 22) +#define HID_EXTENSION_MANAGER_LISTBOX "DESKTOP_HID_EXTENSION_MANAGER_LISTBOX" +#define HID_EXTENSION_MANAGER_LISTBOX_OPTIONS "DESKTOP_HID_EXTENSION_MANAGER_LISTBOX_OPTIONS" +#define HID_EXTENSION_MANAGER_LISTBOX_ENABLE "DESKTOP_HID_EXTENSION_MANAGER_LISTBOX_ENABLE" +#define HID_EXTENSION_MANAGER_LISTBOX_DISABLE "DESKTOP_HID_EXTENSION_MANAGER_LISTBOX_DISABLE" +#define HID_EXTENSION_MANAGER_LISTBOX_REMOVE "DESKTOP_HID_EXTENSION_MANAGER_LISTBOX_REMOVE" -#define HID_EXTENSION_MANAGER_LISTBOX (HID_DESKTOP_START + 23) -#define HID_EXTENSION_MANAGER_LISTBOX_OPTIONS (HID_DESKTOP_START + 24) -#define HID_EXTENSION_MANAGER_LISTBOX_ENABLE (HID_DESKTOP_START + 25) -#define HID_EXTENSION_MANAGER_LISTBOX_DISABLE (HID_DESKTOP_START + 26) -#define HID_EXTENSION_MANAGER_LISTBOX_REMOVE (HID_DESKTOP_START + 27) +#define HID_EXTENSION_DEPENDENCIES "DESKTOP_HID_EXTENSION_DEPENDENCIES" -#define HID_EXTENSION_DEPENDENCIES (HID_DESKTOP_START + 28) - -#define HID_PACKAGE_MANAGER_UPD_REQ (HID_DESKTOP_START + 29) - -#define ACT_DESKTOP_HID_END HID_PACKAGE_MANAGER_UPD_REQ - -// check bounds: -#if ACT_DESKTOP_HID_END > HID_DESKTOP_END -#error Resource overflow in #line, #file -#endif +#define HID_PACKAGE_MANAGER_UPD_REQ "DESKTOP_HID_PACKAGE_MANAGER_UPD_REQ" #endif diff --git a/desktop/source/migration/wizard.cxx b/desktop/source/migration/wizard.cxx index 3169386db192..48ee2abc71ca 100644 --- a/desktop/source/migration/wizard.cxx +++ b/desktop/source/migration/wizard.cxx @@ -191,14 +191,10 @@ FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAccep SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT)); //set help id - // FIXME: HELPID - m_pPrevPage->SetHelpId(""/*HID_FIRSTSTART_PREV*/); - // FIXME: HELPID - m_pNextPage->SetHelpId(""/*HID_FIRSTSTART_NEXT*/); - // FIXME: HELPID - m_pCancel->SetHelpId(""/*HID_FIRSTSTART_CANCEL*/); - // FIXME: HELPID - m_pFinish->SetHelpId(""/*HID_FIRSTSTART_FINISH*/); + m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV); + m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT); + m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL); + m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH); // m_pHelp->SetUniqueId(UID_FIRSTSTART_HELP); m_pHelp->Hide(); m_pHelp->Disable(); diff --git a/editeng/inc/helpid.hrc b/editeng/inc/helpid.hrc index 204f97842bf9..4b6a745c4415 100644 --- a/editeng/inc/helpid.hrc +++ b/editeng/inc/helpid.hrc @@ -35,47 +35,31 @@ #include // Help-Ids -------------------------------------------------------------- -#define HID_EDITENG_SPELLER_WORDLANGUAGE (HID_EDIT_START) -#define HID_EDITENG_SPELLER_PARALANGUAGE (HID_EDIT_START + 1) -#define HID_EDITENG_SPELLER_ADDWORD (HID_EDIT_START + 2) -#define HID_EDITENG_SPELLER_AUTOCORRECT (HID_EDIT_START + 3) -#define HID_EDITENG_SPELLER_IGNORE (HID_EDIT_START + 4) -#define HID_EDITENG_SPELLER_START (HID_EDIT_START + 5) -#define HID_AUTOCORR_HELP_END (HID_EDIT_START + 6) -#define HID_AUTOCORR_HELP_START (HID_EDIT_START + 7) -#define HID_AUTOCORR_HELP_WORD HID_AUTOCORR_HELP_START +#define HID_EDITENG_SPELLER_WORDLANGUAGE "EDITENG_HID_EDITENG_SPELLER_WORDLANGUAGE" +#define HID_EDITENG_SPELLER_PARALANGUAGE "EDITENG_HID_EDITENG_SPELLER_PARALANGUAGE" +#define HID_EDITENG_SPELLER_ADDWORD "EDITENG_HID_EDITENG_SPELLER_ADDWORD" +#define HID_EDITENG_SPELLER_AUTOCORRECT "EDITENG_HID_EDITENG_SPELLER_AUTOCORRECT" +#define HID_EDITENG_SPELLER_IGNORE "EDITENG_HID_EDITENG_SPELLER_IGNORE" +#define HID_EDITENG_SPELLER_START "EDITENG_HID_EDITENG_SPELLER_START" -#define HID_AUTOCORR_HELP_SENT (HID_AUTOCORR_HELP_START+1) -#define HID_AUTOCORR_HELP_SENTWORD (HID_AUTOCORR_HELP_START+2) -#define HID_AUTOCORR_HELP_ACORWORD (HID_AUTOCORR_HELP_START+3) - -#define HID_AUTOCORR_HELP_ACORSENTWORD (HID_AUTOCORR_HELP_START+5) - -#define HID_AUTOCORR_HELP_CHGTOENEMDASH (HID_AUTOCORR_HELP_START+7) -#define HID_AUTOCORR_HELP_WORDENEMDASH (HID_AUTOCORR_HELP_START+8) -#define HID_AUTOCORR_HELP_SENTENEMDASH (HID_AUTOCORR_HELP_START+9) -#define HID_AUTOCORR_HELP_SENTWORDENEMDASH (HID_AUTOCORR_HELP_START+10) -#define HID_AUTOCORR_HELP_ACORWORDENEMDASH (HID_AUTOCORR_HELP_START+11) - -#define HID_AUTOCORR_HELP_ACORSENTWORDENEMDASH (HID_AUTOCORR_HELP_START+13) -#define HID_AUTOCORR_HELP_CHGQUOTES (HID_AUTOCORR_HELP_START+15) -#define HID_AUTOCORR_HELP_CHGSGLQUOTES (HID_AUTOCORR_HELP_START+16) -#define HID_AUTOCORR_HELP_SETINETATTR (HID_AUTOCORR_HELP_START+17) -#define HID_AUTOCORR_HELP_INGNOREDOUBLESPACE (HID_AUTOCORR_HELP_START+18) -#define HID_AUTOCORR_HELP_CHGWEIGHTUNDERL (HID_AUTOCORR_HELP_START+19) -#define HID_AUTOCORR_HELP_CHGFRACTIONSYMBOL (HID_AUTOCORR_HELP_START+20) -#define HID_AUTOCORR_HELP_CHGORDINALNUMBER (HID_AUTOCORR_HELP_START+21) // HID_EDIT_START + 28 - -// please adjust ACT_SVX_HID_END2 below if you add entries here! - -// ----------------------------------------------------------------------- -// Overrun check --------------------------------------------------------- -// ----------------------------------------------------------------------- - -#define ACT_SVX_HID_END (HID_EDIT_START+28) -#if ACT_SVX_HID_END > HID_EDIT_END -#error Resource-Ueberlauf in #line, #file -#endif +#define HID_AUTOCORR_HELP_WORD "EDITENG_HID_AUTOCORR_HELP_START" +#define HID_AUTOCORR_HELP_SENT "EDITENG_HID_AUTOCORR_HELP_SENT" +#define HID_AUTOCORR_HELP_SENTWORD "EDITENG_HID_AUTOCORR_HELP_SENTWORD" +#define HID_AUTOCORR_HELP_ACORWORD "EDITENG_HID_AUTOCORR_HELP_ACORWORD" +#define HID_AUTOCORR_HELP_ACORSENTWORD "EDITENG_HID_AUTOCORR_HELP_ACORSENTWORD" +#define HID_AUTOCORR_HELP_CHGTOENEMDASH "EDITENG_HID_AUTOCORR_HELP_CHGTOENEMDASH" +#define HID_AUTOCORR_HELP_WORDENEMDASH "EDITENG_HID_AUTOCORR_HELP_WORDENEMDASH" +#define HID_AUTOCORR_HELP_SENTENEMDASH "EDITENG_HID_AUTOCORR_HELP_SENTENEMDASH" +#define HID_AUTOCORR_HELP_SENTWORDENEMDASH "EDITENG_HID_AUTOCORR_HELP_SENTWORDENEMDASH" +#define HID_AUTOCORR_HELP_ACORWORDENEMDASH "EDITENG_HID_AUTOCORR_HELP_ACORWORDENEMDASH" +#define HID_AUTOCORR_HELP_ACORSENTWORDENEMDASH "EDITENG_HID_AUTOCORR_HELP_ACORSENTWORDENEMDASH" +#define HID_AUTOCORR_HELP_CHGQUOTES "EDITENG_HID_AUTOCORR_HELP_CHGQUOTES" +#define HID_AUTOCORR_HELP_CHGSGLQUOTES "EDITENG_HID_AUTOCORR_HELP_CHGSGLQUOTES" +#define HID_AUTOCORR_HELP_SETINETATTR "EDITENG_HID_AUTOCORR_HELP_SETINETATTR" +#define HID_AUTOCORR_HELP_INGNOREDOUBLESPACE "EDITENG_HID_AUTOCORR_HELP_INGNOREDOUBLESPACE" +#define HID_AUTOCORR_HELP_CHGWEIGHTUNDERL "EDITENG_HID_AUTOCORR_HELP_CHGWEIGHTUNDERL" +#define HID_AUTOCORR_HELP_CHGFRACTIONSYMBOL "EDITENG_HID_AUTOCORR_HELP_CHGFRACTIONSYMBOL" +#define HID_AUTOCORR_HELP_CHGORDINALNUMBER "EDITENG_HID_AUTOCORR_HELP_CHGORDINALNUMBER" #endif diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 35c51b82d1fe..766023a0038c 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1083,11 +1083,9 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) String aParaStr( EditResId( RID_STR_PARAGRAPH ) ); aParaStr.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%x" ) ), aTmpPara ); aPopupMenu.InsertItem( MN_WORDLANGUAGE, aWordStr ); - // FIXME: HELPID - aPopupMenu.SetHelpId( MN_WORDLANGUAGE, ""/*HID_EDITENG_SPELLER_WORDLANGUAGE*/ ); + aPopupMenu.SetHelpId( MN_WORDLANGUAGE, HID_EDITENG_SPELLER_WORDLANGUAGE ); aPopupMenu.InsertItem( MN_PARALANGUAGE, aParaStr ); - // FIXME: HELPID - aPopupMenu.SetHelpId( MN_PARALANGUAGE, ""/*HID_EDITENG_SPELLER_PARALANGUAGE*/ ); + aPopupMenu.SetHelpId( MN_PARALANGUAGE, HID_EDITENG_SPELLER_PARALANGUAGE ); } // ## Create mnemonics here diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 3e875e0b0fdc..42d7816199c7 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1389,6 +1389,32 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( nRet ) { + const char* aHelpIds[] = + { + HID_AUTOCORR_HELP_WORD, + HID_AUTOCORR_HELP_SENT, + HID_AUTOCORR_HELP_SENTWORD, + HID_AUTOCORR_HELP_ACORWORD, + "", + HID_AUTOCORR_HELP_ACORSENTWORD, + "", + HID_AUTOCORR_HELP_CHGTOENEMDASH, + HID_AUTOCORR_HELP_WORDENEMDASH, + HID_AUTOCORR_HELP_SENTENEMDASH, + HID_AUTOCORR_HELP_SENTWORDENEMDASH, + HID_AUTOCORR_HELP_ACORWORDENEMDASH, + "", + HID_AUTOCORR_HELP_ACORSENTWORDENEMDASH, + "", + HID_AUTOCORR_HELP_CHGQUOTES, + HID_AUTOCORR_HELP_CHGSGLQUOTES, + HID_AUTOCORR_HELP_SETINETATTR, + HID_AUTOCORR_HELP_INGNOREDOUBLESPACE, + HID_AUTOCORR_HELP_CHGWEIGHTUNDERL, + HID_AUTOCORR_HELP_CHGFRACTIONSYMBOL, + HID_AUTOCORR_HELP_CHGORDINALNUMBER + }; + ULONG nHelpId = 0; if( nRet & ( Autocorrect|CptlSttSntnc|CptlSttWrd|ChgToEnEmDash ) ) { @@ -1415,9 +1441,8 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( nHelpId ) { - nHelpId += HID_AUTOCORR_HELP_START - 1; - // FIXME: HELPID - Application::GetHelp()->OpenHelpAgent( String()/*nHelpId*/ ); + nHelpId -= 1; + Application::GetHelp()->OpenHelpAgent( aHelpIds[nHelpId] ); } } diff --git a/formula/inc/formula/IFunctionDescription.hxx b/formula/inc/formula/IFunctionDescription.hxx index 110b1dfd2470..8dd3a95ae067 100644 --- a/formula/inc/formula/IFunctionDescription.hxx +++ b/formula/inc/formula/IFunctionDescription.hxx @@ -92,7 +92,7 @@ namespace formula virtual void fillVisibleArgumentMapping(::std::vector& _rArguments) const = 0; virtual void initArgumentInfo() const = 0; virtual ::rtl::OUString getSignature() const = 0; - virtual long getHelpId() const = 0; + virtual rtl::OString getHelpId() const = 0; // parameter virtual sal_uInt32 getParameterCount() const = 0; diff --git a/formula/inc/formula/formdata.hxx b/formula/inc/formula/formdata.hxx index 780f95f8fdb5..0db3492a9519 100644 --- a/formula/inc/formula/formdata.hxx +++ b/formula/inc/formula/formdata.hxx @@ -81,7 +81,6 @@ private: USHORT nEdFocus; String aUndoStr; BOOL bMatrix; - // FIXME: HELPID rtl::OString aUniqueId; Selection aSelection; }; diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx index 0039b66b4ae2..c12501f61103 100644 --- a/formula/inc/formula/formula.hxx +++ b/formula/inc/formula/formula.hxx @@ -80,9 +80,7 @@ protected: ::std::pair RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputDoneAfter( BOOL bForced = FALSE ); - // FIXME: HELPID rtl::OString FindFocusWin(Window *pWin); - // FIXME: HELPID void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId); void HighlightFunctionParas(const String& aFormula); @@ -131,14 +129,12 @@ protected: ::std::pair RefInputStartBefore( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputDoneAfter( BOOL bForced = FALSE ); - // FIXME: HELPID rtl::OString FindFocusWin(Window *pWin); - // FIXME: HELPID void SetFocusWin(Window *pWin,const rtl::OString& nUniqueId); void HighlightFunctionParas(const String& aFormula); void SetMeText(const String& _sText); - FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate); + FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,BOOL bMatrix,BOOL _bSelect,BOOL _bUpdate); void Update(); BOOL CheckMatrix(String& aFormula /*IN/OUT*/); String GetMeText() const; diff --git a/formula/inc/helpids.hrc b/formula/inc/helpids.hrc index ff51f806b734..796f46752411 100644 --- a/formula/inc/helpids.hrc +++ b/formula/inc/helpids.hrc @@ -31,32 +31,26 @@ #include // HID_FORMULA_START #endif -#define HID_FORMULADLG_FORMULA (HID_FORMULA_START + 0) -#define HID_FORMULA_FAP_FORMULA (HID_FORMULA_START + 1) -#define HID_FORMULA_FAP_STRUCT (HID_FORMULA_START + 2) -#define HID_FORMULA_FAP_PAGE (HID_FORMULA_START + 3) -#define HID_FORMULA_FAP_EDIT1 (HID_FORMULA_START + 4) -#define HID_FORMULA_FAP_EDIT2 (HID_FORMULA_START + 5) -#define HID_FORMULA_FAP_EDIT3 (HID_FORMULA_START + 6) -#define HID_FORMULA_FAP_EDIT4 (HID_FORMULA_START + 7) -#define HID_FORMULA_FAP_BTN_FX1 (HID_FORMULA_START + 8) -#define HID_FORMULA_FAP_BTN_FX2 (HID_FORMULA_START + 9) -#define HID_FORMULA_FAP_BTN_FX3 (HID_FORMULA_START +10) -#define HID_FORMULA_FAP_BTN_FX4 (HID_FORMULA_START +11) -#define HID_FORMULA_FAP_BTN_REF1 (HID_FORMULA_START +12) -#define HID_FORMULA_FAP_BTN_REF2 (HID_FORMULA_START +13) -#define HID_FORMULA_FAP_BTN_REF3 (HID_FORMULA_START +14) -#define HID_FORMULA_FAP_BTN_REF4 (HID_FORMULA_START +15) -#define HID_FORMULA_LB_CATEGORY (HID_FORMULA_START +16) -#define HID_FORMULA_LB_FUNCTION (HID_FORMULA_START +17) -#define HID_FORMULATAB_FUNCTION (HID_FORMULA_START +18) -#define HID_FORMULATAB_STRUCT (HID_FORMULA_START +19) - - -#if HID_FORMULATAB_STRUCT > HID_FORMULA_END -#error Help-Id Ueberlauf in #file, #line -#endif -// don't forget to update the file util/hidother.src +#define HID_FORMULADLG_FORMULA "FORMULA_HID_FORMULADLG_FORMULA" +#define HID_FORMULA_FAP_FORMULA "FORMULA_HID_FORMULA_FAP_FORMULA" +#define HID_FORMULA_FAP_STRUCT "FORMULA_HID_FORMULA_FAP_STRUCT" +#define HID_FORMULA_FAP_PAGE "FORMULA_HID_FORMULA_FAP_PAGE" +#define HID_FORMULA_FAP_EDIT1 "FORMULA_HID_FORMULA_FAP_EDIT1" +#define HID_FORMULA_FAP_EDIT2 "FORMULA_HID_FORMULA_FAP_EDIT2" +#define HID_FORMULA_FAP_EDIT3 "FORMULA_HID_FORMULA_FAP_EDIT3" +#define HID_FORMULA_FAP_EDIT4 "FORMULA_HID_FORMULA_FAP_EDIT4" +#define HID_FORMULA_FAP_BTN_FX1 "FORMULA_HID_FORMULA_FAP_BTN_FX1" +#define HID_FORMULA_FAP_BTN_FX2 "FORMULA_HID_FORMULA_FAP_BTN_FX2" +#define HID_FORMULA_FAP_BTN_FX3 "FORMULA_HID_FORMULA_FAP_BTN_FX3" +#define HID_FORMULA_FAP_BTN_FX4 "FORMULA_HID_FORMULA_FAP_BTN_FX4" +#define HID_FORMULA_FAP_BTN_REF1 "FORMULA_HID_FORMULA_FAP_BTN_REF1" +#define HID_FORMULA_FAP_BTN_REF2 "FORMULA_HID_FORMULA_FAP_BTN_REF2" +#define HID_FORMULA_FAP_BTN_REF3 "FORMULA_HID_FORMULA_FAP_BTN_REF3" +#define HID_FORMULA_FAP_BTN_REF4 "FORMULA_HID_FORMULA_FAP_BTN_REF4" +#define HID_FORMULA_LB_CATEGORY "FORMULA_HID_FORMULA_LB_CATEGORY" +#define HID_FORMULA_LB_FUNCTION "FORMULA_HID_FORMULA_LB_FUNCTION" +#define HID_FORMULATAB_FUNCTION "FORMULA_HID_FORMULATAB_FUNCTION" +#define HID_FORMULATAB_STRUCT "FORMULA_HID_FORMULATAB_STRUCT" #endif //FORMULA_HELPID_HRC diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 3adbd95d9fd1..1d71b40919eb 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -50,7 +50,7 @@ namespace formula virtual void fillVisibleArgumentMapping(::std::vector& ) const {} virtual void initArgumentInfo() const {} virtual ::rtl::OUString getSignature() const { return ::rtl::OUString(); } - virtual long getHelpId() const { return 0; } + virtual rtl::OString getHelpId() const { return ""; } virtual sal_uInt32 getParameterCount() const { return 0; } virtual ::rtl::OUString getParameterName(sal_uInt32 ) const { return ::rtl::OUString(); } virtual ::rtl::OUString getParameterDescription(sal_uInt32 ) const { return ::rtl::OUString(); } diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 8255aae371da..0a971e94e5b6 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -226,14 +226,10 @@ namespace formula FormulaHelper m_aFormulaHelper; - // FIXME: HELPID rtl::OString m_aEditHelpId; - // FIXME: HELPID rtl::OString aOldHelp; - // FIXME: HELPID rtl::OString aOldUnique; - // FIXME: HELPID rtl::OString aActivWinId; BOOL bIsShutDown; @@ -334,9 +330,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent aTabCtrl.SetTabPage( TP_FUNCTION, pFuncPage); aTabCtrl.SetTabPage( TP_STRUCT, pStructPage); - // FIXME: HELPID aOldHelp = pParent->GetHelpId(); // HelpId aus Resource immer fuer "Seite 1" - // FIXME: HELPID aOldUnique = pParent->GetUniqueId(); aFtResult.Show( _bSupportResult ); @@ -414,7 +408,6 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) if(pWin!=NULL) { aActivWinId = pWin->GetUniqueId(); - // FIXME: HELPID if(aActivWinId.getLength()==0) { Window* pParent=pWin->GetParent(); @@ -422,14 +415,12 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) { aActivWinId=pParent->GetUniqueId(); - // FIXME: HELPID if(aActivWinId.getLength()!=0) break; pParent=pParent->GetParent(); } } - // FIXME: HELPID - if(aActivWinId!=0) + if(aActivWinId.getLength()) { FormEditData* pData = m_pHelper->getFormEditData(); @@ -833,9 +824,7 @@ void FormulaDlg_Impl::FillListboxes() aNewTitle = aTitle1; // HelpId fuer 1. Seite ist die aus der Resource - // FIXME: HELPID m_pParent->SetHelpId( aOldHelp ); - // FIXME: HELPID m_pParent->SetUniqueId( aOldUnique ); } // ----------------------------------------------------------------------------- @@ -872,12 +861,9 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) aFtEditName.SetText( pFuncDesc->getFunctionName() ); aFtEditName.Show(); pParaWin->Show(); - // FIXME: HELPID - #if 0 - const long nHelpId = pFuncDesc->getHelpId(); - if ( nHelpId ) - pMEdit->SetSmartHelpId(SmartId(nHelpId)); - #endif + const rtl::OString aHelpId = pFuncDesc->getHelpId(); + if ( aHelpId.getLength() ) + pMEdit->SetHelpId(aHelpId); } xub_StrLen nOldStart, nOldEnd; @@ -933,7 +919,6 @@ void FormulaDlg_Impl::FillControls(BOOL &rbNext, BOOL &rbPrev) else { aFtEditName.SetText(String()); - // FIXME: HELPID pMEdit->SetHelpId( m_aEditHelpId ); } // Test, ob vorne/hinten noch mehr Funktionen sind @@ -1809,7 +1794,6 @@ rtl::OString FormulaDlg_Impl::FindFocusWin(Window *pWin) rtl::OString aUniqueId; if(pWin->HasFocus()) { - // FIXME: HELPID aUniqueId=pWin->GetUniqueId(); if(aUniqueId.getLength()==0) { @@ -1942,13 +1926,11 @@ void FormulaModalDialog::RefInputDoneAfter( BOOL bForced ) rtl::OString FormulaModalDialog::FindFocusWin(Window *pWin) { - // FIXME: HELPID return m_pImpl->FindFocusWin( pWin ); } void FormulaModalDialog::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { - // FIXME: HELPID if(pWin->GetUniqueId()==nUniqueId) { pWin->GrabFocus(); @@ -2024,13 +2006,10 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ,_pHelper,_pFunctionMgr,_pDlg)) { FreeResource(); - // FIXME: HELPID - #if 0 - if(GetHelpId()==0) //Hack, da im SfxModelessDialog die HelpId + if(!GetHelpId().getLength()) //Hack, da im SfxModelessDialog die HelpId SetHelpId(GetUniqueId()); //fuer einen ModelessDialog entfernt und //in eine UniqueId gewandelt wird, machen //wir das an dieser Stelle rueckgaengig. - #endif SetText(m_pImpl->aTitle1); } @@ -2102,13 +2081,11 @@ void FormulaDlg::RefInputDoneAfter( BOOL bForced ) rtl::OString FormulaDlg::FindFocusWin(Window *pWin) { - // FIXME: HELPID return m_pImpl->FindFocusWin( pWin ); } void FormulaDlg::SetFocusWin(Window *pWin,const rtl::OString& nUniqueId) { - // FIXME: HELPID if(pWin->GetUniqueId()==nUniqueId) { pWin->GrabFocus(); @@ -2178,7 +2155,6 @@ IMPL_LINK( FormulaDlg, UpdateFocusHdl, Timer*, EMPTYARG ) if (pData) // wird nicht ueber Close zerstoert; { m_pImpl->m_pHelper->setReferenceInput(pData); - // FIXME: HELPID rtl::OString nUniqueId(pData->GetUniqueId()); SetFocusWin(this,nUniqueId); } diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index a66b4b2137af..1f8b64c7b4ba 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -190,18 +190,14 @@ IMPL_LINK( FuncPage, SelHdl, ListBox*, pLb ) const IFunctionDescription* pDesc = GetFuncDesc( GetFunction() ); if ( pDesc ) { - // FIXME: HELPID - #if 0 - const long nHelpId = pDesc->getHelpId(); - if ( nHelpId ) - aLbFunction.SetSmartHelpId(SmartId(nHelpId)); - #endif + const rtl::OString sHelpId = pDesc->getHelpId(); + if ( sHelpId.getLength() ) + aLbFunction.SetHelpId(sHelpId); } aSelectionLink.Call(this); } else { - // FIXME: HELPID aLbFunction.SetHelpId(m_aHelpId); UpdateFunctionList(); } diff --git a/formula/source/ui/dlg/funcpage.hxx b/formula/source/ui/dlg/funcpage.hxx index 4d7dc5739d0f..225114ff00aa 100644 --- a/formula/source/ui/dlg/funcpage.hxx +++ b/formula/source/ui/dlg/funcpage.hxx @@ -82,7 +82,6 @@ private: m_pFunctionManager; ::std::vector< TFunctionDesc > aLRUList; - // FIXME: HELPID rtl::OString m_aHelpId; diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index db8a4e136015..c4e28b3da8f1 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -758,9 +758,7 @@ EditBox::EditBox( Window* pParent, const ResId& rResId ) // #105582# the HelpId from the resource must be set for the MultiLineEdit, // not for the control that contains it. - // FIXME: HELPID pMEdit->SetHelpId( GetHelpId() ); - // FIXME: HELPID SetHelpId( "" ); } diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index 9afa9fb20587..5e656aea0967 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -297,25 +297,19 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* pFDesc) nArgs = pFuncDesc->getSuppressedArgumentCount(); pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping); aSlider.Hide(); - // FIXME: HELPID - #if 0 - long nHelpId = pFuncDesc->getHelpId(); - SetHelpId( nHelpId ); - aEdArg1.SetHelpId( nHelpId ); - aEdArg2.SetHelpId( nHelpId ); - aEdArg3.SetHelpId( nHelpId ); - aEdArg4.SetHelpId( nHelpId ); - #endif + rtl::OString sHelpId = pFuncDesc->getHelpId(); + SetHelpId( sHelpId ); + aEdArg1.SetHelpId( sHelpId ); + aEdArg2.SetHelpId( sHelpId ); + aEdArg3.SetHelpId( sHelpId ); + aEdArg4.SetHelpId( sHelpId ); // Unique-IDs muessen gleich bleiben fuer Automatisierung - // FIXME: HELPID - #if 0 - SetUniqueId( ""/*HID_FORMULA_FAP_PAGE*/ ); + SetUniqueId( HID_FORMULA_FAP_PAGE ); aEdArg1.SetUniqueId( HID_FORMULA_FAP_EDIT1 ); aEdArg2.SetUniqueId( HID_FORMULA_FAP_EDIT2 ); aEdArg3.SetUniqueId( HID_FORMULA_FAP_EDIT3 ); aEdArg4.SetUniqueId( HID_FORMULA_FAP_EDIT4 ); - #endif SetActiveLine(0); } else diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index c51a326477fa..1e34b2eee840 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -205,32 +205,26 @@ namespace svt { String sHelpURL( _rURL ); if ( COMPARE_EQUAL == sHelpURL.CompareIgnoreCaseToAscii( "HID:", sizeof( "HID:" ) - 1 ) ) - { - // FIXME: HELPID - rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); - if ( _bFileView ) - // the file view "overloaded" the SetHelpId - static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); - else - _pControl->SetHelpId( sID ); - } + sHelpURL = sHelpURL.Copy( sizeof( "HID:" ) - 1 ); + + // URLs should always be UTF8 encoded and escaped + rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); + if ( _bFileView ) + // the file view "overloaded" the SetHelpId + static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); else - { - DBG_ERRORFILE( "OControlAccess::setHelpURL: unsupported help URL type!" ); - } + _pControl->SetHelpId( sID ); } //--------------------------------------------------------------------- ::rtl::OUString OControlAccess::getHelpURL( Window* _pControl, sal_Bool _bFileView ) { - // FIXME: HELPID rtl::OString aHelpId = _pControl->GetHelpId(); if ( _bFileView ) // the file view "overloaded" the SetHelpId aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); rtl::OUString sHelpURL( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); - return sHelpURL; } diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 87df9e404b6a..c7a18050c3ff 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -600,8 +600,7 @@ void SvtFileDialog::Init_Impl bool bSaveMode = ( FILEDLG_MODE_SAVE == _pImp->_eMode ); pURLBox->SetNoURLSelection( bSaveMode ); - // FIXME: HELPID - _pImp->_pEdFileName->SetHelpId( ""/*HID_FILEDLG_AUTOCOMPLETEBOX*/ ); + _pImp->_pEdFileName->SetHelpId( HID_FILEDLG_AUTOCOMPLETEBOX ); _pImp->_pFtFileType = new FixedText( this, SvtResId( FT_EXPLORERFILE_FILETYPE ) ); _pImp->CreateFilterListControl( this, SvtResId( LB_EXPLORERFILE_FILETYPE ) ); @@ -650,8 +649,7 @@ void SvtFileDialog::Init_Impl _pFileView->SetUrlFilter( &m_aURLFilter ); _pFileView->EnableAutoResize(); - // FIXME: HELPID - _pFileView->SetHelpId( ""/*HID_FILEDLG_STANDARD*/ ); + _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); _pFileView->SetStyle( _pFileView->GetStyle() | WB_TABSTOP ); // Positionen und Groessen der Knoepfe bestimmen. @@ -703,8 +701,7 @@ void SvtFileDialog::Init_Impl if ( nStyle & SFXWB_READONLY ) { _pCbReadOnly = new CheckBox( this, SvtResId( CB_EXPLORERFILE_READONLY ) ); - // FIXME: HELPID - _pCbReadOnly->SetHelpId( ""/*HID_FILEOPEN_READONLY*/ ); + _pCbReadOnly->SetHelpId( HID_FILEOPEN_READONLY ); _pCbReadOnly->SetText( SvtResId( STR_SVT_FILEPICKER_READONLY ) ); AddControl( _pCbReadOnly ); ReleaseOwnerShip( _pCbReadOnly ); @@ -813,23 +810,15 @@ void SvtFileDialog::Init_Impl { // different help ids if in save-as mode // 90744 - 09.08.2001 - frank.schoenheit@sun.com - // FIXME: HELPID - SetHelpId( ""/*HID_FILESAVE_DIALOG*/ ); - - // FIXME: HELPID - _pImp->_pEdFileName->SetHelpId( ""/*HID_FILESAVE_FILEURL*/ ); - // FIXME: HELPID - _pImp->_pBtnFileOpen->SetHelpId( ""/*HID_FILESAVE_DOSAVE*/ ); - // FIXME: HELPID - _pImp->_pBtnNewFolder->SetHelpId( ""/*HID_FILESAVE_CREATEDIRECTORY*/ ); - // FIXME: HELPID - _pImp->_pBtnStandard->SetHelpId( ""/*HID_FILESAVE_DEFAULTDIRECTORY*/ ); - // FIXME: HELPID - _pImp->_pBtnUp->SetHelpId( ""/*HID_FILESAVE_LEVELUP*/ ); - // FIXME: HELPID - _pImp->GetFilterListControl()->SetHelpId( ""/*HID_FILESAVE_FILETYPE*/ ); - // FIXME: HELPID - _pFileView->SetHelpId( ""/*HID_FILESAVE_FILEVIEW*/ ); + SetHelpId( HID_FILESAVE_DIALOG ); + + _pImp->_pEdFileName->SetHelpId( HID_FILESAVE_FILEURL ); + _pImp->_pBtnFileOpen->SetHelpId( HID_FILESAVE_DOSAVE ); + _pImp->_pBtnNewFolder->SetHelpId( HID_FILESAVE_CREATEDIRECTORY ); + _pImp->_pBtnStandard->SetHelpId( HID_FILESAVE_DEFAULTDIRECTORY ); + _pImp->_pBtnUp->SetHelpId( HID_FILESAVE_LEVELUP ); + _pImp->GetFilterListControl()->SetHelpId( HID_FILESAVE_FILETYPE ); + _pFileView->SetHelpId( HID_FILESAVE_FILEVIEW ); // formerly, there was only _pLbFileVersion, which was used for 3 different // use cases. For reasons of maintainability, I introduced extra members (_pLbTemplates, _pLbImageTemplates) @@ -838,23 +827,16 @@ void SvtFileDialog::Init_Impl // tests I made lead to a dialog where _no_ of the three list boxes was present. // 96930 - 15.08.2002 - fs@openoffice.org if ( _pImp->_pLbFileVersion ) - // FIXME: HELPID - _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbFileVersion->SetHelpId( HID_FILESAVE_TEMPLATE ); if ( _pImp->_pLbTemplates ) - // FIXME: HELPID - _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); if ( _pImp->_pLbImageTemplates ) - // FIXME: HELPID - _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILESAVE_TEMPLATE*/ ); + _pImp->_pLbImageTemplates->SetHelpId( HID_FILESAVE_TEMPLATE ); - // FIXME: HELPID - if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( ""/*HID_FILESAVE_SAVEWITHPASSWORD*/ ); - // FIXME: HELPID - if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( ""/*HID_FILESAVE_AUTOEXTENSION*/ ); - // FIXME: HELPID - if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( ""/*HID_FILESAVE_CUSTOMIZEFILTER*/ ); - // FIXME: HELPID - if ( _pCbSelection ) _pCbSelection->SetHelpId( ""/*HID_FILESAVE_SELECTION*/ ); + if ( _pImp->_pCbPassword ) _pImp->_pCbPassword->SetHelpId( HID_FILESAVE_SAVEWITHPASSWORD ); + if ( _pImp->_pCbAutoExtension ) _pImp->_pCbAutoExtension->SetHelpId( HID_FILESAVE_AUTOEXTENSION ); + if ( _pImp->_pCbOptions ) _pImp->_pCbOptions->SetHelpId( HID_FILESAVE_CUSTOMIZEFILTER ); + if ( _pCbSelection ) _pCbSelection->SetHelpId( HID_FILESAVE_SELECTION ); } // correct the z-order of the controls @@ -2999,8 +2981,7 @@ void SvtFileDialog::AddControls_Impl( ) { _pCbLinkBox = new CheckBox( this ); _pCbLinkBox ->SetText( SvtResId( STR_SVT_FILEPICKER_INSERT_AS_LINK ) ); - // FIXME: HELPID - _pCbLinkBox ->SetHelpId( ""/*HID_FILEDLG_LINK_CB*/ ); + _pCbLinkBox ->SetHelpId( HID_FILEDLG_LINK_CB ); AddControl( _pCbLinkBox ); ReleaseOwnerShip( _pCbLinkBox ); _pCbLinkBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -3017,8 +2998,7 @@ void SvtFileDialog::AddControls_Impl( ) // "Vorschau" _pCbPreviewBox = new CheckBox( this ); _pCbPreviewBox->SetText( SvtResId( STR_SVT_FILEPICKER_SHOW_PREVIEW ) ); - // FIXME: HELPID - _pCbPreviewBox->SetHelpId( ""/*HID_FILEDLG_PREVIEW_CB*/ ); + _pCbPreviewBox->SetHelpId( HID_FILEDLG_PREVIEW_CB ); AddControl( _pCbPreviewBox ); ReleaseOwnerShip( _pCbPreviewBox ); _pCbPreviewBox->SetClickHdl( LINK( this, SvtFileDialog, ClickHdl_Impl ) ); @@ -3066,8 +3046,7 @@ void SvtFileDialog::AddControls_Impl( ) { _pPbPlay = new PushButton( this ); _pPbPlay->SetText( SvtResId( STR_SVT_FILEPICKER_PLAY ) ); - // FIXME: HELPID - _pPbPlay->SetHelpId( ""/*HID_FILESAVE_DOPLAY*/ ); + _pPbPlay->SetHelpId( HID_FILESAVE_DOPLAY ); AddControl( _pPbPlay ); ReleaseOwnerShip( _pPbPlay ); _pPbPlay->SetClickHdl( LINK( this, SvtFileDialog, PlayButtonHdl_Impl ) ); @@ -3079,8 +3058,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtFileVersion->SetText( SvtResId( STR_SVT_FILEPICKER_VERSION ) ); _pImp->_pLbFileVersion = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbFileVersion->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); + _pImp->_pLbFileVersion->SetHelpId( HID_FILEOPEN_VERSION ); } else if ( _nExtraBits & SFX_EXTRA_TEMPLATES ) { @@ -3088,8 +3066,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_TEMPLATES ) ); _pImp->_pLbTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbTemplates->SetHelpId( ""/*HID_FILEOPEN_VERSION*/ ); + _pImp->_pLbTemplates->SetHelpId( HID_FILEOPEN_VERSION ); // This is strange. During the re-factoring during 96930, I discovered that this help id // is set in the "Templates mode". This was hidden in the previous implementation. // Shouldn't this be a more meaningfull help id. @@ -3101,8 +3078,7 @@ void SvtFileDialog::AddControls_Impl( ) _pImp->_pFtImageTemplates->SetText( SvtResId( STR_SVT_FILEPICKER_IMAGE_TEMPLATE ) ); _pImp->_pLbImageTemplates = new ListBox( this, SvtResId( LB_EXPLORERFILE_SHARED_LISTBOX ) ); - // FIXME: HELPID - _pImp->_pLbImageTemplates->SetHelpId( ""/*HID_FILEOPEN_IMAGE_TEMPLATE*/ ); + _pImp->_pLbImageTemplates->SetHelpId( HID_FILEOPEN_IMAGE_TEMPLATE ); } } diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index 9f5997a4089c..e27ec2cbe3bc 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -86,22 +86,22 @@ #define SID_SFX_START 5000 #define SID_OPENURL (SID_SFX_START + 596) -#define HID_FILEDLG_STANDARD (HID_SFX_START + 27) -#define HID_FILEDLG_MANAGER (HID_SFX_START + 28) -#define HID_FILEDLG_URL (HID_SFX_START + 29) -#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31) -#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32) - -#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218) -#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219) -#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220) -#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221) -#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222) -#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223) -#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224) -#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225) -#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226) -#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227) +#define HID_FILEDLG_STANDARD "FPICKER_HID_FILEDLG_STANDARD" +#define HID_FILEDLG_MANAGER "FPICKER_HID_FILEDLG_MANAGER" +#define HID_FILEDLG_URL "FPICKER_HID_FILEDLG_URL" +#define HID_FILEDLG_USE_PASSWD "FPICKER_HID_FILEDLG_USE_PASSWD" +#define HID_FILEDLG_READ_ONLY "FPICKER_HID_FILEDLG_READ_ONLY" + +#define HID_FILEDLG_AUTOCOMPLETEBOX "FPICKER_HID_FILEDLG_AUTOCOMPLETEBOX" +#define HID_FILEDLG_SAVE_BTN "FPICKER_HID_FILEDLG_SAVE_BTN" +#define HID_FILEDLG_SAVE_FILENAME "FPICKER_HID_FILEDLG_SAVE_FILENAME" +#define HID_FILEDLG_SAVE_FILETYPE "FPICKER_HID_FILEDLG_SAVE_FILETYPE" +#define HID_FILEDLG_INSERT_BTN "FPICKER_HID_FILEDLG_INSERT_BTN" +#define HID_FILEDLG_PATH_BTN "FPICKER_HID_FILEDLG_PATH_BTN" +#define HID_FILEDLG_PATH_FILENAME "FPICKER_HID_FILEDLG_PATH_FILENAME" +#define HID_FILEDLG_FOLDER_BTN "FPICKER_HID_FILEDLG_FOLDER_BTN" +#define HID_FILEDLG_FOLDER_FILENAME "FPICKER_HID_FILEDLG_FOLDER_FILENAME" +#define HID_FILEDLG_SRCHFOLDER_BTN "FPICKER_HID_FILEDLG_SRCHFOLDER_BTN" #endif diff --git a/framework/inc/helpid.hrc b/framework/inc/helpid.hrc index f40d5fcaaa2d..3f9068e65d26 100644 --- a/framework/inc/helpid.hrc +++ b/framework/inc/helpid.hrc @@ -33,17 +33,11 @@ // Help-Ids ----------------------------------------------------------------- -#define HID_BACKINGWINDOW (HID_FRAMEWORK_START + 0) -#define HID_LICENSEDIALOG (HID_FRAMEWORK_START + 1) -#define HID_STATUSBAR (HID_FRAMEWORK_START + 2) - -#define ACT_FRAMEWORK_HID_END HID_BACKINGWINDOW - -// "Uberlaufpr"ufung -------------------------------------------------------- - -#if ACT_FRAMEWORK_HID_END > HID_FRAMEWORK_END -#error Resource-Ueberlauf in #line, #file -#endif +#define HID_BACKINGWINDOW "FWK_HID_BACKINGWINDOW" +#define HID_LICENSEDIALOG "FWK_HID_LICENSEDIALOG" +#define HID_STATUSBAR "FWK_HID_STATUSBAR" +#define HID_SVX_COMMON_MACRO_ORGANIZER "FWK_HID_SVX_COMMON_MACRO_ORGANIZER" +#define HID_SVX_BASIC_MACRO_ORGANIZER "FWK_HID_SVX_BASIC_MACRO_ORGANIZER" #endif // #ifndef _FRAMEWORK_HELPID_HRC diff --git a/framework/inc/uielement/commandinfo.hxx b/framework/inc/uielement/commandinfo.hxx index d33ab0d7baad..5b9822af86e6 100644 --- a/framework/inc/uielement/commandinfo.hxx +++ b/framework/inc/uielement/commandinfo.hxx @@ -47,11 +47,13 @@ namespace framework struct CommandInfo { CommandInfo() : nId( 0 ), + nWidth( 0 ), nImageInfo( 0 ), bMirrored( false ), bRotated( false ) {} USHORT nId; + sal_uInt32 nWidth; ::std::vector< USHORT > aIds; sal_Int16 nImageInfo; sal_Bool bMirrored : 1, diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx index 8016bbb620b8..12301f170f26 100644 --- a/framework/inc/uielement/toolbarmerger.hxx +++ b/framework/inc/uielement/toolbarmerger.hxx @@ -145,6 +145,7 @@ class ToolBarMerger const ::rtl::OUString& rControlType ); static void CreateToolbarItem( ToolBox* pToolbox, + CommandToInfoMap& rCommandMap, sal_uInt16 nPos, sal_uInt16 nItemId, const AddonToolbarItem& rAddonToolbarItem ); diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index dcb0b57182df..5ffc014d1771 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -102,7 +102,7 @@ namespace framework ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > > getLayoutManagerToolbars( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& rLayoutManager ); rtl::OUString getUINameFromCommand( const rtl::OUString& rCommandURL ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > getDispatchFromCommandURL( const rtl::OUString& rCommandURL ); - void addCommand( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, USHORT nHelpId, const rtl::OUString& aLabel ); + void addCommand( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OString& sHelpId, const rtl::OUString& aLabel ); sal_Bool isContextSensitiveToolbarNonVisible(); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState; diff --git a/framework/source/services/backingcomp.cxx b/framework/source/services/backingcomp.cxx index c8cf5249dd9a..13c5647341e6 100644 --- a/framework/source/services/backingcomp.cxx +++ b/framework/source/services/backingcomp.cxx @@ -528,8 +528,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f } // set help ID for our canvas - // FIXME: HELPID - pWindow->SetHelpId(""/*HID_BACKINGWINDOW*/); + pWindow->SetHelpId(HID_BACKINGWINDOW); // inform BackingWindow about frame BackingWindow* pBack = dynamic_cast(pWindow ); diff --git a/framework/source/services/menudocumenthandler.cxx b/framework/source/services/menudocumenthandler.cxx deleted file mode 100644 index 8741fff39320..000000000000 --- a/framework/source/services/menudocumenthandler.cxx +++ /dev/null @@ -1,903 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_framework.hxx" - -#include -#include -#include -#include - -#ifndef __FRAMEWORK_SERVICES_ATTRIBUTELIST_HXX_ -#include -#endif - -#ifndef __COM_SUN_STAR_XML_SAX_XEXTENDEDDOCUMENTHANDLER_HPP_ -#include -#endif - - -using namespace ::rtl; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::xml::sax; - -const int ITEMID_START_VALUE = 1000; - -#define XMLNS_MENU "http://openoffice.org/2001/menu" -#define XMLNS_PREFIX "menu:" - -#define ELEMENT_MENUBAR "http://openoffice.org/2001/menu^menubar" -#define ELEMENT_MENU "http://openoffice.org/2001/menu^menu" -#define ELEMENT_MENUPOPUP "http://openoffice.org/2001/menu^menupopup" -#define ELEMENT_MENUITEM "http://openoffice.org/2001/menu^menuitem" -#define ELEMENT_MENUSEPARATOR "http://openoffice.org/2001/menu^menuseparator" - -#define ELEMENT_NS_MENUBAR "menu:menubar" -#define ELEMENT_NS_MENU "menu:menu" -#define ELEMENT_NS_MENUPOPUP "menu:menupopup" -#define ELEMENT_NS_MENUITEM "menu:menuitem" -#define ELEMENT_NS_MENUSEPARATOR "menu:menuseparator" - -#define ATTRIBUTE_ID "http://openoffice.org/2001/menu^id" -#define ATTRIBUTE_LABEL "http://openoffice.org/2001/menu^label" -#define ATTRIBUTE_HELPID "http://openoffice.org/2001/menu^helpid" -#define ATTRIBUTE_LINEBREAK "http://openoffice.org/2001/menu^linebreak" - -#define ATTRIBUTE_NS_ID "menu:id" -#define ATTRIBUTE_NS_LABEL "menu:label" -#define ATTRIBUTE_NS_HELPID "menu:helpid" -#define ATTRIBUTE_NS_LINEBREAK "menu:linebreak" - -#define ATTRIBUTE_XMLNS_MENU "xmlns:menu" - -#define ATTRIBUTE_TYPE_CDATA "CDATA" - -#define MENUBAR_DOCTYPE "" - - -// special popup menus (filled during runtime) must be saved as a menuitem!!! -// same as in menumanager.cxx - you have to change both files!!! -#define SID_SFX_START 5000 -#define SID_NEWDOCDIRECT (SID_SFX_START + 537) -#define SID_AUTOPILOTMENU (SID_SFX_START + 1381) -#define SID_FORMATMENU (SID_SFX_START + 780) - -const ::rtl::OUString aSlotProtocol( RTL_CONSTASCII_USTRINGPARAM( "slot:" )); -const ::rtl::OUString aSlotNewDocDirect( RTL_CONSTASCII_USTRINGPARAM( "slot:5537" )); -const ::rtl::OUString aSlotAutoPilot( RTL_CONSTASCII_USTRINGPARAM( "slot:6381" )); - -const ::rtl::OUString aSpecialFileMenu( RTL_CONSTASCII_USTRINGPARAM( "file" )); -const ::rtl::OUString aSpecialWindowMenu( RTL_CONSTASCII_USTRINGPARAM( "window" )); - -const ULONG MENU_SAVE_LABEL = 0x00000001; - -namespace framework -{ - -// ----------------------------------------------------------------------------- -// Base class implementation - -ReadMenuDocumentHandlerBase::ReadMenuDocumentHandlerBase() : - m_xLocator( 0 ), - m_xReader( 0 ) -{ -} - -ReadMenuDocumentHandlerBase::~ReadMenuDocumentHandlerBase() -{ -} - -Any SAL_CALL ReadMenuDocumentHandlerBase::queryInterface( - const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - -void SAL_CALL ReadMenuDocumentHandlerBase::ignorableWhitespace( - const OUString& aWhitespaces ) -throw( SAXException, RuntimeException ) -{ -} - -void SAL_CALL ReadMenuDocumentHandlerBase::processingInstruction( - const OUString& aTarget, const OUString& aData ) -throw( SAXException, RuntimeException ) -{ -} - -void SAL_CALL ReadMenuDocumentHandlerBase::setDocumentLocator( - const Reference< XLocator > &xLocator) -throw( SAXException, RuntimeException ) -{ - m_xLocator = xLocator; -} - -::rtl::OUString ReadMenuDocumentHandlerBase::getErrorLineString() -{ - char buffer[32]; - - if ( m_xLocator.is() ) - { - snprintf( buffer, sizeof(buffer), "Line: %ld - ", static_cast( m_xLocator->getLineNumber() )); - return OUString::createFromAscii( buffer ); - } - else - return OUString(); -} - -// ----------------------------------------------------------------------------- - -// #110897# -OReadMenuDocumentHandler::OReadMenuDocumentHandler( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - MenuBar* pMenuBar ) -: // #110897# - mxServiceFactory(xServiceFactory), - m_pMenuBar( pMenuBar ), - m_nElementDepth( 0 ), - m_bMenuBarMode( sal_False ), - m_nItemId( ITEMID_START_VALUE ) -{ -} - -// #110897# -const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& OReadMenuDocumentHandler::getServiceFactory() -{ - // #110897# - return mxServiceFactory; -} - -OReadMenuDocumentHandler::~OReadMenuDocumentHandler() -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::endDocument(void) - throw( SAXException, RuntimeException ) -{ - if ( m_nElementDepth > 0 ) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "A closing element is missing!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuDocumentHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuBarMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUBAR ))) - { - ++m_nElementDepth; - m_bMenuBarMode = sal_True; - - // #110897# m_xReader = Reference< XDocumentHandler >( new OReadMenuBarHandler( m_pMenuBar, &m_nItemId )); - m_xReader = Reference< XDocumentHandler >( new OReadMenuBarHandler( getServiceFactory(), m_pMenuBar, &m_nItemId )); - - m_xReader->startDocument(); - } -} - - -void SAL_CALL OReadMenuDocumentHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuDocumentHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuBarMode ) - { - --m_nElementDepth; - m_xReader->endElement( aName ); - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuBarMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUBAR ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menubar expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - } -} - - -// ----------------------------------------------------------------------------- - - -// #110897# -OReadMenuBarHandler::OReadMenuBarHandler( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, - MenuBar* pMenuBar, USHORT* pItemId ) -: // #110897# - mxServiceFactory( xServiceFactory ), - m_pMenuBar( pMenuBar ), - m_nElementDepth( 0 ), - m_bMenuMode( sal_False ), - m_pItemId( pItemId ) -{ -} - -// #110897# -const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& OReadMenuBarHandler::getServiceFactory() -{ - // #110897# - return mxServiceFactory; -} - -OReadMenuBarHandler::~OReadMenuBarHandler() -{ -} - - -void SAL_CALL OReadMenuBarHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuBarHandler::endDocument(void) - throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuBarHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - ++m_nElementDepth; - - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - m_bMenuMode = sal_True; - PopupMenu* pMenu = new PopupMenu(); - - // read attributes for menu - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenuBar->InsertItem( nItemId, String() ); - m_pMenuBar->SetPopupMenu( nItemId, pMenu ); - m_pMenuBar->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenuBar->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenuBar->SetItemText( nItemId, aLabel ); - m_pMenuBar->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenuBar->SetUserValue( nItemId, 0 ); - } - } - else - { - delete pMenu; - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "attribute id for element menu required!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - - m_xReader = Reference< XDocumentHandler >( new OReadMenuHandler( pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuBarHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void OReadMenuBarHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuMode ) - { - --m_nElementDepth; - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } -} - - -// ----------------------------------------------------------------------------- - - -OReadMenuHandler::OReadMenuHandler( Menu* pMenu, USHORT* pItemId ) : - m_pMenu( pMenu ), - m_nElementDepth( 0 ), - m_bMenuPopupMode( sal_False ), - m_pItemId( pItemId ) -{ -} - - -OReadMenuHandler::~OReadMenuHandler() -{ -} - - -void SAL_CALL OReadMenuHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuHandler::endDocument(void) - throw( SAXException, RuntimeException) -{ -} - - -void SAL_CALL OReadMenuHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - if ( m_bMenuPopupMode ) - { - ++m_nElementDepth; - m_xReader->startElement( aName, xAttrList ); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUPOPUP ))) - { - ++m_nElementDepth; - m_bMenuPopupMode = sal_True; - m_xReader = Reference< XDocumentHandler >( new OReadMenuPopupHandler( m_pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown element found!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - if ( m_bMenuPopupMode ) - { - --m_nElementDepth; - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuPopupMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUPOPUP ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menupopup expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } -} - - -// ----------------------------------------------------------------------------- - - -OReadMenuPopupHandler::OReadMenuPopupHandler( Menu* pMenu, USHORT* pItemId ) : - m_pMenu( pMenu ), - m_nElementDepth( 0 ), - m_bMenuMode( sal_False ), - m_pItemId( pItemId ), - m_nNextElementExpected( ELEM_CLOSE_NONE ) -{ -} - - -OReadMenuPopupHandler::~OReadMenuPopupHandler() -{ -} - - -void SAL_CALL OReadMenuPopupHandler::startDocument(void) - throw ( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::endDocument(void) - throw( SAXException, RuntimeException) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::startElement( - const OUString& aName, const Reference< XAttributeList > &xAttrList ) -throw( SAXException, RuntimeException ) -{ - ++m_nElementDepth; - - if ( m_bMenuMode ) - m_xReader->startElement( aName, xAttrList ); - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - m_bMenuMode = sal_True; - PopupMenu* pMenu = new PopupMenu(); - - // read attributes for menu - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenu->InsertItem( nItemId, String() ); - m_pMenu->SetPopupMenu( nItemId, pMenu ); - m_pMenu->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenu->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenu->SetItemText( nItemId, aLabel ); - m_pMenu->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenu->SetUserValue( nItemId, 0 ); - } - } - else - { - delete pMenu; - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "attribute id for element menu required!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - - m_xReader = Reference< XDocumentHandler >( new OReadMenuHandler( pMenu, m_pItemId )); - m_xReader->startDocument(); - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUITEM ))) - { - ULONG nHelpId = 0; - OUString aCommandId; - OUString aLabel; - - // read attributes for menu item - for ( int i=0; i< xAttrList->getLength(); i++ ) - { - OUString aName = xAttrList->getNameByIndex( i ); - OUString aValue = xAttrList->getValueByIndex( i ); - if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_ID ))) - aCommandId = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_LABEL ))) - aLabel = aValue; - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ATTRIBUTE_HELPID ))) - nHelpId = aValue.toInt32(); - } - - if ( aCommandId.getLength() > 0 ) - { - USHORT nItemId; - if ( aCommandId.compareTo( aSlotProtocol, aSlotProtocol.getLength() ) == 0 ) - nItemId = (USHORT) aCommandId.copy( aSlotProtocol.getLength() ).toInt32(); - else - nItemId = ++(*m_pItemId); - - m_pMenu->InsertItem( nItemId, String() ); - m_pMenu->SetItemCommand( nItemId, aCommandId ); - if ( nHelpId > 0 ) - m_pMenu->SetHelpId( nItemId, nHelpId ); - if ( aLabel.getLength() > 0 ) - { - m_pMenu->SetItemText( nItemId, aLabel ); - m_pMenu->SetUserValue( nItemId, MENU_SAVE_LABEL ); - } - else - { - m_pMenu->SetUserValue( nItemId, 0 ); - } - } - - m_nNextElementExpected = ELEM_CLOSE_MENUITEM; - } - else if ( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUSEPARATOR ))) - { - m_pMenu->InsertSeparator(); - m_nNextElementExpected = ELEM_CLOSE_MENUSEPARATOR; - } - else - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "unknown element found!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } -} - - -void SAL_CALL OReadMenuPopupHandler::characters(const rtl::OUString& aChars) -throw( SAXException, RuntimeException ) -{ -} - - -void SAL_CALL OReadMenuPopupHandler::endElement( const OUString& aName ) - throw( SAXException, RuntimeException ) -{ - --m_nElementDepth; - if ( m_bMenuMode ) - { - if ( 0 == m_nElementDepth ) - { - m_xReader->endDocument(); - m_xReader = Reference< XDocumentHandler >(); - m_bMenuMode = sal_False; - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENU ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menu expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else - m_xReader->endElement( aName ); - } - else - { - if ( m_nNextElementExpected == ELEM_CLOSE_MENUITEM ) - { - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUITEM ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menuitem expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - else if ( m_nNextElementExpected == ELEM_CLOSE_MENUSEPARATOR ) - { - if ( !aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ELEMENT_MENUSEPARATOR ))) - { - OUString aErrorMessage = getErrorLineString(); - aErrorMessage += OUString( RTL_CONSTASCII_USTRINGPARAM( "closing element menuseparator expected!" )); - throw SAXException( aErrorMessage, Reference< XInterface >(), Any() ); - } - } - - m_nNextElementExpected = ELEM_CLOSE_NONE; - } -} - - -// --------------------------------- Write XML --------------------------------- - - -OWriteMenuDocumentHandler::OWriteMenuDocumentHandler( MenuBar* pMenu, Reference< XDocumentHandler > rxWriteDocumentHandler ) : - m_pMenuBar( pMenu ), - m_xWriteDocumentHandler( rxWriteDocumentHandler ) -{ - m_xEmptyList = Reference< XAttributeList >( (XAttributeList *)new AttributeListImpl, UNO_QUERY ); - m_aAttributeType = OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_TYPE_CDATA )); -} - - -OWriteMenuDocumentHandler::~OWriteMenuDocumentHandler() -{ -} - - -void OWriteMenuDocumentHandler::WriteMenuDocument() -throw ( SAXException, RuntimeException ) -{ - AttributeListImpl* pList = new AttributeListImpl; - Reference< XAttributeList > rList( (XAttributeList *) pList , UNO_QUERY ); - - m_xWriteDocumentHandler->startDocument(); - - // write DOCTYPE line! - Reference< XExtendedDocumentHandler > xExtendedDocHandler( m_xWriteDocumentHandler, UNO_QUERY ); - if ( xExtendedDocHandler.is() ) - { - xExtendedDocHandler->unknown( OUString( RTL_CONSTASCII_USTRINGPARAM( MENUBAR_DOCTYPE )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - } - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_XMLNS_MENU )), - m_aAttributeType, - OUString( RTL_CONSTASCII_USTRINGPARAM( XMLNS_MENU )) ); - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - OUString( RTL_CONSTASCII_USTRINGPARAM( "menubar" )) ); - - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUBAR )), pList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - - WriteMenu( m_pMenuBar ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUBAR )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endDocument(); -} - - -void OWriteMenuDocumentHandler::WriteMenu( Menu* pMenu ) -throw ( SAXException, RuntimeException ) -{ - USHORT nItemCount = pMenu->GetItemCount(); - BOOL bSeparator = FALSE; - - for ( USHORT nItemPos = 0; nItemPos < nItemCount; nItemPos++ ) - { - USHORT nItemId = pMenu->GetItemId( nItemPos ); - - PopupMenu* pPopupMenu = pMenu->GetPopupMenu( nItemId ); - if ( pPopupMenu ) - { - OUString aItemCommand = pMenu->GetItemCommand( nItemId ); - - if ( nItemId == SID_NEWDOCDIRECT || - nItemId == SID_AUTOPILOTMENU ) - { - // special popup menus (filled during runtime) must be saved as a menuitem!!! - WriteMenuItem( pMenu, nItemId ); - bSeparator = FALSE; - } - else if ( nItemId == SID_FORMATMENU ) - { - // special popup menu - must be written as empty popup! - AttributeListImpl* pListMenu = new AttributeListImpl; - Reference< XAttributeList > xListMenu( (XAttributeList *)pListMenu , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId ) ); - - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )), xListMenu ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - bSeparator = FALSE; - } - else if ( !AddonPopupMenu::IsCommandURLPrefix ( aItemCommand )) - { - AttributeListImpl* pListMenu = new AttributeListImpl; - Reference< XAttributeList > xListMenu( (XAttributeList *)pListMenu , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pListMenu->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId ) ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )), xListMenu ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - - WriteMenu( pPopupMenu ); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUPOPUP )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENU )) ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - bSeparator = FALSE; - } - } - else - { - if ( pMenu->GetItemType( nItemPos ) != MENUITEM_SEPARATOR ) - { - // don't save special menu items for (window list and pickup list, add-ons ) - if ( !MenuConfiguration::IsPickListItemId( nItemId ) && - !MenuConfiguration::IsWindowListItemId( nItemId ) && - !AddonMenuManager::IsAddonMenuId( nItemId )) - { - bSeparator = FALSE; - WriteMenuItem( pMenu, nItemId ); - } - } - else if ( !bSeparator ) - { - // Don't write two separators together - WriteMenuSeparator(); - bSeparator = TRUE; - } - } - } -} - - -void OWriteMenuDocumentHandler::WriteMenuItem( Menu* pMenu, USHORT nItemId ) -{ - AttributeListImpl* pList = new AttributeListImpl; - Reference< XAttributeList > xList( (XAttributeList *) pList , UNO_QUERY ); - - String aCommand( pMenu->GetItemCommand( nItemId ) ); - if ( !aCommand.Len() ) - { - aCommand = String::CreateFromAscii("slot:"); - aCommand += String::CreateFromInt32( nItemId ); - } - - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_ID )), - m_aAttributeType, - aCommand ); - - ULONG nHelpId = pMenu->GetHelpId( nItemId ); - if ( nHelpId > 0 ) - { - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_HELPID )), - m_aAttributeType, - OUString::valueOf( sal_Int64( nHelpId )) ); - } - -// if ( pMenu->GetUserValue( nItemId ) & MENU_SAVE_LABEL ) - pList->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM( ATTRIBUTE_NS_LABEL )), - m_aAttributeType, - pMenu->GetItemText( nItemId )); - - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUITEM )), xList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUITEM )) ); -} - - -void OWriteMenuDocumentHandler::WriteMenuSeparator() -{ - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->startElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUSEPARATOR )), m_xEmptyList ); - m_xWriteDocumentHandler->ignorableWhitespace( OUString() ); - m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_NS_MENUSEPARATOR )) ); -} - -} // namespace framework diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 7be1516f1331..34579e903d6a 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -48,6 +48,7 @@ #include #include #include "helper/mischelper.hxx" +#include "helpid.hrc" using namespace com::sun::star::uno; using namespace com::sun::star::lang; @@ -97,9 +98,7 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo String aDisplayName = RetrieveLabelFromCommand( aCommand ); pPopupMenu->InsertItem( 2, aDisplayName ); pPopupMenu->SetItemCommand( 2, aCommand ); - //pPopupMenu->SetHelpId( 2, HID_SVX_BASIC_MACRO_ORGANIZER ); - // FIXME: HELPID - pPopupMenu->SetHelpId( 2, ""/*40012*/ ); + pPopupMenu->SetHelpId( 2, ".uno:MacroDialog" ); // insert providers but not basic or java addScriptItems( pPopupMenu, 4); @@ -219,9 +218,7 @@ void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, USHORT startIt aDisplayName.Append( ellipsis ); pPopupMenu->InsertItem( itemId, aDisplayName ); pPopupMenu->SetItemCommand( itemId, aCommand ); - //pPopupMenu->SetHelpId( itemId, HID_SVX_COMMON_MACRO_ORGANIZER ); - // FIXME: HELPID - pPopupMenu->SetHelpId( itemId, ""/*40014*/ ); + pPopupMenu->SetHelpId( itemId, rtl::OString( aCommand.GetBuffer(), aCommand.Len(), RTL_TEXTENCODING_UTF8 ) ); itemId++; break; } diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 0a3295c1395e..58c1c8782f9e 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1795,11 +1795,6 @@ void MenuBarManager::FillMenu( pMenu->InsertItem( nId, aLabel ); pMenu->SetItemCommand( nId, aCommandURL ); - sal_Int32 nHelpId = aHelpURL.toInt32(); - if ( nHelpId > 0 ) - // FIXME: HELPID - // (should set aHelpURL ? - pMenu->SetHelpId( nId, ""/*(USHORT)nHelpId*/ ); if ( nStyle ) { MenuItemBits nBits = pMenu->GetItemBits( nId ); diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx index d143b717366c..553026827524 100644 --- a/framework/source/uielement/statusbarmanager.cxx +++ b/framework/source/uielement/statusbarmanager.cxx @@ -530,17 +530,6 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc m_pStatusBar->InsertItem( nId, nWidth, nItemBits, nOffset ); m_pStatusBar->SetItemCommand( nId, aCommandURL ); m_pStatusBar->SetAccessibleName( nId, aString ); -// m_pStatusBar->SetHelpText( nId, aString ); - - if ( aHelpURL.indexOf( aHelpIdPrefix ) == 0 ) - { - rtl::OUString aId( aHelpURL.copy( HELPID_PREFIX_LENGTH )); - sal_uInt16 nHelpId = (sal_uInt16)(aId.toInt32()); - if ( nHelpId > 0 ) - // FIXME: HELPID - m_pStatusBar->SetHelpId( nId, ""/*nHelpId*/ ); - } - ++nId; } } diff --git a/framework/source/uielement/statusbarwrapper.cxx b/framework/source/uielement/statusbarwrapper.cxx index ed506f5345e3..030a790b35e3 100644 --- a/framework/source/uielement/statusbarwrapper.cxx +++ b/framework/source/uielement/statusbarwrapper.cxx @@ -137,8 +137,7 @@ void SAL_CALL StatusBarWrapper::initialize( const Sequence< Any >& aArguments ) pStatusBarManager = new StatusBarManager( m_xServiceFactory, xFrame, m_aResourceURL, pStatusBar ); ((FrameworkStatusBar*)pStatusBar)->SetStatusBarManager( pStatusBarManager ); m_xStatusBarManager = Reference< XComponent >( static_cast< OWeakObject *>( pStatusBarManager ), UNO_QUERY ); - // FIXME: HELPID - pStatusBar->SetUniqueId( ""/*HID_STATUSBAR*/ ); + pStatusBar->SetUniqueId( HID_STATUSBAR ); } } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 19625d5e198b..3cf90b1867f5 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -883,15 +883,13 @@ void ToolBarManager::CreateControllers() if ( nId == 0 ) continue; - // FIXME: HELPID - // What ? A width initalized with a help id ? Should we perhaps add two bananas and a coconut to it ? - // sal_Int16 nWidth( sal_Int16( m_pToolBar->GetHelpId( nId ))); - sal_Int16 nWidth( nId ); rtl::OUString aLoadURL( RTL_CONSTASCII_USTRINGPARAM( ".uno:OpenUrl" )); rtl::OUString aCommandURL( m_pToolBar->GetItemCommand( nId )); sal_Bool bInit( sal_True ); sal_Bool bCreate( sal_True ); Reference< XStatusListener > xController; + CommandToInfoMap::iterator pCommandIter = m_aCommandMap.find( aCommandURL ); + sal_Int32 nWidth = ( pCommandIter != m_aCommandMap.end() ? pCommandIter->second.nWidth : 0 ); svt::ToolboxController* pController( 0 ); @@ -1188,7 +1186,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine rtl::OUString aHelpURL; rtl::OUString aTooltip; sal_uInt16 nType( ::com::sun::star::ui::ItemType::DEFAULT ); - sal_uInt16 nWidth( 0 ); + sal_uInt32 nWidth( 0 ); sal_Bool bIsVisible( sal_True ); sal_uInt32 nStyle( 0 ); @@ -1277,6 +1275,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine if ( pIter == m_aCommandMap.end()) { aCmdInfo.nId = nId; + aCmdInfo.nWidth = nWidth; m_aCommandMap.insert( CommandToInfoMap::value_type( aCommandURL, aCmdInfo )); } else @@ -1284,10 +1283,6 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine pIter->second.aIds.push_back( nId ); } - // Add additional information for the controller to the obsolete help id - // FIXME: HELPID - m_pToolBar->SetHelpId( ""/*ULONG( nWidth )*/); - if ( !bIsVisible ) m_pToolBar->HideItem( nId ); diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx index 025ebea06a19..aca62a8b44ef 100644 --- a/framework/source/uielement/toolbarmerger.cxx +++ b/framework/source/uielement/toolbarmerger.cxx @@ -512,7 +512,6 @@ bool ToolBarMerger::MergeItems( pToolbar->InsertSeparator( sal_uInt16( nInsPos )); else { - ToolBarMerger::CreateToolbarItem( pToolbar, sal_uInt16( nInsPos ), rItemId, rItem ); CommandToInfoMap::iterator pIter = rCommandMap.find( rItem.aCommandURL ); if ( pIter == rCommandMap.end()) { @@ -524,6 +523,8 @@ bool ToolBarMerger::MergeItems( { pIter->second.aIds.push_back( rItemId ); } + + ToolBarMerger::CreateToolbarItem( pToolbar, rCommandMap, sal_uInt16( nInsPos ), rItemId, rItem ); } ++nIndex; @@ -691,7 +692,7 @@ bool ToolBarMerger::RemoveItems( return pResult; } -void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, sal_uInt16 nPos, sal_uInt16 nItemId, const AddonToolbarItem& rItem ) +void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, CommandToInfoMap& rCommandMap, sal_uInt16 nPos, sal_uInt16 nItemId, const AddonToolbarItem& rItem ) { pToolbar->InsertItem( nItemId, rItem.aLabel, 0, nPos ); pToolbar->SetItemCommand( nItemId, rItem.aCommandURL ); @@ -700,10 +701,9 @@ void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, sal_uInt16 nPos, sal_u pToolbar->EnableItem( nItemId, sal_True ); pToolbar->SetItemState( nItemId, STATE_NOCHECK ); - // Use obsolete help id to transport the width of the item - // FIXME: HELPID - // this looks broken - pToolbar->SetHelpId( nItemId, ""/*rItem.nWidth*/ ); + CommandToInfoMap::iterator pIter = rCommandMap.find( rItem.aCommandURL ); + if ( pIter != rCommandMap.end() ) + pIter->second.nWidth = rItem.nWidth; // Use the user data to store add-on specific data with the toolbar item AddonsParams* pAddonParams = new AddonsParams; diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index d3a616a76629..6ed3e7233a77 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -181,7 +181,7 @@ ToolbarsMenuController::~ToolbarsMenuController() } void ToolbarsMenuController::addCommand( - Reference< css::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, USHORT nHelpId, const rtl::OUString& rLabel ) + Reference< css::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OString& sHelpId, const rtl::OUString& rLabel ) { USHORT nItemId = m_xPopupMenu->getItemCount()+1; @@ -216,9 +216,7 @@ void ToolbarsMenuController::addCommand( PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); if ( !!aImage ) pVCLPopupMenu->SetItemImage( nItemId, aImage ); - // FIXME: HELPID - pVCLPopupMenu->SetHelpId( nItemId, ""/*nHelpId*/ ); - (void)nHelpId; + pVCLPopupMenu->SetHelpId( nItemId, sHelpId ); } m_aCommandVector.push_back( rCommandURL ); @@ -510,14 +508,14 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r m_aModuleIdentifier.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) || m_aModuleIdentifier.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) { - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_HYPERLINKBAR )), 10360, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_HYPERLINKBAR )), CMD_HYPERLINKBAR, aEmptyString ); if ( m_aModuleIdentifier.equalsAscii( "com.sun.star.drawing.DrawingDocument" ) || m_aModuleIdentifier.equalsAscii( "com.sun.star.presentation.PresentationDocument" )) - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_COLORBAR )), 10417, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_COLORBAR )), CMD_COLORBAR, aEmptyString ); else if ( m_aModuleIdentifier.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_INPUTLINEBAR )), 26241, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_INPUTLINEBAR )), CMD_INPUTLINEBAR, aEmptyString ); else - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_FORMULABAR )), 20128, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_FORMULABAR )), CMD_FORMULABAR, aEmptyString ); } sal_Bool bAddCommand( sal_True ); @@ -540,7 +538,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r m_xPopupMenu->insertSeparator( nItemCount+1 ); } - addCommand( m_xPopupMenu, aConfigureToolbar, 5904, aEmptyString ); + addCommand( m_xPopupMenu, aConfigureToolbar, CONFIGURE_TOOLBARS, aEmptyString ); } // Add separator if no configure has been added @@ -556,7 +554,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r String aLabelStr = String( FwkResId( STR_RESTORE_TOOLBARS )); rtl::OUString aRestoreCmd( RTL_CONSTASCII_USTRINGPARAM( CMD_RESTOREVISIBILITY )); - addCommand( m_xPopupMenu, aRestoreCmd, 9999, aLabelStr ); + addCommand( m_xPopupMenu, aRestoreCmd, CMD_RESTOREVISIBILITY, aLabelStr ); } } diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 4b2535a7e61b..9509219eb99a 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -276,6 +276,8 @@ SvCommand::SvCommand( int argc, char ** argv ) if( 's' == aFirstChar ) { // Name der Slot-Ausgabe aSlotMapFile = aName; + aName += String::CreateFromAscii(".csv"); + aCSVFile = aName; } else if( 'l' == aFirstChar ) { // Name der Listing diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx index 3508ea026637..fc7b318965b0 100644 --- a/sfx2/inc/sfx2/basedlgs.hxx +++ b/sfx2/inc/sfx2/basedlgs.hxx @@ -69,7 +69,6 @@ class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog { sal_uInt32 nUniqId; String aExtraData; - Timer aTimer; const SfxItemSet* pInputSet; SfxItemSet* pOutputSet; @@ -77,8 +76,6 @@ private: SAL_DLLPRIVATE SfxModalDialog(SfxModalDialog &); // not defined SAL_DLLPRIVATE void operator =(SfxModalDialog &); // not defined - DECL_DLLPRIVATE_LINK( TimerHdl_Impl, Timer* ); - SAL_DLLPRIVATE void SetDialogData_Impl(); SAL_DLLPRIVATE void GetDialogData_Impl(); SAL_DLLPRIVATE void init(); diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx index f0dd2248c456..8d99d6efd9f4 100644 --- a/sfx2/inc/sfx2/dispatch.hxx +++ b/sfx2/inc/sfx2/dispatch.hxx @@ -122,7 +122,7 @@ friend class SfxViewFrame; DECL_DLLPRIVATE_LINK( PostMsgHandler, SfxRequest * ); SAL_DLLPRIVATE int Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, BOOL bRecord ); - SAL_DLLPRIVATE sal_uInt32 _Update_Impl( BOOL,BOOL,BOOL,SfxWorkWindow*); + SAL_DLLPRIVATE void _Update_Impl( BOOL,BOOL,BOOL,SfxWorkWindow*); SAL_DLLPRIVATE void CollectTools_Impl(SfxWorkWindow*); protected: @@ -237,7 +237,7 @@ public: //#if 0 // _SOLAR__PRIVATE SAL_DLLPRIVATE BOOL HasSlot_Impl( USHORT ); SAL_DLLPRIVATE void SetMenu_Impl(); - SAL_DLLPRIVATE long Update_Impl( BOOL bForce = FALSE ); // ObjectBars etc. + SAL_DLLPRIVATE void Update_Impl( BOOL bForce = FALSE ); // ObjectBars etc. SAL_DLLPRIVATE BOOL IsUpdated_Impl() const; SAL_DLLPRIVATE void DebugOutput_Impl() const; SAL_DLLPRIVATE void ResetObjectBars_Impl(); diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index d17553e2b2d0..ac267c7c6d45 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -305,7 +305,7 @@ public: Pointer to an array of help ids. For each element in _pControlId, there must be a corresponding element herein. */ - void SetControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId ); + void SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); void SetDialogHelpId( const sal_Int32 _nHelpId ); void CreateMatcher( const String& rName ); diff --git a/sfx2/inc/sfx2/mnumgr.hxx b/sfx2/inc/sfx2/mnumgr.hxx index ee1c81daa603..98c282562354 100644 --- a/sfx2/inc/sfx2/mnumgr.hxx +++ b/sfx2/inc/sfx2/mnumgr.hxx @@ -122,7 +122,7 @@ public: void EndInsert(); void CheckItem( USHORT, BOOL ); void RemoveItem( USHORT ); - void InsertItem( USHORT, const String&, MenuItemBits, + void InsertItem( USHORT, const String&, MenuItemBits, const rtl::OString& rHelpId, USHORT nPos = MENU_APPEND ); void InsertSeparator( USHORT nPos = MENU_APPEND ); void RemoveDisabledEntries(); diff --git a/sfx2/inc/sfx2/msg.hxx b/sfx2/inc/sfx2/msg.hxx index efbc2d2c75af..10fbd222a2ed 100644 --- a/sfx2/inc/sfx2/msg.hxx +++ b/sfx2/inc/sfx2/msg.hxx @@ -29,6 +29,9 @@ #include #include +#include +#include +#include //-------------------------------------------------------------------- @@ -287,6 +290,8 @@ public: USHORT GetValue() const { return nValue; } const SfxType* GetType() const { return pType; } const char* GetUnoName() const { return pUnoName; } + SFX2_DLLPUBLIC rtl::OString GetCommand() const; + SFX2_DLLPUBLIC rtl::OUString GetCommandString() const; USHORT GetFormalArgumentCount() const { return nArgDefCount; } const SfxFormalArgument& GetFormalArgument( USHORT nNo ) const diff --git a/sfx2/inc/sfx2/opengrf.hxx b/sfx2/inc/sfx2/opengrf.hxx index 0d11462685d5..a041f6687c62 100644 --- a/sfx2/inc/sfx2/opengrf.hxx +++ b/sfx2/inc/sfx2/opengrf.hxx @@ -55,7 +55,7 @@ public: void SetCurrentFilter(const String&); /// Set dialog help id at FileDlgHelper - void SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId ); + void SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId ); /// Set control help ids at FileDlgHelper void SetDialogHelpId( const INT32 _nHelpId ); private: diff --git a/sfx2/inc/sfx2/sfxcommands.h b/sfx2/inc/sfx2/sfxcommands.h new file mode 100644 index 000000000000..bdf27baac7b3 --- /dev/null +++ b/sfx2/inc/sfx2/sfxcommands.h @@ -0,0 +1,345 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SFX2_SFXCOMMANDS_HRC +#define SFX2_SFXCOMMANDS_HRC + +#define CMD_SID_VIEWSHELL0 ".uno:_SwitchViewShell0" +#define CMD_SID_VIEWSHELL1 ".uno:_SwitchViewShell1" +#define CMD_SID_VIEWSHELL2 ".uno:_SwitchViewShell2" +#define CMD_SID_VIEWSHELL3 ".uno:_SwitchViewShell3" +#define CMD_SID_VIEWSHELL4 ".uno:_SwitchViewShell4" +#define CMD_SID_ABOUT ".uno:About" +#define CMD_SID_ACTIVATE ".uno:Activate" +#define CMD_SID_HELPBALLOONS ".uno:ActiveHelp" +#define CMD_SID_STYLE_FAMILY ".uno:ActualStyleFamily" +#define CMD_SID_NEWDOC ".uno:NewDoc" +#define CMD_SID_CREATELINK ".uno:AddBookmark" +#define CMD_SID_NEWDOCDIRECT ".uno:AddDirect" +#define CMD_SID_TEMPLATE_ADDRESSBOKSOURCE ".uno:AddressBookSource" +#define CMD_SID_BASICIDE_ADDWATCH ".uno:AddWatch" +#define CMD_SID_DOCINFO_AUTHOR ".uno:Author" +#define CMD_SID_AUTOHIDE ".uno:AutoHide" +#define CMD_SID_AUTOPILOTMENU ".uno:AutoPilotMenu" +#define CMD_SID_GALLERY_BG_BRUSH ".uno:BackgroundImage" +#define CMD_SID_BACKSPACE ".uno:Backspace" +#define CMD_SID_BASICBREAK ".uno:BasicBreak" +#define CMD_SID_BASICIDE_APPEAR ".uno:BasicIDEAppear" +#define CMD_SID_BASICSTEPINTO ".uno:BasicStepInto" +#define CMD_SID_BASICSTEPOUT ".uno:BasicStepOut" +#define CMD_SID_BASICSTEPOVER ".uno:BasicStepOver" +#define CMD_SID_BASICSTOP ".uno:BasicStop" +#define CMD_SID_BROWSER ".uno:Beamer" +#define CMD_SID_BASICIDE_BRKPNTSCHANGED ".uno:BreakPointsChanged" +#define CMD_SID_BROWSE_BACKWARD ".uno:BrowseBackward" +#define CMD_SID_BROWSE_FORWARD ".uno:BrowseForward" +#define CMD_SID_BROWSER_MODE ".uno:BrowseView" +#define CMD_SID_BUILD_VERSION ".uno:BuildVersion" +#define CMD_SID_CAPTION ".uno:Caption" +#define CMD_SID_STYLE_FAMILY1 ".uno:CharStyle" +#define CMD_SID_CHECK_KEY ".uno:CheckKey" +#define CMD_SID_BASICIDE_CHOOSEMACRO ".uno:ChooseMacro" +#define CMD_SID_CLEARHISTORY ".uno:ClearHistory" +#define CMD_SID_CLOSEWINS ".uno:CloseWins" +#define CMD_SID_CLOSEDOCS ".uno:CloseDocs" +#define CMD_SID_CLOSEDOC ".uno:CloseDoc" +#define CMD_SID_CLOSEWIN ".uno:CloseWin" +#define CMD_SID_CLOSING ".uno:Closing" +#define CMD_SID_DOCINFO_COMMENTS ".uno:Comments" +#define CMD_SID_OFFICE_COMMERCIAL_USE ".uno:CommercialUse" +#define CMD_SID_DOCUMENT_COMPARE ".uno:CompareDocuments" +#define CMD_SID_BASICCOMPILE ".uno:CompileBasic" +#define CMD_SID_CONFIG ".uno:ConfigureDialog" +#define CMD_SID_CONTEXT ".uno:Context" +#define CMD_SID_COPY ".uno:Copy" +#define CMD_SID_CRASH ".uno:Crash" +#define CMD_SID_BASICIDE_CREATEMACRO ".uno:CreateMacro" +#define CMD_SID_CURRENT_URL ".uno:CurrentURL" +#define CMD_SID_CURSORENDOFSCREEN ".uno:CursorEndOfScreen" +#define CMD_SID_CURSORTOPOFSCREEN ".uno:CursorTopOfScreen" +#define CMD_SID_OFFICE_CUSTOMERNUMBER ".uno:CustomerNumber" +#define CMD_SID_CUT ".uno:Cut" +#define CMD_SID_DEFAULTFILEPATH ".uno:DefaultFilePath" +#define CMD_SID_DEFAULTFILENAME ".uno:DefaultFileName" +#define CMD_SID_DELETE ".uno:Delete" +#define CMD_SID_BASICIDE_DELETECURRENT ".uno:DeleteCurrent" +#define CMD_SID_STYLE_DELETE ".uno:DeleteStyle" +#define CMD_SID_STYLE_DESIGNER ".uno:DesignerDialog" +#define CMD_SID_STYLE_DRAGHIERARCHIE ".uno:DragHierarchy" +#define CMD_SID_EDITDOC ".uno:EditDoc" +#define CMD_SID_BASICIDE_EDITMACRO ".uno:EditMacro" +#define CMD_SID_STYLE_EDIT ".uno:EditStyle" +#define CMD_FID_SEARCH_NOW ".uno:ExecuteSearch" +#define CMD_SID_EXTENDEDHELP ".uno:ExtendedHelp" +#define CMD_SID_FILE_NAME ".uno:FileName" +#define CMD_SID_FOCUSURLBOX ".uno:FocusUrlBox" +#define CMD_SID_FORMATMENU ".uno:FormatMenu" +#define CMD_SID_STYLE_FAMILY3 ".uno:FrameStyle" +#define CMD_SID_FRAMETITLE ".uno:FrameTitle" +#define CMD_SID_PROGFILENAME ".uno:FullName" +#define CMD_SID_DOCFULLNAME ".uno:FullName" +#define CMD_SID_WIN_FULLSCREEN ".uno:FullScreen" +#define CMD_SID_FILLFRAME ".uno:GetFrameWindow" +#define CMD_SID_CURSORDOWN ".uno:GoDown" +#define CMD_SID_CURSORPAGEDOWN ".uno:GoDownBlock" +#define CMD_SID_CURSORPAGEDOWN_SEL ".uno:GoDownBlockSel" +#define CMD_SID_CURSORDOWN_SEL ".uno:GoDownSel" +#define CMD_SID_CURSORLEFT ".uno:GoLeft" +#define CMD_SID_CURSORPAGELEFT ".uno:GoLeftBlock" +#define CMD_SID_CURSORPAGELEFT_SEL ".uno:GoLeftBlockSel" +#define CMD_SID_CURSORLEFT_SEL ".uno:GoLeftSel" +#define CMD_SID_CURSORRIGHT ".uno:GoRight" +#define CMD_SID_CURSORRIGHT_SEL ".uno:GoRightSel" +#define CMD_SID_CURSORENDOFFILE ".uno:GoToEndOfData" +#define CMD_SID_CURSORENDOFFILE_SEL ".uno:GoToEndOfDataSel" +#define CMD_SID_CURSOREND ".uno:GoToEndOfRow" +#define CMD_SID_CURSOREND_SEL ".uno:GoToEndOfRowSel" +#define CMD_SID_CURSORTOPOFFILE ".uno:GoToStart" +#define CMD_SID_CURSORHOME ".uno:GoToStartOfRow" +#define CMD_SID_CURSORHOME_SEL ".uno:GoToStartOfRowSel" +#define CMD_SID_CURSORTOPOFFILE_SEL ".uno:GoToStartSel" +#define CMD_SID_CURSORUP ".uno:GoUp" +#define CMD_SID_CURSORPAGEUP ".uno:GoUpBlock" +#define CMD_SID_CURSORPAGEUP_SEL ".uno:GoUpBlockSel" +#define CMD_SID_CURSORUP_SEL ".uno:GoUpSel" +#define CMD_SID_HELP_ANNOTATE ".uno:HelpAnnotate" +#define CMD_SID_HELP_BOOKMARK ".uno:HelpBookmark" +#define CMD_SID_HELP_HELPFILEBOX ".uno:HelpChooseFile" +#define CMD_SID_HELP_DOWNLOAD ".uno:HelpDownload" +#define CMD_SID_HELP_PI ".uno:HelperDialog" +#define CMD_SID_HELPINDEX ".uno:HelpIndex" +#define CMD_SID_HELPMENU ".uno:HelpMenu" +#define CMD_SID_HELPONHELP ".uno:HelpOnHelp" +#define CMD_SID_HELP_SEARCH ".uno:HelpSearch" +#define CMD_SID_HELPTIPS ".uno:HelpTip" +#define CMD_SID_HELP_ZOOMIN ".uno:HelpZoomIn" +#define CMD_SID_HELP_ZOOMOUT ".uno:HelpZoomOut" +#define CMD_SID_BASICIDE_HIDECURPAGE ".uno:HideCurPage" +#define CMD_SID_HYPERLINK_DIALOG ".uno:HyperlinkDialog" +#define CMD_SID_INSERTDOC ".uno:InsertDoc" +#define CMD_SID_HYPERLINK_INSERT ".uno:InsertHyperlink" +#define CMD_SID_INSERT_FLOATINGFRAME ".uno:InsertObjectFloatingFrame" +#define CMD_SID_INTERNET_ONLINE ".uno:InternetOnline" +#define CMD_SID_INTERNET_SEARCH ".uno:InternetSearch" +#define CMD_SID_DOC_LOADING ".uno:IsLoading" +#define CMD_SID_IMG_LOADING ".uno:IsLoadingImages" +#define CMD_SID_PRINTOUT ".uno:IsPrinting" +#define CMD_SID_JUMPTOMARK ".uno:JumpToMark" +#define CMD_SID_DOCINFO_KEYWORDS ".uno:Keywords" +#define CMD_SID_BASICIDE_LIBLOADED ".uno:LibLoaded" +#define CMD_SID_BASICIDE_LIBREMOVED ".uno:LibRemoved" +#define CMD_SID_BASICIDE_LIBSELECTED ".uno:LibSelect" +#define CMD_SID_BASICIDE_LIBSELECTOR ".uno:LibSelector" +#define CMD_SID_OFFICE_PLK ".uno:LicenceKey" +#define CMD_SID_CONFIGACCEL ".uno:LoadAccel" +#define CMD_SID_BASICLOAD ".uno:LoadBasic" +#define CMD_SID_LOADCONFIG ".uno:LoadConfiguration" +#define CMD_SID_CONFIGEVENT ".uno:LoadEvents" +#define CMD_SID_CONFIGMENU ".uno:LoadMenu" +#define CMD_SID_CONFIGSTATUSBAR ".uno:LoadStatusBar" +#define CMD_SID_TOOLBOXOPTIONS ".uno:LoadToolBox" +#define CMD_SID_LOGOUT ".uno:Logout" +#define CMD_SID_SCRIPTORGANIZER ".uno:ScriptOrganizer" +#define CMD_SID_MACROORGANIZER ".uno:MacroOrganizer" +#define CMD_SID_RUNMACRO ".uno:RunMacro" +#define CMD_SID_BASICCHOOSER ".uno:MacroDialog" +#define CMD_SID_MAIL_NOTIFY ".uno:MailReceipt" +#define CMD_SID_MAIL_CHILDWIN ".uno:MailWindow" +#define CMD_SID_BASICIDE_MATCHGROUP ".uno:MatchGroup" +#define CMD_SID_TOGGLE_MENUBAR ".uno:MenuBarVisible" +#define CMD_SID_DOCUMENT_MERGE ".uno:MergeDocuments" +#define CMD_SID_ATTR_METRIC ".uno:MetricUnit" +#define CMD_SID_MODIFIED ".uno:Modified" +#define CMD_SID_DOC_MODIFIED ".uno:ModifiedStatus" +#define CMD_SID_BASICIDE_MODULEDLG ".uno:ModuleDialog" +#define CMD_SID_BASICIDE_NAMECHANGEDONTAB ".uno:NameChangedOnTab" +#define CMD_SID_NAVIGATOR ".uno:Navigator" +#define CMD_SID_RESTORE_EDITING_VIEW ".uno:RestoreEditingView" +#define CMD_SID_BASICIDE_NEWDIALOG ".uno:NewDialog" +#define CMD_SID_BASICIDE_NEWMODULE ".uno:NewModule" +#define CMD_SID_CREATE_BASICOBJECT ".uno:NewObject" +#define CMD_SID_STYLE_NEW ".uno:NewStyle" +#define CMD_SID_NEWWINDOW ".uno:NewWindow" +#define CMD_SID_BASICIDE_OBJCAT ".uno:ObjectCatalog" +#define CMD_SID_OBJECT ".uno:ObjectMenue" +#define CMD_SID_OLD_PALK ".uno:OldPALK" +#define CMD_SID_OPENDOC ".uno:Open" +#define CMD_SID_WEBHTML ".uno:WebHtml" +#define CMD_SID_OPENHYPERLINK ".uno:OpenHyperlink" +#define CMD_SID_DOCINFO_TITLE ".uno:DocInfoTitle" +#define CMD_SID_OPENTEMPLATE ".uno:OpenTemplate" +#define CMD_SID_OPENURL ".uno:OpenUrl" +#define CMD_SID_OPTIONS ".uno:Options" +#define CMD_SID_ORGANIZER ".uno:Organizer" +#define CMD_SID_STYLE_FAMILY4 ".uno:PageStyle" +#define CMD_SID_STYLE_FAMILY2 ".uno:ParaStyle" +#define CMD_SID_PARTWIN ".uno:PartWindow" +#define CMD_SID_PASTE ".uno:Paste" +#define CMD_SID_CLIPBOARD_FORMAT_ITEMS ".uno:ClipboardFormatItems" +#define CMD_SID_PASTE_SPECIAL ".uno:PasteSpecial" +#define CMD_SID_DOCPATH ".uno:DocPath" +#define CMD_SID_PICKLIST ".uno:PickList" +#define CMD_SID_PLAYMACRO ".uno:PlayMacro" +#define CMD_SID_PLUGINS_ACTIVE ".uno:PlugInsActive" +#define CMD_SID_PRINTDOC ".uno:Print" +#define CMD_SID_PRINTDOCDIRECT ".uno:PrintDefault" +#define CMD_SID_PRINTER_NAME ".uno:Printer" +#define CMD_SID_SETUPPRINTER ".uno:PrinterSetup" +#define CMD_SID_PRINTPREVIEW ".uno:PrintPreview" +#define CMD_SID_OFFICE_PRIVATE_USE ".uno:PrivateUse" +#define CMD_SID_DOCINFO ".uno:SetDocumentProperties" +#define CMD_SID_QUITAPP ".uno:Quit" +#define CMD_SID_DOC_READONLY ".uno:ReadOnly" +#define CMD_SID_RECORDMACRO ".uno:MacroRecorder" +#define CMD_SID_STOP_RECORDING ".uno:StopRecording" +#define CMD_SID_RECORDING_FLOATWINDOW ".uno:MacroRecordingFloat" +#define CMD_SID_REDO ".uno:Redo" +#define CMD_SID_DELETE_BASICOBJECT ".uno:ReleaseObject" +#define CMD_SID_RELOAD ".uno:Reload" +#define CMD_SID_BASICIDE_REMOVEWATCH ".uno:RemoveWatch" +#define CMD_SID_BASICIDE_RENAMECURRENT ".uno:RenameCurrent" +#define CMD_SID_REPAINT ".uno:Repaint" +#define CMD_SID_REPEAT ".uno:RepeatAction" +#define CMD_SID_RUBY_DIALOG ".uno:RubyDialog" +#define CMD_SID_BASICRUN ".uno:RunBasic" +#define CMD_SID_STARTSW ".uno:RunStarWriter" +#define CMD_SID_SAVEDOC ".uno:Save" +#define CMD_SID_SAVEDOCS ".uno:SaveAll" +#define CMD_SID_SAVEASDOC ".uno:SaveAs" +#define CMD_SID_DOCTEMPLATE ".uno:SaveAsTemplate" +#define CMD_SID_BASICSAVEAS ".uno:SaveBasicAs" +#define CMD_SID_EXPORT_DIALOG ".uno:ExportDialog" +#define CMD_SID_IMPORT_DIALOG ".uno:ImportDialog" +#define CMD_SID_SAVECONFIG ".uno:SaveConfiguration" +#define CMD_SID_DOC_SAVED ".uno:Saved" +#define CMD_SID_BASICIDE_SBXDELETED ".uno:SbxDeleted" +#define CMD_SID_BASICIDE_SBXINSERTED ".uno:SbxInserted" +#define CMD_SID_BASICIDE_SBXRENAMED ".uno:SbxRenamed" +#define CMD_SID_MAIL_SCROLLBODY_PAGEDOWN ".uno:ScrollBodyPageDown" +#define CMD_SID_SEARCH_DLG ".uno:SearchDialog" +#define CMD_SID_SEARCH_OPTIONS ".uno:SearchOptions" +#define CMD_SID_SEARCH_ITEM ".uno:SearchProperties" +#define CMD_SID_SELECTALL ".uno:SelectAll" +#define CMD_FN_FAX ".uno:SendFax" +#define CMD_SID_MAIL_SENDDOC ".uno:SendMail" +#define CMD_SID_MAIL_SENDDOCASPDF ".uno:SendMailDocAsPDF" +#define CMD_SID_MAIL_SENDDOCASFORMAT ".uno:SendMailDocAsFormat" +#define CMD_SID_MAIL_SENDDOCASMS ".uno:SendMailDocAsMS" +#define CMD_SID_MAIL_SENDDOCASOOO ".uno:SendMailDocAsOOo" +#define CMD_SID_SETOPTIONS ".uno:SetOptions" +#define CMD_SID_OFFICE_PALK ".uno:SetPALK" +#define CMD_SID_SHOW_BROWSER ".uno:ShowBrowser" +#define CMD_SID_SHOWPOPUPS ".uno:ShowPopups" +#define CMD_SID_BASICIDE_SHOWSBX ".uno:ShowSbx" +#define CMD_SID_SOURCEVIEW ".uno:SourceView" +#define CMD_SID_ONLINE_REGISTRATION_DLG ".uno:StartRegistrationDialog" +#define CMD_SID_STATUSBARTEXT ".uno:StatusBar" +#define CMD_SID_TOGGLESTATUSBAR ".uno:StatusBarVisible" +#define CMD_SID_BASICIDE_STAT_DATE ".uno:StatusGetDate" +#define CMD_SID_BASICIDE_STAT_POS ".uno:StatusGetPosition" +#define CMD_SID_BASICIDE_STAT_TITLE ".uno:StatusGetTitle" +#define CMD_SID_BASICIDE_STOREALLMODULESOURCES ".uno:StoreAllModuleSources" +#define CMD_SID_BASICIDE_STOREMODULESOURCE ".uno:StoreModuleSource" +#define CMD_SID_STYLE_APPLY ".uno:StyleApplyState" +#define CMD_SID_STYLE_CATALOG ".uno:StyleCatalog" +#define CMD_SID_STYLE_NEW_BY_EXAMPLE ".uno:StyleNewByExample" +#define CMD_SID_STYLE_UPDATE_BY_EXAMPLE ".uno:StyleUpdateByExample" +#define CMD_SID_STYLE_WATERCAN ".uno:StyleWatercanMode" +#define CMD_SID_VIEWSHELL ".uno:SwitchViewShell" +#define CMD_SID_TASKBAR ".uno:TaskBarVisible" +#define CMD_SID_STYLE_FAMILY5 ".uno:ListStyle" +#define CMD_SID_TIPWINDOW ".uno:TipsDialog" +#define CMD_SID_DOCTITLE ".uno:Title" +#define CMD_SID_TITLE ".uno:Title" +#define CMD_SID_BASICIDE_TOGGLEBRKPNT ".uno:ToggleBreakPoint" +#define CMD_SID_BASICIDE_SHOWWINDOW ".uno:BasicIDEShowWindow" +#define CMD_SID_EDITMACRO ".uno:ToolsMacroEdit" +#define CMD_SID_UNDO ".uno:Undo" +#define CMD_SID_FORMATPAINTBRUSH ".uno:FormatPaintbrush" +#define CMD_SID_ATTR_UNDO_COUNT ".uno:UndoCount" +#define CMD_SID_BASICIDE_UPDATEALLMODULESOURCES ".uno:UpdateAllModuleSources" +#define CMD_SID_BASICIDE_UPDATEMODULESOURCE ".uno:UpdateModuleSource" +#define CMD_SID_BASICIDE_MANAGEBRKPNTS ".uno:ManageBreakPoints" +#define CMD_SID_BASICIDE_TOGGLEBRKPNTENABLED ".uno:ToggleBreakPointEnabled" +#define CMD_SID_UPDATE_VERSION ".uno:UpdateVersion" +#define CMD_SID_VERSION ".uno:VersionDialog" +#define CMD_SID_SIGNATURE ".uno:Signature" +#define CMD_SID_MACRO_SIGNATURE ".uno:MacroSignature" +#define CMD_SID_VERSION_VISIBLE ".uno:VersionVisible" +#define CMD_SID_VIEW_DATA_SOURCE_BROWSER ".uno:ViewDataSourceBrowser" +#define CMD_SID_WIN_VISIBLE ".uno:WinVisible" +#define CMD_SID_MDIWINDOWLIST ".uno:WindowList" +#define CMD_SID_ZOOM_IN ".uno:ZoomMinus" +#define CMD_SID_ZOOM ".uno:Zooming" +#define CMD_SID_ZOOM_NEXT ".uno:ZoomNext" +#define CMD_SID_ZOOM_OUT ".uno:ZoomPlus" +#define CMD_SID_ZOOM_PREV ".uno:ZoomPrevious" +#define CMD_SID_ZOOM_TOOLBOX ".uno:ZoomToolBox" +#define CMD_SID_EXPORTDOC ".uno:ExportTo" +#define CMD_SID_EXPORTDOCASPDF ".uno:ExportToPDF" +#define CMD_SID_DIRECTEXPORTDOCASPDF ".uno:ExportDirectToPDF" +#define CMD_SID_IMAGE_ORIENTATION ".uno:ImageOrientation" +#define CMD_SID_SAVE_VERSION_ON_CLOSE ".uno:SaveVersionOnClose" +#define CMD_SID_ADDONS ".uno:Addons" +#define CMD_SID_SHOW_IME_STATUS_WINDOW ".uno:ShowImeStatusWindow" +#define CMD_SID_UPDATE_CONFIG ".uno:UpdateConfiguration" +#define CMD_SID_HELP_SUPPORTPAGE ".uno:HelpSupport" +#define CMD_SID_HELP_TUTORIALS ".uno:HelpTutorials" +#define CMD_SID_ADDONHELP ".uno:AddonHelp" +#define CMD_SID_FORMATMENUSTATE ".uno:FormatMenuState" +#define CMD_SID_INET_DLG ".uno:InternetDialog" +#define CMD_SID_ONLINE_REGISTRATION ".uno:OnlineRegistrationDlg" +#define CMD_SID_OFFICE_CHECK_PLZ ".uno:CheckPLZ" +#define CMD_SID_ADDRESS_DATA_SOURCE ".uno:AutoPilotAddressDataSource" +#define CMD_FN_BUSINESS_CARD ".uno:InsertBusinessCard" +#define CMD_FN_LABEL ".uno:InsertLabels" +#define CMD_FN_XFORMS_INIT ".uno:NewXForms" +#define CMD_SID_SD_AUTOPILOT ".uno:AutoPilotPresentations" +#define CMD_SID_NEWSD ".uno:NewPresentation" +#define CMD_SID_COMP_BIBLIOGRAPHY ".uno:BibliographyComponent" +#define CMD_SID_MINIMIZED ".uno:Minimized" +#define CMD_SID_AUTO_CORRECT_DLG ".uno:AutoCorrectDlg" +#define CMD_SID_OPTIONS_TREEDIALOG ".uno:OptionsTreeDialog" +#define CMD_SID_TERMINATE_INPLACEACTIVATION ".uno:TerminateInplaceActivation" +#define CMD_SID_RECENTFILELIST ".uno:RecentFileList" +#define CMD_SID_AVAILABLE_TOOLBARS ".uno:AvailableToolbars" +#define CMD_SID_AVMEDIA_PLAYER ".uno:AVMediaPlayer" +#define CMD_SID_INSERT_AVMEDIA ".uno:InsertAVMedia" +#define CMD_SID_MORE_DICTIONARIES ".uno:MoreDictionaries" +#define CMD_SID_ACTIVATE_STYLE_APPLY ".uno:ActivateStyleApply" +#define CMD_SID_DOCKWIN_0 ".uno:DockingWindow0" +#define CMD_SID_DOCKWIN_1 ".uno:DockingWindow1" +#define CMD_SID_DOCKWIN_2 ".uno:DockingWindow2" +#define CMD_SID_DOCKWIN_3 ".uno:DockingWindow3" +#define CMD_SID_DOCKWIN_4 ".uno:DockingWindow4" +#define CMD_SID_DOCKWIN_5 ".uno:DockingWindow5" +#define CMD_SID_DOCKWIN_6 ".uno:DockingWindow6" +#define CMD_SID_DOCKWIN_7 ".uno:DockingWindow7" +#define CMD_SID_DOCKWIN_8 ".uno:DockingWindow8" +#define CMD_SID_DOCKWIN_9 ".uno:DockingWindow9" +#define CMD_SID_PASTE_UNFORMATTED ".uno:PasteUnformatted" + +#endif diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx index d82abeefe8bc..f3d773f98afc 100644 --- a/sfx2/inc/sfx2/sfxdlg.hxx +++ b/sfx2/inc/sfx2/sfxdlg.hxx @@ -133,10 +133,10 @@ public: const String *pUserButtonText=0 ) = 0; virtual CreateTabPage GetTabPageCreatorFunc( USHORT nId ) = 0; virtual GetTabPageRanges GetTabPageRangesFunc( USHORT nId ) = 0; - virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, USHORT nSlotId, + virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( Window* pParent, const rtl::OUString& rCommand, const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStor, const SvObjectServerList* pList = 0 )=0; - virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, USHORT nSlotId, + virtual VclAbstractDialog* CreateEditObjectDialog( Window* pParent, const rtl::OUString& rCommand, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObj )=0; virtual SfxAbstractPasteDialog* CreatePasteDialog( Window* pParent )=0; virtual SfxAbstractLinksDialog* CreateLinksDialog( Window* pParent, sfx2::LinkManager* pMgr, BOOL bHTML=FALSE, sfx2::SvBaseLink* p=0 )=0; diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx index b19f78c6184b..608361a1e777 100644 --- a/sfx2/inc/sfxhelp.hxx +++ b/sfx2/inc/sfxhelp.hxx @@ -45,15 +45,10 @@ class SFX2_DLLPUBLIC SfxHelp : public Help SfxHelp_Impl* pImp; private: - // FIXME: HELPID - // SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); - // FIXME: HELPID - // SAL_DLLPRIVATE virtual void OpenHelpAgent( ULONG nHelpId ); + SAL_DLLPRIVATE virtual void OpenHelpAgent( const rtl::OString& sHelpId ); SAL_DLLPRIVATE String GetHelpModuleName_Impl(); - // FIXME: HELPID - // SAL_DLLPRIVATE String CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ); SAL_DLLPRIVATE String CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ); public: @@ -63,15 +58,11 @@ public: inline void SetTicket( const String& rTicket ) { aTicket = rTicket; } inline void SetUser( const String& rUser ) { aUser = rUser; } - // FIXME: HELPID - //virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow ); virtual XubString GetHelpText( const String&, const Window* pWindow ); - // FIXME: HELPID - // static String CreateHelpURL( ULONG nHelpId, const String& rModuleName ); static String CreateHelpURL( const String& aCommandURL, const String& rModuleName ); using Help::OpenHelpAgent; - static void OpenHelpAgent( SfxFrame* pFrame, ULONG nHelpId ); + static void OpenHelpAgent( SfxFrame* pFrame, const rtl::OString& sHelpId ); static String GetDefaultHelpModule(); static ::rtl::OUString GetCurrentModuleIdentifier(); }; diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 10a920852848..785eea211f4f 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -6356,7 +6356,7 @@ SfxBoolItem TaskBarVisible SID_TASKBAR ] //-------------------------------------------------------------------------- -SfxTemplateItem TemplateFamily5 SID_STYLE_FAMILY5 +SfxTemplateItem ListStyle SID_STYLE_FAMILY5 [ /* flags: */ diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index 0858e66e7347..47750cd73f78 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -626,169 +626,6 @@ String RID_ENVTOOLBOX Text [ en-US ] = "Function Bar" ; }; -ToolBox RID_ENVTOOLBOX -{ - HelpId = RID_ENVTOOLBOX ; - ButtonType = BUTTON_SYMBOL ; - LineSpacing = TRUE ; - Border = TRUE ; - Scroll = TRUE ; - SVLook = TRUE ; - Dockable = TRUE ; - Moveable = TRUE ; - Sizeable = TRUE ; - Closeable = TRUE ; - Zoomable = TRUE ; - Customize = TRUE ; - FloatingMode = FALSE ; - Hide = TRUE ; - HideWhenDeactivate = TRUE ; - Align = BOXALIGN_TOP ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_OPENURL ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_NEWDOCDIRECT ; - DropDown = TRUE; - }; - ToolBoxItem - { - Identifier = SID_NEWDOC ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = SID_OPENDOC ; - }; - ToolBoxItem - { - Identifier = SID_SAVEDOC ; - }; - ToolBoxItem - { - Identifier = SID_SAVEASDOC ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_EDITDOC ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_DIRECTEXPORTDOCASPDF ; - }; - ToolBoxItem - { - Identifier = SID_PRINTDOCDIRECT ; - }; - ToolBoxItem - { - Identifier = FN_FAX ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_CUT ; - }; - ToolBoxItem - { - Identifier = SID_COPY ; - }; - ToolBoxItem - { - Identifier = SID_PASTE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_UNDO ; - }; - ToolBoxItem - { - Identifier = SID_REDO ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_NAVIGATOR ; - }; - ToolBoxItem - { - Identifier = SID_STYLE_DESIGNER ; - }; - ToolBoxItem - { - Identifier = SID_HYPERLINK_DIALOG ; - }; - ToolBoxItem - { - Identifier = SID_HYPERLINK_INSERT ; - Hide = TRUE; - }; - ToolBoxItem - { - Identifier = SID_WIN_FULLSCREEN ; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_RECORDMACRO; - Hide = TRUE; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_GALLERY ; - }; - ToolBoxItem - { - Identifier = SID_AVMEDIA_PLAYER ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = SID_CLOSEDOC; - Hide = TRUE; - }; - }; -}; - String RID_SPECIALCONFIG_ERROR { Text [ en-US ] = "An error has occurred in the special configuration.\nPlease contact your administrator." ; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 2abcdffe0169..decb3dd186f0 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -350,12 +350,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Help* pHelp = Application::GetHelp(); if ( pHelp ) { - ULONG nHelpId = ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE ) ? 66056 : 0; - if ( 66056 == nHelpId ) + if ( rReq.GetSlot() == SID_HELP_SUPPORTPAGE ) { // show Support page with new URL - // FIXME: HELPID - String sHelpURL = SfxHelp::CreateHelpURL( String()/*nHelpId*/, String() ); + String sHelpURL = SfxHelp::CreateHelpURL( String::CreateFromAscii(".uno:HelpSupport"), String() ); String sParams = sHelpURL.Copy( sHelpURL.Search( '?' ) ); sHelpURL = String::CreateFromAscii("vnd.sun.star.help://shared/text/shared/05/00000001.xhp"); sHelpURL += sParams; @@ -363,8 +361,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) pHelp->Start( sHelpURL, NULL ); } else - // FIXME: HELPID - pHelp->Start( String()/*nHelpId*/, NULL ); // show start page + pHelp->Start( String::CreateFromAscii(".uno:HelpIndex"), NULL ); // show start page bDone = TRUE; } break; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 6b8dfe3a023c..9289920b8e09 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -2105,32 +2105,24 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : xFrame->setName( DEFINE_CONST_UNICODE("OFFICE_HELP") ); lcl_disableLayoutOfFrame(xFrame); - // FIXME: HELPID - aToolBox.SetHelpId( ""/*HID_HELP_TOOLBOX*/ ); + aToolBox.SetHelpId( HID_HELP_TOOLBOX ); aToolBox.InsertItem( TBI_INDEX, aIndexOffText ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_INDEX, ""/*HID_HELP_TOOLBOXITEM_INDEX*/ ); + aToolBox.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aToolBox.InsertSeparator(); aToolBox.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_BACKWARD, ""/*HID_HELP_TOOLBOXITEM_BACKWARD*/ ); + aToolBox.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); aToolBox.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_FORWARD, ""/*HID_HELP_TOOLBOXITEM_FORWARD*/ ); + aToolBox.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); aToolBox.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_START, ""/*HID_HELP_TOOLBOXITEM_START*/ ); + aToolBox.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aToolBox.InsertSeparator(); aToolBox.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_PRINT, ""/*HID_HELP_TOOLBOXITEM_PRINT*/ ); + aToolBox.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); aToolBox.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_BOOKMARKS, ""/*HID_HELP_TOOLBOXITEM_BOOKMARKS*/ ); + aToolBox.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); aToolBox.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ) ); - // FIXME: HELPID - aToolBox.SetHelpId( TBI_SEARCHDIALOG, ""/*HID_HELP_TOOLBOXITEM_SEARCHDIALOG*/ ); + aToolBox.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); InitToolBoxImages(); aToolBox.Show(); @@ -2146,9 +2138,8 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : SvtMiscOptions().AddListenerLink( LINK( this, SfxHelpTextWindow_Impl, NotifyHdl ) ); - if ( aOnStartupCB.GetHelpId() == 0 ) - // FIXME: HELPID - aOnStartupCB.SetHelpId( ""/*HID_HELP_ONSTARTUP_BOX*/ ); + if ( !aOnStartupCB.GetHelpId().getLength() ) + aOnStartupCB.SetHelpId( HID_HELP_ONSTARTUP_BOX ); } // ----------------------------------------------------------------------- @@ -2604,40 +2595,32 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) else aMenu.InsertItem( TBI_INDEX, aIndexOnText, Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_INDEX_ON : IMG_HELP_TOOLBOX_INDEX_ON ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_INDEX, ""/*HID_HELP_TOOLBOXITEM_INDEX*/ ); + aMenu.SetHelpId( TBI_INDEX, HID_HELP_TOOLBOXITEM_INDEX ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_BACKWARD, String( SfxResId( STR_HELP_BUTTON_PREV ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PREV : IMG_HELP_TOOLBOX_PREV ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_BACKWARD, ""/*HID_HELP_TOOLBOXITEM_BACKWARD*/ ); + aMenu.SetHelpId( TBI_BACKWARD, HID_HELP_TOOLBOXITEM_BACKWARD ); aMenu.EnableItem( TBI_BACKWARD, pHelpWin->HasHistoryPredecessor() ); aMenu.InsertItem( TBI_FORWARD, String( SfxResId( STR_HELP_BUTTON_NEXT ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_NEXT : IMG_HELP_TOOLBOX_NEXT ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_FORWARD, ""/*HID_HELP_TOOLBOXITEM_FORWARD*/ ); + aMenu.SetHelpId( TBI_FORWARD, HID_HELP_TOOLBOXITEM_FORWARD ); aMenu.EnableItem( TBI_FORWARD, pHelpWin->HasHistorySuccessor() ); aMenu.InsertItem( TBI_START, String( SfxResId( STR_HELP_BUTTON_START ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_START : IMG_HELP_TOOLBOX_START ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_START, ""/*HID_HELP_TOOLBOXITEM_START*/ ); + aMenu.SetHelpId( TBI_START, HID_HELP_TOOLBOXITEM_START ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_PRINT, String( SfxResId( STR_HELP_BUTTON_PRINT ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_PRINT : IMG_HELP_TOOLBOX_PRINT ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_PRINT, ""/*HID_HELP_TOOLBOXITEM_PRINT*/ ); + aMenu.SetHelpId( TBI_PRINT, HID_HELP_TOOLBOXITEM_PRINT ); aMenu.InsertItem( TBI_BOOKMARKS, String( SfxResId( STR_HELP_BUTTON_ADDBOOKMARK ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_BOOKMARKS : IMG_HELP_TOOLBOX_BOOKMARKS ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_BOOKMARKS, ""/*HID_HELP_TOOLBOXITEM_BOOKMARKS*/ ); + aMenu.SetHelpId( TBI_BOOKMARKS, HID_HELP_TOOLBOXITEM_BOOKMARKS ); aMenu.InsertItem( TBI_SEARCHDIALOG, String( SfxResId( STR_HELP_BUTTON_SEARCHDIALOG ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_SEARCHDIALOG : IMG_HELP_TOOLBOX_SEARCHDIALOG ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_SEARCHDIALOG, ""/*HID_HELP_TOOLBOXITEM_SEARCHDIALOG*/ ); + aMenu.SetHelpId( TBI_SEARCHDIALOG, HID_HELP_TOOLBOXITEM_SEARCHDIALOG ); aMenu.InsertSeparator(); aMenu.InsertItem( TBI_SELECTIONMODE, String( SfxResId( STR_HELP_MENU_TEXT_SELECTION_MODE ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_SELECTIONMODE, ""/*HID_HELP_TEXT_SELECTION_MODE*/ ); + aMenu.SetHelpId( TBI_SELECTIONMODE, HID_HELP_TEXT_SELECTION_MODE ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); URL aURL; aURL.Complete = DEFINE_CONST_UNICODE(".uno:SelectTextMode"); @@ -2657,8 +2640,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) aMenu.InsertSeparator(); aMenu.InsertItem( TBI_COPY, String( SfxResId( STR_HELP_MENU_TEXT_COPY ) ), Image( SfxResId( bHiContrast ? IMG_HELP_TOOLBOX_HC_COPY : IMG_HELP_TOOLBOX_COPY ) ) ); - // FIXME: HELPID - aMenu.SetHelpId( TBI_COPY, ""/*SID_COPY*/ ); + aMenu.SetHelpId( TBI_COPY, ".uno:Copy" ); aMenu.EnableItem( TBI_COPY, HasSelection() ); if ( bIsDebug ) @@ -3243,8 +3225,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( aWinPos ( 0, 0 ), sTitle ( pParent->GetText() ) { - // FIXME: HELPID - SetHelpId( ""/*HID_HELP_WINDOW*/ ); + SetHelpId( HID_HELP_WINDOW ); SetStyle( GetStyle() | WB_DIALOGCONTROL ); pHelpInterceptor->InitWaiter( this ); diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index a4d134df27fa..23fb100c7895 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -284,7 +284,7 @@ void SvxOpenGraphicDialog::SetCurrentFilter(const String& rStr) mpImpl->aFileDlg.SetCurrentFilter(rStr); } -void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const INT32* _pHelpId ) +void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId ) { mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId ); } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 9c246c592b82..a18521e3a289 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -29,7 +29,7 @@ #include "precompiled_sfx2.hxx" #include "sfxhelp.hxx" - +#include #include #include #include @@ -76,6 +76,7 @@ #include #include #include +#include using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -221,13 +222,13 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) class SfxHelpOptions_Impl : public utl::ConfigItem { private: - SvULongsSort* m_pIds; + std::set < rtl::OString > m_aIds; public: SfxHelpOptions_Impl(); ~SfxHelpOptions_Impl(); - BOOL HasId( ULONG nId ) { USHORT nDummy; return m_pIds ? m_pIds->Seek_Entry( nId, &nDummy ) : FALSE; } + bool HasId( const rtl::OString& rId ) { return m_aIds.size() ? m_aIds.find( rId ) != m_aIds.end() : false; } virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); virtual void Commit(); }; @@ -254,7 +255,6 @@ static Sequence< ::rtl::OUString > GetPropertyNames() SfxHelpOptions_Impl::SfxHelpOptions_Impl() : ConfigItem( ::rtl::OUString::createFromAscii("Office.SFX/Help") ) - , m_pIds( NULL ) { Sequence< ::rtl::OUString > aNames = GetPropertyNames(); Sequence< Any > aValues = GetProperties( aNames ); @@ -275,11 +275,15 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() ::rtl::OUString aCodedList; if ( pValues[nProp] >>= aCodedList ) { - String aTmp( aCodedList ); - USHORT nCount = aTmp.GetTokenCount( ',' ); - m_pIds = new SvULongsSort(); - for ( USHORT n=0; nInsert( (ULONG) aTmp.GetToken( n, ',' ).ToInt64() ); + rtl::OString aTmp( aCodedList, aCodedList.getLength(), RTL_TEXTENCODING_UTF8 ); + sal_Int32 nIndex = 0; + do + { + rtl::OString aToken = aTmp.getToken( 0, ',', nIndex ); + if ( aToken.getLength() ) + m_aIds.insert( aToken ); + } + while ( nIndex >= 0 ); } else { DBG_ERRORFILE( "Wrong property type!" ); @@ -299,7 +303,6 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() SfxHelpOptions_Impl::~SfxHelpOptions_Impl() { - delete m_pIds; } @@ -326,8 +329,6 @@ public: ~SfxHelp_Impl(); SfxHelpOptions_Impl* GetOptions(); - // FIXME: HELPID - // String GetHelpText( ULONG nHelpId, const String& rModule ); // get "Active Help" String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); sal_Bool HasModule( const ::rtl::OUString& rModule ); // module installed sal_Bool IsHelpInstalled(); // module list not empty @@ -371,19 +372,6 @@ void SfxHelp_Impl::Load() } } -#if 0 -// FIXME: HELPID -String SfxHelp_Impl::GetHelpText( ULONG nHelpId, const String& rModule ) -{ - // create help url - String aHelpURL = SfxHelp::CreateHelpURL( nHelpId, rModule ); - // added 'active' parameter - aHelpURL.Insert( String( DEFINE_CONST_UNICODE("&Active=true") ), aHelpURL.SearchBackward( '#' ) ); - // load help string - return SfxContentHelper::GetActiveHelpString( aHelpURL ); -} -#endif - String SfxHelp_Impl::GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ) { // create help url @@ -585,79 +573,6 @@ String SfxHelp::GetHelpModuleName_Impl() return sModuleName; } -#if 0 -// FIXME: HELPID -String SfxHelp::CreateHelpURL_Impl( ULONG nHelpId, const String& rModuleName ) -{ - String aModuleName( rModuleName ); - if ( aModuleName.Len() == 0 ) - aModuleName = getDefaultModule_Impl(); - - // build up the help URL - String aHelpURL; - if ( aTicket.Len() ) - { - // if there is a ticket, we are inside a plugin, so a special Help URL must be sent - aHelpURL = DEFINE_CONST_UNICODE("vnd.sun.star.cmd:help?"); - aHelpURL += DEFINE_CONST_UNICODE("HELP_Request_Mode=contextIndex&HELP_Session_Mode=context&HELP_CallMode=portal&HELP_Device=html"); - - if ( !nHelpId ) - { - // no help id -> start page - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID=start"); - } - else - { - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ContextID="); - aHelpURL += String::CreateFromInt64( nHelpId ); - } - - aHelpURL += DEFINE_CONST_UNICODE("&HELP_ProgramID="); - aHelpURL += aModuleName; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_User="); - aHelpURL += aUser; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Ticket="); - aHelpURL += aTicket; - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Language="); - aHelpURL += aLanguageStr; - if ( aCountryStr.Len() ) - { - aHelpURL += DEFINE_CONST_UNICODE("&HELP_Country="); - aHelpURL += aCountryStr; - } - } - else - { - sal_Bool bHasAnchor = sal_False; - String aAnchor; - aHelpURL = String::CreateFromAscii("vnd.sun.star.help://"); - aHelpURL += aModuleName; - - if ( !nHelpId ) - aHelpURL += String::CreateFromAscii("/start"); - else - { - aHelpURL += '/'; - aHelpURL += String::CreateFromInt64( nHelpId ); - - String aTempURL = aHelpURL; - AppendConfigToken_Impl( aTempURL, sal_True ); - bHasAnchor = GetHelpAnchor_Impl( aTempURL, aAnchor ); - } - - AppendConfigToken_Impl( aHelpURL, sal_True ); - - if ( bHasAnchor ) - { - aHelpURL += '#'; - aHelpURL += aAnchor; - } - } - - return aHelpURL; -} -#endif - String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ) { // build up the help URL @@ -667,28 +582,7 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM String aModuleName( rModuleName ); if ( aModuleName.Len() == 0 ) - { - // no active module (quicklaunch?) -> detect default module - SvtModuleOptions aModOpt; - if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) - aModuleName = DEFINE_CONST_UNICODE("swriter"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) - aModuleName = DEFINE_CONST_UNICODE("scalc"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) - aModuleName = DEFINE_CONST_UNICODE("simpress"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) - aModuleName = DEFINE_CONST_UNICODE("sdraw"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SMATH ) ) - aModuleName = DEFINE_CONST_UNICODE("smath"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SCHART ) ) - aModuleName = DEFINE_CONST_UNICODE("schart"); - else if ( aModOpt.IsModuleInstalled( SvtModuleOptions::E_SBASIC ) ) - aModuleName = DEFINE_CONST_UNICODE("sbasic"); - else - { - DBG_ERRORFILE( "no installed module found" ); - } - } + aModuleName = getDefaultModule_Impl(); aHelpURL = String::CreateFromAscii("vnd.sun.star.help://"); aHelpURL += aModuleName; @@ -701,7 +595,7 @@ String SfxHelp::CreateHelpURL_Impl( const String& aCommandURL, const String& rM aHelpURL += String( rtl::Uri::encode( aCommandURL, rtl_UriCharClassRelSegment, rtl_UriEncodeKeepEscapes, - RTL_TEXTENCODING_ASCII_US )); + RTL_TEXTENCODING_UTF8 )); String aTempURL = aHelpURL; AppendConfigToken_Impl( aTempURL, sal_True ); @@ -769,6 +663,49 @@ SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame >& rHelpTask , return pHelpWindow; } +XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow ) +{ + String sModuleName = GetHelpModuleName_Impl(); + String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); + + ByteString aNewHelpId; + + if ( pWindow && !sHelpText.Len() ) + { + // no help text found -> try with parent help id. + Window* pParent = pWindow->GetParent(); + while ( pParent ) + { + aNewHelpId = pParent->GetHelpId(); + sHelpText = pImp->GetHelpText( String( aNewHelpId, RTL_TEXTENCODING_UTF8 ), sModuleName ); + if ( sHelpText.Len() > 0 ) + pParent = NULL; + else + pParent = pParent->GetParent(); + } + + if ( bIsDebug && !sHelpText.Len() ) + aNewHelpId.Erase(); + } + + // add some debug information? + if ( bIsDebug ) + { + sHelpText += DEFINE_CONST_UNICODE("\n-------------\n"); + sHelpText += String( sModuleName ); + sHelpText += DEFINE_CONST_UNICODE(": "); + sHelpText += aCommandURL; + if ( aNewHelpId.Len() ) + { + sHelpText += DEFINE_CONST_UNICODE(" - "); + sHelpText += String( aNewHelpId, RTL_TEXTENCODING_UTF8 ); + } + } + + return sHelpText; +} + + BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) { // check if help is available @@ -790,34 +727,33 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) INetProtocol nProtocol = aParser.GetProtocol(); if ( nProtocol != INET_PROT_VND_SUN_STAR_HELP ) { - // #i90162 Accept anything that is not invalid as help id, as both - // uno: URLs used as commands/help ids in the Office and the scheme - // used in extension help ids (e.g. com.foocorp.foo-ext:FooDialogButton) - // are accepted as INET_PROT_UNO respectively INET_PROT_GENERIC - bool bAcceptAsURL = ( nProtocol != INET_PROT_NOT_VALID ); - - // #i94891 As in some extensions help ids like foo.bar.dummy without - // any : have been used that worked before the fix of #i90162 (see - // above) strings containing . will be also accepted to avoid brea- - // king the help of existing extensions. - if( !bAcceptAsURL ) - bAcceptAsURL = ( rURL.Search( '.' ) != STRING_NOTFOUND ); - - if ( bAcceptAsURL ) - { - aHelpURL = CreateHelpURL_Impl( rURL, GetHelpModuleName_Impl( ) ); - } - else + String aHelpModuleName( GetHelpModuleName_Impl() ); + aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { - // FIXME: HELPID - aHelpURL = CreateHelpURL_Impl( String()/*0*/, GetHelpModuleName_Impl( ) ); - - // pb i91715: strings begin with ".HelpId:" are not words of the basic ide - // they are helpid-strings used by the testtool -> so we ignore them - static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") ); - if ( rURL.Search( sHelpIdScheme ) != 0 ) - sKeyword = ::rtl::OUString( rURL ); + // no help found -> try with parent help id. + Window* pParent = pWindow->GetParent(); + while ( pParent ) + { + ByteString aHelpId = pParent->GetHelpId(); + aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName ); + if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + break; + else + { + pParent = pParent->GetParent(); + if ( !pParent ) + // create help url of start page ( helpid == 0 -> start page) + aHelpURL = CreateHelpURL( String(), aHelpModuleName ); + } + } } + + // pb i91715: strings begin with ".HelpId:" are not words of the basic ide + // they are helpid-strings used by the testtool -> so we ignore them + static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") ); + if ( rURL.Search( sHelpIdScheme ) != 0 ) + sKeyword = ::rtl::OUString( rURL ); } Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( @@ -847,6 +783,12 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) if (!xHelp.is() || !xHelpContent.is() || !pHelpWindow) return FALSE; +#ifdef DBG_UTIL + ByteString aTmp("SfxHelp: HelpId = "); + aTmp += ByteString( aHelpURL, RTL_TEXTENCODING_UTF8 ); + DBG_TRACE( aTmp.GetBuffer() ); +#endif + pHelpWindow->SetHelpURL( aHelpURL ); pHelpWindow->loadHelpContent(aHelpURL); if ( sKeyword.getLength() > 0 ) @@ -859,110 +801,6 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) return TRUE; } -#if 0 -// FIXME: HELPID -BOOL SfxHelp::Start( ULONG nHelpId, const Window* pWindow ) -{ - String aHelpModuleName( GetHelpModuleName_Impl() ); - String aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName ); - if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - { - // no help found -> try with parent help id. - Window* pParent = pWindow->GetParent(); - while ( pParent ) - { - nHelpId = pParent->GetSmartUniqueOrHelpId().GetNum(); - aHelpURL = CreateHelpURL( nHelpId, aHelpModuleName ); - - if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - break; - else - { - pParent = pParent->GetParent(); - if ( !pParent ) - // create help url of start page ( helpid == 0 -> start page) - aHelpURL = CreateHelpURL( 0, aHelpModuleName ); - } - } - } - - return Start( aHelpURL, pWindow ); -} -#endif - -#if 0 -// FIXME: HELPID -XubString SfxHelp::GetHelpText( ULONG nHelpId, const Window* pWindow ) -{ - String aModuleName = GetHelpModuleName_Impl(); - String aHelpText = pImp->GetHelpText( nHelpId, aModuleName ); - ULONG nNewHelpId = 0; - - if ( pWindow && aHelpText.Len() == 0 ) - { - // no help text found -> try with parent help id. - Window* pParent = pWindow->GetParent(); - while ( pParent ) - { - nNewHelpId = pParent->GetHelpId(); - aHelpText = pImp->GetHelpText( nNewHelpId, aModuleName ); - - if ( aHelpText.Len() > 0 ) - pParent = NULL; - else - pParent = pParent->GetParent(); - } - - if ( bIsDebug && aHelpText.Len() == 0 ) - nNewHelpId = 0; - } - - if ( bIsDebug ) - { - aHelpText += DEFINE_CONST_UNICODE("\n\n"); - aHelpText += aModuleName; - aHelpText += DEFINE_CONST_UNICODE(" - "); - aHelpText += String::CreateFromInt64( nHelpId ); - if ( nNewHelpId ) - { - aHelpText += DEFINE_CONST_UNICODE(" - "); - aHelpText += String::CreateFromInt64( nNewHelpId ); - } - } - - return aHelpText; -} -#endif - -XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* ) -{ - String sModuleName = GetHelpModuleName_Impl(); - String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); - - // add some debug information? - if ( bIsDebug ) - { - sHelpText += DEFINE_CONST_UNICODE("\n-------------\n"); - sHelpText += String( sModuleName ); - sHelpText += DEFINE_CONST_UNICODE(": "); - sHelpText += aCommandURL; - } - - return sHelpText; -} - -#if 0 -// FIXME: HELPID -String SfxHelp::CreateHelpURL( ULONG nHelpId, const String& rModuleName ) -{ - String aURL; - SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); - if ( pHelp ) - aURL = pHelp->CreateHelpURL_Impl( nHelpId, rModuleName ); - return aURL; -} -#endif - String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleName ) { String aURL; @@ -972,36 +810,25 @@ String SfxHelp::CreateHelpURL( const String& aCommandURL, const String& rModuleN return aURL; } -void SfxHelp::OpenHelpAgent( SfxFrame*, ULONG nHelpId ) +void SfxHelp::OpenHelpAgent( SfxFrame*, const rtl::OString& sHelpId ) { -// FIXME HELPID -#if 0 - SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); - if ( pHelp ) - pHelp->OpenHelpAgent( nHelpId ); -#else -(void)nHelpId; -#endif + SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); + if ( pHelp ) + pHelp->OpenHelpAgent( sHelpId ); } -// FIXME: HELPID -#if 0 -void SfxHelp::OpenHelpAgent( ULONG nHelpId ) +void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) { if ( SvtHelpOptions().IsHelpAgentAutoStartMode() ) { -// SfxHelp* pHelp = SAL_STATIC_CAST( SfxHelp*, Application::GetHelp() ); -// if ( pHelp ) -// { SfxHelpOptions_Impl *pOpt = pImp->GetOptions(); - if ( !pOpt->HasId( nHelpId ) ) + if ( !pOpt->HasId( sHelpId ) ) return; try { URL aURL; - // FIXME: HELPID - aURL.Complete = CreateHelpURL_Impl( String()/*nHelpId*/, GetHelpModuleName_Impl() ); + aURL.Complete = CreateHelpURL_Impl( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8 ), GetHelpModuleName_Impl() ); Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" ) ), UNO_QUERY ); xTrans->parseStrict(aURL); @@ -1027,10 +854,8 @@ void SfxHelp::OpenHelpAgent( ULONG nHelpId ) { DBG_ERRORFILE( "OpenHelpAgent: caught an exception while executing the dispatch!" ); } -// } } } -#endif String SfxHelp::GetDefaultHelpModule() { diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index e66dd2c56eaf..444be02127b3 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -281,7 +281,11 @@ int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest if ( !pView ) pView = SfxViewFrame::Current(); if ( pView ) - SfxHelp::OpenHelpAgent( &pView->GetFrame(), rReq.GetSlot() ); + { + rtl::OString aCmd(".uno:"); + aCmd += rSlot.GetUnoName(); + SfxHelp::OpenHelpAgent( &pView->GetFrame(), aCmd ); + } SfxExecFunc pFunc = rSlot.GetExecFnc(); rShell.CallExec( pFunc, rReq ); @@ -1675,14 +1679,14 @@ void SfxDispatcher::SetMenu_Impl() } //-------------------------------------------------------------------- -long SfxDispatcher::Update_Impl( sal_Bool bForce ) +void SfxDispatcher::Update_Impl( sal_Bool bForce ) { SFX_STACK(SfxDispatcher::Update_Impl); Flush(); if ( !pImp->pFrame || pImp->bUILocked ) - return 0; + return; SFX_APP(); // -Wall is this required??? SfxDispatcher *pDisp = this; @@ -1704,7 +1708,7 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) } if ( !bUpdate || pImp->pFrame->GetFrame().IsClosing_Impl() ) - return 0; + return; SfxViewFrame* pTop = pImp->pFrame ? pImp->pFrame->GetTopViewFrame() : NULL; sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this; @@ -1778,12 +1782,11 @@ long SfxDispatcher::Update_Impl( sal_Bool bForce ) if ( xLayoutManager.is() ) xLayoutManager->unlock(); - return 1; + return; } -sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bool bIsIPOwner, SfxWorkWindow *pTaskWin ) +void SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, sal_Bool bIsIPOwner, SfxWorkWindow *pTaskWin ) { - sal_uInt32 nHelpId = 0; SFX_APP(); SfxWorkWindow *pWorkWin = pImp->pFrame->GetFrame().GetWorkWindow_Impl(); sal_Bool bIsActive = sal_False; @@ -1798,7 +1801,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, } if ( pImp->pParent && !pImp->bQuiet /* && bUIActive */ ) - nHelpId = pImp->pParent->_Update_Impl( bUIActive, bIsMDIApp, bIsIPOwner, pTaskWin ); + pImp->pParent->_Update_Impl( bUIActive, bIsMDIApp, bIsIPOwner, pTaskWin ); for (sal_uInt16 n=0; naObjBars[n].nResId = 0; @@ -1807,7 +1810,7 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, // bQuiet : own shells aren't considered for UI and SlotServer // bNoUI: own Shells aren't considered fors UI if ( pImp->bQuiet || pImp->bNoUI || (pImp->pFrame && pImp->pFrame->GetObjectShell()->IsPreview()) ) - return nHelpId; + return; sal_uInt32 nStatBarId=0; SfxShell *pStatusBarShell = NULL; @@ -1818,8 +1821,6 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, { SfxShell *pShell = GetShell( nShell-1 ); SfxInterface *pIFace = pShell->GetInterface(); - if (pShell->GetHelpId()) - nHelpId = pShell->GetHelpId(); // don't consider shells if "Hidden" oder "Quiet" sal_Bool bReadOnlyShell = IsReadOnlyShell_Impl( nShell-1 ); @@ -1950,8 +1951,6 @@ sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp, pImp->pFrame->GetFrame().GetWorkWindow_Impl()->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings ); } } - - return nHelpId; } //-------------------------------------------------------------------- diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx index 0aa4df6902ee..6b05c03160ff 100644 --- a/sfx2/source/control/msg.cxx +++ b/sfx2/source/control/msg.cxx @@ -29,9 +29,6 @@ #include "precompiled_sfx2.hxx" #include #include -#ifndef GCC -#endif - #include //==================================================================== @@ -63,4 +60,16 @@ USHORT SfxSlot::GetWhich( const SfxItemPool &rPool ) const return nMasterSlotId; } +::rtl::OString SfxSlot::GetCommand() const +{ + rtl::OString sRet(".uno:"); + sRet += pUnoName; + return sRet; +} + +::rtl::OUString SfxSlot::GetCommandString() const +{ + rtl::OString aCmd(GetCommand()); + return rtl::OUString( aCmd, aCmd.getLength(), RTL_TEXTENCODING_UTF8 ); +} diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx index 1d1ef73ad8cf..73284dbd9806 100644 --- a/sfx2/source/dialog/about.cxx +++ b/sfx2/source/dialog/about.cxx @@ -297,9 +297,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerS FreeResource(); - // explizite Help-Id - // FIXME: HELPID - SetHelpId( ""/*SID_ABOUT*/ ); + SetHelpId( ".uno:About" ); //#112429# replace occurences of "StarOffice" in the "StarSuite" version String sCopyright( aCopyrightText.GetText() ); diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index d85a01870074..df1f13155513 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -160,9 +160,6 @@ void SfxModalDialog::GetDialogData_Impl() void SfxModalDialog::init() { GetDialogData_Impl(); - aTimer.SetTimeout( 100 ); - aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) ); - aTimer.Start(); } // ----------------------------------------------------------------------- @@ -214,13 +211,7 @@ SfxModalDialog::~SfxModalDialog() */ { -/* - SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI(); - if ( pHelpPI ) - pHelpPI->ResetTopic(); -*/ SetDialogData_Impl(); - aTimer.Stop(); delete pOutputSet; } @@ -233,16 +224,6 @@ void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool ) // ----------------------------------------------------------------------- -IMPL_LINK( SfxModalDialog, TimerHdl_Impl, Timer*, EMPTYARG ) -{ -/* - SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI(); - if ( pHelpPI ) - pHelpPI->LoadTopic( GetHelpId() ); - */ - return 0L; -} - void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet ) { DBG_ASSERT( !pOutputSet, "Double creation of OutputSet!" ); @@ -373,7 +354,6 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - // FIXME: HELPID SetUniqueId( GetHelpId() ); SetHelpId(""); if ( pBindinx ) @@ -393,7 +373,6 @@ SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - // FIXME: HELPID SetUniqueId( GetHelpId() ); SetHelpId(""); if ( pBindinx ) @@ -418,16 +397,15 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt ) pBindings->SetActiveFrame( pImp->pMgr->GetFrame() ); pImp->pMgr->Activate_Impl(); Window* pWindow = rEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) + rtl::OString sHelpId; + while ( !sHelpId.getLength() && pWindow ) { - // FIXME: HELPID - nHelpId = 0; // pWindow->GetHelpId(); + sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( nHelpId ) - SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + if ( sHelpId.getLength() ) + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() ) { @@ -521,16 +499,15 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt ) pBindings->SetActiveFrame( pImp->pMgr->GetFrame() ); pImp->pMgr->Activate_Impl(); Window* pWindow = rEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) + rtl::OString sHelpId; + while ( !sHelpId.getLength() && pWindow ) { - // FIXME: HELPID - nHelpId = 0; //pWindow->GetHelpId(); + sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( nHelpId ) - SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + if ( sHelpId.getLength() ) + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS ) { @@ -563,7 +540,6 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - // FIXME: HELPID SetUniqueId( GetHelpId() ); SetHelpId(""); if ( pBindinx ) @@ -584,7 +560,6 @@ SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx, { pImp->pMgr = pCW; pImp->bConstructed = FALSE; - // FIXME: HELPID SetUniqueId( GetHelpId() ); SetHelpId(""); if ( pBindinx ) diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc index f1e100e17cf5..78844d335f6a 100644 --- a/sfx2/source/dialog/dialog.hrc +++ b/sfx2/source/dialog/dialog.hrc @@ -76,7 +76,6 @@ #define CB_URL ( RC_DIALOG_BEGIN + 64 ) #define STR_INTERNET ( RC_DIALOG_BEGIN + 65 ) -#define RID_AUTOHIDE ( RC_DIALOG_BEGIN + 66 ) #define DLG_ONLINE_REGISTER ( RC_DIALOG_BEGIN + 68 ) #define DLG_VERSIONS ( RC_DIALOG_BEGIN + 69 ) diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src index a54d2c340d04..53e232a7c63c 100644 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src @@ -231,22 +231,7 @@ ModalDialog RID_URLOPEN Left = TRUE ; }; }; -Menu RID_AUTOHIDE -{ - ItemList = - { - MenuItem - { - Identifier = SID_AUTOHIDE ; - HelpID = SID_AUTOHIDE ; - Text [ en-US ] = "Hide" ; - }; - }; -}; -String RID_AUTOHIDE -{ - Text [ en-US ] = "Don't Hide" ; -}; + String SID_NAVIGATOR { Text [ en-US ] = "Navigator"; diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 8ad551278a27..499987f5ff3b 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -46,6 +46,7 @@ #include #include "sfxhelp.hxx" #include +#include #include #include @@ -918,13 +919,23 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - // FIXME: HELPID - ULONG nId = 0;// GetHelpId(); - if ( !nId && pCW ) - nId = pCW->GetType(); - SetHelpId( "" ); - // FIXME: HELPID - SetUniqueId( ""/*nId*/ ); + if ( GetHelpId().getLength() ) + { + SetUniqueId( GetHelpId() ); + SetHelpId(""); + } + else + { + SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame(); + SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool(); + const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() ); + if ( pSlot ) + { + rtl::OString aCmd(".uno:"); + aCmd += pSlot->GetUnoName(); + SetUniqueId( aCmd ); + } + } pImp = new SfxDockingWindow_Impl; pImp->bConstructed = FALSE; @@ -962,9 +973,23 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - // FIXME: HELPID - SetUniqueId( GetHelpId() ); - SetHelpId(""); + if ( GetHelpId().getLength() ) + { + SetUniqueId( GetHelpId() ); + SetHelpId(""); + } + else + { + SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame(); + SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool(); + const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() ); + if ( pSlot ) + { + rtl::OString aCmd(".uno:"); + aCmd += pSlot->GetUnoName(); + SetUniqueId( aCmd ); + } + } pImp = new SfxDockingWindow_Impl; pImp->bConstructed = FALSE; @@ -1846,16 +1871,15 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt ) pMgr->Activate_Impl(); Window* pWindow = rEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) + rtl::OString sHelpId; + while ( !sHelpId.getLength() && pWindow ) { - // FIXME: HELPID - //nHelpId = pWindow->GetHelpId(); + sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( nHelpId ) - SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), nHelpId ); + if ( sHelpId.getLength() ) + SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); // In VCL geht Notify zun"achst an das Fenster selbst, // also base class rufen, sonst erf"ahrt der parent nichts diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 2785a38305cd..6512bac43b7e 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -218,55 +218,55 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve { //!!! todo: cache the help strings (here or TRA) - ULONG nHelpId = 0; + rtl::OString sHelpId; // mapping from element id -> help id switch ( aEvent.ElementId ) { case ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION : - nHelpId = HID_FILESAVE_AUTOEXTENSION; + sHelpId = HID_FILESAVE_AUTOEXTENSION; break; case ExtendedFilePickerElementIds::CHECKBOX_PASSWORD : - nHelpId = HID_FILESAVE_SAVEWITHPASSWORD; + sHelpId = HID_FILESAVE_SAVEWITHPASSWORD; break; case ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS : - nHelpId = HID_FILESAVE_CUSTOMIZEFILTER; + sHelpId = HID_FILESAVE_CUSTOMIZEFILTER; break; case ExtendedFilePickerElementIds::CHECKBOX_READONLY : - nHelpId = HID_FILEOPEN_READONLY; + sHelpId = HID_FILEOPEN_READONLY; break; case ExtendedFilePickerElementIds::CHECKBOX_LINK : - nHelpId = HID_FILEDLG_LINK_CB; + sHelpId = HID_FILEDLG_LINK_CB; break; case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW : - nHelpId = HID_FILEDLG_PREVIEW_CB; + sHelpId = HID_FILEDLG_PREVIEW_CB; break; case ExtendedFilePickerElementIds::PUSHBUTTON_PLAY : - nHelpId = HID_FILESAVE_DOPLAY; + sHelpId = HID_FILESAVE_DOPLAY; break; case ExtendedFilePickerElementIds::LISTBOX_VERSION_LABEL : case ExtendedFilePickerElementIds::LISTBOX_VERSION : - nHelpId = HID_FILEOPEN_VERSION; + sHelpId = HID_FILEOPEN_VERSION; break; case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE_LABEL : case ExtendedFilePickerElementIds::LISTBOX_TEMPLATE : - nHelpId = HID_FILESAVE_TEMPLATE; + sHelpId = HID_FILESAVE_TEMPLATE; break; case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE_LABEL : case ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE : - nHelpId = HID_FILEOPEN_IMAGE_TEMPLATE; + sHelpId = HID_FILEOPEN_IMAGE_TEMPLATE; break; case ExtendedFilePickerElementIds::CHECKBOX_SELECTION : - nHelpId = HID_FILESAVE_SELECTION; + sHelpId = HID_FILESAVE_SELECTION; break; default: @@ -276,8 +276,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - // FIXME: HELPID - aHelpText = String( pHelp->GetHelpText( String()/*nHelpId*/, NULL ) ); + aHelpText = String( pHelp->GetHelpText( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8), NULL ) ); return aHelpText; } @@ -1223,7 +1222,7 @@ void SAL_CALL PickerThread_Impl::run() } // ------------------------------------------------------------------------ -void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId ) +void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ) { DBG_ASSERT( _pControlId && _pHelpId, "FileDialogHelper_Impl::setControlHelpIds: invalid array pointers!" ); if ( !_pControlId || !_pHelpId ) @@ -1239,10 +1238,8 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con { while ( *_pControlId ) { - // calc the help id of the element ::rtl::OUString sId( sHelpIdPrefix ); - sId += ::rtl::OUString::valueOf( *_pHelpId ); - // set the help id + sId += ::rtl::OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 ); xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) ); ++_pControlId; ++_pHelpId; @@ -1256,7 +1253,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con } // ------------------------------------------------------------------------ -void FileDialogHelper_Impl::setDialogHelpId( const sal_Int32 _nHelpId ) +void FileDialogHelper_Impl::setDialogHelpId( sal_Int32 _nHelpId ) { svt::SetDialogHelpId( mxFileDlg, _nHelpId ); } @@ -2458,7 +2455,7 @@ void FileDialogHelper::CreateMatcher( const String& rFactory ) } // ------------------------------------------------------------------------ -void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId ) +void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ) { mpImp->setControlHelpIds( _pControlId, _pHelpId ); } diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index b023b8fb53a9..bfd94595feee 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -140,8 +140,8 @@ namespace sfx2 void correctVirtualDialogType(); - void setControlHelpIds( const sal_Int16* _pControlId, const sal_Int32* _pHelpId ); - void setDialogHelpId( const sal_Int32 _nHelpId ); + void setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); + void setDialogHelpId( sal_Int32 nId ); sal_Bool CheckFilterOptionsCapability( const SfxFilter* _pFilter ); diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index b271d1e04dc7..d7f258e7ccb3 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -51,8 +51,7 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd , WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE); eChildAlignment = SFX_ALIGN_NOALIGNMENT; - // FIXME: HELPID - pWindow->SetHelpId ( ""/*HID_NAVIGATOR_WINDOW*/ ); + pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW ); pWindow->SetOutputSizePixel( Size( 270, 240 ) ); ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo ); diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src index fa5fa62a2ee4..90ed1a139cbb 100644 --- a/sfx2/source/dialog/newstyle.src +++ b/sfx2/source/dialog/newstyle.src @@ -28,10 +28,11 @@ #include #include "dialog.hrc" #include "newstyle.hrc" +#include "sfx2/sfxcommands.h" ModalDialog DLG_NEW_STYLE_BY_EXAMPLE { - HelpId = SID_STYLE_NEW_BY_EXAMPLE ; + HelpId = CMD_SID_STYLE_NEW_BY_EXAMPLE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 177 , 112 ) ; diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 065b407c6769..3c7a58cd09f9 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -664,8 +664,7 @@ void SfxTabDialog::Init_Impl( BOOL bFmtFlag, const String* pUserButtonText ) aCancelBtn.Show(); aHelpBtn.Show(); aResetBtn.Show(); - // FIXME: HELPID - aResetBtn.SetHelpId( ""/*HID_TABDLG_RESET_BTN*/ ); + aResetBtn.SetHelpId( HID_TABDLG_RESET_BTN ); if ( pUserBtn ) { @@ -681,8 +680,7 @@ void SfxTabDialog::Init_Impl( BOOL bFmtFlag, const String* pUserButtonText ) String aStd( SfxResId( STR_STANDARD_SHORTCUT ) ); aBaseFmtBtn.SetText( aStd ); aBaseFmtBtn.SetClickHdl( LINK( this, SfxTabDialog, BaseFmtHdl ) ); - // FIXME: HELPID - aBaseFmtBtn.SetHelpId( ""/*HID_TABDLG_STANDARD_BTN*/ ); + aBaseFmtBtn.SetHelpId( HID_TABDLG_STANDARD_BTN ); // bFmt = tempor"ares Flag im Ctor() "ubergeben, // wenn bFmt == 2, dann auch TRUE, @@ -789,8 +787,7 @@ void SfxTabDialog::EnableApplyButton(BOOL bEnable) pImpl->pApplyButton->SetText( String( SfxResId( STR_APPLY ) ) ); pImpl->pApplyButton->Show(); - // FIXME: HELPID - pImpl->pApplyButton->SetHelpId( ""/*HID_TABDLG_APPLY_BTN*/ ); + pImpl->pApplyButton->SetHelpId( HID_TABDLG_APPLY_BTN ); } else { @@ -1783,16 +1780,15 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) if ( pViewFrame ) { Window* pWindow = rNEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) + rtl::OString sHelpId; + while ( !sHelpId.getLength() && pWindow ) { - // FIXME: HELPID - // nHelpId = pWindow->GetHelpId(); + sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( nHelpId ) - SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), nHelpId ); + if ( sHelpId.getLength() ) + SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), sHelpId ); } } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 4777798aef2b..a3d9fd7b4ed2 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -778,10 +778,8 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx bHierarchical ( FALSE ), bBindingUpdate ( TRUE ) { - // FIXME: HELPID - aFmtLb.SetHelpId( ""/*HID_TEMPLATE_FMT*/ ); - // FIXME: HELPID - aFilterLb.SetHelpId( ""/*HID_TEMPLATE_FILTER*/ ); + aFmtLb.SetHelpId( HID_TEMPLATE_FMT ); + aFilterLb.SetHelpId( HID_TEMPLATE_FILTER ); aFmtLb.SetWindowBits( WB_SORT | WB_HIDESELECTION ); Font aFont = aFmtLb.GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); @@ -2210,32 +2208,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox // HilfePI antriggern, wenn von Call als Handler und Bereich erlaubt ist if( !pListBox || pListBox->IsSelected( pListBox->GetHdlEntry() ) ) { -#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS - SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI(); - if ( pHelpPI && pListBox && IsInitialized() && - GetSelectedEntry().Len() ) - { - const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); - const SfxStyleFamily eFam = pItem->GetFamily(); - DBG_ASSERT(pStyleSheetPool, "Kein Pool"); - // SfxStyleSheetBase* pStyle = pStyleSheetPool - // ? pStyleSheetPool->Find( GetSelectedEntry(), eFam ) : 0; - SfxStyleSheetBase *pStyle; - if ( pStyleSheetPool ) - pStyle = pStyleSheetPool->Find ( GetSelectedEntry(), eFam ); - else - pStyle = 0; - - if ( pStyle ) - { - String aHelpFile; - ULONG nHelpId=pStyle->GetHelpId(aHelpFile); - if ( nHelpId ) - pHelpPI->LoadTopic( nHelpId ); - } - } -#endif - // nur, wenn Giesskanne an ist if ( IsInitialized() && IsCheckedItem(SID_STYLE_WATERCAN) && @@ -2361,8 +2333,7 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl( Font aFont=aFilterLb.GetFont(); aFont.SetWeight( WEIGHT_NORMAL ); aFilterLb.SetFont( aFont ); - // FIXME: HELPID - m_aActionTbL.SetHelpId( ""/*HID_TEMPLDLG_TOOLBOX_LEFT*/ ); + m_aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT ); } // ------------------------------------------------------------------------ @@ -2376,19 +2347,18 @@ void SfxTemplateDialog_Impl::EnableFamilyItem( USHORT nId, BOOL bEnable ) void SfxTemplateDialog_Impl::InsertFamilyItem(USHORT nId,const SfxStyleFamilyItem *pItem) { - USHORT nHelpId = 0; + rtl::OString sHelpId; switch( (USHORT) pItem->GetFamily() ) { - case SFX_STYLE_FAMILY_CHAR: nHelpId = SID_STYLE_FAMILY1; break; - case SFX_STYLE_FAMILY_PARA: nHelpId = SID_STYLE_FAMILY2; break; - case SFX_STYLE_FAMILY_FRAME:nHelpId = SID_STYLE_FAMILY3; break; - case SFX_STYLE_FAMILY_PAGE: nHelpId = SID_STYLE_FAMILY4; break; - case SFX_STYLE_FAMILY_PSEUDO: nHelpId = SID_STYLE_FAMILY5; break; - default: DBG_ERROR("unbekannte StyleFamily"); break; + case SFX_STYLE_FAMILY_CHAR: sHelpId = ".uno:CharStyle"; break; + case SFX_STYLE_FAMILY_PARA: sHelpId = ".uno:ParaStyle"; break; + case SFX_STYLE_FAMILY_FRAME: sHelpId = ".uno:FrameStyle"; break; + case SFX_STYLE_FAMILY_PAGE: sHelpId = ".uno:PageStyle"; break; + case SFX_STYLE_FAMILY_PSEUDO: sHelpId = ".uno:ListStyle"; break; + default: DBG_ERROR("unknown StyleFamily"); break; } m_aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), 0, 0); - // FIXME: HELPID - m_aActionTbL.SetHelpId( nId, ""/*nHelpId*/ ); + m_aActionTbL.SetHelpId( nId, sHelpId ); } // ------------------------------------------------------------------------ @@ -2687,21 +2657,18 @@ IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox ) uno::Any aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleNewByExample")); ::rtl::OUString sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel ); - // FIXME: HELPID - pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, ""/*HID_TEMPLDLG_NEWBYEXAMPLE*/); + pMenu->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE); aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:StyleUpdateByExample")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel ); - // FIXME: HELPID - pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, ""/*HID_TEMPLDLG_UPDATEBYEXAMPLE*/); + pMenu->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE); aCommand = xUICommands->getByName(::rtl::OUString::createFromAscii(".uno:LoadStyles")); sLabel = lcl_GetLabel( aCommand ); pMenu->InsertItem( SID_TEMPLATE_LOAD, sLabel ); - // FIXME: HELPID - pMenu->SetHelpId(SID_TEMPLATE_LOAD, ""/*SID_TEMPLATE_LOAD*/); + pMenu->SetHelpId(SID_TEMPLATE_LOAD, ".uno:LoadStyles"); pMenu->SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, MenuSelectHdl)); pMenu->Execute( pBox, diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index a4adcd77b6d3..e5b4f1fd9cdf 100644 --- a/sfx2/source/dialog/templdlg.src +++ b/sfx2/source/dialog/templdlg.src @@ -57,7 +57,7 @@ ImageList IMG_LST_STYLE_DESIGNER_HC // RID_STYLECATALOG ------------------------------------------------------ ModalDialog RID_STYLECATALOG { - HelpId = SID_STYLE_CATALOG ; + HelpId = CMD_SID_STYLE_CATALOG ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 181 , 134 ) ; @@ -146,7 +146,7 @@ DockingWindow DLG_STYLE_DESIGNER { Text [ en-US ] = "Styles and Formatting" ; - HelpId = SID_STYLE_DESIGNER ; + HelpId = CMD_SID_STYLE_DESIGNER ; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc index 838168e64526..7e8fd688af52 100644 --- a/sfx2/source/doc/doc.hrc +++ b/sfx2/source/doc/doc.hrc @@ -44,7 +44,6 @@ #define STR_NOSTARTPRINTER (RID_SFX_DOC_START+ 8) #define MSG_CONFIRM_FILTER (RID_SFX_DOC_START+11) #define MSG_CONFIRM_OVERWRITE_TEMPLATE (RID_SFX_DOC_START+12) -#define MSG_QUERY_LOAD_TEMPLATE (RID_SFX_DOC_START+13) #define STR_DELETE_REGION (RID_SFX_DOC_START+14) #define STR_DELETE_TEMPLATE (RID_SFX_DOC_START+15) diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src index d17b62c9b52a..497d4ccd7c97 100644 --- a/sfx2/source/doc/doc.src +++ b/sfx2/source/doc/doc.src @@ -43,14 +43,6 @@ QueryBox MSG_CONFIRM_OVERWRITE_TEMPLATE DefButton = WB_DEF_NO ; Message [ en-US ] = "Name already in use.\nDo you want to overwrite document template?" ; }; -QueryBox MSG_QUERY_LOAD_TEMPLATE -{ - BUTTONS = WB_YES_NO ; - DEFBUTTON = WB_DEF_NO ; - HelpId = MSG_QUERY_LOAD_TEMPLATE; - - Message [ en-US ] = "The Styles in this document do not match your current Styles. Should your current Styles be applied to this document?"; -}; String STR_DELETE_REGION { Text [ en-US ] = "Are you sure you want to delete the region \"$1\"?" ; diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src index 91d966fbd2d5..3192de44c19a 100644 --- a/sfx2/source/doc/doctdlg.src +++ b/sfx2/source/doc/doctdlg.src @@ -28,10 +28,11 @@ #include #include "doc.hrc" #include "doctdlg.hrc" +#include ModalDialog DLG_DOC_TEMPLATE { - HelpId = SID_DOCTEMPLATE ; + HelpId = CMD_SID_DOCTEMPLATE ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 280 , 128 ) ; diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index 1d57e0b9c761..719dc5b8d223 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -245,9 +245,8 @@ SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent, // * always work with an own instance, even if we get only NULL in this ctor } - // FIXME: HELPID - aLeftLb.SetHelpId( ""/*HID_CTL_ORGANIZER_LEFT*/ ); - aRightLb.SetHelpId( ""/*HID_CTL_ORGANIZER_RIGHT*/ ); + aLeftLb.SetHelpId( HID_CTL_ORGANIZER_LEFT ); + aRightLb.SetHelpId( HID_CTL_ORGANIZER_RIGHT ); String aWorkPath = SvtPathOptions().GetWorkPath(); if ( aWorkPath.Len() ) diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src index 2c9975de9bb8..d9ef886f59bb 100644 --- a/sfx2/source/doc/docvor.src +++ b/sfx2/source/doc/docvor.src @@ -37,7 +37,7 @@ ModalDialog DLG_ORGANIZE { - HelpId = SID_ORGANIZER ; + HelpId = CMD_SID_ORGANIZER ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 271 , 162 ) ; diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 3ad0cc51a923..f7df58ffd397 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -384,7 +384,7 @@ void SAL_CALL IFrameObject::removeVetoableChangeListener(const ::rtl::OUString&, ::sal_Int16 SAL_CALL IFrameObject::execute() throw (::com::sun::star::uno::RuntimeException) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_FLOATINGFRAME, mxObj ); + VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, rtl::OUString::createFromAscii(".uno:InsertObjectFloatingFrame"), mxObj ); if ( pDlg ) pDlg->Execute(); return 0; diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 3b1ebde3f1ae..d3235b1c7a7f 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -177,8 +177,7 @@ SfxPreviewWin::SfxPreviewWin( Window* pParent, const ResId& rResId, SfxObjectShellLock &rDocSh ) : Window(pParent, rResId), rDocShell( rDocSh ) { - // FIXME: HELPID - SetHelpId( ""/*HID_PREVIEW_FRAME*/ ); + SetHelpId( HID_PREVIEW_FRAME ); // adjust contrast mode initially bool bUseContrast = UseHighContrastSetting(); diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src index 146f9f630570..63c9f49110dd 100644 --- a/sfx2/source/doc/new.src +++ b/sfx2/source/doc/new.src @@ -28,12 +28,14 @@ #include #include "doc.hrc" #include "new.hrc" +#include + // pragma ---------------------------------------------------------------- // DLG_NEW_FILE ---------------------------------------------------------- ModalDialog DLG_NEW_FILE { - HelpId = SID_NEWDOC ; + HelpId = CMD_SID_NEWDOC ; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 336 , 96 ) ; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index e73594af1e10..2e5968d83077 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -365,17 +365,6 @@ void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT) { SfxStyleSheetBasePool *pStylePool = GetStyleSheetPool(); SetOrganizerSearchMask(pStylePool); -#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS - SfxStyleSheetBase *pStyle = (*pStylePool)[nIdx2]; - if(pStyle) - { - String aHelpFile; - ULONG nHelpId=pStyle->GetHelpId(aHelpFile); - SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI(); - if ( pHelpPI && nHelpId ) - pHelpPI->LoadTopic( nHelpId ); - } -#endif } } diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx index a254deb24c52..3e6a529bc67e 100644 --- a/sfx2/source/doc/querytemplate.cxx +++ b/sfx2/source/doc/querytemplate.cxx @@ -31,7 +31,7 @@ #include "querytemplate.hxx" #include "sfxresid.hxx" #include "doc.hrc" - +#include "helpid.hrc" #include namespace sfx2 @@ -41,8 +41,7 @@ QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) : MessBox ( pParent, 0, Application::GetDisplayName(), rMessage ) { SetImage( QueryBox::GetStandardImage() ); - // FIXME: HELPID - SetHelpId( ""/*MSG_QUERY_LOAD_TEMPLATE*/ ); + SetHelpId( HID_QUERY_LOAD_TEMPLATE ); AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON ); diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index 29ad461d18da..86353e4ca968 100644 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -30,330 +30,323 @@ // include ------------------------------------------------------------------ #include +#include // Help-Ids ----------------------------------------------------------------- -#define HID_GLOBAL_FALLBACK 0xFFFFFFFF +#define HID_FILTER_SELECT "SFX2_HID_FILTER_SELECT" +#define HID_USERDEFBMP "SFX2_HID_USERDEFBMP" +#define HID_DOCINFO_EDT "SFX2_HID_DOCINFO_EDT" +#define HID_PASSWD "SFX2_HID_PASSWD" +#define HID_PRINTMONITOR "SFX2_HID_PRINTMONITOR" +#define HID_CONFIG_OBJECTBAR "SFX2_HID_CONFIG_OBJECTBAR" +#define HID_MANAGE_STYLES "SFX2_HID_MANAGE_STYLES" +#define HID_CONFIG_EVENT "SFX2_HID_CONFIG_EVENT" +#define HID_DOCINFODESC "SFX2_HID_DOCINFODESC" +#define HID_DOCINFODOC "SFX2_HID_DOCINFODOC" +#define HID_DOCINFOUSER "SFX2_HID_DOCINFOUSER" +#define HID_BOOKMARKPROPS "SFX2_HID_BOOKMARKPROPS" +#define HID_BOOKGROUPPROPS "SFX2_HID_BOOKGROUPPROPS" +#define HID_BOOKFILEPROPS "SFX2_HID_BOOKFILEPROPS" +#define HID_NEWS_SERVERPROPS "SFX2_HID_NEWS_SERVERPROPS" +#define HID_NEWS_RULEPAGE "SFX2_HID_NEWS_RULEPAGE" +#define HID_MAILINTRAYPROPS "SFX2_HID_MAILINTRAYPROPS" +#define HID_DOCINFORELOAD "SFX2_HID_DOCINFORELOAD" +#define HID_NEWS_GROUPPAGE "SFX2_HID_NEWS_GROUPPAGE" +#define HID_NEWS_SERVERPAGE "SFX2_HID_NEWS_SERVERPAGE" +#define HID_FILEDLG_STANDARD "SFX2_HID_FILEDLG_STANDARD" +#define HID_FILEDLG_MANAGER "SFX2_HID_FILEDLG_MANAGER" +#define HID_FILEDLG_URL "SFX2_HID_FILEDLG_URL" +#define HID_FILEDLG_FILE "SFX2_HID_FILEDLG_FILE" +#define HID_FILEDLG_USE_PASSWD "SFX2_HID_FILEDLG_USE_PASSWD" +#define HID_FILEDLG_READ_ONLY "SFX2_HID_FILEDLG_READ_ONLY" +#define HID_EXPLORERCONTROL "SFX2_HID_EXPLORERCONTROL" +#define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL" +#define HID_CTL_ORGANIZER_LEFT "SFX2_HID_CTL_ORGANIZER_LEFT" +#define HID_CTL_ORGANIZER_RIGHT "SFX2_HID_CTL_ORGANIZER_RIGHT" +#define HID_EXPLMAILSRV_GENERAL_PAGE "SFX2_HID_EXPLMAILSRV_GENERAL_PAGE" +#define HID_EXPLMAILSRV_PROTOCOL_PAGE "SFX2_HID_EXPLMAILSRV_PROTOCOL_PAGE" +#define HID_EXPLMAILSRV_DATAMATCH_PAGE "SFX2_HID_EXPLMAILSRV_DATAMATCH_PAGE" +#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE "SFX2_HID_EXPLMAILSRV_SENDJOURNAL_PAGE" +#define HID_EXPLMAIL_GENERAL_PAGE "SFX2_HID_EXPLMAIL_GENERAL_PAGE" +#define HID_NEWS_CTL_RULES "SFX2_HID_NEWS_CTL_RULES" +#define HID_NEWS_CTL_GROUPS "SFX2_HID_NEWS_CTL_GROUPS" +#define HID_CONFIG_OBJECTBAR_CTL "SFX2_HID_CONFIG_OBJECTBAR_CTL" +#define HID_NEWS_QUICKSEARCH "SFX2_HID_NEWS_QUICKSEARCH" +#define HID_NEWS_SERVERVIEWPROPS "SFX2_HID_NEWS_SERVERVIEWPROPS" +#define HID_NEWS_SHOWARTICLEPROPS "SFX2_HID_NEWS_SHOWARTICLEPROPS" +#define HID_NEWS_SHOWGROUPPROPS "SFX2_HID_NEWS_SHOWGROUPPROPS" +#define HID_NEWS_USER "SFX2_HID_NEWS_USER" +#define HID_MULTISELECTION_GENERAL_PAGE "SFX2_HID_MULTISELECTION_GENERAL_PAGE" +#define HID_LINK_GENERAL_PAGE "SFX2_HID_LINK_GENERAL_PAGE" +#define HID_LINK_ADDRESS_PAGE "SFX2_HID_LINK_ADDRESS_PAGE" +#define HID_FOLDER_GENERAL_PAGE "SFX2_HID_FOLDER_GENERAL_PAGE" +#define HID_FILE_GENERAL_PAGE "SFX2_HID_FILE_GENERAL_PAGE" +#define HID_FTP_GENERAL_PAGE "SFX2_HID_FTP_GENERAL_PAGE" +#define HID_PRINT_OPTIONS "SFX2_HID_PRINT_OPTIONS" +#define HID_PREVIEW_FRAME "SFX2_HID_PREVIEW_FRAME" +#define HID_DOCINFO_FRAME "SFX2_HID_DOCINFO_FRAME" +#define HID_EXPLORER_FRAME "SFX2_HID_EXPLORER_FRAME" +#define HID_APP_WIN "SFX2_HID_APP_WIN" +#define HID_TEMPLATE_FMT "SFX2_HID_TEMPLATE_FMT" +#define HID_TEMPLATE_FILTER "SFX2_HID_TEMPLATE_FILTER" +#define HID_FTPSERVER_PAGE "SFX2_HID_FTPSERVER_PAGE" +#define HID_DLG_SFX_EXP_SEARCH "SFX2_HID_DLG_SFX_EXP_SEARCH" +#define HID_TP_SFX_EXP_SEARCH_CRITERIA "SFX2_HID_TP_SFX_EXP_SEARCH_CRITERIA" +#define HID_TP_SFX_EXP_SEARCH_PLACE "SFX2_HID_TP_SFX_EXP_SEARCH_PLACE" +#define HID_SEARCH_DLG_TABLB "SFX2_HID_SEARCH_DLG_TABLB" +#define HID_TEMPLDLG_NEWBYEXAMPLE "SFX2_HID_TEMPLDLG_NEWBYEXAMPLE" +#define HID_TEMPLDLG_UPDATEBYEXAMPLE "SFX2_HID_TEMPLDLG_UPDATEBYEXAMPLE" +#define HID_TEMPLDLG_WATERCAN "SFX2_HID_TEMPLDLG_WATERCAN" +#define HID_DESKTOP "SFX2_HID_DESKTOP" +#define HID_EXPLORERTOOLSTOOLBOX "SFX2_HID_EXPLORERTOOLSTOOLBOX" +#define HID_EXPLOREROBJECTTOOLBOX "SFX2_HID_EXPLOREROBJECTTOOLBOX" +#define HID_RECORDINGTOOLBOX "SFX2_HID_RECORDINGTOOLBOX" +#define HID_FULLSCREENTOOLBOX "SFX2_HID_FULLSCREENTOOLBOX" +#define HID_HELPBAR "SFX2_HID_HELPBAR" +#define HID_ENVTOOLBOX "SFX2_HID_ENVTOOLBOX" +#define HID_FRAMESETEDIT_TOOLBOX "SFX2_HID_FRAMESETEDIT_TOOLBOX" +#define HID_NAVIGATOR_WINDOW "SFX2_HID_NAVIGATOR_WINDOW" +#define HID_TABDLG_RESET_BTN "SFX2_HID_TABDLG_RESET_BTN" +#define HID_TABDLG_STANDARD_BTN "SFX2_HID_TABDLG_STANDARD_BTN" +#define HID_HELPAGENT_TIP_BOX "SFX2_HID_HELPAGENT_TIP_BOX" +#define HID_TEMPLDLG_TOOLBOX_LEFT "SFX2_HID_TEMPLDLG_TOOLBOX_LEFT" +#define HID_TEMPLDLG_TOOLBOX_RIGHT "SFX2_HID_TEMPLDLG_TOOLBOX_RIGHT" +#define HID_EXPLORER_SRCH_COUNT "SFX2_HID_EXPLORER_SRCH_COUNT" +#define HID_BEAMER_SORT_ASCENDING "SFX2_HID_BEAMER_SORT_ASCENDING" +#define HID_BEAMER_SORT_DESCENDING "SFX2_HID_BEAMER_SORT_DESCENDING" +#define HID_EXPLORER_SRCH_LATEST_COUNT "SFX2_HID_EXPLORER_SRCH_LATEST_COUNT" +#define HID_CONFIG_EVENT_OFFICE_BASED "SFX2_HID_CONFIG_EVENT_OFFICE_BASED" +#define HID_CONFIG_EVENT_DOCUMENT_BASED "SFX2_HID_CONFIG_EVENT_DOCUMENT_BASED" +#define HID_ORGANIZE_NEW "SFX2_HID_ORGANIZE_NEW" +#define HID_ORGANIZE_DELETE "SFX2_HID_ORGANIZE_DELETE" +#define HID_ORGANIZE_EDIT "SFX2_HID_ORGANIZE_EDIT" +#define HID_ORGANIZE_COPY_FROM "SFX2_HID_ORGANIZE_COPY_FROM" +#define HID_ORGANIZE_COPY_TO "SFX2_HID_ORGANIZE_COPY_TO" +#define HID_ORGANIZE_PRINT "SFX2_HID_ORGANIZE_PRINT" +#define HID_ORGANIZE_PRINTER_SETUP "SFX2_HID_ORGANIZE_PRINTER_SETUP" +#define HID_ORGANIZE_RESCAN "SFX2_HID_ORGANIZE_RESCAN" +#define HID_STYLIST_NEW "SFX2_HID_STYLIST_NEW" +#define HID_STYLIST_EDIT "SFX2_HID_STYLIST_EDIT" +#define HID_STYLIST_DELETE "SFX2_HID_STYLIST_DELETE" +#define HID_EXPLORERMENU_ARRANGEICONS "SFX2_HID_EXPLORERMENU_ARRANGEICONS" +#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID "SFX2_HID_EXPLORERMENU_ARRANGEICONS_ONGRID" +#define HID_EXPLORERMENU_FIXEDICONPOS "SFX2_HID_EXPLORERMENU_FIXEDICONPOS" +#define HID_EXPLORERMENU_OPEN "SFX2_HID_EXPLORERMENU_OPEN" +#define HID_EXPLORERMENU_PRINT "SFX2_HID_EXPLORERMENU_PRINT" +#define HID_EXPLORERMENU_SEARCH "SFX2_HID_EXPLORERMENU_SEARCH" +#define HID_EXPLORERMENU_COPY "SFX2_HID_EXPLORERMENU_COPY" +#define HID_EXPLORERMENU_DELETE "SFX2_HID_EXPLORERMENU_DELETE" +#define HID_EXPLORERMENU_CREATELINK "SFX2_HID_EXPLORERMENU_CREATELINK" +#define HID_EXPLORERMENU_EDITPROPERTIES "SFX2_HID_EXPLORERMENU_EDITPROPERTIES" +#define HID_EXPLORERMENU_DOWNLOAD "SFX2_HID_EXPLORERMENU_DOWNLOAD" +#define HID_EXPLORERMENU_STDTEMPLATE "SFX2_HID_EXPLORERMENU_STDTEMPLATE" +#define HID_EXPLORERDLG_FILELIST "SFX2_HID_EXPLORERDLG_FILELIST" +#define HID_PDFOLDERS_WORKPLACE "SFX2_HID_PDFOLDERS_WORKPLACE" +#define HID_PDFOLDERS_EXPLORER "SFX2_HID_PDFOLDERS_EXPLORER" +#define HID_PDFOLDERS_STANDARD "SFX2_HID_PDFOLDERS_STANDARD" +#define HID_PDFOLDERS_ROOT "SFX2_HID_PDFOLDERS_ROOT" +#define HID_PDFOLDERS_DESKTOP "SFX2_HID_PDFOLDERS_DESKTOP" +#define HID_CNTMENU_REMOVE_GROUP "SFX2_HID_CNTMENU_REMOVE_GROUP" +#define HID_CNTMENU_CLEAR_CACHE "SFX2_HID_CNTMENU_CLEAR_CACHE" +#define HID_CNT_SYNC_INFO_DLG "SFX2_HID_CNT_SYNC_INFO_DLG" +#define HID_CNT_REMOVE_REMOVEDLIST "SFX2_HID_CNT_REMOVE_REMOVEDLIST" +#define HID_CNT_ABORT_DIALOG "SFX2_HID_CNT_ABORT_DIALOG" +#define HID_CNT_PAGE_PRJ_DATAEXCHANGE "SFX2_HID_CNT_PAGE_PRJ_DATAEXCHANGE" +#define HID_CHAOSDOC_OBJECTBAR_FILE "SFX2_HID_CHAOSDOC_OBJECTBAR_FILE" +#define HID_CHAOSDOC_OBJECTBAR_MESSAGE "SFX2_HID_CHAOSDOC_OBJECTBAR_MESSAGE" +#define HID_CHAOSDOC_MN_PART_OPEN "SFX2_HID_CHAOSDOC_MN_PART_OPEN" +#define HID_CHAOSDOC_MN_PART_DELETE "SFX2_HID_CHAOSDOC_MN_PART_DELETE" +#define HID_CHAOSDOC_MN_PART_RENAME "SFX2_HID_CHAOSDOC_MN_PART_RENAME" +#define HID_CHAOSDOC_MN_PART_SAVEAS "SFX2_HID_CHAOSDOC_MN_PART_SAVEAS" +#define HID_EXPLORER_DOCVIEW_ICON "SFX2_HID_EXPLORER_DOCVIEW_ICON" +#define HID_EXPLORER_DOCVIEW_DETAILS "SFX2_HID_EXPLORER_DOCVIEW_DETAILS" +#define HID_CHAOSDOC_WIN "SFX2_HID_CHAOSDOC_WIN" +#define HID_CHAOSDOC_WIN_HEADER "SFX2_HID_CHAOSDOC_WIN_HEADER" +#define HID_CHAOSDOC_WIN_PARTS "SFX2_HID_CHAOSDOC_WIN_PARTS" +#define HID_CHAOSDOC_WIN_BODY "SFX2_HID_CHAOSDOC_WIN_BODY" +#define HID_CNT_INSERT_COLUMN "SFX2_HID_CNT_INSERT_COLUMN" +#define HID_CNT_REMOVE_COLUMN "SFX2_HID_CNT_REMOVE_COLUMN" +#define HID_CNT_OPT_WIDTH "SFX2_HID_CNT_OPT_WIDTH" +#define HID_CNT_SORT_ASC "SFX2_HID_CNT_SORT_ASC" +#define HID_CNT_SORT_DESC "SFX2_HID_CNT_SORT_DESC" +#define HID_CNT_RULEPG_OPEN_DIR "SFX2_HID_CNT_RULEPG_OPEN_DIR" +#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK "SFX2_HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK" +#define HID_CHAOSDOC_MN_HEADER_COPYLINK "SFX2_HID_CHAOSDOC_MN_HEADER_COPYLINK" +#define HID_CLEAN_CACHE "SFX2_HID_CLEAN_CACHE" +#define HID_SBOX_LOCATION "SFX2_HID_SBOX_LOCATION" +#define HID_SBOX_SUBSCRIBTION "SFX2_HID_SBOX_SUBSCRIBTION" +#define HID_SBOX_CDF_SUBSCRIBTION "SFX2_HID_SBOX_CDF_SUBSCRIBTION" +#define HID_SBOX_SCHEDULE "SFX2_HID_SBOX_SCHEDULE" +#define HID_SBOX_NOTIFICATION "SFX2_HID_SBOX_NOTIFICATION" +#define HID_SBOX_SDC_GENERAL "SFX2_HID_SBOX_SDC_GENERAL" +#define HID_BRWBOX_HEADERBAR "SFX2_HID_BRWBOX_HEADERBAR" +#define HID_CANNOT_CREATE_BMK_HERE "SFX2_HID_CANNOT_CREATE_BMK_HERE" +#define HID_CREATE_BOOKMARK "SFX2_HID_CREATE_BOOKMARK" +#define HID_TASKBAR "SFX2_HID_TASKBAR" +#define HID_TASKBUTTONBAR "SFX2_HID_TASKBUTTONBAR" +#define HID_TASKTOOLBAR "SFX2_HID_TASKTOOLBAR" +#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION "SFX2_HID_CHAOSDOC_SHOW_FSYS_EXTENSION" +#define HID_CNT_FILE "SFX2_HID_CNT_FILE" +#define HID_CHAOSDOC_MN_BODY_OPENLINK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK" +#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK "SFX2_HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK" +#define HID_CHAOSDOC_MN_BODY_DOWNLOAD "SFX2_HID_CHAOSDOC_MN_BODY_DOWNLOAD" +#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK "SFX2_HID_CHAOSDOC_MN_BODY_ADDBOOKMARK" +#define HID_OPEN_MENU_CNT "SFX2_HID_OPEN_MENU_CNT" +#define HID_CNT_OPEN_AS_TEMPLATE "SFX2_HID_CNT_OPEN_AS_TEMPLATE" +#define HID_CNT_OPEN_AS_DOC "SFX2_HID_CNT_OPEN_AS_DOC" +#define HID_PDFOLDERS_TEMPLATE "SFX2_HID_PDFOLDERS_TEMPLATE" +#define HID_EXPLORER_ROOT "SFX2_HID_EXPLORER_ROOT" +#define HID_RESET_URL "SFX2_HID_RESET_URL" +#define HID_PHONE_DIALOG "SFX2_HID_PHONE_DIALOG" +#define HID_QB_RESOLVE_LINK "SFX2_HID_QB_RESOLVE_LINK" +#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_BOLD" +#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC "SFX2_HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC" +#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_BIG_HEADER" +#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER "SFX2_HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER" +#define HID_CNT_MARK_THREAD_MARKED "SFX2_HID_CNT_MARK_THREAD_MARKED" +#define HID_CNT_MARK_THREAD_UNMARKED "SFX2_HID_CNT_MARK_THREAD_UNMARKED" +#define HID_CNT_DLG_SEARCH_BT_SHOW "SFX2_HID_CNT_DLG_SEARCH_BT_SHOW" +#define HID_CNT_DLG_SEARCH_BT_UPDATE "SFX2_HID_CNT_DLG_SEARCH_BT_UPDATE" +#define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE "SFX2_HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE" +#define HID_CNT_DLG_SEARCH_BT_STOP "SFX2_HID_CNT_DLG_SEARCH_BT_STOP" +#define HID_CNT_PAGE_HEADER "SFX2_HID_CNT_PAGE_HEADER" +#define HID_CNT_DLG_ADDRESS "SFX2_HID_CNT_DLG_ADDRESS" +#define HID_EXPLORERMENU_AUTO_ARRANGEICONS "SFX2_HID_EXPLORERMENU_AUTO_ARRANGEICONS" +#define HID_EXPLORERMENU_AUTO_ADJUSTICONS "SFX2_HID_EXPLORERMENU_AUTO_ADJUSTICONS" +#define HID_EXPLORERMENU_FREE_POSITIONING "SFX2_HID_EXPLORERMENU_FREE_POSITIONING" +#define HID_CNT_TARGET_MENU "SFX2_HID_CNT_TARGET_MENU" +#define HID_CNT_PAGE_DESCRIPTION "SFX2_HID_CNT_PAGE_DESCRIPTION" +#define HID_CNT_LB_HEADER "SFX2_HID_CNT_LB_HEADER" +#define HID_CNT_LB_DESCRIPTION "SFX2_HID_CNT_LB_DESCRIPTION" +#define HID_GROUPVIEW_BIG_SYMBOLS "SFX2_HID_GROUPVIEW_BIG_SYMBOLS" +#define HID_GROUPVIEW_SMALL_SYMBOLS "SFX2_HID_GROUPVIEW_SMALL_SYMBOLS" +#define HID_GROUPVIEW_ADD_GROUP "SFX2_HID_GROUPVIEW_ADD_GROUP" +#define HID_GROUPVIEW_REMOVE_GROUP "SFX2_HID_GROUPVIEW_REMOVE_GROUP" +#define HID_GROUPVIEW_RENAME_GROUP "SFX2_HID_GROUPVIEW_RENAME_GROUP" +#define HID_GROUPVIEW_ADD_BOOKMARK "SFX2_HID_GROUPVIEW_ADD_BOOKMARK" +#define HID_GROUPVIEW_TREE "SFX2_HID_GROUPVIEW_TREE" +#define HID_GROUPVIEW_ADD_AS_FOLDER "SFX2_HID_GROUPVIEW_ADD_AS_FOLDER" +#define HID_GROUPVIEW_ADD_AS_BMK "SFX2_HID_GROUPVIEW_ADD_AS_BMK" +#define HID_GROUPVIEW_REMOVE_BMK "SFX2_HID_GROUPVIEW_REMOVE_BMK" +#define HID_GROUPVIEW_CONTENT_BIG "SFX2_HID_GROUPVIEW_CONTENT_BIG" +#define HID_GROUPVIEW_CONTENT_SMALL "SFX2_HID_GROUPVIEW_CONTENT_SMALL" +#define HID_GROUPVIEW_CONTENT_TREE "SFX2_HID_GROUPVIEW_CONTENT_TREE" +#define HID_GROUPVIEW_SHOW_DOCS "SFX2_HID_GROUPVIEW_SHOW_DOCS" +#define HID_EDIT_TEMPLATE "SFX2_HID_EDIT_TEMPLATE" +#define HID_PDFOLDERS_GRAPHICS "SFX2_HID_PDFOLDERS_GRAPHICS" +#define HID_FILEDLG_AUTOCOMPLETEBOX "SFX2_HID_FILEDLG_AUTOCOMPLETEBOX" +#define HID_FILEDLG_SAVE_BTN "SFX2_HID_FILEDLG_SAVE_BTN" +#define HID_FILEDLG_SAVE_FILENAME "SFX2_HID_FILEDLG_SAVE_FILENAME" +#define HID_FILEDLG_SAVE_FILETYPE "SFX2_HID_FILEDLG_SAVE_FILETYPE" +#define HID_FILEDLG_INSERT_BTN "SFX2_HID_FILEDLG_INSERT_BTN" +#define HID_FILEDLG_PATH_BTN "SFX2_HID_FILEDLG_PATH_BTN" +#define HID_FILEDLG_PATH_FILENAME "SFX2_HID_FILEDLG_PATH_FILENAME" +#define HID_FILEDLG_FOLDER_BTN "SFX2_HID_FILEDLG_FOLDER_BTN" +#define HID_FILEDLG_FOLDER_FILENAME "SFX2_HID_FILEDLG_FOLDER_FILENAME" +#define HID_FILEDLG_SRCHFOLDER_BTN "SFX2_HID_FILEDLG_SRCHFOLDER_BTN" +#define HID_PDFOLDERS_GROUPS "SFX2_HID_PDFOLDERS_GROUPS" +#define HID_OPEN_CHOOSE_FILTER "SFX2_HID_OPEN_CHOOSE_FILTER" +#define HID_PDFOLDERS_BOOKMARKS "SFX2_HID_PDFOLDERS_BOOKMARKS" +#define HID_PDFOLDERS_FAVORITES_ADD "SFX2_HID_PDFOLDERS_FAVORITES_ADD" +#define HID_PDFOLDERS_FAVORITES_REMOVE "SFX2_HID_PDFOLDERS_FAVORITES_REMOVE" +#define HID_PDFOLDERS_HISTORY "SFX2_HID_PDFOLDERS_HISTORY" +#define HID_FILEDLG_EDIT_FAVORITES "SFX2_HID_FILEDLG_EDIT_FAVORITES" +#define HID_FILEDLG_NEW_FAVORITE "SFX2_HID_FILEDLG_NEW_FAVORITE" +#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SFX2_HID_FILEDLG_EDIT_FAVORITES_LISTBOX" +#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SFX2_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR" +#define HID_CNT_CB_FORCE_BODY_EXPORT "SFX2_HID_CNT_CB_FORCE_BODY_EXPORT" +#define HID_CNT_PAGE_REPSTATE_CONTROL "SFX2_HID_CNT_PAGE_REPSTATE_CONTROL" +#define HID_TASKSTATUSBAR "SFX2_HID_TASKSTATUSBAR" +#define HID_CNT_PAGE_HEADER_TABBAR "SFX2_HID_CNT_PAGE_HEADER_TABBAR" +#define HID_CNT_PAGE_SUBSCR_TABBAR "SFX2_HID_CNT_PAGE_SUBSCR_TABBAR" +#define HID_CHAOSDOC_MN_PART_PRINT "SFX2_HID_CHAOSDOC_MN_PART_PRINT" +#define HID_STATUSINDICATOR_TEXT "SFX2_HID_STATUSINDICATOR_TEXT" +#define HID_STATUSINDICATOR_PROGRESS "SFX2_HID_STATUSINDICATOR_PROGRESS" +#define HID_CNT_VALUE_ADDED_NONE "SFX2_HID_CNT_VALUE_ADDED_NONE" +#define HID_CNT_VALUE_ADDED_DOCINFO "SFX2_HID_CNT_VALUE_ADDED_DOCINFO" +#define HID_CNT_VALUE_ADDED_FULL "SFX2_HID_CNT_VALUE_ADDED_FULL" +#define HID_CNT_MESSAGE_STOREMODE_REMOTE "SFX2_HID_CNT_MESSAGE_STOREMODE_REMOTE" +#define HID_CNT_MESSAGE_STOREMODE_LOCAL "SFX2_HID_CNT_MESSAGE_STOREMODE_LOCAL" +#define HID_CNT_VIEW_ALL_ARTICLES "SFX2_HID_CNT_VIEW_ALL_ARTICLES" +#define HID_CNT_VIEW_UNREAD_ARTICLES "SFX2_HID_CNT_VIEW_UNREAD_ARTICLES" +#define HID_CNT_VIEW_READ_ARTICLES "SFX2_HID_CNT_VIEW_READ_ARTICLES" +#define HID_CNT_VIEW_MARKED_ARTICLES "SFX2_HID_CNT_VIEW_MARKED_ARTICLES" +#define HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES "SFX2_HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES" +#define HID_CNT_VIEW_ALL_FOLDERS "SFX2_HID_CNT_VIEW_ALL_FOLDERS" +#define HID_CNT_VIEW_SUBSCRIBED_FOLDERS "SFX2_HID_CNT_VIEW_SUBSCRIBED_FOLDERS" +#define HID_CNT_VIEW_ACTIVE_FOLDERS "SFX2_HID_CNT_VIEW_ACTIVE_FOLDERS" +#define HID_CNT_SENT_VIEW_ALL_ARTICLES "SFX2_HID_CNT_SENT_VIEW_ALL_ARTICLES" +#define HID_CNT_SENT_VIEW_SENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_SENT_ARTICLES" +#define HID_CNT_SENT_VIEW_UNSENT_ARTICLES "SFX2_HID_CNT_SENT_VIEW_UNSENT_ARTICLES" +#define HID_CNT_SENT_VIEW_MARKED_ARTICLES "SFX2_HID_CNT_SENT_VIEW_MARKED_ARTICLES" +#define HID_MAILWIN_SEND_BUTTON "SFX2_HID_MAILWIN_SEND_BUTTON" +#define HID_MAILWIN_CLOSE_BUTTON "SFX2_HID_MAILWIN_CLOSE_BUTTON" +#define HID_MAILWIN_ROLE_BOX "SFX2_HID_MAILWIN_ROLE_BOX" +#define HID_MAILWIN_ADDRESS_EDIT "SFX2_HID_MAILWIN_ADDRESS_EDIT" +#define HID_MAILWIN_ADDRESS_BOX "SFX2_HID_MAILWIN_ADDRESS_BOX" +#define HID_MAILWIN_SUBJECT_EDIT "SFX2_HID_MAILWIN_SUBJECT_EDIT" +#define HID_MAILWIN_FROM_EDIT "SFX2_HID_MAILWIN_FROM_EDIT" +#define HID_MAILWIN_PRIO_BOX "SFX2_HID_MAILWIN_PRIO_BOX" +#define HID_TABDLG_APPLY_BTN "SFX2_HID_TABDLG_APPLY_BTN" +#define HID_TP_COMMONPRINTOPTIONS "SFX2_HID_TP_COMMONPRINTOPTIONS" +#define HID_FILEDLG_LINK_CB "SFX2_HID_FILEDLG_LINK_CB" +#define HID_FILEDLG_PREVIEW_CB "SFX2_HID_FILEDLG_PREVIEW_CB" +#define HID_HELP_WINDOW "SFX2_HID_HELP_WINDOW" +#define HID_HELP_LISTBOX "SFX2_HID_HELP_LISTBOX" +#define HID_HELP_TABCONTROL "SFX2_HID_HELP_TABCONTROL" +#define HID_HELP_TOOLBOX "SFX2_HID_HELP_TOOLBOX" +#define HID_HELP_TOOLBOXITEM_INDEX "SFX2_HID_HELP_TOOLBOXITEM_INDEX" +#define HID_HELP_TOOLBOXITEM_START "SFX2_HID_HELP_TOOLBOXITEM_START" +#define HID_HELP_TOOLBOXITEM_BACKWARD "SFX2_HID_HELP_TOOLBOXITEM_BACKWARD" +#define HID_HELP_TOOLBOXITEM_FORWARD "SFX2_HID_HELP_TOOLBOXITEM_FORWARD" +#define HID_HELP_TOOLBOXITEM_PRINT "SFX2_HID_HELP_TOOLBOXITEM_PRINT" +#define HID_HELP_TOOLBOXITEM_BOOKMARKS "SFX2_HID_HELP_TOOLBOXITEM_BOOKMARKS" +#define HID_HELP_TABPAGE_CONTENTS "SFX2_HID_HELP_TABPAGE_CONTENTS" +#define HID_HELP_TABPAGE_INDEX "SFX2_HID_HELP_TABPAGE_INDEX" +#define HID_HELP_TABPAGE_SEARCH "SFX2_HID_HELP_TABPAGE_SEARCH" +#define HID_HELP_TABPAGE_BOOKMARKS "SFX2_HID_HELP_TABPAGE_BOOKMARKS" +#define HID_TBXCONTROL_FILENEW "SFX2_HID_TBXCONTROL_FILENEW" +#define HID_ORGANIZE_STDTEMPLATE_ADD "SFX2_HID_ORGANIZE_STDTEMPLATE_ADD" +#define HID_ORGANIZE_STDTEMPLATE_DEL "SFX2_HID_ORGANIZE_STDTEMPLATE_DEL" +#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG "SFX2_HID_HELP_TOOLBOXITEM_SEARCHDIALOG" +#define HID_HELP_BOOKMARKS_OPEN "SFX2_HID_HELP_BOOKMARKS_OPEN" +#define HID_HELP_BOOKMARKS_RENAME "SFX2_HID_HELP_BOOKMARKS_RENAME" +#define HID_HELP_BOOKMARKS_DELETE "SFX2_HID_HELP_BOOKMARKS_DELETE" +#define HID_CLOSE_WARNING "SFX2_HID_CLOSE_WARNING" +#define HID_DID_SAVE_PACKED_XML "SFX2_HID_DID_SAVE_PACKED_XML" +#define HID_HELP_TREELISTBOX_CONTENTS "SFX2_HID_HELP_TREELISTBOX_CONTENTS" +#define HID_CUSTOMIZETOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX" +#define HID_CUSTOMIZETOOLBOX_FUNCTIONS "SFX2_HID_CUSTOMIZETOOLBOX_FUNCTIONS" +#define HID_CUSTOMIZETOOLBOX_TOOLBOX "SFX2_HID_CUSTOMIZETOOLBOX_TOOLBOX" +#define HID_HELP_TEXT_SELECTION_MODE "SFX2_HID_HELP_TEXT_SELECTION_MODE" -#define HID_FILTER_SELECT (HID_SFX_START + 0) -#define HID_USERDEFBMP (HID_SFX_START + 1) -#define HID_DOCINFO_EDT (HID_SFX_START + 2) -#define HID_PASSWD (HID_SFX_START + 3) -#define HID_PRINTMONITOR (HID_SFX_START + 4) -#define HID_CONFIG_OBJECTBAR (HID_SFX_START + 5) -#define HID_MANAGE_STYLES (HID_SFX_START + 6) -#define HID_CONFIG_EVENT (HID_SFX_START + 7) -#define HID_DOCINFODESC (HID_SFX_START + 8) -#define HID_DOCINFODOC (HID_SFX_START + 9) -#define HID_DOCINFOUSER (HID_SFX_START + 10) -#define HID_BOOKMARKPROPS (HID_SFX_START + 14) -#define HID_BOOKGROUPPROPS (HID_SFX_START + 15) -#define HID_BOOKFILEPROPS (HID_SFX_START + 16) -#define HID_NEWS_SERVERPROPS (HID_SFX_START + 20) -#define HID_NEWS_RULEPAGE (HID_SFX_START + 21) -#define HID_MAILINTRAYPROPS (HID_SFX_START + 23) -#define HID_DOCINFORELOAD (HID_SFX_START + 24) -#define HID_NEWS_GROUPPAGE (HID_SFX_START + 25) -#define HID_NEWS_SERVERPAGE (HID_SFX_START + 26) -#define HID_FILEDLG_STANDARD (HID_SFX_START + 27) -#define HID_FILEDLG_MANAGER (HID_SFX_START + 28) -#define HID_FILEDLG_URL (HID_SFX_START + 29) -#define HID_FILEDLG_FILE (HID_SFX_START + 30) -#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31) -#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32) -#define HID_EXPLORERCONTROL (HID_SFX_START + 33) -#define HID_BROWSERCONTROL (HID_SFX_START + 34) -#define HID_CTL_ORGANIZER_LEFT (HID_SFX_START + 35) -#define HID_CTL_ORGANIZER_RIGHT (HID_SFX_START + 36) -#define HID_EXPLMAILSRV_GENERAL_PAGE (HID_SFX_START + 37) -#define HID_EXPLMAILSRV_PROTOCOL_PAGE (HID_SFX_START + 38) -#define HID_EXPLMAILSRV_DATAMATCH_PAGE (HID_SFX_START + 39) -#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE (HID_SFX_START + 40) -#define HID_EXPLMAIL_GENERAL_PAGE (HID_SFX_START + 41) -#define HID_NEWS_CTL_RULES (HID_SFX_START + 42) -#define HID_NEWS_CTL_GROUPS (HID_SFX_START + 43) -#define HID_CONFIG_OBJECTBAR_CTL (HID_SFX_START + 44) -#define HID_NEWS_QUICKSEARCH (HID_SFX_START + 45) -#define HID_NEWS_SERVERVIEWPROPS (HID_SFX_START + 46) -#define HID_NEWS_SHOWARTICLEPROPS (HID_SFX_START + 47) -#define HID_NEWS_SHOWGROUPPROPS (HID_SFX_START + 48) -#define HID_NEWS_USER (HID_SFX_START + 49) -#define HID_MULTISELECTION_GENERAL_PAGE (HID_SFX_START + 50) -#define HID_LINK_GENERAL_PAGE (HID_SFX_START + 51) -#define HID_LINK_ADDRESS_PAGE (HID_SFX_START + 52) -#define HID_FOLDER_GENERAL_PAGE (HID_SFX_START + 53) -#define HID_FILE_GENERAL_PAGE (HID_SFX_START + 54) -#define HID_FTP_GENERAL_PAGE (HID_SFX_START + 55) -#define HID_PRINT_OPTIONS (HID_SFX_START + 56) -#define HID_PREVIEW_FRAME (HID_SFX_START + 57) -#define HID_DOCINFO_FRAME (HID_SFX_START + 58) -#define HID_EXPLORER_FRAME (HID_SFX_START + 59) -#define HID_APP_WIN (HID_SFX_START + 60) -#define HID_TEMPLATE_FMT (HID_SFX_START + 61) -#define HID_TEMPLATE_FILTER (HID_SFX_START + 62) -#define HID_FTPSERVER_PAGE (HID_SFX_START + 63) -#define HID_DLG_SFX_EXP_SEARCH (HID_SFX_START + 65) -#define HID_TP_SFX_EXP_SEARCH_CRITERIA (HID_SFX_START + 66) -#define HID_TP_SFX_EXP_SEARCH_PLACE (HID_SFX_START + 67) -#define HID_SEARCH_DLG_TABLB (HID_SFX_START + 68) -#define HID_TEMPLDLG_NEWBYEXAMPLE (HID_SFX_START + 69) -#define HID_TEMPLDLG_UPDATEBYEXAMPLE (HID_SFX_START + 70) -#define HID_TEMPLDLG_WATERCAN (HID_SFX_START + 71) -#define HID_DESKTOP (HID_SFX_START + 78) -#define HID_EXPLORERTOOLSTOOLBOX (HID_SFX_START + 79) -#define HID_EXPLOREROBJECTTOOLBOX (HID_SFX_START + 80) -#define HID_RECORDINGTOOLBOX (HID_SFX_START + 81) -#define HID_FULLSCREENTOOLBOX (HID_SFX_START + 82) -#define HID_HELPBAR (HID_SFX_START + 83) -#define HID_ENVTOOLBOX (HID_SFX_START + 84) -#define HID_FRAMESETEDIT_TOOLBOX (HID_SFX_START + 85) -#define HID_NAVIGATOR_WINDOW (HID_SFX_START + 86) -#define HID_TABDLG_RESET_BTN (HID_SFX_START + 89) -#define HID_TABDLG_STANDARD_BTN (HID_SFX_START + 90) -#define HID_HELPAGENT_TIP_BOX (HID_SFX_START + 91) -#define HID_TEMPLDLG_TOOLBOX_LEFT (HID_SFX_START + 92) -#define HID_TEMPLDLG_TOOLBOX_RIGHT (HID_SFX_START + 93) -#define HID_EXPLORER_SRCH_COUNT (HID_SFX_START + 94) -#define HID_BEAMER_SORT_ASCENDING (HID_SFX_START + 95) -#define HID_BEAMER_SORT_DESCENDING (HID_SFX_START + 96) -#define HID_EXPLORER_SRCH_LATEST_COUNT (HID_SFX_START + 97) -#define HID_CONFIG_EVENT_OFFICE_BASED (HID_SFX_START + 98) -#define HID_CONFIG_EVENT_DOCUMENT_BASED (HID_SFX_START + 99) -#define HID_ORGANIZE_NEW (HID_SFX_START + 100) -#define HID_ORGANIZE_DELETE (HID_SFX_START + 101) -#define HID_ORGANIZE_EDIT (HID_SFX_START + 102) -#define HID_ORGANIZE_COPY_FROM (HID_SFX_START + 103) -#define HID_ORGANIZE_COPY_TO (HID_SFX_START + 104) -#define HID_ORGANIZE_PRINT (HID_SFX_START + 105) -#define HID_ORGANIZE_PRINTER_SETUP (HID_SFX_START + 106) -#define HID_ORGANIZE_RESCAN (HID_SFX_START + 107) -#define HID_STYLIST_NEW (HID_SFX_START + 108) -#define HID_STYLIST_EDIT (HID_SFX_START + 109) -#define HID_STYLIST_DELETE (HID_SFX_START + 110) -#define HID_EXPLORERMENU_ARRANGEICONS (HID_SFX_START + 111) -#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID (HID_SFX_START + 112) -#define HID_EXPLORERMENU_FIXEDICONPOS (HID_SFX_START + 113) -#define HID_EXPLORERMENU_OPEN (HID_SFX_START + 114) -#define HID_EXPLORERMENU_PRINT (HID_SFX_START + 115) -#define HID_EXPLORERMENU_SEARCH (HID_SFX_START + 116) -#define HID_EXPLORERMENU_COPY (HID_SFX_START + 117) -#define HID_EXPLORERMENU_DELETE (HID_SFX_START + 118) -#define HID_EXPLORERMENU_CREATELINK (HID_SFX_START + 119) -#define HID_EXPLORERMENU_EDITPROPERTIES (HID_SFX_START + 120) -#define HID_EXPLORERMENU_DOWNLOAD (HID_SFX_START + 121) -#define HID_EXPLORERMENU_STDTEMPLATE (HID_SFX_START + 122) -#define HID_EXPLORERDLG_FILELIST (HID_SFX_START + 124) -#define HID_PDFOLDERS_WORKPLACE (HID_SFX_START + 125) -#define HID_PDFOLDERS_EXPLORER (HID_SFX_START + 126) -#define HID_PDFOLDERS_STANDARD (HID_SFX_START + 127) -#define HID_PDFOLDERS_ROOT (HID_SFX_START + 128) -#define HID_PDFOLDERS_DESKTOP (HID_SFX_START + 129) -#define HID_CNTMENU_REMOVE_GROUP (HID_SFX_START + 130) -#define HID_CNTMENU_CLEAR_CACHE (HID_SFX_START + 131) -#define HID_CNT_SYNC_INFO_DLG (HID_SFX_START + 132) -#define HID_CNT_REMOVE_REMOVEDLIST (HID_SFX_START + 133) -#define HID_CNT_ABORT_DIALOG (HID_SFX_START + 134) -#define HID_CNT_PAGE_PRJ_DATAEXCHANGE (HID_SFX_START + 135) -#define HID_CHAOSDOC_OBJECTBAR_FILE (HID_SFX_START + 136) -#define HID_CHAOSDOC_OBJECTBAR_MESSAGE (HID_SFX_START + 137) -#define HID_CHAOSDOC_MN_PART_OPEN (HID_SFX_START + 138) -#define HID_CHAOSDOC_MN_PART_DELETE (HID_SFX_START + 139) -#define HID_CHAOSDOC_MN_PART_RENAME (HID_SFX_START + 140) -#define HID_CHAOSDOC_MN_PART_SAVEAS (HID_SFX_START + 141) -#define HID_EXPLORER_DOCVIEW_ICON (HID_SFX_START + 142) -#define HID_EXPLORER_DOCVIEW_DETAILS (HID_SFX_START + 143) -#define HID_CHAOSDOC_WIN (HID_SFX_START + 144) -#define HID_CHAOSDOC_WIN_HEADER (HID_SFX_START + 145) -#define HID_CHAOSDOC_WIN_PARTS (HID_SFX_START + 146) -#define HID_CHAOSDOC_WIN_BODY (HID_SFX_START + 147) -#define HID_CNT_INSERT_COLUMN (HID_SFX_START + 148) -#define HID_CNT_REMOVE_COLUMN (HID_SFX_START + 149) -#define HID_CNT_OPT_WIDTH (HID_SFX_START + 150) -#define HID_CNT_SORT_ASC (HID_SFX_START + 151) -#define HID_CNT_SORT_DESC (HID_SFX_START + 152) -#define HID_CNT_RULEPG_OPEN_DIR (HID_SFX_START + 153) -#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK (HID_SFX_START + 154) -#define HID_CHAOSDOC_MN_HEADER_COPYLINK (HID_SFX_START + 155) -#define HID_CLEAN_CACHE (HID_SFX_START + 156) -#define HID_SBOX_LOCATION (HID_SFX_START + 157) -#define HID_SBOX_SUBSCRIBTION (HID_SFX_START + 158) -#define HID_SBOX_CDF_SUBSCRIBTION (HID_SFX_START + 159) -#define HID_SBOX_SCHEDULE (HID_SFX_START + 160) -#define HID_SBOX_NOTIFICATION (HID_SFX_START + 161) -#define HID_SBOX_SDC_GENERAL (HID_SFX_START + 162) -#define HID_BRWBOX_HEADERBAR (HID_SFX_START + 163) -#define HID_CANNOT_CREATE_BMK_HERE (HID_SFX_START + 164) -#define HID_CREATE_BOOKMARK (HID_SFX_START + 165) -#define HID_TASKBAR (HID_SFX_START + 166) -#define HID_TASKBUTTONBAR (HID_SFX_START + 167) -#define HID_TASKTOOLBAR (HID_SFX_START + 168) -#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION (HID_SFX_START + 169) -#define HID_CNT_FILE (HID_SFX_START + 170) -#define HID_CHAOSDOC_MN_BODY_OPENLINK (HID_SFX_START + 171) -#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK (HID_SFX_START + 172) -#define HID_CHAOSDOC_MN_BODY_DOWNLOAD (HID_SFX_START + 173) -#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK (HID_SFX_START + 174) -#define HID_OPEN_MENU_CNT (HID_SFX_START + 175) -#define HID_CNT_OPEN_AS_TEMPLATE (HID_SFX_START + 176) -#define HID_CNT_OPEN_AS_DOC (HID_SFX_START + 177) -#define HID_PDFOLDERS_TEMPLATE (HID_SFX_START + 178) -#define HID_EXPLORER_ROOT (HID_SFX_START + 179) -#define HID_RESET_URL (HID_SFX_START + 180) -#define HID_PHONE_DIALOG (HID_SFX_START + 181) -#define HID_QB_RESOLVE_LINK (HID_SFX_START + 182) -#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD (HID_SFX_START + 183) -#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC (HID_SFX_START + 184) -#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER (HID_SFX_START + 185) -#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER (HID_SFX_START + 186) -#define HID_CNT_MARK_THREAD_MARKED (HID_SFX_START + 187) -#define HID_CNT_MARK_THREAD_UNMARKED (HID_SFX_START + 188) -#define HID_CNT_DLG_SEARCH_BT_SHOW (HID_SFX_START + 189) -#define HID_CNT_DLG_SEARCH_BT_UPDATE (HID_SFX_START + 190) -#define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE (HID_SFX_START + 191) -#define HID_CNT_DLG_SEARCH_BT_STOP (HID_SFX_START + 192) -#define HID_CNT_PAGE_HEADER (HID_SFX_START + 193) -#define HID_CNT_DLG_ADDRESS (HID_SFX_START + 194) -#define HID_EXPLORERMENU_AUTO_ARRANGEICONS (HID_SFX_START + 195) -#define HID_EXPLORERMENU_AUTO_ADJUSTICONS (HID_SFX_START + 196) -#define HID_EXPLORERMENU_FREE_POSITIONING (HID_SFX_START + 197) -#define HID_CNT_TARGET_MENU (HID_SFX_START + 198) -#define HID_CNT_PAGE_DESCRIPTION (HID_SFX_START + 199) -#define HID_CNT_LB_HEADER (HID_SFX_START + 200) -#define HID_CNT_LB_DESCRIPTION (HID_SFX_START + 201) -#define HID_GROUPVIEW_BIG_SYMBOLS (HID_SFX_START + 202) -#define HID_GROUPVIEW_SMALL_SYMBOLS (HID_SFX_START + 203) -#define HID_GROUPVIEW_ADD_GROUP (HID_SFX_START + 204) -#define HID_GROUPVIEW_REMOVE_GROUP (HID_SFX_START + 205) -#define HID_GROUPVIEW_RENAME_GROUP (HID_SFX_START + 206) -#define HID_GROUPVIEW_ADD_BOOKMARK (HID_SFX_START + 207) -#define HID_GROUPVIEW_TREE (HID_SFX_START + 208) -#define HID_GROUPVIEW_ADD_AS_FOLDER (HID_SFX_START + 209) -#define HID_GROUPVIEW_ADD_AS_BMK (HID_SFX_START + 210) -#define HID_GROUPVIEW_REMOVE_BMK (HID_SFX_START + 211) -#define HID_GROUPVIEW_CONTENT_BIG (HID_SFX_START + 212) -#define HID_GROUPVIEW_CONTENT_SMALL (HID_SFX_START + 213) -#define HID_GROUPVIEW_CONTENT_TREE (HID_SFX_START + 214) -#define HID_GROUPVIEW_SHOW_DOCS (HID_SFX_START + 215) -#define HID_EDIT_TEMPLATE (HID_SFX_START + 216) -#define HID_PDFOLDERS_GRAPHICS (HID_SFX_START + 217) -#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218) -#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219) -#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220) -#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221) -#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222) -#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223) -#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224) -#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225) -#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226) -#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227) -#define HID_PDFOLDERS_GROUPS (HID_SFX_START + 228) -#define HID_OPEN_CHOOSE_FILTER (HID_SFX_START + 229) -#define HID_PDFOLDERS_BOOKMARKS (HID_SFX_START + 230) -#define HID_PDFOLDERS_FAVORITES_ADD (HID_SFX_START + 231) -#define HID_PDFOLDERS_FAVORITES_REMOVE (HID_SFX_START + 232) -#define HID_PDFOLDERS_HISTORY (HID_SFX_START + 233) -#define HID_FILEDLG_EDIT_FAVORITES (HID_SFX_START + 234) -#define HID_FILEDLG_NEW_FAVORITE (HID_SFX_START + 235) -#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX (HID_SFX_START + 236) -#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR (HID_SFX_START + 237) -#define HID_CNT_CB_FORCE_BODY_EXPORT (HID_SFX_START + 240) -#define HID_CNT_PAGE_REPSTATE_CONTROL (HID_SFX_START + 241) -#define HID_TASKSTATUSBAR (HID_SFX_START + 242) -#define HID_CNT_PAGE_HEADER_TABBAR (HID_SFX_START + 244) -#define HID_CNT_PAGE_SUBSCR_TABBAR (HID_SFX_START + 245) -#define HID_CHAOSDOC_MN_PART_PRINT (HID_SFX_START + 246) -#define HID_STATUSINDICATOR_TEXT (HID_SFX_START + 247) -#define HID_STATUSINDICATOR_PROGRESS (HID_SFX_START + 248) -#define HID_CNT_VALUE_ADDED_NONE (HID_SFX_START + 249) -#define HID_CNT_VALUE_ADDED_DOCINFO (HID_SFX_START + 250) -#define HID_CNT_VALUE_ADDED_FULL (HID_SFX_START + 251) -#define HID_CNT_MESSAGE_STOREMODE_REMOTE (HID_SFX_START + 252) -#define HID_CNT_MESSAGE_STOREMODE_LOCAL (HID_SFX_START + 253) -#define HID_CNT_VIEW_ALL_ARTICLES (HID_SFX_START + 254) -#define HID_CNT_VIEW_UNREAD_ARTICLES (HID_SFX_START + 255) -#define HID_CNT_VIEW_READ_ARTICLES (HID_SFX_START + 256) -#define HID_CNT_VIEW_MARKED_ARTICLES (HID_SFX_START + 257) -#define HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES (HID_SFX_START + 258) -#define HID_CNT_VIEW_ALL_FOLDERS (HID_SFX_START + 259) -#define HID_CNT_VIEW_SUBSCRIBED_FOLDERS (HID_SFX_START + 260) -#define HID_CNT_VIEW_ACTIVE_FOLDERS (HID_SFX_START + 261) -#define HID_CNT_SENT_VIEW_ALL_ARTICLES (HID_SFX_START + 262) -#define HID_CNT_SENT_VIEW_SENT_ARTICLES (HID_SFX_START + 263) -#define HID_CNT_SENT_VIEW_UNSENT_ARTICLES (HID_SFX_START + 264) -#define HID_CNT_SENT_VIEW_MARKED_ARTICLES (HID_SFX_START + 265) -#define HID_MAILWIN_SEND_BUTTON (HID_SFX_START + 266) -#define HID_MAILWIN_CLOSE_BUTTON (HID_SFX_START + 267) -#define HID_MAILWIN_ROLE_BOX (HID_SFX_START + 268) -#define HID_MAILWIN_ADDRESS_EDIT (HID_SFX_START + 269) -#define HID_MAILWIN_ADDRESS_BOX (HID_SFX_START + 270) -#define HID_MAILWIN_SUBJECT_EDIT (HID_SFX_START + 271) -#define HID_MAILWIN_FROM_EDIT (HID_SFX_START + 272) -#define HID_MAILWIN_PRIO_BOX (HID_SFX_START + 273) -#define HID_TABDLG_APPLY_BTN (HID_SFX_START + 274) -#define HID_TP_COMMONPRINTOPTIONS (HID_SFX_START + 275) -#define HID_FILEDLG_LINK_CB (HID_SFX_START + 276) -#define HID_FILEDLG_PREVIEW_CB (HID_SFX_START + 277) -#define HID_HELP_WINDOW (HID_SFX_START + 278) -#define HID_HELP_LISTBOX (HID_SFX_START + 279) -#define HID_HELP_TABCONTROL (HID_SFX_START + 280) -#define HID_HELP_TOOLBOX (HID_SFX_START + 281) -#define HID_HELP_TOOLBOXITEM_INDEX (HID_SFX_START + 282) -#define HID_HELP_TOOLBOXITEM_START (HID_SFX_START + 283) -#define HID_HELP_TOOLBOXITEM_BACKWARD (HID_SFX_START + 284) -#define HID_HELP_TOOLBOXITEM_FORWARD (HID_SFX_START + 285) -#define HID_HELP_TOOLBOXITEM_PRINT (HID_SFX_START + 286) -#define HID_HELP_TOOLBOXITEM_BOOKMARKS (HID_SFX_START + 287) -#define HID_HELP_TABPAGE_CONTENTS (HID_SFX_START + 288) -#define HID_HELP_TABPAGE_INDEX (HID_SFX_START + 289) -#define HID_HELP_TABPAGE_SEARCH (HID_SFX_START + 290) -#define HID_HELP_TABPAGE_BOOKMARKS (HID_SFX_START + 291) -#define HID_TBXCONTROL_FILENEW (HID_SFX_START + 292) -#define HID_ORGANIZE_STDTEMPLATE_ADD (HID_SFX_START + 293) -#define HID_ORGANIZE_STDTEMPLATE_DEL (HID_SFX_START + 294) -#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG (HID_SFX_START + 295) -#define HID_HELP_BOOKMARKS_OPEN (HID_SFX_START + 296) -#define HID_HELP_BOOKMARKS_RENAME (HID_SFX_START + 297) -#define HID_HELP_BOOKMARKS_DELETE (HID_SFX_START + 298) -#define HID_CLOSE_WARNING (HID_SFX_START + 299) -#define HID_DID_SAVE_PACKED_XML (HID_SFX_START + 300) -#define HID_HELP_TREELISTBOX_CONTENTS (HID_SFX_START + 301) -#define HID_CUSTOMIZETOOLBOX (HID_SFX_START + 302) -#define HID_CUSTOMIZETOOLBOX_FUNCTIONS (HID_SFX_START + 303) -#define HID_CUSTOMIZETOOLBOX_TOOLBOX (HID_SFX_START + 304) -#define HID_HELP_TEXT_SELECTION_MODE (HID_SFX_START + 305) +#define HID_WARNING_SECURITY_HYPERLINK "SFX2_HID_WARNING_SECURITY_HYPERLINK" +#define HID_FILEDLG_EXPORTASPDF "SFX2_HID_FILEDLG_EXPORTASPDF" +#define HID_USERDEFBMP_TOOLBOX "SFX2_HID_USERDEFBMP_TOOLBOX" -#define HID_WARNING_SECURITY_HYPERLINK (HID_SFX_START + 306) -#define HID_FILEDLG_EXPORTASPDF (HID_SFX_START + 307) -#define HID_USERDEFBMP_TOOLBOX (HID_SFX_START + 308) +#define HID_CONFIG_LOAD "SFX2_HID_CONFIG_LOAD" +#define HID_CONFIG_SAVE "SFX2_HID_CONFIG_SAVE" -#define HID_CONFIG_LOAD (HID_SFX_START + 309) -#define HID_CONFIG_SAVE (HID_SFX_START + 310) +#define HID_SEARCHDIALOG "SFX2_HID_SEARCHDIALOG" -#define HID_SEARCHDIALOG (HID_SFX_START + 311) +#define HID_XMLSEC_WARNING_BROKENSIGNATURE "SFX2_HID_XMLSEC_WARNING_BROKENSIGNATURE" +#define HID_XMLSEC_QUERY_LOSINGSIGNATURE "SFX2_HID_XMLSEC_QUERY_LOSINGSIGNATURE" +#define HID_XMLSEC_QUERY_SAVEBEFORESIGN "SFX2_HID_XMLSEC_QUERY_SAVEBEFORESIGN" +#define HID_XMLSECDLG_MACROWARN "SFX2_HID_XMLSECDLG_MACROWARN" +#define HID_XMLSEC_INFO_WRONGDOCFORMAT "SFX2_HID_XMLSEC_INFO_WRONGDOCFORMAT" +#define HID_WARNING_MACROSDISABLED "SFX2_HID_WARNING_MACROSDISABLED" +#define HID_WARNING_ALIENFORMAT "SFX2_HID_WARNING_ALIENFORMAT" +#define HID_HELP_ONSTARTUP_BOX "SFX2_HID_HELP_ONSTARTUP_BOX" +#define HID_DLG_CHECKFORONLINEUPDATE "SFX2_HID_DLG_CHECKFORONLINEUPDATE" +#define HID_TP_CUSTOMPROPERTIES "SFX2_HID_TP_CUSTOMPROPERTIES" +#define HID_CTRL_CUSTOMPROPERTIES "SFX2_HID_CTRL_CUSTOMPROPERTIES" +#define HID_CTRL_CUSTOMPROPS_YES_NO "SFX2_HID_CTRL_CUSTOMPROPS_YES_NO" +#define HID_DLG_CUSTOMPROPS_DURATION "SFX2_HID_DLG_CUSTOMPROPS_DURATION" -#define HID_XMLSEC_WARNING_BROKENSIGNATURE (HID_SFX_START + 314) -#define HID_XMLSEC_QUERY_LOSINGSIGNATURE (HID_SFX_START + 315) -#define HID_XMLSEC_QUERY_SAVEBEFORESIGN (HID_SFX_START + 316) -#define HID_XMLSECDLG_MACROWARN (HID_SFX_START + 317) -#define HID_XMLSEC_INFO_WRONGDOCFORMAT (HID_SFX_START + 318) -#define HID_WARNING_MACROSDISABLED (HID_SFX_START + 319) -#define HID_WARNING_ALIENFORMAT (HID_SFX_START + 320) -#define HID_HELP_ONSTARTUP_BOX (HID_SFX_START + 321) -#define HID_DLG_CHECKFORONLINEUPDATE (HID_SFX_START + 322) -#define HID_TP_CUSTOMPROPERTIES (HID_SFX_START + 324) -#define HID_CTRL_CUSTOMPROPERTIES (HID_SFX_START + 325) -#define HID_CTRL_CUSTOMPROPS_YES_NO (HID_SFX_START + 326) -#define HID_DLG_CUSTOMPROPS_DURATION (HID_SFX_START + 327) +#define HID_HELP_ONHELP "SFX2_HID_HELP_ONHELP" -#define ACT_SFX_HID_END HID_DLG_CUSTOMPROPS_DURATION - -// "Uberlaufpr"ufung -------------------------------------------------------- - -#if ACT_SFX_HID_END > HID_SFX_END -#error Resource-Ueberlauf in #line, #file -#endif - -#define HID_HELP_ONHELP 68245 +#define HID_QUERY_LOAD_TEMPLATE "SFX2_HID_QUERY_LOAD_TEMPLATE" #endif // #ifndef _SFX_HELPID_HRC diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src index 97c9c7f640fa..0f9501e8502a 100644 --- a/sfx2/source/menu/menu.src +++ b/sfx2/source/menu/menu.src @@ -26,6 +26,7 @@ ************************************************************************/ #include "menu.hrc" +#include String STR_MENU_CFGITEM { @@ -44,19 +45,19 @@ Menu MN_CLIPBOARDFUNCS MenuItem { Identifier = SID_CUT ; - HelpID = SID_CUT ; + HelpID = CMD_SID_CUT ; Text [ en-US ] = "Cu~t" ; }; MenuItem { Identifier = SID_COPY ; - HelpID = SID_COPY ; + HelpID = CMD_SID_COPY ; Text [ en-US ] = "~Copy" ; }; MenuItem { Identifier = SID_PASTE ; - HelpID = SID_PASTE ; + HelpID = CMD_SID_PASTE ; Text [ en-US ] = "~Paste" ; }; }; diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 9137abd04764..c76f47345979 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -160,8 +160,6 @@ void InsertVerbs_Impl( SfxBindings* pBindings, const com::sun::star::uno::Sequen // einf"ugen pMenu->InsertItem( nId, aVerbs[n].VerbName ); - // FIXME: HELPID - pMenu->SetHelpId( nId, ""/*(ULONG) nId*/ ); } } } @@ -376,11 +374,10 @@ void SfxPopupMenuManager::InsertSeparator( USHORT nPos ) //------------------------------------------------------------------------- -void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, USHORT nPos ) +void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, const rtl::OString& rHelpId, USHORT nPos ) { pSVMenu->InsertItem( nId, rName, nBits,nPos ); - // FIXME: HELPID - pSVMenu->SetHelpId( nId, ""/*(ULONG) nId*/ ); + pSVMenu->SetHelpId( nId, rHelpId ); } //------------------------------------------------------------------------- diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index e3d694eae747..48ff6a3948c5 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -345,7 +345,9 @@ void SfxVirtualMenu::CreateFromSVMenu() DBG_CHKTHIS(SfxVirtualMenu, 0); // Merge Addon popup menus into the SV Menu - Reference< com::sun::star::frame::XFrame > xFrame( pBindings->GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface() ); + SfxViewFrame* pViewFrame = pBindings->GetDispatcher()->GetFrame(); + SfxSlotPool* pSlotPool = pViewFrame->GetObjectShell()->GetModule()->GetSlotPool(); + Reference< com::sun::star::frame::XFrame > xFrame( pViewFrame->GetFrame().GetFrameInterface() ); if ( pSVMenu->IsMenuBar() ) { @@ -448,24 +450,14 @@ void SfxVirtualMenu::CreateFromSVMenu() } else { -/* - if ( nSlotId >= SID_SFX_START && !SfxMenuManager::IsPopupFunction(nSlotId) ) + const SfxSlot* pSlot = pSlotPool->GetSlot( nSlotId ); + if ( pSlot ) { - // Echte Popups sollen keine SlotIds haben; leider sind - // da noch Altlasten mit herumzuschleppen ... - String aTitle = pSVMenu->GetItemText( nSlotId ); - pSVMenu->SetPopupMenu( nSlotId, NULL ); - USHORT nPos = pSVMenu->GetItemPos( nSlotId ); - pSVMenu->RemoveItem( nPos ); - nSlotId = 1; - while ( pSVMenu->GetItemPos(nSlotId) != MENU_ITEM_NOTFOUND ) - nSlotId++; - pSVMenu->InsertItem( nSlotId, aTitle, 0, nPos ); - pSVMenu->SetPopupMenu( nSlotId, pPopup ); + rtl::OString aCmd(".uno:"); + aCmd += pSlot->GetUnoName(); + pSVMenu->SetHelpId( nSlotId, pSlot->GetUnoName() ); } -*/ - // FIXME: HELPID - pSVMenu->SetHelpId( nSlotId, ""/*0L*/ ); + pMnuCtrl = pItems+nPos; // normalerweise jetzt erst im Activate-Handler diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index defccd4e23be..9b5fbd2d5d4e 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -132,7 +132,12 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory( { USHORT nSlotId = pSlot->GetSlotId(); if ( nSlotId > 0 ) + { + rtl::OString aCmd(".uno:"); + aCmd += pSlot->GetUnoName(); return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule ); + pStatusBar->SetHelpId( nSlotId, aCmd ); + } } return NULL; diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index fc26d0077161..f5b38d5a8a18 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -1520,8 +1520,7 @@ SfxAppToolBoxControl_Impl::SfxAppToolBoxControl_Impl( USHORT nSlotId, USHORT nId , bBigImages( FALSE ) , pMenu( 0 ) { - // FIXME: HELPID - rBox.SetHelpId( nId, ""/*HID_TBXCONTROL_FILENEW*/ ); + rBox.SetHelpId( nId, HID_TBXCONTROL_FILENEW ); rBox.SetItemBits( nId, rBox.GetItemBits( nId ) | TIB_DROPDOWN); // Determine the current background color of the menus diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index fea860f6a3ff..ef2574c0d574 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -127,16 +127,15 @@ long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt ) // TODO/LATER: do we still need this code? Window* pWindow = rNEvt.GetWindow(); - ULONG nHelpId = 0; - while ( !nHelpId && pWindow ) + rtl::OString sHelpId; + while ( !sHelpId.getLength() && pWindow ) { - // FIXME: HELPID - // nHelpId = pWindow->GetHelpId(); + sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( nHelpId ) - SfxHelp::OpenHelpAgent( pFrame, nHelpId ); + if ( sHelpId.getLength() ) + SfxHelp::OpenHelpAgent( pFrame, sHelpId ); // if focus was on an external window, the clipboard content might have been changed pView->GetBindings().Invalidate( SID_PASTE ); diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index ab9aa9f8ce1b..6c4787cd1fbc 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -30,88 +30,68 @@ // include ----------------------------------------------------------- #include -// in solar.hrc -//#define HID_FORMS_START (HID_LIB_START+4000) -//#define HID_FORMS_END (HID_LIB_START+4999) - // Help-Ids -------------------------------------------------------------- -#define HID_DLG_DBMSG ( HID_FORMS_START + 1) -#define HID_FORM_NAVIGATOR ( HID_FORMS_START + 2) -#define HID_FORM_NAVIGATOR_WIN ( HID_FORMS_START + 3) -#define HID_FIELD_SEL ( HID_FORMS_START + 4) -#define HID_FIELD_SEL_WIN ( HID_FORMS_START + 5) -#define HID_FILTER_NAVIGATOR ( HID_FORMS_START + 6) -#define HID_FILTER_NAVIGATOR_WIN ( HID_FORMS_START + 7) -#define HID_FM_DLG_SEARCH ( HID_FORMS_START + 8) -#define HID_SEARCH_TEXT ( HID_FORMS_START + 9) -#define HID_SEARCH_ALLFIELDS ( HID_FORMS_START + 10) -//#define HID_SEARCH_SINGLEFIELD ( HID_FORMS_START + 11) -#define HID_SEARCH_FIELDSELECTION ( HID_FORMS_START + 12) -#define HID_SEARCH_POSITION ( HID_FORMS_START + 13) -#define HID_SEARCH_FORMATTER ( HID_FORMS_START + 14) -#define HID_SEARCH_CASE ( HID_FORMS_START + 15) -#define HID_SEARCH_BACKWARD ( HID_FORMS_START + 16) -#define HID_SEARCH_STARTOVER ( HID_FORMS_START + 17) -#define HID_SEARCH_WILDCARD ( HID_FORMS_START + 18) -#define HID_SEARCH_REGULAR ( HID_FORMS_START + 19) -#define HID_SEARCH_APPROX ( HID_FORMS_START + 20) -#define HID_SEARCH_APPROXSETTINGS ( HID_FORMS_START + 21) -#define HID_SEARCH_BTN_SEARCH ( HID_FORMS_START + 22) -#define HID_SEARCH_BTN_CLOSE ( HID_FORMS_START + 23) -#define HID_CONTROLS_DATE_N_TIME ( HID_FORMS_START + 24) -#define HID_GRID_TRAVEL_FIRST ( HID_FORMS_START + 25) -#define HID_GRID_TRAVEL_PREV ( HID_FORMS_START + 26) -#define HID_GRID_TRAVEL_NEXT ( HID_FORMS_START + 27) -#define HID_GRID_TRAVEL_LAST ( HID_FORMS_START + 28) -#define HID_GRID_TRAVEL_NEW ( HID_FORMS_START + 29) -#define HID_GRID_TRAVEL_ABSOLUTE ( HID_FORMS_START + 30) -#define HID_GRID_NUMBEROFRECORDS ( HID_FORMS_START + 31) -#define UID_SEARCH_RECORDSTATUS ( HID_FORMS_START + 32) -#define UID_FORMPROPBROWSER_FRAME ( HID_FORMS_START + 33) -#define UID_ABSOLUTE_RECORD_WINDOW ( HID_FORMS_START + 34) -#define HID_DATA_NAVIGATOR_WIN ( HID_FORMS_START + 35) -#define HID_XFORMS_ADDDATAITEM_DLG ( HID_FORMS_START + 36) -#define HID_XFORMS_ADDCONDITION_DLG ( HID_FORMS_START + 37) -#define HID_XFORMS_NAMESPACEITEM_DLG ( HID_FORMS_START + 38) -#define HID_XFORMS_NAMESPACEITEM_LIST ( HID_FORMS_START + 39) -#define HID_XFORMS_MANAGENAMESPACE_DLG ( HID_FORMS_START + 40) -//#define HID_TP_XFORMS_INSTANCE ( HID_FORMS_START + 41) -//#define HID_TP_XFORMS_SUBMISSION ( HID_FORMS_START + 42) -//#define HID_TP_XFORMS_BINDING ( HID_FORMS_START + 43) -#define HID_MN_XFORMS_MODELS_ADD ( HID_FORMS_START + 44) -#define HID_MN_XFORMS_MODELS_EDIT ( HID_FORMS_START + 45) -#define HID_MN_XFORMS_MODELS_REMOVE ( HID_FORMS_START + 46) -#define HID_MN_XFORMS_INSTANCES_ADD ( HID_FORMS_START + 47) -#define HID_MN_XFORMS_INSTANCES_EDIT ( HID_FORMS_START + 48) -#define HID_MN_XFORMS_INSTANCES_REMOVE ( HID_FORMS_START + 49) -#define HID_MN_XFORMS_SHOW_DETAILS ( HID_FORMS_START + 50) -#define HID_XFORMS_TOOLBOX ( HID_FORMS_START + 51) -#define HID_XFORMS_TOOLBOX_ITEM_ADD ( HID_FORMS_START + 52) -#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT ( HID_FORMS_START + 53) -#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE ( HID_FORMS_START + 54) -#define HID_XFORMS_TOOLBOX_ITEM_EDIT ( HID_FORMS_START + 55) -#define HID_XFORMS_TOOLBOX_ITEM_REMOVE ( HID_FORMS_START + 56) -#define HID_XFORMS_ITEMS_LIST ( HID_FORMS_START + 57) -#define HID_XFORMS_MODELS_LIST ( HID_FORMS_START + 58) -#define HID_XFORMS_MODELS_MENUBTN ( HID_FORMS_START + 59) -#define HID_XFORMS_INSTANCES_MENUBTN ( HID_FORMS_START + 60) -#define HID_XFORMS_ADDSUBMISSION_DLG ( HID_FORMS_START + 61) -#define HID_XFORMS_ADDMODEL_DLG ( HID_FORMS_START + 62) -#define HID_XFORMS_ADDINSTANCE_DLG ( HID_FORMS_START + 63) -#define HID_XFORMS_MID_INSERT_CONTROL ( HID_FORMS_START + 64) -#define HID_XFORMS_TAB_CONTROL ( HID_FORMS_START + 65) - // if you add a new define here, please adjust the overflow check - // at the end of the file!! - -// ----------------------------------------------------------------------- -// "Uberlaufpr"ufung ----------------------------------------------------- -// ----------------------------------------------------------------------- - -#define ACT_FM_HID_END HID_XFORMS_TAB_CONTROL - -#if ACT_FM_HID_END > HID_FORMS_END -#error Resource-Ueberlauf in #line, #file -#endif +#define HID_DLG_DBMSG "SVX_HID_DLG_DBMSG" +#define HID_FORM_NAVIGATOR "SVX_HID_FORM_NAVIGATOR" +#define HID_FORM_NAVIGATOR_WIN "SVX_HID_FORM_NAVIGATOR_WIN" +#define HID_FIELD_SEL "SVX_HID_FIELD_SEL" +#define HID_FIELD_SEL_WIN "SVX_HID_FIELD_SEL_WIN" +#define HID_FILTER_NAVIGATOR "SVX_HID_FILTER_NAVIGATOR" +#define HID_FILTER_NAVIGATOR_WIN "SVX_HID_FILTER_NAVIGATOR_WIN" +#define HID_FM_DLG_SEARCH "SVX_HID_FM_DLG_SEARCH" +#define HID_SEARCH_TEXT "SVX_HID_SEARCH_TEXT" +#define HID_SEARCH_ALLFIELDS "SVX_HID_SEARCH_ALLFIELDS" +#define HID_SEARCH_FIELDSELECTION "SVX_HID_SEARCH_FIELDSELECTION" +#define HID_SEARCH_POSITION "SVX_HID_SEARCH_POSITION" +#define HID_SEARCH_FORMATTER "SVX_HID_SEARCH_FORMATTER" +#define HID_SEARCH_CASE "SVX_HID_SEARCH_CASE" +#define HID_SEARCH_BACKWARD "SVX_HID_SEARCH_BACKWARD" +#define HID_SEARCH_STARTOVER "SVX_HID_SEARCH_STARTOVER" +#define HID_SEARCH_WILDCARD "SVX_HID_SEARCH_WILDCARD" +#define HID_SEARCH_REGULAR "SVX_HID_SEARCH_REGULAR" +#define HID_SEARCH_APPROX "SVX_HID_SEARCH_APPROX" +#define HID_SEARCH_APPROXSETTINGS "SVX_HID_SEARCH_APPROXSETTINGS" +#define HID_SEARCH_BTN_SEARCH "SVX_HID_SEARCH_BTN_SEARCH" +#define HID_SEARCH_BTN_CLOSE "SVX_HID_SEARCH_BTN_CLOSE" +#define HID_CONTROLS_DATE_N_TIME "SVX_HID_CONTROLS_DATE_N_TIME" +#define HID_GRID_TRAVEL_FIRST "SVX_HID_GRID_TRAVEL_FIRST" +#define HID_GRID_TRAVEL_PREV "SVX_HID_GRID_TRAVEL_PREV" +#define HID_GRID_TRAVEL_NEXT "SVX_HID_GRID_TRAVEL_NEXT" +#define HID_GRID_TRAVEL_LAST "SVX_HID_GRID_TRAVEL_LAST" +#define HID_GRID_TRAVEL_NEW "SVX_HID_GRID_TRAVEL_NEW" +#define HID_GRID_TRAVEL_ABSOLUTE "SVX_HID_GRID_TRAVEL_ABSOLUTE" +#define HID_GRID_NUMBEROFRECORDS "SVX_HID_GRID_NUMBEROFRECORDS" +#define UID_SEARCH_RECORDSTATUS "SVX_UID_SEARCH_RECORDSTATUS" +#define UID_FORMPROPBROWSER_FRAME "SVX_UID_FORMPROPBROWSER_FRAME" +#define UID_ABSOLUTE_RECORD_WINDOW "SVX_UID_ABSOLUTE_RECORD_WINDOW" +#define HID_DATA_NAVIGATOR_WIN "SVX_HID_DATA_NAVIGATOR_WIN" +#define HID_XFORMS_ADDDATAITEM_DLG "SVX_HID_XFORMS_ADDDATAITEM_DLG" +#define HID_XFORMS_ADDCONDITION_DLG "SVX_HID_XFORMS_ADDCONDITION_DLG" +#define HID_XFORMS_NAMESPACEITEM_DLG "SVX_HID_XFORMS_NAMESPACEITEM_DLG" +#define HID_XFORMS_NAMESPACEITEM_LIST "SVX_HID_XFORMS_NAMESPACEITEM_LIST" +#define HID_XFORMS_MANAGENAMESPACE_DLG "SVX_HID_XFORMS_MANAGENAMESPACE_DLG" +#define HID_MN_XFORMS_MODELS_ADD "SVX_HID_MN_XFORMS_MODELS_ADD" +#define HID_MN_XFORMS_MODELS_EDIT "SVX_HID_MN_XFORMS_MODELS_EDIT" +#define HID_MN_XFORMS_MODELS_REMOVE "SVX_HID_MN_XFORMS_MODELS_REMOVE" +#define HID_MN_XFORMS_INSTANCES_ADD "SVX_HID_MN_XFORMS_INSTANCES_ADD" +#define HID_MN_XFORMS_INSTANCES_EDIT "SVX_HID_MN_XFORMS_INSTANCES_EDIT" +#define HID_MN_XFORMS_INSTANCES_REMOVE "SVX_HID_MN_XFORMS_INSTANCES_REMOVE" +#define HID_MN_XFORMS_SHOW_DETAILS "SVX_HID_MN_XFORMS_SHOW_DETAILS" +#define HID_XFORMS_TOOLBOX "SVX_HID_XFORMS_TOOLBOX" +#define HID_XFORMS_TOOLBOX_ITEM_ADD "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD" +#define HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD_ELEMENT" +#define HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE "SVX_HID_XFORMS_TOOLBOX_ITEM_ADD_ATTRIBUTE" +#define HID_XFORMS_TOOLBOX_ITEM_EDIT "SVX_HID_XFORMS_TOOLBOX_ITEM_EDIT" +#define HID_XFORMS_TOOLBOX_ITEM_REMOVE "SVX_HID_XFORMS_TOOLBOX_ITEM_REMOVE" +#define HID_XFORMS_ITEMS_LIST "SVX_HID_XFORMS_ITEMS_LIST" +#define HID_XFORMS_MODELS_LIST "SVX_HID_XFORMS_MODELS_LIST" +#define HID_XFORMS_MODELS_MENUBTN "SVX_HID_XFORMS_MODELS_MENUBTN" +#define HID_XFORMS_INSTANCES_MENUBTN "SVX_HID_XFORMS_INSTANCES_MENUBTN" +#define HID_XFORMS_ADDSUBMISSION_DLG "SVX_HID_XFORMS_ADDSUBMISSION_DLG" +#define HID_XFORMS_ADDMODEL_DLG "SVX_HID_XFORMS_ADDMODEL_DLG" +#define HID_XFORMS_ADDINSTANCE_DLG "SVX_HID_XFORMS_ADDINSTANCE_DLG" +#define HID_XFORMS_MID_INSERT_CONTROL "SVX_HID_XFORMS_MID_INSERT_CONTROL" +#define HID_XFORMS_TAB_CONTROL "SVX_HID_XFORMS_TAB_CONTROL" #endif diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index e328a39a0707..252bdc69623e 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -38,288 +38,242 @@ #define ITEM_FORM_CONTROL_PROPERTIES\ Identifier = SID_FM_CTL_PROPERTIES ; \ Command = ".uno:ControlProperties" ; \ - HelpID = SID_FM_CTL_PROPERTIES ; \ Text [ en-US ] = "Con~trol..." ; \ #define ITEM_FORM_PROPERTIES\ Identifier = SID_FM_PROPERTIES ; \ Command = ".uno:FormProperties" ; \ - HelpID = SID_FM_PROPERTIES ; \ Text [ en-US ] = "For~m..." ; \ #define ITEM_REPLACE_CONTROL\ Identifier = SID_FM_CHANGECONTROLTYPE ;\ Command = ".uno:ChangeControlType" ; \ - HelpID = SID_FM_CHANGECONTROLTYPE ; \ Text [ en-US ] = "~Replace with"; \ #define ITEM_FORMAT_TEMPLATECATALOG \ Identifier = SID_STYLE_CATALOG ; \ Command = ".uno:StyleCatalog" ; \ - HelpID = SID_STYLE_CATALOG ; \ Text [ en-US ] = "~Catalog..." ; \ #define ITEM_FORMAT_TEMPLATE \ Identifier = SID_STYLE_DESIGNER ; \ Command = ".uno:DesignerDialog" ; \ - HelpID = SID_STYLE_DESIGNER ; \ Text [ en-US ] = "St~ylist" ; \ #define ITEM_FORMAT_AUTOFORMAT \ Identifier = SID_AUTOFORMAT ; \ Command = ".uno:AutoFormat" ; \ - HelpID = SID_AUTOFORMAT ; \ Text [ en-US ] = "Auto~Format..." ;\ #define ITEM_FORMAT_CHAR_DLG \ Identifier = SID_CHAR_DLG ; \ Command = ".uno:FontDialog" ; \ - HelpID = SID_CHAR_DLG ; \ Text [ en-US ] = "C~haracter..." ;\ #define ITEM_FORMAT_PARA_DLG \ Identifier = SID_PARA_DLG ; \ Command = ".uno:ParagraphDialog" ; \ - HelpID = SID_PARA_DLG ; \ Text [ en-US ] = "P~aragraph..." ;\ #define ITEM_FORMAT_FONTWORK \ Identifier = SID_FONTWORK ; \ Command = ".uno:FontWork" ; \ - HelpID = SID_FONTWORK ; \ Text [ en-US ] = "F~ontwork" ;\ #define ITEM_EDIT_CUT \ Identifier = SID_CUT ; \ Command = ".uno:Cut" ; \ - HelpID = SID_CUT ; \ Text [ en-US ] = "Cu~t" ;\ #define ITEM_EDIT_COPY \ Identifier = SID_COPY ; \ Command = ".uno:Copy" ; \ - HelpID = SID_COPY ; \ Text [ en-US ] = "~Copy" ;\ #define ITEM_EDIT_DELETE \ Identifier = SID_DELETE ; \ Command = ".uno:Delete" ; \ - HelpID = SID_DELETE ; \ Text [ en-US ] = "~Delete" ;\ #define ITEM_FORMAT_ATTR_CHAR_FONT \ Identifier = SID_ATTR_CHAR_FONT ; \ Command = ".uno:CharFontName" ; \ - HelpID = SID_ATTR_CHAR_FONT ; \ Text [ en-US ] = "Font" ;\ #define ITEM_FORMAT_ATTR_CHAR_FONTHEIGHT \ Identifier = SID_ATTR_CHAR_FONTHEIGHT ; \ Command = ".uno:FontHeight" ; \ - HelpID = SID_ATTR_CHAR_FONTHEIGHT ; \ Text [ en-US ] = "Size" ;\ #define ITEM_FORMAT_ATTR_CHAR_WEIGHT \ Identifier = SID_ATTR_CHAR_WEIGHT ; \ Command = ".uno:Bold" ; \ - HelpID = SID_ATTR_CHAR_WEIGHT ; \ Text [ en-US ] = "Bold" ; \ #define ITEM_FORMAT_ATTR_CHAR_POSTURE \ Identifier = SID_ATTR_CHAR_POSTURE ; \ Command = ".uno:Italic" ; \ - HelpID = SID_ATTR_CHAR_POSTURE ; \ Text [ en-US ] = "Italic" ;\ #define ITEM_FORMAT_ATTR_CHAR_UNDERLINE \ Identifier = SID_ATTR_CHAR_UNDERLINE ; \ Command = ".uno:Underline" ; \ - HelpID = SID_ATTR_CHAR_UNDERLINE ; \ Text [ en-US ] = "Underline" ;\ #define ITEM_FORMAT_ATTR_CHAR_OVERLINE \ Identifier = SID_ATTR_CHAR_OVERLINE ; \ Command = ".uno:Overline" ; \ - HelpID = SID_ATTR_CHAR_OVERLINE ; \ Text [ en-US ] = "Overline" ;\ #define ITEM_FORMAT_ATTR_CHAR_STRIKEOUT \ Identifier = SID_ATTR_CHAR_STRIKEOUT ; \ Command = ".uno:Strikeout" ; \ - HelpID = SID_ATTR_CHAR_STRIKEOUT ; \ Text [ en-US ] = "Strikethrough" ;\ #define ITEM_FORMAT_ATTR_CHAR_SHADOWED \ Identifier = SID_ATTR_CHAR_SHADOWED ; \ Command = ".uno:Shadowed" ; \ - HelpID = SID_ATTR_CHAR_SHADOWED ; \ Text [ en-US ] = "Shadow" ;\ #define ITEM_FORMAT_ATTR_CHAR_CONTOUR \ Identifier = SID_ATTR_CHAR_CONTOUR ; \ Command = ".uno:OutlineFont" ; \ - HelpID = SID_ATTR_CHAR_CONTOUR ; \ Text [ en-US ] = "Outline" ;\ #define ITEM_FORMAT_SET_SUPER_SCRIPT \ Identifier = SID_SET_SUPER_SCRIPT; \ - HelpID = SID_SET_SUPER_SCRIPT; \ + Command = CMD_SID_SET_SUPER_SCRIPT; \ Text [ en-US ] = "Su~perscript"; \ #define ITEM_FORMAT_SET_SUB_SCRIPT \ Identifier = SID_SET_SUB_SCRIPT; \ - HelpID = SID_SET_SUB_SCRIPT; \ + Command = CMD_SID_SET_SUB_SCRIPT; \ Text [ en-US ] = "Su~bscript"; \ #define ITEM_FORMAT_ATTR_PARA_ADJUST_LEFT \ Identifier = SID_ATTR_PARA_ADJUST_LEFT ; \ Command = ".uno:LeftPara" ; \ - HelpID = SID_ATTR_PARA_ADJUST_LEFT ; \ Text [ en-US ] = "~Left" ;\ #define ITEM_FORMAT_ATTR_PARA_ADJUST_RIGHT \ Identifier = SID_ATTR_PARA_ADJUST_RIGHT ; \ Command = ".uno:RightPara" ; \ - HelpID = SID_ATTR_PARA_ADJUST_RIGHT ; \ Text [ en-US ] = "~Right" ;\ #define ITEM_FORMAT_ATTR_PARA_ADJUST_CENTER \ Identifier = SID_ATTR_PARA_ADJUST_CENTER ; \ Command = ".uno:CenterPara" ; \ - HelpID = SID_ATTR_PARA_ADJUST_CENTER ; \ Text [ en-US ] = "~Centered" ;\ #define ITEM_FORMAT_ATTR_PARA_ADJUST_BLOCK \ Identifier = SID_ATTR_PARA_ADJUST_BLOCK ; \ Command = ".uno:JustifyPara" ; \ - HelpID = SID_ATTR_PARA_ADJUST_BLOCK ; \ Text [ en-US ] = "Justified" ;\ #define ITEM_FORMAT_PARA_LINESPACE_10 \ Identifier = SID_ATTR_PARA_LINESPACE_10 ; \ Command = ".uno:SpacePara1" ; \ - HelpID = SID_ATTR_PARA_LINESPACE_10 ; \ Text [ en-US ] = "Single" ;\ #define ITEM_FORMAT_PARA_LINESPACE_15 \ Identifier = SID_ATTR_PARA_LINESPACE_15 ; \ Command = ".uno:SpacePara15" ; \ - HelpID = SID_ATTR_PARA_LINESPACE_15 ; \ Text [ en-US ] = "1.5 lines" ;\ #define ITEM_FORMAT_PARA_LINESPACE_20 \ Identifier = SID_ATTR_PARA_LINESPACE_20 ; \ Command = ".uno:SpacePara2" ; \ - HelpID = SID_ATTR_PARA_LINESPACE_20 ; \ Text [ en-US ] = "~Double" ;\ #define ITEM_FORMAT_FRAME_TO_TOP \ Identifier = SID_FRAME_TO_TOP ; \ Command = ".uno:BringToFront" ; \ - HelpID = SID_FRAME_TO_TOP ; \ Text [ en-US ] = "~Bring to Front" ;\ #define ITEM_FORMAT_FRAME_TO_BOTTOM \ Identifier = SID_FRAME_TO_BOTTOM ; \ Command = ".uno:SendToBack" ; \ - HelpID = SID_FRAME_TO_BOTTOM ; \ Text [ en-US ] = "~Send to Back" ;\ #define ITEM_FORMAT_OBJECT_ALIGN \ Identifier = SID_OBJECT_ALIGN ; \ Command = ".uno:ObjectAlign" ; \ - HelpID = SID_OBJECT_ALIGN ; \ Text [ en-US ] = "A~lignment" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_LEFT \ Identifier = SID_OBJECT_ALIGN_LEFT ; \ Command = ".uno:ObjectAlignLeft" ; \ - HelpID = SID_OBJECT_ALIGN_LEFT ; \ Text [ en-US ] = "~Left" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_CENTER \ Identifier = SID_OBJECT_ALIGN_CENTER ; \ Command = ".uno:AlignCenter" ; \ - HelpID = SID_OBJECT_ALIGN_CENTER ; \ Text [ en-US ] = "~Centered" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_RIGHT \ Identifier = SID_OBJECT_ALIGN_RIGHT ; \ Command = ".uno:ObjectAlignRight" ; \ - HelpID = SID_OBJECT_ALIGN_RIGHT ; \ Text [ en-US ] = "~Right" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_UP \ Identifier = SID_OBJECT_ALIGN_UP ; \ Command = ".uno:AlignUp" ; \ - HelpID = SID_OBJECT_ALIGN_UP ; \ Text [ en-US ] = "~Top" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_MIDDLE \ Identifier = SID_OBJECT_ALIGN_MIDDLE ; \ Command = ".uno:AlignMiddle" ; \ - HelpID = SID_OBJECT_ALIGN_MIDDLE ; \ Text [ en-US ] = "C~enter" ;\ #define ITEM_FORMAT_OBJECT_ALIGN_DOWN \ Identifier = SID_OBJECT_ALIGN_DOWN ; \ Command = ".uno:AlignDown" ; \ - HelpID = SID_OBJECT_ALIGN_DOWN ; \ Text [ en-US ] = "~Bottom" ;\ #define ITEM_FORMAT_ATTRIBUTES_LINE \ Identifier = SID_ATTRIBUTES_LINE ; \ Command = ".uno:FormatLine" ; \ - HelpID = SID_ATTRIBUTES_LINE ; \ Text [ en-US ] = "L~ine..." ;\ #define ITEM_FORMAT_ATTRIBUTES_AREA \ Identifier = SID_ATTRIBUTES_AREA ; \ Command = ".uno:FormatArea" ; \ - HelpID = SID_ATTRIBUTES_AREA ; \ Text [ en-US ] = "A~rea..." ;\ #define ITEM_FORMAT_ATTR_TRANSFORM \ Identifier = SID_ATTR_TRANSFORM ; \ Command = ".uno:TransformDialog" ; \ - HelpID = SID_ATTR_TRANSFORM ; \ Text [ en-US ] = "Position and Si~ze..." ;\ #define ITEM_FORMAT_OBJECT_HEAVEN \ Identifier = SID_OBJECT_HEAVEN ; \ Command = ".uno:SetObjectToForeground" ; \ - HelpID = SID_OBJECT_HEAVEN ; \ Text [ en-US ] = "~To Foreground" ;\ #define ITEM_FORMAT_OBJECT_HELL \ Identifier = SID_OBJECT_HELL ; \ Command = ".uno:SetObjectToBackground" ; \ - HelpID = SID_OBJECT_HELL ; \ Text [ en-US ] = "T~o Background" ;\ #define ITEM_FORMAT_BEZIER_EDIT \ Identifier = SID_BEZIER_EDIT ; \ Command = ".uno:ToggleObjectBezierMode" ; \ - HelpID = SID_BEZIER_EDIT ; \ Text [ en-US ] = "Edit ~Points" ;\ #define ITEM_FILE_PICKLIST \ Identifier = SID_PICKLIST ; \ Command = ".uno:PickList" ; \ - HelpID = SID_PICKLIST ; \ Text [ en-US ] = "~File" ; \ #define ITEM_FILE_NEWDOC \ Identifier = SID_NEWDOCDIRECT ; \ Command = ".uno:AddDirect" ; \ - HelpID = SID_NEWDOCDIRECT ; \ Text [ en-US ] = "~New" ;\ #define ITEM_FILE_OPENDOC \ Identifier = SID_OPENDOC ; \ Command = ".uno:Open" ; \ - HelpID = SID_OPENDOC ; \ Text [ en-US ] = "~Open..." ;\ @@ -328,62 +282,52 @@ {\ Identifier = SID_AUTOPILOTMENU ; \ Command = ".uno:AutoPilotMenu" ; \ - HelpID = SID_AUTOPILOTMENU ; \ Text [ en-US ] = "A~utoPilot" ; \ }; #define ITEM_FILE_CLOSEDOC \ Identifier = SID_CLOSEDOC ; \ Command = ".uno:CloseDoc" ; \ - HelpID = SID_CLOSEDOC ; \ Text [ en-US ] = "~Close" ;\ #define ITEM_FILE_SAVEDOC \ Identifier = SID_SAVEDOC ; \ Command = ".uno:Save" ; \ - HelpID = SID_SAVEDOC ; \ Text [ en-US ] = "~Save" ; \ #define ITEM_FILE_SAVEDOCS \ Identifier = SID_SAVEDOCS ; \ Command = ".uno:SaveAll" ; \ - HelpID = SID_SAVEDOCS ; \ Text [ en-US ] = "Sa~ve All" ; \ #define ITEM_FILE_SAVEASDOC \ Identifier = SID_SAVEASDOC ; \ Command = ".uno:SaveAs" ; \ - HelpID = SID_SAVEASDOC ; \ Text [ en-US ] = "Save ~As..." ; \ #define ITEM_FILE_EXPORTDOC \ Identifier = SID_EXPORTDOC ; \ Command = ".uno:ExportTo" ; \ - HelpID = SID_EXPORTDOC ; \ Text [ en-US ] = "Expor~t..." ; \ #define ITEM_FILE_EXPORTDOCASPDF \ Identifier = SID_EXPORTDOCASPDF ; \ Command = ".uno:ExportToPDF" ; \ - HelpID = SID_EXPORTDOCASPDF ; \ Text [ en-US ] = "Export as P~DF..." ; \ #define ITEM_FILE_VERSIONDIALOG \ Identifier = SID_VERSION ; \ Command = ".uno:VersionDialog" ; \ - HelpID = SID_VERSION ; \ Text [ en-US ] = "Versions..." ; \ #define ITEM_FILE_LASTVERSIONDOC \ Identifier = SID_RELOAD ; \ Command = ".uno:Reload" ; \ - HelpID = SID_RELOAD ; \ Text [ en-US ] = "Reload" ;\ #define ITEM_FILE_DOCINFO \ Identifier = SID_DOCINFO ; \ Command = ".uno:SetDocumentProperties" ; \ - HelpID = SID_DOCINFO ; \ Text [ en-US ] = "Propert~ies..." ;\ #define ITEM_FILE_DOCTEMPLATE \ @@ -398,28 +342,24 @@ { \ Identifier = SID_ORGANIZER ; \ Command = ".uno:Organizer" ; \ - HelpId = SID_ORGANIZER ; \ Text [ en-US ] = "~Organize...";\ }; \ MenuItem \ { \ Identifier = SID_TEMPLATE_ADDRESSBOKSOURCE; \ Command = ".uno:AddressBookSource" ; \ - HelpId = SID_TEMPLATE_ADDRESSBOKSOURCE; \ Text [ en-US ] = "~Address Book Source..."; \ }; \ MenuItem \ { \ Identifier = SID_DOCTEMPLATE ; \ Command = ".uno:SaveAsTemplate" ; \ - HelpId = SID_DOCTEMPLATE ; \ Text [ en-US ] = "~Save...";\ }; \ MenuItem \ { \ Identifier = SID_OPENTEMPLATE ; \ Command = ".uno:OpenTemplate" ; \ - HelpId = SID_OPENTEMPLATE ; \ Text [ en-US ] = "~Edit...";\ }; \ }; \ @@ -428,164 +368,138 @@ #define ITEM_FILE_PRINTPREVIEW \ Identifier = SID_PRINTPREVIEW ; \ Command = ".uno:PrintPreview" ; \ - HelpID = SID_PRINTPREVIEW ; \ Text [ en-US ] = "Pa~ge Preview" ;\ #define ITEM_FILE_SETUPPRINTER \ Identifier = SID_SETUPPRINTER ; \ Command = ".uno:PrinterSetup" ; \ - HelpID = SID_SETUPPRINTER ; \ Text [ en-US ] = "P~rinter Settings..." ; \ #define ITEM_FILE_PRINTDOC \ Identifier = SID_PRINTDOC ; \ Command = ".uno:Print" ; \ - HelpID = SID_PRINTDOC ; \ Text [ en-US ] = "~Print..." ; \ #define ITEM_FILE_MAIL_SENDDOC \ Identifier = SID_MAIL_SENDDOC ; \ Command = ".uno:SendMail" ; \ - HelpID = SID_MAIL_SENDDOC ; \ Text [ en-US ] = "Document as ~E-mail..." ; \ #define ITEM_FILE_MAIL_SENDDOCASPDF \ Identifier = SID_MAIL_SENDDOCASPDF ; \ Command = ".uno:SendMailDocAsPDF" ; \ - HelpID = SID_MAIL_SENDDOCASPDF ; \ Text [ en-US ] = "Document as P~DF Attachment..." ; \ #define ITEM_FILE_QUITAPP \ Identifier = SID_QUITAPP ; \ Command = ".uno:Quit" ; \ - HelpID = SID_QUITAPP ; \ Text [ en-US ] = "E~xit" ; \ #define ITEM_FILE_LOGOUT \ Identifier = SID_LOGOUT ; \ Command = ".uno:Logout" ; \ - HelpID = SID_LOGOUT ; \ Text [ en-US ] = "Logout" ; \ #define ITEM_EDIT_UNDO \ Identifier = SID_UNDO ; \ Command = ".uno:UndoAction" ; \ - HelpID = SID_UNDO ; \ Text [ en-US ] = "Can't Undo" ; \ #define ITEM_EDIT_REDO \ Identifier = SID_REDO ; \ Command = ".uno:Redo" ; \ - HelpID = SID_REDO ; \ Text [ en-US ] = "Can't Restore" ; \ #define ITEM_EDIT_REPEAT \ Identifier = SID_REPEAT ; \ Command = ".uno:Repeat" ; \ - HelpID = SID_REPEAT ; \ Text [ en-US ] = "~Repeat" ; \ #define ITEM_EDIT_PASTE \ Identifier = SID_PASTE ; \ Command = ".uno:Paste" ; \ - HelpID = SID_PASTE ; \ Text [ en-US ] = "~Paste" ; \ #define ITEM_EDIT_SELECTALL \ Identifier = SID_SELECTALL ; \ Command = ".uno:SelectAll" ; \ - HelpID = SID_SELECTALL ; \ Text [ en-US ] = "Select ~All" ; \ #define ITEM_EDIT_SEARCH_DLG \ Identifier = SID_SEARCH_DLG ; \ Command = ".uno:SearchDialog" ; \ - HelpID = SID_SEARCH_DLG ; \ Text [ en-US ] = "~Find & Replace..." ; \ #define ITEM_EDIT_NAVIGATOR \ Identifier = SID_NAVIGATOR ; \ Command = ".uno:Navigator" ; \ - HelpID = SID_NAVIGATOR ; \ Text [ en-US ] = "~Navigator" ; \ #define ITEM_EDIT_BIBLIOGRAPHY \ Identifier = SID_COMP_BIBLIOGRAPHY ; \ Command = ".uno:BibliographyComponent" ; \ - HelpID = SID_COMP_BIBLIOGRAPHY ; \ Text [ en-US ] = "~Bibliography Database"; \ #define ITEM_EDIT_PLUGINS_ACTIVE \ Identifier = SID_PLUGINS_ACTIVE ; \ Command = ".uno:PlugInsActive" ; \ - HelpID = SID_PLUGINS_ACTIVE ; \ Text [ en-US ] = "P~lug-in" ; \ #define ITEM_EDIT_IMAP \ Identifier = SID_IMAP ; \ Command = ".uno:ImageMapDialog" ; \ - HelpID = SID_IMAP ; \ Text [ en-US ] = "ImageMap" ; \ #define ITEM_EDIT_OBJECT \ Identifier = SID_OBJECT ; \ Command = ".uno:ObjectMenue" ; \ - HelpID = SID_OBJECT ; \ Text [ en-US ] = "~Object" ; \ #define ITEM_VIEW_ATTR_ZOOM \ Identifier = SID_ATTR_ZOOM ; \ Command = ".uno:Zoom" ; \ - HelpID = SID_ATTR_ZOOM ; \ Text [ en-US ] = "~Zoom..." ; \ #define ITEM_VIEW_TOGGLEFUNCTIONBAR \ Identifier = SID_TOGGLEFUNCTIONBAR ; \ Command = ".uno:FunctionBarVisible" ; \ - HelpID = SID_TOGGLEFUNCTIONBAR ; \ Text [ en-US ] = "~Function Bar" ; \ #define ITEM_VIEW_TOGGLEOBJECTBAR \ Identifier = SID_TOGGLEOBJECTBAR ; \ Command = ".uno:ObjectBarVisible" ; \ - HelpID = SID_TOGGLEOBJECTBAR ; \ Text [ en-US ] = "~Object Bar" ; \ #define ITEM_VIEW_TOGGLEINETBAR \ Identifier = SID_TOGGLEINETBAR ; \ - HelpID = SID_TOGGLEINETBAR ; \ + Command = CMD_SID_TOGGLEINETBAR; \ Text [ en-US ] = "Internet Bar" ; \ #define ITEM_VIEW_TOGGLESTATUSBAR \ Identifier = SID_TOGGLESTATUSBAR ; \ Command = ".uno:StatusBarVisible" ; \ - HelpID = SID_TOGGLESTATUSBAR ; \ Text [ en-US ] = "~Status Bar" ; \ #define ITEM_VIEW_TOGGLEIMESTATUSWINDOW \ Identifier = SID_SHOW_IME_STATUS_WINDOW ; \ Command = ".uno:ShowImeStatusWindow" ; \ - HelpID = SID_SHOW_IME_STATUS_WINDOW ; \ Text [ en-US ] = "~Input Method Status"; \ #define ITEM_VIEW_TASKBAR \ Identifier = SID_TASKBAR ; \ Command = ".uno:TaskBarVisible" ; \ - HelpID = SID_TASKBAR ; \ Text [ en-US ] = "~Status Bar" ; \ #define ITEM_VIEW_COLORBAR \ Identifier = SID_COLOR_CONTROL ; \ Command = ".uno:ColorControl" ; \ - HelpID = SID_COLOR_CONTROL ; \ Text [ en-US ] = "~Color Bar" ; \ #define ITEM_VIEW_FULLSCREEN \ Identifier = SID_WIN_FULLSCREEN ; \ Command = ".uno:FullScreen" ; \ - HelpID = SID_WIN_FULLSCREEN ; \ Text [ en-US ] = "F~ull Screen" ; \ @@ -598,26 +512,22 @@ #define ITEM_VIEW_BROWSER_MODE \ Identifier = SID_BROWSER_MODE ; \ Command = ".uno:BrowseView" ; \ - HelpID = SID_BROWSER_MODE ; \ Text [ en-US ] = "~Online Layout" ; \ #define ITEM_VIEW_BROWSER \ Identifier = SID_BROWSER ; \ Command = ".uno:Beamer" ; \ - HelpID = SID_BROWSER ; \ Text [ en-US ] = "~Beamer" ; \ #define ITEM_INSERT_HYPERLINK_INSERT \ Identifier = SID_HYPERLINK_INSERT ; \ Command = ".uno:InsertHyperlink" ; \ - HelpID = SID_HYPERLINK_INSERT ; \ Text [ en-US ] = "~Hyperlink Bar" ; \ #define ITEM_INSERT_INSERT_GRAPHIC \ Identifier = SID_INSERT_GRAPHIC ; \ Command = ".uno:InsertGraphic" ; \ - HelpID = SID_INSERT_GRAPHIC ; \ Text [ en-US ] = "~Graphics..." ; \ #define ITEM_INSERT_TWAIN_SELECT \ @@ -625,7 +535,6 @@ {\ Identifier = SID_TWAIN_SELECT ; \ Command = ".uno:TwainSelect" ; \ - HelpID = SID_TWAIN_SELECT ; \ Text [ en-US ] = "~Select Source..." ; \ }; @@ -634,7 +543,6 @@ {\ Identifier = SID_TWAIN_TRANSFER ; \ Command = ".uno:TwainTransfer" ; \ - HelpID = SID_TWAIN_TRANSFER ; \ Text [ en-US ] = "~Request..." ; \ }; @@ -643,7 +551,6 @@ {\ Identifier = SID_SCAN ; \ Command = ".uno:Scan" ; \ - HelpID = SID_SCAN ; \ Text [ en-US ] = "Scan" ; \ SubMenu = Menu\ {\ @@ -658,19 +565,16 @@ #define ITEM_INSERT_INSERT_DIAGRAM \ Identifier = SID_INSERT_DIAGRAM ; \ Command = ".uno:InsertObjectChart" ; \ - HelpID = SID_INSERT_DIAGRAM ; \ Text [ en-US ] = "~Chart..." ; \ #define ITEM_INSERT_GALLERY \ Identifier = SID_GALLERY ; \ Command = ".uno:Gallery" ; \ - HelpID = SID_GALLERY ; \ Text [ en-US ] = "~Gallery" ; \ #define ITEM_INSERT_INSERTDOC \ Identifier = SID_INSERTDOC ; \ Command = ".uno:InsertDoc" ; \ - HelpID = SID_INSERTDOC ; \ Text [ en-US ] = "~File..." ; \ #define TMP_SID_INSERT_PLUGIN \ @@ -678,7 +582,6 @@ {\ Identifier = SID_INSERT_PLUGIN ; \ Command = ".uno:InsertPlugin" ; \ - HelpID = SID_INSERT_PLUGIN ; \ Text [ en-US ] = "~Plug-in..." ; \ }; @@ -687,7 +590,6 @@ {\ Identifier = SID_INSERT_SOUND ; \ Command = ".uno:InsertSound" ; \ - HelpID = SID_INSERT_SOUND ; \ Text [ en-US ] = "~Sound..." ; \ }; @@ -696,7 +598,6 @@ {\ Identifier = SID_INSERT_VIDEO ; \ Command = ".uno:InsertVideo" ; \ - HelpID = SID_INSERT_VIDEO ; \ Text [ en-US ] = "~Video..." ; \ }; @@ -706,7 +607,6 @@ {\ Identifier = SID_INSERT_APPLET ; \ Command = ".uno:InsertApplet" ; \ - HelpID = SID_INSERT_APPLET ; \ Text [ en-US ] = "~Applet..." ; \ }; #else @@ -716,7 +616,6 @@ MenuItem\ {\ Identifier = SID_MN_INSERT_OBJECT_DLGS ; \ - HelpID = SID_MN_INSERT_OBJECT_DLGS ; \ Command = ".uno:ObjectMenu" ; \ Text [ en-US ] = "~Object" ; \ SubMenu = Menu\ @@ -727,7 +626,6 @@ {\ Identifier = SID_INSERT_OBJECT ; \ Command = ".uno:InsertObject" ; \ - HelpID = SID_INSERT_OBJECT ; \ Text [ en-US ] = "~OLE Object..." ; \ };\ TMP_SID_INSERT_PLUGIN\ @@ -738,7 +636,6 @@ {\ Identifier = SID_INSERT_MATH ; \ Command = ".uno:InsertMath" ; \ - HelpID = SID_INSERT_MATH ; \ Text [ en-US ] = "~Formula..." ; \ };\ };\ @@ -749,7 +646,6 @@ MenuItem\ {\ Identifier = SID_MN_INSERT_OBJECT_DLGS ; \ - HelpID = SID_MN_INSERT_OBJECT_DLGS ; \ Command = ".uno:ObjectMenu" ; \ Text [ en-US ] = "~Object" ; \ SubMenu = Menu\ @@ -760,14 +656,12 @@ {\ Identifier = SID_INSERT_OBJECT ; \ Command = ".uno:InsertObject" ; \ - HelpID = SID_INSERT_OBJECT ; \ Text [ en-US ] = "~OLE Object..." ; \ };\ MenuItem\ {\ Identifier = SID_INSERT_MATH ; \ Command = ".uno:InsertMath" ; \ - HelpID = SID_INSERT_MATH ; \ Text [ en-US ] = "~Formula" ; \ };\ };\ @@ -778,7 +672,6 @@ MenuItem\ {\ Identifier = DEFINE_SLOTID_FOR_NUMBER_BULLETS ; \ - HelpID = DEFINE_SLOTID_FOR_NUMBER_BULLETS ; \ Text [ en-US ] = "~Numbering/Bullets..." ; \ }; @@ -786,7 +679,6 @@ #define ITEM_FORMAT \ Identifier = SID_OBJECTMENU0 ; \ - HelpID = SID_OBJECTMENU0 ; \ Command = ".uno:FormatMenu" ; \ Text [ en-US ] = "F~ormat" ; \ @@ -794,7 +686,6 @@ #define ITEM_TOOLS_MACROS \ Identifier = SID_SCRIPTORGANIZER ; \ - HelpId = SID_SCRIPTORGANIZER ; \ Command = ".uno:ScriptOrganizer" ; \ Text [ en-US ] = "Scripts/Macros" ; \ @@ -810,13 +701,11 @@ { \ Identifier = SID_RECORDMACRO ; \ Command = ".uno:MacroRecorder" ; \ - HelpId = SID_RECORDMACRO ; \ Text [ en-US ] = "Record Macro"; }; \ MenuItem \ { \ Identifier = SID_BASICCHOOSER ; \ Command = ".uno:MacroDialog" ; \ - HelpID = SID_BASICCHOOSER ; \ Text [ en-US ] = "~Macro..." ; \ }; \ }; \ @@ -829,7 +718,6 @@ #define ITEM_TOOLS_CONFIG \ Identifier = SID_CONFIG ; \ Command = ".uno:ConfigureDialog"; \ - HelpID = SID_CONFIG ; \ Text [ en-US ] = "~Configure..." ; \ @@ -838,7 +726,6 @@ {\ Identifier = SID_AUTO_CORRECT_DLG ; \ Command = ".uno:AutoCorrectDlg" ; \ - HelpID = SID_AUTO_CORRECT_DLG ; \ Text [ en-US ] = "~AutoCorrect..." ; \ }; @@ -847,7 +734,6 @@ {\ Identifier = SID_SD_GRAPHIC_OPTIONS ; \ Command = ".uno:SdGraphicOptions" ; \ - HelpID = SID_SD_GRAPHIC_OPTIONS ; \ Text [ en-US ] = "~Drawing..." ; \ }; @@ -856,7 +742,6 @@ {\ Identifier = SID_OPTIONS_TREEDIALOG ; \ Command = ".uno:OptionsTreeDialog" ; \ - HelpID = SID_OPTIONS_TREEDIALOG ; \ Text [ en-US ] = "~Options..." ; \ }; @@ -867,13 +752,11 @@ #define ITEM_WINDOW_MDIWINDOWLIST \ Identifier = SID_MDIWINDOWLIST ; \ Command = ".uno:WindowList" ; \ - HelpID = SID_MDIWINDOWLIST ; \ Text [ en-US ] = "~Window" ; \ #define ITEM_WINDOW_CLONEWIN \ Identifier = SID_NEWWINDOW ; \ Command = ".uno:NewWindow" ; \ - HelpID = SID_NEWWINDOW ; \ Text [ en-US ] = "~New Window" ; \ #define ITEM_WINDOW_CASCADEWINS \ @@ -881,7 +764,6 @@ {\ Identifier = SID_CASCADEWINS ; \ Command = ".uno:Cascade" ; \ - HelpID = SID_CASCADEWINS ; \ Text [ en-US ] = "~Cascade" ; \ }; @@ -890,7 +772,6 @@ {\ Identifier = SID_TILEWINS ; \ Command = ".uno:Tile" ; \ - HelpID = SID_TILEWINS ; \ Text [ en-US ] = "~Tile" ; \ }; @@ -899,7 +780,6 @@ {\ Identifier = SID_HORIZONTALWINS ; \ Command = ".uno:ArrangeHorizontal" ; \ - HelpID = SID_HORIZONTALWINS ; \ Text [ en-US ] = "~Horizontally" ; \ }; @@ -908,14 +788,12 @@ {\ Identifier = SID_VERTICALWINS ; \ Command = ".uno:ArrangeVertical" ; \ - HelpID = SID_VERTICALWINS ; \ Text [ en-US ] = "~Vertically" ; \ }; #define ITEM_WINDOW_CLOSEWIN \ Identifier = SID_CLOSEWIN ; \ Command = ".uno:CloseWin" ; \ - HelpID = SID_CLOSEWIN ; \ Text [ en-US ] = "Close Window" ; \ #define ITEM_HYPERLINK_DIALOG \ @@ -923,7 +801,6 @@ {\ Identifier = SID_HYPERLINK_DIALOG ; \ Command = ".uno:HyperlinkDialog" ; \ - HelpID = SID_HYPERLINK_DIALOG ; \ Text [ en-US ] = "~Hyperlink" ; \ } ; @@ -932,7 +809,6 @@ {\ Identifier = SID_POLY_MERGE ; \ Command = ".uno:Merge" ; \ - HelpID = SID_POLY_MERGE ; \ Text [ en-US ] = "~Merge" ; \ }; #define ITEM_POLY_SUBSTRACT \ @@ -940,7 +816,6 @@ {\ Identifier = SID_POLY_SUBSTRACT ; \ Command = ".uno:Substract" ; \ - HelpID = SID_POLY_SUBSTRACT ; \ Text [ en-US ] = "~Subtract" ; \ }; #define ITEM_POLY_INTERSECT \ @@ -948,7 +823,6 @@ {\ Identifier = SID_POLY_INTERSECT ; \ Command = ".uno:Intersect" ; \ - HelpID = SID_POLY_INTERSECT ; \ Text [ en-US ] = "I~ntersect" ; \ }; @@ -957,7 +831,6 @@ { \ Identifier = SID_POLY_FORMEN ; \ Command = ".uno:PolyFormen" ; \ - HelpID = SID_POLY_FORMEN ; \ Text [ en-US ] = "~Shapes" ; \ SubMenu = Menu \ {\ @@ -1016,56 +889,47 @@ #define ITEM_HELP_HELPMENU \ Identifier = SID_HELPMENU ; \ Command = ".uno:HelpMenu" ; \ - HelpID = SID_HELPMENU ; \ Text [ en-US ] = "~Help" ; \ #define ITEM_HELP_HELPINDEX \ Identifier = SID_HELPINDEX ; \ Command = ".uno:HelpIndex" ; \ - HelpID = SID_HELPINDEX ; \ Text [ en-US ] = "~Contents" ; \ #define ITEM_HELP_HELPONHELP \ Identifier = SID_HELPONHELP ; \ Command = ".uno:HelpOnHelp" ; \ - HelpID = SID_HELPONHELP ; \ Text [ en-US ] = "Using Help" ; \ #define ITEM_HELP_HELP_PI \ Identifier = SID_HELP_PI ; \ Command = ".uno:HelperDialog" ; \ - HelpID = SID_HELP_PI ; \ Text [ en-US ] = "Help ~Agent" ; \ #define ITEM_HELP_HELPTIPS \ Identifier = SID_HELPTIPS ; \ Command = ".uno:HelpTip" ; \ - HelpID = SID_HELPTIPS ; \ Text [ en-US ] = "~Tips" ; \ #define ITEM_HELP_BALLOONHELP \ Identifier = SID_HELPBALLOONS ; \ Command = ".uno:ActiveHelp" ; \ - HelpID = SID_HELPBALLOONS ; \ Text [ en-US ] = "~Extended Tips" ; \ #define ITEM_HELP_SUPPORTPAGE \ Identifier = SID_HELP_SUPPORTPAGE ; \ Command = ".uno:HelpSupport" ; \ - HelpID = SID_HELP_SUPPORTPAGE ; \ Text [ en-US ] = "~Support" ; \ #define ITEM_HELP_ONLINE_REGISTRATION \ Identifier = SID_ONLINE_REGISTRATION ; \ Command = ".uno:OnlineRegistrationDlg" ; \ - HelpID = SID_ONLINE_REGISTRATION ; \ Text [ en-US ] = "~Registration..." ; \ #define ITEM_HELP_ABOUT \ Identifier = SID_ABOUT ; \ Command = ".uno:About" ; \ - HelpID = SID_ABOUT ; \ Text [ en-US ] = "A~bout %PRODUCTNAME..." ; \ /*------------------------------------------------------------------------ @@ -1131,39 +995,33 @@ #define ITEM_POPUP_TEMPLATE_EDIT \ Identifier = SID_STYLE_EDIT ; \ Command = ".uno:EditStyle" ; \ - HelpID = SID_STYLE_EDIT ; \ Text [ en-US ] = "Edit Paragraph Style..." ; \ // Gruppen-/Kombination-Funktionen #define ITEM_POPUP_GROUP \ Identifier = SID_GROUP ; \ Command = ".uno:FormatGroup" ; \ - HelpID = SID_GROUP ; \ Text [ en-US ] = "~Group" ; \ #define ITEM_POPUP_UNGROUP \ Identifier = SID_UNGROUP ; \ Command = ".uno:FormatUngroup" ; \ - HelpID = SID_UNGROUP ; \ Text [ en-US ] = "~Ungroup" ; \ #define ITEM_POPUP_ENTER_GROUP \ Identifier = SID_ENTER_GROUP ; \ Command = ".uno:EnterGroup" ; \ - HelpID = SID_ENTER_GROUP ; \ Text [ en-US ] = "~Edit Group" ; \ #define ITEM_POPUP_LEAVE_GROUP \ Identifier = SID_LEAVE_GROUP ; \ Command = ".uno:LeaveGroup" ; \ - HelpID = SID_LEAVE_GROUP ; \ Text [ en-US ] = "E~xit Group" ; \ #define ITEM_GROUP_MENU \ MenuItem\ {\ Identifier = SID_MN_GROUP ; \ - HelpID = SID_MN_GROUP ; \ Command = ".uno:GroupMenu" ; \ SubMenu = Menu\ {\ @@ -1195,14 +1053,12 @@ { \ Identifier = SID_DATASOURCE_ADMINISTRATION ; \ Command = ".uno:DatasourceAdministration" ; \ - HelpID = SID_DATASOURCE_ADMINISTRATION ; \ Text [ en-US ] = "~Data Sources..." ; \ }; #define ITEM_VIEW_DATA_SOURCE_BROWSER \ Identifier = SID_VIEW_DATA_SOURCE_BROWSER; \ Command = ".uno:ViewDataSourceBrowser" ; \ - HelpID = SID_VIEW_DATA_SOURCE_BROWSER; \ Text [ en-US ] = "~Data Sources" ; \ /*------------------------------------------------------------------------ @@ -1211,112 +1067,92 @@ #define ITEM_TOOLBAR_SET_JUSTIFY_PARA \ Identifier = SID_ATTR_PARA_ADJUST_BLOCK ; \ Command = ".uno:JustifyPara" ; \ - HelpID = SID_ATTR_PARA_ADJUST_BLOCK ; #define ITEM_TOOLBAR_NEWDOCDIRECT \ Identifier = SID_NEWDOCDIRECT ; \ Command = ".uno:AddDirect" ; \ - HelpID = SID_NEWDOCDIRECT ; #define ITEM_TOOLBAR_PRINTDOCDIRECT \ Identifier = SID_PRINTDOCDIRECT ; \ Command = ".uno:PrintDefault" ; \ - HelpID = SID_PRINTDOCDIRECT ; #define ITEM_TOOLBAR_INSERT_DRAW \ Identifier = SID_INSERT_DRAW ; \ Command = ".uno:InsertDraw" ; \ - HelpID = SID_INSERT_DRAW ; \ DropDown = TRUE ; #define ITEM_TOOLBAR_CHOOSE_CONTROLS \ Identifier = SID_CHOOSE_CONTROLS ; \ Command = ".uno:ChooseControls" ; \ - HelpID = SID_CHOOSE_CONTROLS ; \ DropDown = TRUE ; #define ITEM_TOOLBAR_AUTOSPELL_CHECK \ Identifier = SID_AUTOSPELL_CHECK ; \ Command = ".uno:SpellOnline" ; \ - HelpID = SID_AUTOSPELL_CHECK ; #define ITEM_TOOLBAR_TEMPLATE_APPLY \ Identifier = SID_STYLE_APPLY ; \ Command = ".uno:StyleApply" ; \ - HelpID = SID_STYLE_APPLY ; #define ITEM_TOOLBAR_ATTR_CHAR_COLOR \ Identifier = SID_ATTR_CHAR_COLOR ; \ Command = ".uno:Color" ; \ - HelpID = SID_ATTR_CHAR_COLOR ;\ DropDown = TRUE ; #define ITEM_TOOLBAR_BACKGROUND_PATTERN \ Identifier = SID_BACKGROUND_PATTERN ; \ Command = ".uno:BackgroundPatternController" ; \ - HelpID = SID_BACKGROUND_PATTERN ;\ DropDown = TRUE ; #define ITEM_TOOLBAR_BACKGROUND_COLOR \ Identifier = SID_BACKGROUND_COLOR ; \ Command = ".uno:BackgroundColor" ; \ - HelpID = SID_BACKGROUND_COLOR ;\ DropDown = TRUE ; #define ITEM_TOOLBAR_ATTR_BORDER \ Identifier = SID_ATTR_BORDER ; \ Command = ".uno:BorderStyle" ; \ - HelpID = SID_ATTR_BORDER ; #define ITEM_TOOLBAR_FRAME_LINESTYLE \ Identifier = SID_FRAME_LINESTYLE ; \ Command = ".uno:LineStyle" ; \ - HelpID = SID_FRAME_LINESTYLE ; #define ITEM_TOOLBAR_FRAME_LINECOLOR \ Identifier = SID_FRAME_LINECOLOR ; \ Command = ".uno:FrameLineColor" ; \ - HelpID = SID_FRAME_LINECOLOR ; #define ITEM_TOOLBAR_SIM_START \ Identifier = SID_SIM_START ; \ Command = ".uno:LaunchStarImage" ; \ - HelpID = SID_SIM_START ; #define ITEM_TOOLBAR_ATTR_LINEEND_STYLE \ Identifier = SID_ATTR_LINEEND_STYLE ; \ Command = ".uno:LineEndStyle" ; \ - HelpID = SID_ATTR_LINEEND_STYLE ; \ DropDown = TRUE ; #define ITEM_TOOLBAR_ATTR_LINE_STYLE \ Identifier = SID_ATTR_LINE_STYLE ; \ Command = ".uno:XLineStyle" ; \ - HelpID = SID_ATTR_LINE_STYLE ; #define ITEM_TOOLBAR_ATTR_LINE_WIDTH \ Identifier = SID_ATTR_LINE_WIDTH ; \ Command = ".uno:LineWidth" ; \ - HelpID = SID_ATTR_LINE_WIDTH ; #define ITEM_TOOLBAR_ATTR_LINE_COLOR \ Identifier = SID_ATTR_LINE_COLOR ; \ Command = ".uno:XLineColor" ; \ - HelpID = SID_ATTR_LINE_COLOR ; #define ITEM_TOOLBAR_ATTR_FILL_STYLE \ Identifier = SID_ATTR_FILL_STYLE ; \ Command = ".uno:FillStyle" ; \ - HelpID = SID_ATTR_FILL_STYLE ; #define ITEM_TOOLBAR_OBJECT_ROTATE \ Identifier = SID_OBJECT_ROTATE ; \ Command = ".uno:ToggleObjectRotateMode" ; \ - HelpID = SID_OBJECT_ROTATE ; #define ITEM_VIEW_OFFICEBAR \ Identifier = SID_GROUPVIEW; \ - HelpID = SID_GROUPVIEW; \ + Command = CMD_SID_GROUPVIEW; \ Text [ en-US ] = "~Office Bar" ; \ @@ -1324,7 +1160,6 @@ MenuItem\ {\ Identifier = SID_MN_SUB_TRANSLITERATE ; \ - HelpID = SID_MN_SUB_TRANSLITERATE ; \ Command = ".uno:TransliterateMenu" ; \ SubMenu = Menu\ {\ @@ -1334,42 +1169,36 @@ {\ Identifier = SID_TRANSLITERATE_UPPER ; \ Command = ".uno:ChangeCaseToUpper" ; \ - HelpID = SID_TRANSLITERATE_UPPER ; \ Text [ en-US ] = "~Uppercase";\ };\ MenuItem\ {\ Identifier = SID_TRANSLITERATE_LOWER; \ Command = ".uno:ChangeCaseToLower" ; \ - HelpID = SID_TRANSLITERATE_LOWER; \ Text [ en-US ] = "~Lowercase";\ };\ MenuItem\ {\ Identifier = SID_TRANSLITERATE_HALFWIDTH; \ Command = ".uno:ChangeCaseToHalfWidth" ; \ - HelpID = SID_TRANSLITERATE_HALFWIDTH; \ Text [ en-US ] = "H~alf-width";\ };\ MenuItem\ {\ Identifier = SID_TRANSLITERATE_FULLWIDTH; \ Command = ".uno:ChangeCaseToFullWidth" ; \ - HelpID = SID_TRANSLITERATE_FULLWIDTH; \ Text [ en-US ] = "Full-width";\ };\ MenuItem\ {\ Identifier = SID_TRANSLITERATE_HIRAGANA; \ Command = ".uno:ChangeCaseToHiragana" ; \ - HelpID = SID_TRANSLITERATE_HIRAGANA; \ Text [ en-US ] = "~Hiragana";\ };\ MenuItem\ {\ Identifier = SID_TRANSLITERATE_KATAGANA; \ Command = ".uno:ChangeCaseToKatakana" ; \ - HelpID = SID_TRANSLITERATE_KATAGANA; \ Text [ en-US ] = "~Katakana";\ };\ };\ @@ -1379,23 +1208,23 @@ #define ITEM_OPEN_HYPERLINK \ Identifier = SID_OPEN_HYPERLINK ; \ - HelpID = SID_OPEN_HYPERLINK ; \ + Command = CMD_SID_OPEN_HYPERLINK; \ Text [ en-US ] = "~Open Hyperlink" ; \ #define ITEM_OPEN_SMARTTAGMENU \ Identifier = SID_OPEN_SMARTTAGMENU ; \ - HelpID = SID_OPEN_SMARTTAGMENU ; \ + Command = CMD_SID_OPEN_SMARTTAGMENU; \ Text [ en-US ] = "Open ~Smart Tag Menu" ; \ #define ITEM_OPEN_XML_FILTERSETTINGS \ Identifier = SID_OPEN_XML_FILTERSETTINGS ; \ - HelpID = SID_OPEN_XML_FILTERSETTINGS ; \ + Command = CMD_SID_OPEN_XML_FILTERSETTINGS; \ Text [ en-US ] = "~XML Filter Settings..."; \ #define ITEM_HANGUL_HANJA_CONVERSION \ Identifier = SID_HANGUL_HANJA_CONVERSION; \ - HelpId = SID_HANGUL_HANJA_CONVERSION; \ + Command = CMD_SID_HANGUL_HANJA_CONVERSION; \ Text [ en-US ] = "Hangul/Hanja Conversion..."; \ #endif // #ifndef _GLOBLMN_HRC diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index 6d9153818cde..63687550dd12 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -31,264 +31,255 @@ #include #include +#include +#include // Help-Ids -------------------------------------------------------------- -#define HID_ALIGN_TBX (HID_SVX_START + 1) -#define HID_BMPMASK_CTL_PIPETTE (HID_SVX_START + 4) -#define HID_BMPMASK_CTL_QCOL_1 (HID_SVX_START + 5) -#define HID_BMPMASK_TBI_PIPETTE (HID_SVX_START + 6) -#define HID_COLOR_CTL_COLORS (HID_SVX_START + 7) -#define HID_CONTDLG_APPLY (HID_SVX_START + 8) -#define HID_CONTDLG_AUTOCONTOUR (HID_SVX_START + 9) -#define HID_CONTDLG_CIRCLE (HID_SVX_START + 10) -#define HID_CONTDLG_FREEPOLY (HID_SVX_START + 11) -#define HID_CONTDLG_GRAPHWND (HID_SVX_START + 12) -#define HID_CONTDLG_PIPETTE (HID_SVX_START + 13) -#define HID_CONTDLG_POLY (HID_SVX_START + 14) -#define HID_CONTDLG_POLYDELETE (HID_SVX_START + 15) -#define HID_CONTDLG_POLYEDIT (HID_SVX_START + 16) -#define HID_CONTDLG_POLYINSERT (HID_SVX_START + 17) -#define HID_CONTDLG_POLYMOVE (HID_SVX_START + 18) -#define HID_CONTDLG_RECT (HID_SVX_START + 19) -#define HID_CONTDLG_REDO (HID_SVX_START + 20) -#define HID_CONTDLG_SELECT (HID_SVX_START + 21) -#define HID_CONTDLG_TOOLBOX (HID_SVX_START + 22) -#define HID_CONTDLG_UNDO (HID_SVX_START + 23) -#define HID_CONTDLG_WORKPLACE (HID_SVX_START + 24) -#define HID_CTL_FONTWORK_FAVORITES (HID_SVX_START + 25) -#define HID_CTRL3D_HSCROLL (HID_SVX_START + 26) -#define HID_CTRL3D_SWITCHER (HID_SVX_START + 27) -#define HID_CTRL3D_VSCROLL (HID_SVX_START + 28) -#define HID_CTRL_COLOR (HID_SVX_START + 29) -#define HID_DRAWTOOL_TBX (HID_SVX_START + 30) -#define HID_EDITENG_SPELLER_ADDWORD (HID_SVX_START + 31) -#define HID_EDITENG_SPELLER_AUTOCORRECT (HID_SVX_START + 32) -#define HID_EDITENG_SPELLER_IGNORE (HID_SVX_START + 33) -#define HID_EDITENG_SPELLER_PARALANGUAGE (HID_SVX_START + 34) -#define HID_EDITENG_SPELLER_START (HID_SVX_START + 35) -#define HID_EDITENG_SPELLER_WORDLANGUAGE (HID_SVX_START + 36) -#define HID_FILL_ATTR_LISTBOX (HID_SVX_START + 37) -#define HID_FILL_TYPE_LISTBOX (HID_SVX_START + 38) -#define HID_FONTWORK_CTL_FORMS (HID_SVX_START + 39) -#define HID_FONTWORK_TBI_ADJUST_AUTOSIZE (HID_SVX_START + 40) -#define HID_FONTWORK_TBI_ADJUST_CENTER (HID_SVX_START + 41) -#define HID_FONTWORK_TBI_ADJUST_LEFT (HID_SVX_START + 42) -#define HID_FONTWORK_TBI_ADJUST_MIRROR (HID_SVX_START + 43) -#define HID_FONTWORK_TBI_ADJUST_RIGHT (HID_SVX_START + 44) -#define HID_FONTWORK_TBI_OUTLINE (HID_SVX_START + 45) -#define HID_FONTWORK_TBI_SHADOW_NORMAL (HID_SVX_START + 46) -#define HID_FONTWORK_TBI_SHADOW_OFF (HID_SVX_START + 47) -#define HID_FONTWORK_TBI_SHADOW_SLANT (HID_SVX_START + 48) -#define HID_FONTWORK_TBI_SHOWFORM (HID_SVX_START + 49) -#define HID_FONTWORK_TBI_STYLE_OFF (HID_SVX_START + 50) -#define HID_FONTWORK_TBI_STYLE_ROTATE (HID_SVX_START + 51) -#define HID_FONTWORK_TBI_STYLE_SLANTX (HID_SVX_START + 52) -#define HID_FONTWORK_TBI_STYLE_SLANTY (HID_SVX_START + 53) -#define HID_FONTWORK_TBI_STYLE_UPRIGHT (HID_SVX_START + 54) -#define HID_FORMAT_FOOTER (HID_SVX_START + 55) -#define HID_FORMAT_HEADER (HID_SVX_START + 56) +#define HID_ALIGN_TBX "SVX_HID_ALIGN_TBX" +#define HID_BMPMASK_CTL_PIPETTE "SVX_HID_BMPMASK_CTL_PIPETTE" +#define HID_BMPMASK_CTL_QCOL_1 "SVX_HID_BMPMASK_CTL_QCOL_1" +#define HID_BMPMASK_TBI_PIPETTE "SVX_HID_BMPMASK_TBI_PIPETTE" +#define HID_COLOR_CTL_COLORS "SVX_HID_COLOR_CTL_COLORS" +#define HID_CONTDLG_APPLY "SVX_HID_CONTDLG_APPLY" +#define HID_CONTDLG_AUTOCONTOUR "SVX_HID_CONTDLG_AUTOCONTOUR" +#define HID_CONTDLG_CIRCLE "SVX_HID_CONTDLG_CIRCLE" +#define HID_CONTDLG_FREEPOLY "SVX_HID_CONTDLG_FREEPOLY" +#define HID_CONTDLG_GRAPHWND "SVX_HID_CONTDLG_GRAPHWND" +#define HID_CONTDLG_PIPETTE "SVX_HID_CONTDLG_PIPETTE" +#define HID_CONTDLG_POLY "SVX_HID_CONTDLG_POLY" +#define HID_CONTDLG_POLYDELETE "SVX_HID_CONTDLG_POLYDELETE" +#define HID_CONTDLG_POLYEDIT "SVX_HID_CONTDLG_POLYEDIT" +#define HID_CONTDLG_POLYINSERT "SVX_HID_CONTDLG_POLYINSERT" +#define HID_CONTDLG_POLYMOVE "SVX_HID_CONTDLG_POLYMOVE" +#define HID_CONTDLG_RECT "SVX_HID_CONTDLG_RECT" +#define HID_CONTDLG_REDO "SVX_HID_CONTDLG_REDO" +#define HID_CONTDLG_SELECT "SVX_HID_CONTDLG_SELECT" +#define HID_CONTDLG_TOOLBOX "SVX_HID_CONTDLG_TOOLBOX" +#define HID_CONTDLG_UNDO "SVX_HID_CONTDLG_UNDO" +#define HID_CONTDLG_WORKPLACE "SVX_HID_CONTDLG_WORKPLACE" +#define HID_CTL_FONTWORK_FAVORITES "SVX_HID_CTL_FONTWORK_FAVORITES" +#define HID_CTRL3D_HSCROLL "SVX_HID_CTRL3D_HSCROLL" +#define HID_CTRL3D_SWITCHER "SVX_HID_CTRL3D_SWITCHER" +#define HID_CTRL3D_VSCROLL "SVX_HID_CTRL3D_VSCROLL" +#define HID_CTRL_COLOR "SVX_HID_CTRL_COLOR" +#define HID_DRAWTOOL_TBX "SVX_HID_DRAWTOOL_TBX" +#define HID_EDITENG_SPELLER_ADDWORD "SVX_HID_EDITENG_SPELLER_ADDWORD" +#define HID_EDITENG_SPELLER_AUTOCORRECT "SVX_HID_EDITENG_SPELLER_AUTOCORRECT" +#define HID_EDITENG_SPELLER_IGNORE "SVX_HID_EDITENG_SPELLER_IGNORE" +#define HID_EDITENG_SPELLER_PARALANGUAGE "SVX_HID_EDITENG_SPELLER_PARALANGUAGE" +#define HID_EDITENG_SPELLER_START "SVX_HID_EDITENG_SPELLER_START" +#define HID_EDITENG_SPELLER_WORDLANGUAGE "SVX_HID_EDITENG_SPELLER_WORDLANGUAGE" +#define HID_FILL_ATTR_LISTBOX "SVX_HID_FILL_ATTR_LISTBOX" +#define HID_FILL_TYPE_LISTBOX "SVX_HID_FILL_TYPE_LISTBOX" +#define HID_FONTWORK_CTL_FORMS "SVX_HID_FONTWORK_CTL_FORMS" +#define HID_FONTWORK_TBI_ADJUST_AUTOSIZE "SVX_HID_FONTWORK_TBI_ADJUST_AUTOSIZE" +#define HID_FONTWORK_TBI_ADJUST_CENTER "SVX_HID_FONTWORK_TBI_ADJUST_CENTER" +#define HID_FONTWORK_TBI_ADJUST_LEFT "SVX_HID_FONTWORK_TBI_ADJUST_LEFT" +#define HID_FONTWORK_TBI_ADJUST_MIRROR "SVX_HID_FONTWORK_TBI_ADJUST_MIRROR" +#define HID_FONTWORK_TBI_ADJUST_RIGHT "SVX_HID_FONTWORK_TBI_ADJUST_RIGHT" +#define HID_FONTWORK_TBI_OUTLINE "SVX_HID_FONTWORK_TBI_OUTLINE" +#define HID_FONTWORK_TBI_SHADOW_NORMAL "SVX_HID_FONTWORK_TBI_SHADOW_NORMAL" +#define HID_FONTWORK_TBI_SHADOW_OFF "SVX_HID_FONTWORK_TBI_SHADOW_OFF" +#define HID_FONTWORK_TBI_SHADOW_SLANT "SVX_HID_FONTWORK_TBI_SHADOW_SLANT" +#define HID_FONTWORK_TBI_SHOWFORM "SVX_HID_FONTWORK_TBI_SHOWFORM" +#define HID_FONTWORK_TBI_STYLE_OFF "SVX_HID_FONTWORK_TBI_STYLE_OFF" +#define HID_FONTWORK_TBI_STYLE_ROTATE "SVX_HID_FONTWORK_TBI_STYLE_ROTATE" +#define HID_FONTWORK_TBI_STYLE_SLANTX "SVX_HID_FONTWORK_TBI_STYLE_SLANTX" +#define HID_FONTWORK_TBI_STYLE_SLANTY "SVX_HID_FONTWORK_TBI_STYLE_SLANTY" +#define HID_FONTWORK_TBI_STYLE_UPRIGHT "SVX_HID_FONTWORK_TBI_STYLE_UPRIGHT" +#define HID_FORMAT_FOOTER "SVX_HID_FORMAT_FOOTER" +#define HID_FORMAT_HEADER "SVX_HID_FORMAT_HEADER" // free -#define HID_GALLERY_ICONVIEW (HID_SVX_START + 58) -#define HID_GALLERY_LISTVIEW (HID_SVX_START + 59) -#define HID_GALLERY_MN_ADD (HID_SVX_START + 60) -#define HID_GALLERY_MN_ADDMENU (HID_SVX_START + 61) -#define HID_GALLERY_MN_ADD_LINK (HID_SVX_START + 62) -#define HID_GALLERY_MN_BACKGROUND (HID_SVX_START + 63) -#define HID_GALLERY_MN_COPYCLIPBOARD (HID_SVX_START + 64) -#define HID_GALLERY_MN_DELETE (HID_SVX_START + 65) -#define HID_GALLERY_MN_PASTECLIPBOARD (HID_SVX_START + 66) -#define HID_GALLERY_MN_PREVIEW (HID_SVX_START + 67) -#define HID_GALLERY_NEWTHEME (HID_SVX_START + 68) -#define HID_GALLERY_PREVIEW (HID_SVX_START + 69) -#define HID_GALLERY_PROPERTIES (HID_SVX_START + 70) -#define HID_GALLERY_RENAME (HID_SVX_START + 71) -#define HID_GALLERY_THEMELIST (HID_SVX_START + 72) +#define HID_GALLERY_ICONVIEW "SVX_HID_GALLERY_ICONVIEW" +#define HID_GALLERY_LISTVIEW "SVX_HID_GALLERY_LISTVIEW" +#define HID_GALLERY_MN_ADD "SVX_HID_GALLERY_MN_ADD" +#define HID_GALLERY_MN_ADDMENU "SVX_HID_GALLERY_MN_ADDMENU" +#define HID_GALLERY_MN_ADD_LINK "SVX_HID_GALLERY_MN_ADD_LINK" +#define HID_GALLERY_MN_BACKGROUND "SVX_HID_GALLERY_MN_BACKGROUND" +#define HID_GALLERY_MN_COPYCLIPBOARD "SVX_HID_GALLERY_MN_COPYCLIPBOARD" +#define HID_GALLERY_MN_DELETE "SVX_HID_GALLERY_MN_DELETE" +#define HID_GALLERY_MN_PASTECLIPBOARD "SVX_HID_GALLERY_MN_PASTECLIPBOARD" +#define HID_GALLERY_MN_PREVIEW "SVX_HID_GALLERY_MN_PREVIEW" +#define HID_GALLERY_NEWTHEME "SVX_HID_GALLERY_NEWTHEME" +#define HID_GALLERY_PREVIEW "SVX_HID_GALLERY_PREVIEW" +#define HID_GALLERY_PROPERTIES "SVX_HID_GALLERY_PROPERTIES" +#define HID_GALLERY_RENAME "SVX_HID_GALLERY_RENAME" +#define HID_GALLERY_THEMELIST "SVX_HID_GALLERY_THEMELIST" // free -#define HID_GALLERY_WINDOW (HID_SVX_START + 74) -#define HID_GRFFILTER (HID_SVX_START + 75) -#define HID_GRFFILTER_EMBOSS (HID_SVX_START + 76) -#define HID_GRFFILTER_INVERT (HID_SVX_START + 77) -#define HID_GRFFILTER_MOSAIC (HID_SVX_START + 78) -#define HID_GRFFILTER_POPART (HID_SVX_START + 79) -#define HID_GRFFILTER_POSTER (HID_SVX_START + 80) -#define HID_GRFFILTER_REMOVENOISE (HID_SVX_START + 81) -#define HID_GRFFILTER_SEPIA (HID_SVX_START + 82) -#define HID_GRFFILTER_SHARPEN (HID_SVX_START + 83) -#define HID_GRFFILTER_SMOOTH (HID_SVX_START + 84) -#define HID_GRFFILTER_SOBEL (HID_SVX_START + 85) -#define HID_GRFFILTER_SOLARIZE (HID_SVX_START + 86) +#define HID_GALLERY_WINDOW "SVX_HID_GALLERY_WINDOW" +#define HID_GRFFILTER "SVX_HID_GRFFILTER" +#define HID_GRFFILTER_EMBOSS "SVX_HID_GRFFILTER_EMBOSS" +#define HID_GRFFILTER_INVERT "SVX_HID_GRFFILTER_INVERT" +#define HID_GRFFILTER_MOSAIC "SVX_HID_GRFFILTER_MOSAIC" +#define HID_GRFFILTER_POPART "SVX_HID_GRFFILTER_POPART" +#define HID_GRFFILTER_POSTER "SVX_HID_GRFFILTER_POSTER" +#define HID_GRFFILTER_REMOVENOISE "SVX_HID_GRFFILTER_REMOVENOISE" +#define HID_GRFFILTER_SEPIA "SVX_HID_GRFFILTER_SEPIA" +#define HID_GRFFILTER_SHARPEN "SVX_HID_GRFFILTER_SHARPEN" +#define HID_GRFFILTER_SMOOTH "SVX_HID_GRFFILTER_SMOOTH" +#define HID_GRFFILTER_SOBEL "SVX_HID_GRFFILTER_SOBEL" +#define HID_GRFFILTER_SOLARIZE "SVX_HID_GRFFILTER_SOLARIZE" -#define HID_IMAPDLG_ACTIVE (HID_SVX_START + 88) -#define HID_IMAPDLG_APPLY (HID_SVX_START + 89) -#define HID_IMAPDLG_CIRCLE (HID_SVX_START + 90) -#define HID_IMAPDLG_FREEPOLY (HID_SVX_START + 91) -#define HID_IMAPDLG_GRAPHWND (HID_SVX_START + 92) -#define HID_IMAPDLG_MACRO (HID_SVX_START + 93) -#define HID_IMAPDLG_OPEN (HID_SVX_START + 94) -#define HID_IMAPDLG_POLY (HID_SVX_START + 95) -#define HID_IMAPDLG_POLYDELETE (HID_SVX_START + 96) -#define HID_IMAPDLG_POLYEDIT (HID_SVX_START + 97) -#define HID_IMAPDLG_POLYINSERT (HID_SVX_START + 98) -#define HID_IMAPDLG_POLYMOVE (HID_SVX_START + 99) -#define HID_IMAPDLG_PROPERTY (HID_SVX_START + 100) -#define HID_IMAPDLG_RECT (HID_SVX_START + 101) -#define HID_IMAPDLG_REDO (HID_SVX_START + 102) -#define HID_IMAPDLG_SAVEAS (HID_SVX_START + 103) -#define HID_IMAPDLG_SELECT (HID_SVX_START + 104) -#define HID_IMAPDLG_TOOLBOX (HID_SVX_START + 105) -#define HID_IMAPDLG_UNDO (HID_SVX_START + 106) -#define HID_MENU_EXTRUSION_DEPTH (HID_SVX_START + 107) -#define HID_MENU_EXTRUSION_DIRECTION (HID_SVX_START + 108) -#define HID_MENU_EXTRUSION_LIGHTING (HID_SVX_START + 109) -#define HID_MENU_EXTRUSION_SURFACE (HID_SVX_START + 110) -#define HID_MNU_FUNC_AVG (HID_SVX_START + 111) -#define HID_MNU_FUNC_COUNT (HID_SVX_START + 112) -#define HID_MNU_FUNC_COUNT2 (HID_SVX_START + 113) -#define HID_MNU_FUNC_MAX (HID_SVX_START + 114) -#define HID_MNU_FUNC_MIN (HID_SVX_START + 115) -#define HID_MNU_FUNC_NONE (HID_SVX_START + 116) -#define HID_MNU_FUNC_SUM (HID_SVX_START + 117) -#define HID_MNU_ZOOM_100 (HID_SVX_START + 118) -#define HID_MNU_ZOOM_150 (HID_SVX_START + 119) -#define HID_MNU_ZOOM_200 (HID_SVX_START + 120) -#define HID_MNU_ZOOM_50 (HID_SVX_START + 121) -#define HID_MNU_ZOOM_75 (HID_SVX_START + 122) -#define HID_MNU_ZOOM_OPTIMAL (HID_SVX_START + 123) -#define HID_MNU_ZOOM_PAGE_WIDTH (HID_SVX_START + 124) -#define HID_MNU_ZOOM_WHOLE_PAGE (HID_SVX_START + 125) -#define HID_OPTIONS_GRID (HID_SVX_START + 126) -#define HID_PASSWORD (HID_SVX_START + 127) -#define HID_POPUP_COLOR (HID_SVX_START + 128) -#define HID_POPUP_COLOR_CTRL (HID_SVX_START + 129) -#define HID_POPUP_EXTRUSION_DEPTH (HID_SVX_START + 130) -#define HID_POPUP_EXTRUSION_DIRECTION (HID_SVX_START + 131) -#define HID_POPUP_EXTRUSION_LIGHTING (HID_SVX_START + 132) -#define HID_POPUP_EXTRUSION_SURFACE (HID_SVX_START + 133) -#define HID_POPUP_FONTWORK_ALIGN (HID_SVX_START + 134) -#define HID_POPUP_FONTWORK_CHARSPACE (HID_SVX_START + 135) -#define HID_POPUP_FRAME (HID_SVX_START + 136) -#define HID_POPUP_LINE (HID_SVX_START + 137) -#define HID_POPUP_LINEEND (HID_SVX_START + 138) -#define HID_POPUP_LINEEND_CTRL (HID_SVX_START + 139) -#define HID_REDLINING_FILTER_BTN_REF (HID_SVX_START + 140) -#define HID_REDLINING_FILTER_CB_ACTION (HID_SVX_START + 141) -#define HID_REDLINING_FILTER_CB_AUTOR (HID_SVX_START + 142) -#define HID_REDLINING_FILTER_CB_COMMENT (HID_SVX_START + 143) -#define HID_REDLINING_FILTER_CB_DATE (HID_SVX_START + 144) -#define HID_REDLINING_FILTER_CB_RANGE (HID_SVX_START + 145) -#define HID_REDLINING_FILTER_DF_DATE (HID_SVX_START + 146) -#define HID_REDLINING_FILTER_DF_DATE2 (HID_SVX_START + 147) -#define HID_REDLINING_FILTER_ED_COMMENT (HID_SVX_START + 148) -#define HID_REDLINING_FILTER_ED_RANGE (HID_SVX_START + 149) -#define HID_REDLINING_FILTER_IB_CLOCK (HID_SVX_START + 150) -#define HID_REDLINING_FILTER_IB_CLOCK2 (HID_SVX_START + 151) -#define HID_REDLINING_FILTER_LB_ACTION (HID_SVX_START + 152) -#define HID_REDLINING_FILTER_LB_AUTOR (HID_SVX_START + 153) -#define HID_REDLINING_FILTER_LB_DATE (HID_SVX_START + 154) -#define HID_REDLINING_FILTER_PAGE (HID_SVX_START + 155) -#define HID_REDLINING_FILTER_TF_DATE (HID_SVX_START + 156) -#define HID_REDLINING_FILTER_TF_DATE2 (HID_SVX_START + 157) -#define HID_REDLINING_TABCONTROL (HID_SVX_START + 158) -#define HID_REDLINING_VIEW_DG_VIEW (HID_SVX_START + 159) -#define HID_REDLINING_VIEW_DG_VIEW_HEADER (HID_SVX_START + 160) -#define HID_REDLINING_VIEW_DG_VIEW_TABLE (HID_SVX_START + 161) -#define HID_REDLINING_VIEW_PAGE (HID_SVX_START + 162) -#define HID_REDLINING_VIEW_PB_ACCEPT (HID_SVX_START + 163) -#define HID_REDLINING_VIEW_PB_ACCEPTALL (HID_SVX_START + 164) -#define HID_REDLINING_VIEW_PB_REJECT (HID_SVX_START + 165) -#define HID_REDLINING_VIEW_PB_REJECTALL (HID_SVX_START + 166) -#define HID_REDLINING_VIEW_PB_UNDO (HID_SVX_START + 167) -#define HID_RUBY_DIALOG (HID_SVX_START + 168) -#define HID_STYLE_LISTBOX (HID_SVX_START + 169) -#define HID_SVXTBX_ALIGNMENT (HID_SVX_START + 170) -#define HID_SVXTBX_DRAW (HID_SVX_START + 171) -#define HID_SVXTBX_UNDO_REDO_CTRL (HID_SVX_START + 172) -#define HID_SVX_CHINESE_DICTIONARY_CB_REVERSE (HID_SVX_START + 173) -#define HID_SVX_CHINESE_DICTIONARY_LB_HEADER (HID_SVX_START + 174) -#define HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED (HID_SVX_START + 175) -#define HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL (HID_SVX_START + 176) -#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED (HID_SVX_START + 177) -#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL (HID_SVX_START + 178) -#define HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS (HID_SVX_START + 179) -#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED (HID_SVX_START + 180) -#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL (HID_SVX_START + 181) -#define HID_SVX_MDLG_DOCRECOVERY_BROKEN (HID_SVX_START + 182) -#define HID_SVX_MDLG_DOCRECOVERY_PROGR (HID_SVX_START + 183) -#define HID_SVX_MDLG_ERR_REP_OPTIONS (HID_SVX_START + 184) -#define HID_SVX_MDLG_ERR_REP_PREVIEW (HID_SVX_START + 185) -#define HID_SVX_TABDLG_DOCRECOVERY (HID_SVX_START + 186) -#define HID_SVX_TP_DOCRECOVERY_RECOVER (HID_SVX_START + 187) -#define HID_SVX_TP_DOCRECOVERY_SAVE (HID_SVX_START + 188) -#define HID_SVX_TP_ERR_REP_SEND (HID_SVX_START + 189) -#define HID_SVX_TP_ERR_REP_WELCOME (HID_SVX_START + 190) +#define HID_IMAPDLG_ACTIVE "SVX_HID_IMAPDLG_ACTIVE" +#define HID_IMAPDLG_APPLY "SVX_HID_IMAPDLG_APPLY" +#define HID_IMAPDLG_CIRCLE "SVX_HID_IMAPDLG_CIRCLE" +#define HID_IMAPDLG_FREEPOLY "SVX_HID_IMAPDLG_FREEPOLY" +#define HID_IMAPDLG_GRAPHWND "SVX_HID_IMAPDLG_GRAPHWND" +#define HID_IMAPDLG_MACRO "SVX_HID_IMAPDLG_MACRO" +#define HID_IMAPDLG_OPEN "SVX_HID_IMAPDLG_OPEN" +#define HID_IMAPDLG_POLY "SVX_HID_IMAPDLG_POLY" +#define HID_IMAPDLG_POLYDELETE "SVX_HID_IMAPDLG_POLYDELETE" +#define HID_IMAPDLG_POLYEDIT "SVX_HID_IMAPDLG_POLYEDIT" +#define HID_IMAPDLG_POLYINSERT "SVX_HID_IMAPDLG_POLYINSERT" +#define HID_IMAPDLG_POLYMOVE "SVX_HID_IMAPDLG_POLYMOVE" +#define HID_IMAPDLG_PROPERTY "SVX_HID_IMAPDLG_PROPERTY" +#define HID_IMAPDLG_RECT "SVX_HID_IMAPDLG_RECT" +#define HID_IMAPDLG_REDO "SVX_HID_IMAPDLG_REDO" +#define HID_IMAPDLG_SAVEAS "SVX_HID_IMAPDLG_SAVEAS" +#define HID_IMAPDLG_SELECT "SVX_HID_IMAPDLG_SELECT" +#define HID_IMAPDLG_TOOLBOX "SVX_HID_IMAPDLG_TOOLBOX" +#define HID_IMAPDLG_UNDO "SVX_HID_IMAPDLG_UNDO" +#define HID_MENU_EXTRUSION_DEPTH "SVX_HID_MENU_EXTRUSION_DEPTH" +#define HID_MENU_EXTRUSION_DIRECTION "SVX_HID_MENU_EXTRUSION_DIRECTION" +#define HID_MENU_EXTRUSION_LIGHTING "SVX_HID_MENU_EXTRUSION_LIGHTING" +#define HID_MENU_EXTRUSION_SURFACE "SVX_HID_MENU_EXTRUSION_SURFACE" +#define HID_MNU_FUNC_AVG "SVX_HID_MNU_FUNC_AVG" +#define HID_MNU_FUNC_COUNT "SVX_HID_MNU_FUNC_COUNT" +#define HID_MNU_FUNC_COUNT2 "SVX_HID_MNU_FUNC_COUNT2" +#define HID_MNU_FUNC_MAX "SVX_HID_MNU_FUNC_MAX" +#define HID_MNU_FUNC_MIN "SVX_HID_MNU_FUNC_MIN" +#define HID_MNU_FUNC_NONE "SVX_HID_MNU_FUNC_NONE" +#define HID_MNU_FUNC_SUM "SVX_HID_MNU_FUNC_SUM" +#define HID_MNU_ZOOM_100 "SVX_HID_MNU_ZOOM_100" +#define HID_MNU_ZOOM_150 "SVX_HID_MNU_ZOOM_150" +#define HID_MNU_ZOOM_200 "SVX_HID_MNU_ZOOM_200" +#define HID_MNU_ZOOM_50 "SVX_HID_MNU_ZOOM_50" +#define HID_MNU_ZOOM_75 "SVX_HID_MNU_ZOOM_75" +#define HID_MNU_ZOOM_OPTIMAL "SVX_HID_MNU_ZOOM_OPTIMAL" +#define HID_MNU_ZOOM_PAGE_WIDTH "SVX_HID_MNU_ZOOM_PAGE_WIDTH" +#define HID_MNU_ZOOM_WHOLE_PAGE "SVX_HID_MNU_ZOOM_WHOLE_PAGE" +#define HID_OPTIONS_GRID "SVX_HID_OPTIONS_GRID" +#define HID_PASSWORD "SVX_HID_PASSWORD" +#define HID_POPUP_COLOR "SVX_HID_POPUP_COLOR" +#define HID_POPUP_COLOR_CTRL "SVX_HID_POPUP_COLOR_CTRL" +#define HID_POPUP_EXTRUSION_DEPTH "SVX_HID_POPUP_EXTRUSION_DEPTH" +#define HID_POPUP_EXTRUSION_DIRECTION "SVX_HID_POPUP_EXTRUSION_DIRECTION" +#define HID_POPUP_EXTRUSION_LIGHTING "SVX_HID_POPUP_EXTRUSION_LIGHTING" +#define HID_POPUP_EXTRUSION_SURFACE "SVX_HID_POPUP_EXTRUSION_SURFACE" +#define HID_POPUP_FONTWORK_ALIGN "SVX_HID_POPUP_FONTWORK_ALIGN" +#define HID_POPUP_FONTWORK_CHARSPACE "SVX_HID_POPUP_FONTWORK_CHARSPACE" +#define HID_POPUP_FRAME "SVX_HID_POPUP_FRAME" +#define HID_POPUP_LINE "SVX_HID_POPUP_LINE" +#define HID_POPUP_LINEEND "SVX_HID_POPUP_LINEEND" +#define HID_POPUP_LINEEND_CTRL "SVX_HID_POPUP_LINEEND_CTRL" +#define HID_REDLINING_FILTER_BTN_REF "SVX_HID_REDLINING_FILTER_BTN_REF" +#define HID_REDLINING_FILTER_CB_ACTION "SVX_HID_REDLINING_FILTER_CB_ACTION" +#define HID_REDLINING_FILTER_CB_AUTOR "SVX_HID_REDLINING_FILTER_CB_AUTOR" +#define HID_REDLINING_FILTER_CB_COMMENT "SVX_HID_REDLINING_FILTER_CB_COMMENT" +#define HID_REDLINING_FILTER_CB_DATE "SVX_HID_REDLINING_FILTER_CB_DATE" +#define HID_REDLINING_FILTER_CB_RANGE "SVX_HID_REDLINING_FILTER_CB_RANGE" +#define HID_REDLINING_FILTER_DF_DATE "SVX_HID_REDLINING_FILTER_DF_DATE" +#define HID_REDLINING_FILTER_DF_DATE2 "SVX_HID_REDLINING_FILTER_DF_DATE2" +#define HID_REDLINING_FILTER_ED_COMMENT "SVX_HID_REDLINING_FILTER_ED_COMMENT" +#define HID_REDLINING_FILTER_ED_RANGE "SVX_HID_REDLINING_FILTER_ED_RANGE" +#define HID_REDLINING_FILTER_IB_CLOCK "SVX_HID_REDLINING_FILTER_IB_CLOCK" +#define HID_REDLINING_FILTER_IB_CLOCK2 "SVX_HID_REDLINING_FILTER_IB_CLOCK2" +#define HID_REDLINING_FILTER_LB_ACTION "SVX_HID_REDLINING_FILTER_LB_ACTION" +#define HID_REDLINING_FILTER_LB_AUTOR "SVX_HID_REDLINING_FILTER_LB_AUTOR" +#define HID_REDLINING_FILTER_LB_DATE "SVX_HID_REDLINING_FILTER_LB_DATE" +#define HID_REDLINING_FILTER_PAGE "SVX_HID_REDLINING_FILTER_PAGE" +#define HID_REDLINING_FILTER_TF_DATE "SVX_HID_REDLINING_FILTER_TF_DATE" +#define HID_REDLINING_FILTER_TF_DATE2 "SVX_HID_REDLINING_FILTER_TF_DATE2" +#define HID_REDLINING_TABCONTROL "SVX_HID_REDLINING_TABCONTROL" +#define HID_REDLINING_VIEW_DG_VIEW "SVX_HID_REDLINING_VIEW_DG_VIEW" +#define HID_REDLINING_VIEW_DG_VIEW_HEADER "SVX_HID_REDLINING_VIEW_DG_VIEW_HEADER" +#define HID_REDLINING_VIEW_DG_VIEW_TABLE "SVX_HID_REDLINING_VIEW_DG_VIEW_TABLE" +#define HID_REDLINING_VIEW_PAGE "SVX_HID_REDLINING_VIEW_PAGE" +#define HID_REDLINING_VIEW_PB_ACCEPT "SVX_HID_REDLINING_VIEW_PB_ACCEPT" +#define HID_REDLINING_VIEW_PB_ACCEPTALL "SVX_HID_REDLINING_VIEW_PB_ACCEPTALL" +#define HID_REDLINING_VIEW_PB_REJECT "SVX_HID_REDLINING_VIEW_PB_REJECT" +#define HID_REDLINING_VIEW_PB_REJECTALL "SVX_HID_REDLINING_VIEW_PB_REJECTALL" +#define HID_REDLINING_VIEW_PB_UNDO "SVX_HID_REDLINING_VIEW_PB_UNDO" +#define HID_RUBY_DIALOG "SVX_HID_RUBY_DIALOG" +#define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX" +#define HID_SVXTBX_ALIGNMENT "SVX_HID_SVXTBX_ALIGNMENT" +#define HID_SVXTBX_DRAW "SVX_HID_SVXTBX_DRAW" +#define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL" +#define HID_SVX_CHINESE_DICTIONARY_CB_REVERSE "SVX_HID_SVX_CHINESE_DICTIONARY_CB_REVERSE" +#define HID_SVX_CHINESE_DICTIONARY_LB_HEADER "SVX_HID_SVX_CHINESE_DICTIONARY_LB_HEADER" +#define HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED" +#define HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL" +#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED" +#define HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL" +#define HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS "SVX_HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS" +#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED "SVX_HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED" +#define HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL "SVX_HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL" +#define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN" +#define HID_SVX_MDLG_DOCRECOVERY_PROGR "SVX_HID_SVX_MDLG_DOCRECOVERY_PROGR" +#define HID_SVX_MDLG_ERR_REP_OPTIONS "SVX_HID_SVX_MDLG_ERR_REP_OPTIONS" +#define HID_SVX_MDLG_ERR_REP_PREVIEW "SVX_HID_SVX_MDLG_ERR_REP_PREVIEW" +#define HID_SVX_TABDLG_DOCRECOVERY "SVX_HID_SVX_TABDLG_DOCRECOVERY" +#define HID_SVX_TP_DOCRECOVERY_RECOVER "SVX_HID_SVX_TP_DOCRECOVERY_RECOVER" +#define HID_SVX_TP_DOCRECOVERY_SAVE "SVX_HID_SVX_TP_DOCRECOVERY_SAVE" +#define HID_SVX_TP_ERR_REP_SEND "SVX_HID_SVX_TP_ERR_REP_SEND" +#define HID_SVX_TP_ERR_REP_WELCOME "SVX_HID_SVX_TP_ERR_REP_WELCOME" -#define HID_VALUESET_EXTRUSION_DIRECTION (HID_SVX_START + 192) -#define HID_VALUESET_EXTRUSION_LIGHTING (HID_SVX_START + 193) -#define HID_WIN_FONTWORK_ALIGN (HID_SVX_START + 194) -#define HID_WIN_FONTWORK_CHARSPACE (HID_SVX_START + 195) -#define HID_XMLSEC_CALL (HID_SVX_START + 196) -#define HID_OFA_HYPERLINK_DLG (HID_SVX_START + 197) -#define HID_OFA_HYPERLINK_NAME (HID_SVX_START + 198) -#define HID_OFA_HYPERLINK_SEARCH (HID_SVX_START + 199) -#define HID_OFA_HYPERLINK_TARGET (HID_SVX_START + 200) -#define HID_OFA_HYPERLINK_URL (HID_SVX_START + 201) -#define HID_OFA_HYPERLINK_URL_TXT (HID_SVX_START + 202) -#define HID_AUTOCORR_DLG (HID_SVX_START + 203) -#define HID_SVXCTL_MAIL_ATTACH (HID_SVX_START + 204) -#define HID_SVXDLG_REGISTRATION (HID_SVX_START + 205) -#define HID_SVXDLG_TREE_BASE (HID_SVX_START + 206) -#define HID_SVXDLG_TREE_CHART (HID_SVX_START + 207) -#define HID_SVXDLG_TREE_FILTER (HID_SVX_START + 208) -#define HID_SVXDLG_TREE_LANGUAGE (HID_SVX_START + 209) -#define HID_SVXWIN_MAIL_ATTACH (HID_SVX_START + 210) -#define HID_SVXWIN_MAIL_HEADER (HID_SVX_START + 211) -#define HID_SVX_DLGFORMNEW (HID_SVX_START + 212) -#define HID_SVX_DLGTABNEW (HID_SVX_START + 213) -#define HID_SVX_HYPERLINK (HID_SVX_START + 214) -#define HID_SVX_MAILATTACH_ASCII_CB (HID_SVX_START + 215) -#define HID_SVX_MAILATTACH_HTML_CB (HID_SVX_START + 216) -#define HID_SVX_MAILATTACH_OFFICE_CB (HID_SVX_START + 217) -#define HID_SVX_MAILATTACH_PRIORITY_LB (HID_SVX_START + 218) -#define HID_SVX_MAILATTACH_RECEIPT_CB (HID_SVX_START + 219) -#define HID_SVX_MAILATTACH_RTF_CB (HID_SVX_START + 220) -#define HID_SVX_MAILHEAD_HEAD_WIN (HID_SVX_START + 221) -#define HID_SVX_MAILHEAD_PRIORITY_LB (HID_SVX_START + 222) -#define HID_SVX_MAILHEAD_PROTOCOL_LB (HID_SVX_START + 223) -#define HID_SVX_MAILHEAD_RCPT_CB (HID_SVX_START + 224) -#define HID_SVX_MAILHEAD_RCPT_ED (HID_SVX_START + 225) -#define HID_SVX_MAILHEAD_RCPT_LB (HID_SVX_START + 226) -#define HID_SVX_MAILHEAD_RECEIPT_CB (HID_SVX_START + 227) -#define HID_SVX_MAILHEAD_ROLE_LB (HID_SVX_START + 228) -#define HID_SVX_MAILHEAD_SUBJECT_ED (HID_SVX_START + 229) -#define HID_SVX_MAILMENU_ADDADDRESS (HID_SVX_START + 230) -#define HID_SVX_MAILMENU_COPYLINK (HID_SVX_START + 231) -#define HID_SVX_MAILMENU_DELETE (HID_SVX_START + 232) -#define HID_SVX_MAILMENU_FILE (HID_SVX_START + 233) -#define HID_SVX_MAILMENU_OPEN (HID_SVX_START + 234) -#define HID_SVX_MAILMENU_RENAME (HID_SVX_START + 235) -#define HID_SVX_MAILMENU_SAVEAS (HID_SVX_START + 236) -#define HID_SVX_MAILMENU_SIG1 (HID_SVX_START + 237) -#define HID_SVX_MAILMENU_SIG2 (HID_SVX_START + 238) -#define HID_SVX_MAILMENU_SIG3 (HID_SVX_START + 239) -#define HID_SVX_MAILMENU_SIG4 (HID_SVX_START + 240) -#define HID_SVX_MAILTOOLBOX (HID_SVX_START + 241) -#define HID_SVX_SENDMENU_ENCRYPT (HID_SVX_START + 242) -#define HID_SVX_SENDMENU_PLAIN (HID_SVX_START + 243) -#define HID_SVX_SENDMENU_SIGN (HID_SVX_START + 244) -#define HID_SVX_SENDMENU_SIGNANDENCRYPT (HID_SVX_START + 245) -#define HID_SVX_TP_APPEARANCE (HID_SVX_START + 246) -#define HID_SVX_TP_DESKTOP (HID_SVX_START + 247) - -// please adjust ACT_SVX_HID_END2 below if you add entries here! - -// ----------------------------------------------------------------------- -// Overrun check --------------------------------------------------------- -// ----------------------------------------------------------------------- - -#define ACT_SVX_HID_END (HID_SVX_START+247) -#if ACT_SVX_HID_END > HID_SVX_END -#error Resource-Ueberlauf in #line, #file -#endif +#define HID_VALUESET_EXTRUSION_DIRECTION "SVX_HID_VALUESET_EXTRUSION_DIRECTION" +#define HID_VALUESET_EXTRUSION_LIGHTING "SVX_HID_VALUESET_EXTRUSION_LIGHTING" +#define HID_WIN_FONTWORK_ALIGN "SVX_HID_WIN_FONTWORK_ALIGN" +#define HID_WIN_FONTWORK_CHARSPACE "SVX_HID_WIN_FONTWORK_CHARSPACE" +#define HID_XMLSEC_CALL "SVX_HID_XMLSEC_CALL" +#define HID_OFA_HYPERLINK_DLG "SVX_HID_OFA_HYPERLINK_DLG" +#define HID_OFA_HYPERLINK_NAME "SVX_HID_OFA_HYPERLINK_NAME" +#define HID_OFA_HYPERLINK_SEARCH "SVX_HID_OFA_HYPERLINK_SEARCH" +#define HID_OFA_HYPERLINK_TARGET "SVX_HID_OFA_HYPERLINK_TARGET" +#define HID_OFA_HYPERLINK_URL "SVX_HID_OFA_HYPERLINK_URL" +#define HID_OFA_HYPERLINK_URL_TXT "SVX_HID_OFA_HYPERLINK_URL_TXT" +#define HID_AUTOCORR_DLG "SVX_HID_AUTOCORR_DLG" +#define HID_SVXCTL_MAIL_ATTACH "SVX_HID_SVXCTL_MAIL_ATTACH" +#define HID_SVXDLG_REGISTRATION "SVX_HID_SVXDLG_REGISTRATION" +#define HID_SVXDLG_TREE_BASE "SVX_HID_SVXDLG_TREE_BASE" +#define HID_SVXDLG_TREE_CHART "SVX_HID_SVXDLG_TREE_CHART" +#define HID_SVXDLG_TREE_FILTER "SVX_HID_SVXDLG_TREE_FILTER" +#define HID_SVXDLG_TREE_LANGUAGE "SVX_HID_SVXDLG_TREE_LANGUAGE" +#define HID_SVXWIN_MAIL_ATTACH "SVX_HID_SVXWIN_MAIL_ATTACH" +#define HID_SVXWIN_MAIL_HEADER "SVX_HID_SVXWIN_MAIL_HEADER" +#define HID_SVX_DLGFORMNEW "SVX_HID_SVX_DLGFORMNEW" +#define HID_SVX_DLGTABNEW "SVX_HID_SVX_DLGTABNEW" +#define HID_SVX_HYPERLINK "SVX_HID_SVX_HYPERLINK" +#define HID_SVX_MAILATTACH_ASCII_CB "SVX_HID_SVX_MAILATTACH_ASCII_CB" +#define HID_SVX_MAILATTACH_HTML_CB "SVX_HID_SVX_MAILATTACH_HTML_CB" +#define HID_SVX_MAILATTACH_OFFICE_CB "SVX_HID_SVX_MAILATTACH_OFFICE_CB" +#define HID_SVX_MAILATTACH_PRIORITY_LB "SVX_HID_SVX_MAILATTACH_PRIORITY_LB" +#define HID_SVX_MAILATTACH_RECEIPT_CB "SVX_HID_SVX_MAILATTACH_RECEIPT_CB" +#define HID_SVX_MAILATTACH_RTF_CB "SVX_HID_SVX_MAILATTACH_RTF_CB" +#define HID_SVX_MAILHEAD_HEAD_WIN "SVX_HID_SVX_MAILHEAD_HEAD_WIN" +#define HID_SVX_MAILHEAD_PRIORITY_LB "SVX_HID_SVX_MAILHEAD_PRIORITY_LB" +#define HID_SVX_MAILHEAD_PROTOCOL_LB "SVX_HID_SVX_MAILHEAD_PROTOCOL_LB" +#define HID_SVX_MAILHEAD_RCPT_CB "SVX_HID_SVX_MAILHEAD_RCPT_CB" +#define HID_SVX_MAILHEAD_RCPT_ED "SVX_HID_SVX_MAILHEAD_RCPT_ED" +#define HID_SVX_MAILHEAD_RCPT_LB "SVX_HID_SVX_MAILHEAD_RCPT_LB" +#define HID_SVX_MAILHEAD_RECEIPT_CB "SVX_HID_SVX_MAILHEAD_RECEIPT_CB" +#define HID_SVX_MAILHEAD_ROLE_LB "SVX_HID_SVX_MAILHEAD_ROLE_LB" +#define HID_SVX_MAILHEAD_SUBJECT_ED "SVX_HID_SVX_MAILHEAD_SUBJECT_ED" +#define HID_SVX_MAILMENU_ADDADDRESS "SVX_HID_SVX_MAILMENU_ADDADDRESS" +#define HID_SVX_MAILMENU_COPYLINK "SVX_HID_SVX_MAILMENU_COPYLINK" +#define HID_SVX_MAILMENU_DELETE "SVX_HID_SVX_MAILMENU_DELETE" +#define HID_SVX_MAILMENU_FILE "SVX_HID_SVX_MAILMENU_FILE" +#define HID_SVX_MAILMENU_OPEN "SVX_HID_SVX_MAILMENU_OPEN" +#define HID_SVX_MAILMENU_RENAME "SVX_HID_SVX_MAILMENU_RENAME" +#define HID_SVX_MAILMENU_SAVEAS "SVX_HID_SVX_MAILMENU_SAVEAS" +#define HID_SVX_MAILMENU_SIG1 "SVX_HID_SVX_MAILMENU_SIG1" +#define HID_SVX_MAILMENU_SIG2 "SVX_HID_SVX_MAILMENU_SIG2" +#define HID_SVX_MAILMENU_SIG3 "SVX_HID_SVX_MAILMENU_SIG3" +#define HID_SVX_MAILMENU_SIG4 "SVX_HID_SVX_MAILMENU_SIG4" +#define HID_SVX_MAILTOOLBOX "SVX_HID_SVX_MAILTOOLBOX" +#define HID_SVX_SENDMENU_ENCRYPT "SVX_HID_SVX_SENDMENU_ENCRYPT" +#define HID_SVX_SENDMENU_PLAIN "SVX_HID_SVX_SENDMENU_PLAIN" +#define HID_SVX_SENDMENU_SIGN "SVX_HID_SVX_SENDMENU_SIGN" +#define HID_SVX_SENDMENU_SIGNANDENCRYPT "SVX_HID_SVX_SENDMENU_SIGNANDENCRYPT" +#define HID_SVX_TP_APPEARANCE "SVX_HID_SVX_TP_APPEARANCE" +#define HID_SVX_TP_DESKTOP "SVX_HID_SVX_TP_DESKTOP" #endif diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc index d193652b57fc..e1b785cf3bee 100644 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -317,10 +317,6 @@ #define RID_SVXBMP_3D_FOCAL_LENGTH_09 (RID_SVX_START + 180) #define RID_SVXBMP_3D_FOCAL_LENGTH_10 (RID_SVX_START + 181) -// fuer ToolboxControls Alignment und Drawobjekte -#define RID_SVXTBX_DRAW (RID_SVX_START + 189) -#define RID_SVXTBX_ALIGNMENT (RID_SVX_START + 190) - // Ids fuer Autokorrektur #define RID_SVX_AUTOCORR (RID_SVX_START + 192) diff --git a/svx/inc/svx/exthelpid.hrc b/svx/inc/svx/exthelpid.hrc index 68cd1b224650..4d885e422b70 100644 --- a/svx/inc/svx/exthelpid.hrc +++ b/svx/inc/svx/exthelpid.hrc @@ -37,19 +37,10 @@ // are moved to this exported (delivered) hrc file // Help-Ids -------------------------------------------------------------- -#define HID_GALLERY_ACTUALIZE (HID_SVX_EXT0_START + 0) -#define HID_GALLERY_TITLE (HID_SVX_EXT0_START + 1) +#define HID_GALLERY_ACTUALIZE "SVX_HID_GALLERY_ACTUALIZE" +#define HID_GALLERY_TITLE "SVX_HID_GALLERY_TITLE" // please adjust ACT_SVX_EXT_HID_END2 below if you add entries here! -// ----------------------------------------------------------------------- -// Overrun check --------------------------------------------------------- -// ----------------------------------------------------------------------- - -#define ACT_SVX_EXT_HID_END (HID_SVX_EXT0_START + 1) -#if ACT_SVX_EXT_HID_END > HID_SVX_EXT0_END -#error Resource-Ueberlauf in #line, #file -#endif - #endif diff --git a/svx/inc/svx/simptabl.hxx b/svx/inc/svx/simptabl.hxx index c409ed5b63be..e24dedbdc22c 100644 --- a/svx/inc/svx/simptabl.hxx +++ b/svx/inc/svx/simptabl.hxx @@ -172,8 +172,7 @@ public: void SetHeaderBarDblClickHdl( const Link& rLink ) { aHeaderBarDblClickLink = rLink; } const Link& GetHeaderBarDblClickHdl() const { return aHeaderBarDblClickLink; } - // FIXME: HELPID - void SetHeaderBarHelpId(ULONG /*nHelpId*/) {aHeaderBar.SetHelpId(""/*nHelpId*/);} + void SetHeaderBarHelpId(const rtl::OString& rHelpId) {aHeaderBar.SetHelpId(rHelpId);} }; diff --git a/svx/inc/svx/svxcommands.h b/svx/inc/svx/svxcommands.h new file mode 100644 index 000000000000..54376da62e7b --- /dev/null +++ b/svx/inc/svx/svxcommands.h @@ -0,0 +1,604 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SVX_SVXCOMMANDS_HRC +#define SVX_SVXCOMMANDS_HRC + +#define CMD_SID_INET_DLG ".uno:InternetDialog" +#define CMD_SID_FM_RECORD_ABSOLUTE ".uno:AbsoluteRecord" +#define CMD_SID_FM_ADD_FIELD ".uno:AddField" +#define CMD_SID_FM_ADDTABLE ".uno:AddTable" +#define CMD_SID_OBJECT_ALIGN_CENTER ".uno:AlignCenter" +#define CMD_SID_OBJECT_ALIGN_DOWN ".uno:AlignDown" +#define CMD_SID_OBJECT_ALIGN_LEFT ".uno:ObjectAlignLeft" +#define CMD_SID_ATTR_PARA_ADJUST ".uno:Alignment" +#define CMD_SID_OBJECT_ALIGN_MIDDLE ".uno:AlignMiddle" +#define CMD_SID_OBJECT_ALIGN_RIGHT ".uno:ObjectAlignRight" +#define CMD_SID_OBJECT_ALIGN_UP ".uno:AlignUp" +#define CMD_SID_DRAW_ARC ".uno:Arc" +#define CMD_SID_3D_ASSIGN ".uno:Assign3D" +#define CMD_SID_FM_AUTOCONTROLFOCUS ".uno:AutoControlFocus" +#define CMD_SID_FM_AUTOFILTER ".uno:AutoFilter" +#define CMD_SID_AUTOFORMAT ".uno:AutoFormat" +#define CMD_SID_TABLE_STYLE ".uno:TableStyle" +#define CMD_SID_TABLE_STYLE_SETTINGS ".uno:TableStyleSettings" +#define CMD_SID_TABLEDESIGN ".uno:TableDesign" +#define CMD_SID_BACKGROUND_COLOR ".uno:BackgroundColor" +#define CMD_SID_ATTR_BRUSH ".uno:BackgroundPattern" +#define CMD_SID_BACKGROUND_PATTERN ".uno:BackgroundPatternController" +#define CMD_SID_DRAW_BEZIER_NOFILL ".uno:Bezier_Unfilled" +#define CMD_SID_BEZIER_APPEND ".uno:BezierAppend" +#define CMD_SID_BEZIER_CLOSE ".uno:BezierClose" +#define CMD_SID_BEZIER_CONVERT ".uno:BezierConvert" +#define CMD_SID_BEZIER_CUTLINE ".uno:BezierCutLine" +#define CMD_SID_BEZIER_DELETE ".uno:BezierDelete" +#define CMD_SID_BEZIER_EDGE ".uno:BezierEdge" +#define CMD_SID_BEZIER_ELIMINATE_POINTS ".uno:BezierEliminatePoints" +#define CMD_SID_DRAW_BEZIER_FILL ".uno:BezierFill" +#define CMD_SID_BEZIER_INSERT ".uno:BezierInsert" +#define CMD_SID_BEZIER_MOVE ".uno:BezierMove" +#define CMD_SID_BEZIER_SMOOTH ".uno:BezierSmooth" +#define CMD_SID_BEZIER_SYMMTR ".uno:BezierSymmetric" +#define CMD_SID_BEZIERTO ".uno:BezierTo" +#define CMD_SID_BMPMASK ".uno:BmpMask" +#define CMD_SID_BMPMASK_EXEC ".uno:BmpMaskExec" +#define CMD_SID_BMPMASK_PIPETTE ".uno:BmpMaskPipette" +#define CMD_SID_ATTR_CHAR_WEIGHT ".uno:Bold" +#define CMD_SID_ATTR_CHAR_LATIN_WEIGHT ".uno:BoldLatin" +#define CMD_SID_ATTR_CHAR_CJK_WEIGHT ".uno:BoldCJK" +#define CMD_SID_ATTR_CHAR_CTL_WEIGHT ".uno:BoldCTL" +#define CMD_SID_BORDER_OBJECT ".uno:Border" +#define CMD_SID_ATTR_BORDER_INNER ".uno:BorderInner" +#define CMD_SID_ATTR_BORDER_OUTER ".uno:BorderOuter" +#define CMD_SID_ATTR_BORDER ".uno:SetBorderStyle" +#define CMD_SID_FRAME_TO_TOP ".uno:BringToFront" +#define CMD_SID_DRAW_CAPTION ".uno:DrawCaption" +#define CMD_SID_ATTR_CHAR_CASEMAP ".uno:CaseMap" +#define CMD_SID_ATTR_PARA_ADJUST_CENTER ".uno:CenterPara" +#define CMD_SID_TRANSLITERATE_FULLWIDTH ".uno:ChangeCaseToFullWidth" +#define CMD_SID_TRANSLITERATE_HALFWIDTH ".uno:ChangeCaseToHalfWidth" +#define CMD_SID_TRANSLITERATE_HIRAGANA ".uno:ChangeCaseToHiragana" +#define CMD_SID_TRANSLITERATE_KATAGANA ".uno:ChangeCaseToKatakana" +#define CMD_SID_TRANSLITERATE_LOWER ".uno:ChangeCaseToLower" +#define CMD_SID_TRANSLITERATE_UPPER ".uno:ChangeCaseToUpper" +#define CMD_SID_FM_CHANGECONTROLTYPE ".uno:ChangeControlType" +#define CMD_SID_ATTR_CHAR_FONT ".uno:CharFontName" +#define CMD_SID_ATTR_CHAR_LATIN_FONT ".uno:CharFontNameLatin" +#define CMD_SID_ATTR_CHAR_CJK_FONT ".uno:CharFontNameCJK" +#define CMD_SID_ATTR_CHAR_CTL_FONT ".uno:CharFontNameCTL" +#define CMD_SID_INSERT_CHECKBOX ".uno:Checkbox" +#define CMD_SID_FM_CHECKBOX ".uno:CheckBox" +#define CMD_SID_CHOOSE_CONTROLS ".uno:ChooseControls" +#define CMD_SID_CHOOSE_POLYGON ".uno:ChoosePolygon" +#define CMD_SID_DRAW_CIRCLE ".uno:Circle" +#define CMD_SID_DRAW_CIRCLE_NOFILL ".uno:Circle_Unfilled" +#define CMD_SID_DRAW_CIRCLEARC ".uno:CircleArc" +#define CMD_SID_DRAW_CIRCLECUT ".uno:CircleCut" +#define CMD_SID_DRAW_CIRCLECUT_NOFILL ".uno:CircleCut_Unfilled" +#define CMD_SID_DRAW_CIRCLEPIE ".uno:CirclePie" +#define CMD_SID_DRAW_CIRCLEPIE_NOFILL ".uno:CirclePie_Unfilled" +#define CMD_SID_OUTLINE_DELETEALL ".uno:ClearOutline" +#define CMD_SID_ATTR_CHAR_COLOR ".uno:Color" +#define CMD_SID_COLOR_CONTROL ".uno:ColorControl" +#define CMD_SID_FM_COMBOBOX ".uno:ComboBox" +#define CMD_SID_FM_NAVIGATIONBAR ".uno:NavigationBar" +#define CMD_SID_INSERT_COMBOBOX ".uno:Combobox" +#define CMD_SID_FM_CONFIG ".uno:Config" +#define CMD_SID_FM_MORE_CONTROLS ".uno:MoreControls" +#define CMD_SID_FM_FORM_DESIGN_TOOLS ".uno:FormDesignTools" +#define CMD_SID_CONTOUR_DLG ".uno:ContourDialog" +#define CMD_SID_CONTOUR_EXEC ".uno:ContourExecute" +#define CMD_SID_FM_CTL_PROPERTIES ".uno:ControlProperties" +#define CMD_SID_FM_CONVERTTO_BUTTON ".uno:ConvertToButton" +#define CMD_SID_FM_CONVERTTO_CHECKBOX ".uno:ConvertToCheckBox" +#define CMD_SID_FM_CONVERTTO_COMBOBOX ".uno:ConvertToCombo" +#define CMD_SID_FM_CONVERTTO_CURRENCY ".uno:ConvertToCurrency" +#define CMD_SID_FM_CONVERTTO_DATE ".uno:ConvertToDate" +#define CMD_SID_FM_CONVERTTO_EDIT ".uno:ConvertToEdit" +#define CMD_SID_FM_CONVERTTO_FILECONTROL ".uno:ConvertToFileControl" +#define CMD_SID_FM_CONVERTTO_FIXEDTEXT ".uno:ConvertToFixed" +#define CMD_SID_FM_CONVERTTO_FORMATTED ".uno:ConvertToFormatted" +#define CMD_SID_FM_CONVERTTO_SCROLLBAR ".uno:ConvertToScrollBar" +#define CMD_SID_FM_CONVERTTO_SPINBUTTON ".uno:ConvertToSpinButton" +#define CMD_SID_FM_CONVERTTO_GROUPBOX ".uno:ConvertToGroup" +#define CMD_SID_FM_CONVERTTO_IMAGEBUTTON ".uno:ConvertToImageBtn" +#define CMD_SID_FM_CONVERTTO_IMAGECONTROL ".uno:ConvertToImageControl" +#define CMD_SID_FM_CONVERTTO_LISTBOX ".uno:ConvertToList" +#define CMD_SID_FM_CONVERTTO_NUMERIC ".uno:ConvertToNumeric" +#define CMD_SID_FM_CONVERTTO_PATTERN ".uno:ConvertToPattern" +#define CMD_SID_FM_CONVERTTO_RADIOBUTTON ".uno:ConvertToRadio" +#define CMD_SID_FM_CONVERTTO_TIME ".uno:ConvertToTime" +#define CMD_SID_FM_CONVERTTO_NAVIGATIONBAR ".uno:ConvertToNavigationBar" +#define CMD_SID_FM_COUNTALL ".uno:CountAll" +#define CMD_SID_FM_CREATE_CONTROL ".uno:CreateControl" +#define CMD_SID_INSERT_CURRENCYFIELD ".uno:InsertCurrencyField" +#define CMD_SID_FM_CURRENCYFIELD ".uno:CurrencyField" +#define CMD_SID_DASH ".uno:Dash" +#define CMD_SID_INSERT_DATEFIELD ".uno:AddDateField" +#define CMD_SID_FM_DATEFIELD ".uno:DateField" +#define CMD_FN_NUM_BULLET_ON ".uno:DefaultBullet" +#define CMD_SID_FM_RECORD_DELETE ".uno:DeleteRecord" +#define CMD_SID_FM_DESIGN_MODE ".uno:SwitchControlDesignMode" +#define CMD_SID_DISTRIBUTE_DLG ".uno:DistributeSelection" +#define CMD_SID_DRAW_SELECT ".uno:DrawSelect" +#define CMD_SID_INSERT_DRAW ".uno:InsertDraw" +#define CMD_SID_DSBROWSER_EXPLORER ".uno:DSBrowserExplorer" +#define CMD_SID_FM_EDIT ".uno:Edit" +#define CMD_SID_INSERT_EDIT ".uno:InsertEdit" +#define CMD_SID_DRAW_ELLIPSE ".uno:Ellipse" +#define CMD_SID_DRAW_ELLIPSE_NOFILL ".uno:Ellipse_Unfilled" +#define CMD_SID_DRAW_ELLIPSECUT ".uno:EllipseCut" +#define CMD_SID_DRAW_ELLIPSECUT_NOFILL ".uno:EllipseCut_Unfilled" +#define CMD_SID_ENTER_GROUP ".uno:EnterGroup" +#define CMD_SID_ATTR_CHAR_ESCAPEMENT ".uno:Escapement" +#define CMD_SID_FM_FIELDS_CONTROL ".uno:FieldController" +#define CMD_SID_FM_FILECONTROL ".uno:FileControl" +#define CMD_SID_INSERT_FILECONTROL ".uno:InsertFileControl" +#define CMD_SID_INSERT_TREECONTROL ".uno:InsertTreeControl" +#define CMD_SID_ATTR_FILL_BITMAP ".uno:FillBitmap" +#define CMD_SID_ATTR_FILL_COLOR ".uno:FillColor" +#define CMD_SID_ATTR_FILL_GRADIENT ".uno:FillGradient" +#define CMD_SID_ATTR_FILL_HATCH ".uno:FillHatch" +#define CMD_SID_ATTR_FILL_STYLE ".uno:FillStyle" +#define CMD_SID_FM_FILTERCRIT ".uno:FilterCrit" +#define CMD_SID_FM_RECORD_FIRST ".uno:FirstRecord" +#define CMD_SID_ATTR_FLASH ".uno:Flash" +#define CMD_SID_FM_FMEXPLORER_CONTROL ".uno:FmExplorerController" +#define CMD_SID_FM_FILTER_NAVIGATOR_CONTROL ".uno:FmFilterNavigatorController" +#define CMD_SID_CHAR_DLG ".uno:FontDialog" +#define CMD_SID_ATTR_CHAR_FONTHEIGHT ".uno:FontHeight" +#define CMD_SID_ATTR_CHAR_LATIN_FONTHEIGHT ".uno:FontHeighLatin" +#define CMD_SID_ATTR_CHAR_CJK_FONTHEIGHT ".uno:FontHeightCJK" +#define CMD_SID_ATTR_CHAR_CTL_FONTHEIGHT ".uno:FontHeightCTL" +#define CMD_SID_FONTWORK ".uno:FontWork" +#define CMD_SID_FORMTEXT_ADJUST ".uno:FontWorkTextAdjust" +#define CMD_SID_FORMTEXT_STDFORM ".uno:FontWorkTextClearAttributes" +#define CMD_SID_FORMTEXT_DISTANCE ".uno:FontWorkTextDistance" +#define CMD_SID_FORMTEXT_MIRROR ".uno:FontWorkTextMirror" +#define CMD_SID_FORMTEXT_OUTLINE ".uno:FontWorkTextOutline" +#define CMD_SID_FORMTEXT_SHADOW ".uno:FontWorkTextShadow" +#define CMD_SID_FORMTEXT_SHDWCOLOR ".uno:FontWorkTextShadowColor" +#define CMD_SID_FORMTEXT_SHDWXVAL ".uno:FontWorkTextShadowXVal" +#define CMD_SID_FORMTEXT_SHDWYVAL ".uno:FontWorkTextShadowYVal" +#define CMD_SID_FORMTEXT_START ".uno:FontWorkTextStart" +#define CMD_SID_FORMTEXT_STYLE ".uno:FontWorkTextStyle" +#define CMD_SID_ATTRIBUTES_AREA ".uno:FormatArea" +#define CMD_SID_FORMTEXT_HIDEFORM ".uno:FormatFontWorkClose" +#define CMD_SID_GROUP ".uno:FormatGroup" +#define CMD_SID_ATTRIBUTES_LINE ".uno:FormatLine" +#define CMD_SID_FM_FORMATTEDFIELD ".uno:FormattedField" +#define CMD_SID_FM_SCROLLBAR ".uno:ScrollBar" +#define CMD_SID_FM_SPINBUTTON ".uno:SpinButton" +#define CMD_SID_INSERT_FORMATTEDFIELD ".uno:InsertFormattedField" +#define CMD_SID_UNGROUP ".uno:FormatUngroup" +#define CMD_SID_FM_FILTER_START ".uno:FormFilter" +#define CMD_SID_FM_FORM_FILTERED ".uno:FormFiltered" +#define CMD_SID_FM_FILTER_EXECUTE ".uno:FormFilterExecute" +#define CMD_SID_FM_FILTER_EXIT ".uno:FormFilterExit" +#define CMD_SID_FM_FILTER_NAVIGATOR ".uno:FormFilterNavigator" +#define CMD_SID_FM_PROPERTIES ".uno:FormProperties" +#define CMD_SID_DRAW_FREELINE ".uno:Freeline" +#define CMD_SID_DRAW_FREELINE_NOFILL ".uno:Freeline_Unfilled" +#define CMD_SID_ATTR_AUTO_COLOR_INVALID ".uno:AutoColorInvalid" +#define CMD_SID_GALLERY ".uno:Gallery" +#define CMD_SID_GALLERY_ENABLE_ADDCOPY ".uno:GalleryEnableAddCopy" +#define CMD_SID_GETREDOSTRINGS ".uno:GetRedoStrings" +#define CMD_SID_GETUNDOSTRINGS ".uno:GetUndoStrings" +#define CMD_SID_ATTR_GRAF_CROP ".uno:GrafAttrCrop" +#define CMD_SID_ATTR_GRAF_BLUE ".uno:GrafBlue" +#define CMD_SID_ATTR_GRAF_CONTRAST ".uno:GrafContrast" +#define CMD_SID_ATTR_GRAF_GAMMA ".uno:GrafGamma" +#define CMD_SID_ATTR_GRAF_GREEN ".uno:GrafGreen" +#define CMD_SID_ATTR_GRAF_INVERT ".uno:GrafInvert" +#define CMD_SID_ATTR_GRAF_LUMINANCE ".uno:GrafLuminance" +#define CMD_SID_ATTR_GRAF_MODE ".uno:GrafMode" +#define CMD_SID_ATTR_GRAF_RED ".uno:GrafRed" +#define CMD_SID_ATTR_GRAF_TRANSPARENCE ".uno:GrafTransparence" +#define CMD_SID_GRFFILTER_INVERT ".uno:GraphicFilterInvert" +#define CMD_SID_GRFFILTER_MOSAIC ".uno:GraphicFilterMosaic" +#define CMD_SID_GRFFILTER_POPART ".uno:GraphicFilterPopart" +#define CMD_SID_GRFFILTER_POSTER ".uno:GraphicFilterPoster" +#define CMD_SID_GRFFILTER_EMBOSS ".uno:GraphicFilterRelief" +#define CMD_SID_GRFFILTER_REMOVENOISE ".uno:GraphicFilterRemoveNoise" +#define CMD_SID_GRFFILTER_SEPIA ".uno:GraphicFilterSepia" +#define CMD_SID_GRFFILTER_SHARPEN ".uno:GraphicFilterSharpen" +#define CMD_SID_GRFFILTER_SMOOTH ".uno:GraphicFilterSmooth" +#define CMD_SID_GRFFILTER_SOBEL ".uno:GraphicFilterSobel" +#define CMD_SID_GRFFILTER_SOLARIZE ".uno:GraphicFilterSolarize" +#define CMD_SID_GRFFILTER ".uno:GraphicFilterToolbox" +#define CMD_SID_FM_DBGRID ".uno:Grid" +#define CMD_SID_GRID_USE ".uno:GridUse" +#define CMD_SID_GRID_VISIBLE ".uno:GridVisible" +#define CMD_SID_OUTLINE_MAKE ".uno:Group" +#define CMD_SID_FM_GROUPBOX ".uno:GroupBox" +#define CMD_SID_INSERT_GROUPBOX ".uno:Groupbox" +#define CMD_SID_RULER_LR_MIN_MAX ".uno:HeaderFooterBorder" +#define CMD_SID_HELPLINES_MOVE ".uno:HelplinesMove" +#define CMD_SID_INSERT_HFIXEDLINE ".uno:HFixedLine" +#define CMD_SID_OUTLINE_HIDE ".uno:HideDetail" +#define CMD_SID_INSERT_HSCROLLBAR ".uno:HScrollbar" +#define CMD_SID_HYPERLINK_GETLINK ".uno:Hyperlink" +#define CMD_SID_FM_IMAGEBUTTON ".uno:Imagebutton" +#define CMD_SID_FM_IMAGECONTROL ".uno:ImageControl" +#define CMD_SID_INSERT_IMAGECONTROL ".uno:InsertImageControl" +#define CMD_SID_IMAP ".uno:ImageMapDialog" +#define CMD_SID_IMAP_EXEC ".uno:ImageMapExecute" +#define CMD_SID_3D_INIT ".uno:Init3D" +#define CMD_SID_OBJECTRESIZE ".uno:InPlaceObjectResize" +#define CMD_SID_ENTER_STRING ".uno:EnterString" +#define CMD_SID_INSERT_POSTIT ".uno:InsertAnnotation" +#define CMD_SID_SHOW_POSTIT ".uno:ShowAnnotations" +#define CMD_SID_REPLYTO_POSTIT ".uno:ReplyToAnnotation" +#define CMD_SID_DELETE_POSTIT ".uno:DeleteAnnotation" +#define CMD_SID_DELETEALL_POSTIT ".uno:DeleteAllAnnotation" +#define CMD_SID_DELETEALLBYAUTHOR_POSTIT ".uno:DeleteAllAnnotationByAuthor" +#define CMD_SID_NEXT_POSTIT ".uno:NextAnnotation" +#define CMD_SID_PREVIOUS_POSTIT ".uno:PreviousAnnotation" +#define CMD_SID_INSERT_APPLET ".uno:InsertApplet" +#define CMD_SID_GALLERY_FORMATS ".uno:InsertGalleryPic" +#define CMD_SID_INSERT_GRAPHIC ".uno:InsertGraphic" +#define CMD_SID_INSERT_IMAGE ".uno:InsertImage" +#define CMD_SID_INSERT_MATH ".uno:InsertMath" +#define CMD_SID_ATTR_INSERT ".uno:InsertMode" +#define CMD_FN_NUM_NUMBERING_ON ".uno:DefaultNumbering" +#define CMD_SID_INSERT_OBJECT ".uno:InsertObject" +#define CMD_SID_INSERT_DIAGRAM ".uno:InsertObjectChart" +#define CMD_SID_INSERT_PLUGIN ".uno:InsertPlugin" +#define CMD_SID_INSERT_SOUND ".uno:InsertSound" +#define CMD_SID_CHARMAP ".uno:InsertSymbol" +#define CMD_SID_ATTR_TABLE ".uno:InsertSpreadsheet" +#define CMD_SID_INSERT_TABLE ".uno:InsertTable" +#define CMD_SID_INSERT_FRAME ".uno:InsertTextFrame" +#define CMD_SID_INSERT_VIDEO ".uno:InsertVideo" +#define CMD_SID_POLY_INTERSECT ".uno:Intersect" +#define CMD_SID_ATTR_CHAR_POSTURE ".uno:Italic" +#define CMD_SID_ATTR_CHAR_LATIN_POSTURE ".uno:ItalicLatin" +#define CMD_SID_ATTR_CHAR_CJK_POSTURE ".uno:ItalicCJK" +#define CMD_SID_ATTR_CHAR_CTL_POSTURE ".uno:ItalicCTL" +#define CMD_SID_ATTR_PARA_ADJUST_BLOCK ".uno:JustifyPara" +#define CMD_SID_INSERT_FIXEDTEXT ".uno:InsertFixedText" +#define CMD_SID_FM_FIXEDTEXT ".uno:Label" +#define CMD_SID_ATTR_CHAR_LANGUAGE ".uno:Language" +#define CMD_SID_ATTR_CHAR_LATIN_LANGUAGE ".uno:LanguageLatin" +#define CMD_SID_FM_RECORD_LAST ".uno:LastRecord" +#define CMD_SID_FM_LEAVE_CREATE ".uno:LeaveFMCreateMode" +#define CMD_SID_LEAVE_GROUP ".uno:LeaveGroup" +#define CMD_SID_ATTR_PARA_ADJUST_LEFT ".uno:LeftPara" +#define CMD_SID_ATTR_LRSPACE ".uno:LeftRightMargin" +#define CMD_SID_ATTR_PARA_LRSPACE ".uno:LeftRightParaMargin" +#define CMD_SID_ATTR_PARA_LRSPACE_VERTICAL ".uno:LeftRightParaMargin_Vertical" +#define CMD_SID_DRAW_LINE ".uno:Line" +#define CMD_SID_DRAW_XLINE ".uno:Line_Diagonal" +#define CMD_SID_FRAME_LINECOLOR ".uno:FrameLineColor" +#define CMD_SID_ATTR_LINE_DASH ".uno:LineDash" +#define CMD_SID_ATTR_LINEEND_STYLE ".uno:LineEndStyle" +#define CMD_SID_ATTR_PARA_LINESPACE ".uno:LineSpacing" +#define CMD_SID_FRAME_LINESTYLE ".uno:LineStyle" +#define CMD_SID_ATTR_LINE_WIDTH ".uno:LineWidth" +#define CMD_SID_FM_LISTBOX ".uno:ListBox" +#define CMD_SID_INSERT_LISTBOX ".uno:InsertListbox" +#define CMD_SID_POLY_MERGE ".uno:Merge" +#define CMD_SID_BASICIDE_NEWJAVAMODULE ".uno:NewJavaModule" +#define CMD_SID_FM_RECORD_NEW ".uno:NewRecord" +#define CMD_SID_FM_RECORD_NEXT ".uno:NextRecord" +#define CMD_SID_FM_NUMERICFIELD ".uno:NumericField" +#define CMD_SID_INSERT_NUMERICFIELD ".uno:InsertNumericField" +#define CMD_SID_OBJECT_ALIGN ".uno:ObjectAlign" +#define CMD_SID_FRAME_DOWN ".uno:ObjectBackOne" +#define CMD_SID_FRAME_UP ".uno:ObjectForwardOne" +#define CMD_SID_FM_OPEN_READONLY ".uno:OpenReadOnly" +#define CMD_SID_FM_ORDERCRIT ".uno:OrderCrit" +#define CMD_SID_ATTR_PARA_ORPHANS ".uno:Orphan" +#define CMD_SID_OUTLINE_BULLET ".uno:OutlineBullet" +#define CMD_SID_OUTLINE_COLLAPSE ".uno:OutlineCollapse" +#define CMD_SID_OUTLINE_COLLAPSE_ALL ".uno:OutlineCollapseAll" +#define CMD_SID_OUTLINE_DOWN ".uno:OutlineDown" +#define CMD_SID_OUTLINE_EXPAND ".uno:OutlineExpand" +#define CMD_SID_OUTLINE_EXPAND_ALL ".uno:OutlineExpandAll" +#define CMD_SID_ATTR_CHAR_CONTOUR ".uno:OutlineFont" +#define CMD_SID_OUTLINE_FORMAT ".uno:OutlineFormat" +#define CMD_SID_OUTLINE_LEFT ".uno:OutlineLeft" +#define CMD_SID_OUTLINE_RIGHT ".uno:OutlineRight" +#define CMD_SID_OUTLINE_UP ".uno:OutlineUp" +#define CMD_SID_ATTR_PARA_PAGEBREAK ".uno:Pagebreak" +#define CMD_SID_ATTR_PAGE_PAPERBIN ".uno:PagePaperBin" +#define CMD_SID_ATTR_PAGE_SIZE ".uno:AttributePageSize" +#define CMD_SID_ATTR_PARA_MODEL ".uno:AttributeParaModel" +#define CMD_SID_ATTR_PAGE ".uno:AttributePage" +#define CMD_SID_ATTR_CHAR_AUTOKERN ".uno:PairKerning" +#define CMD_SID_PARA_DLG ".uno:ParagraphDialog" +#define CMD_SID_ATTR_PARA_KEEP ".uno:ParaKeepTogether" +#define CMD_SID_ATTR_PARA_SPLIT ".uno:ParaSplit" +#define CMD_SID_INSERT_PATTERNFIELD ".uno:InsertPatternField" +#define CMD_SID_FM_PATTERNFIELD ".uno:PatternField" +#define CMD_SID_DRAW_PIE ".uno:Pie" +#define CMD_SID_DRAW_PIE_NOFILL ".uno:Pie_Unfilled" +#define CMD_SID_POLY_FORMEN ".uno:PolyFormen" +#define CMD_SID_DRAW_XPOLYGON ".uno:Polygon_Diagonal" +#define CMD_SID_DRAW_XPOLYGON_NOFILL ".uno:Polygon_Diagonal_Unfilled" +#define CMD_SID_DRAW_POLYGON_NOFILL ".uno:Polygon_Unfilled" +#define CMD_SID_ATTR_POSITION ".uno:Position" +#define CMD_SID_INSERT_PREVIEW ".uno:Preview" +#define CMD_SID_FM_RECORD_PREV ".uno:PrevRecord" +#define CMD_SID_INSERT_PROGRESSBAR ".uno:ProgressBar" +#define CMD_SID_FM_PROPERTY_CONTROL ".uno:PropertyController" +#define CMD_SID_FM_PUSHBUTTON ".uno:Pushbutton" +#define CMD_SID_INSERT_PUSHBUTTON ".uno:InsertPushbutton" +#define CMD_SID_INSERT_RADIOBUTTON ".uno:Radiobutton" +#define CMD_SID_FM_RADIOBUTTON ".uno:RadioButton" +#define CMD_SID_READONLY_MODE ".uno:ReadOnlyMode" +#define CMD_SID_FM_RECORD_FROM_TEXT ".uno:RecFromText" +#define CMD_SID_FM_RECORD_SAVE ".uno:RecSave" +#define CMD_SID_FM_SEARCH ".uno:RecSearch" +#define CMD_SID_DRAW_RECT ".uno:Rect" +#define CMD_SID_DRAW_RECT_ROUND ".uno:Rect_Rounded" +#define CMD_SID_DRAW_RECT_ROUND_NOFILL ".uno:Rect_Rounded_Unfilled" +#define CMD_SID_DRAW_RECT_NOFILL ".uno:Rect_Unfilled" +#define CMD_SID_FM_RECORD_TEXT ".uno:RecText" +#define CMD_SID_FM_RECORD_TOTAL ".uno:RecTotal" +#define CMD_SID_FM_RECORD_UNDO ".uno:RecUndo" +#define CMD_SID_FM_REFRESH ".uno:Refresh" +#define CMD_SID_FM_REFRESH_FORM_CONTROL ".uno:RefreshFormControl" +#define CMD_SID_FM_FILTER_REMOVE ".uno:RemoveFilter" +#define CMD_SID_FM_REMOVE_FILTER_SORT ".uno:RemoveFilterSort" +#define CMD_FID_SEARCH_REPLACESET ".uno:ReplaceSet" +#define CMD_SID_ATTR_PARA_ADJUST_RIGHT ".uno:RightPara" +#define CMD_SID_RULER_BORDER_DISTANCE ".uno:RulerBorderDistance" +#define CMD_SID_RULER_BORDERS ".uno:RulerBorders" +#define CMD_SID_RULER_BORDERS_VERTICAL ".uno:RulerBordersVertical" +#define CMD_SID_RULER_NULL_OFFSET ".uno:RulerNullOffset" +#define CMD_SID_RULER_PAGE_POS ".uno:RulerPagePos" +#define CMD_SID_RULER_PROTECT ".uno:RulerProtect" +#define CMD_SID_FM_EXECUTE ".uno:SbaExecuteSql" +#define CMD_SID_FM_NATIVESQL ".uno:SbaNativeSql" +#define CMD_SID_SCAN ".uno:Scan" +#define CMD_SID_SC_EDITOPTIONS ".uno:ScEditOptions" +#define CMD_SID_SCH_EDITOPTIONS ".uno:SchEditOptions" +#define CMD_SID_SD_EDITOPTIONS ".uno:SdEditOptions" +#define CMD_SID_SD_GRAPHIC_OPTIONS ".uno:SdGraphicOptions" +#define CMD_FID_SEARCH_OFF ".uno:SearchOff" +#define CMD_FID_SEARCH_ON ".uno:SearchOn" +#define CMD_FID_SEARCH_SEARCHSET ".uno:SearchSet" +#define CMD_SID_SELECT ".uno:Select" +#define CMD_SID_FRAME_TO_BOTTOM ".uno:SendToBack" +#define CMD_SID_SET_DEFAULT ".uno:SetDefault" +#define CMD_SID_HYPERLINK_SETLINK ".uno:SetHyperlink" +#define CMD_SID_ATTR_PARA_HYPHENZONE ".uno:SetHyphenZone" +#define CMD_SID_ATTR_LONG_LRSPACE ".uno:SetLongLeftRightMargin" +#define CMD_SID_ATTR_LONG_ULSPACE ".uno:SetLongTopBottomMargin" +#define CMD_SID_OBJECT_HELL ".uno:SetObjectToBackground" +#define CMD_SID_OBJECT_HEAVEN ".uno:SetObjectToForeground" +#define CMD_SID_ATTR_PAGE_MAXSIZE ".uno:SetPageMaxSize" +#define CMD_SID_ATTR_BORDER_SHADOW ".uno:BorderShadow" +#define CMD_SID_ATTR_FILL_SHADOW ".uno:FillShadow" +#define CMD_SID_ATTR_CHAR_SHADOWED ".uno:Shadowed" +#define CMD_SID_OUTLINE_SHOW ".uno:ShowDetail" +#define CMD_SID_FM_SHOW_FMEXPLORER ".uno:ShowFmExplorer" +#define CMD_SID_SHOW_ITEMBROWSER ".uno:ShowItemBrowser" +#define CMD_SID_SHOW_PROPERTYBROWSER ".uno:ShowPropBrowser" +#define CMD_SID_FM_SHOW_PROPERTIES ".uno:ShowProperties" +#define CMD_SID_FM_SHOW_PROPERTY_BROWSER ".uno:ShowPropertyBrowser" +#define CMD_SID_RULER ".uno:ShowRuler" +#define CMD_SID_SIM_EDITOPTIONS ".uno:SimEditOptions" +#define CMD_SID_ATTR_SIZE ".uno:Size" +#define CMD_SID_SM_EDITOPTIONS ".uno:SmEditOptions" +#define CMD_SID_FM_SORTDOWN ".uno:SortDown" +#define CMD_SID_FM_SORTUP ".uno:Sortup" +#define CMD_SID_ATTR_PARA_LINESPACE_10 ".uno:SpacePara1" +#define CMD_SID_ATTR_PARA_LINESPACE_15 ".uno:SpacePara15" +#define CMD_SID_ATTR_PARA_LINESPACE_20 ".uno:SpacePara2" +#define CMD_SID_ATTR_CHAR_KERNING ".uno:Spacing" +#define CMD_SID_AUTOSPELL_CHECK ".uno:SpellOnline" +#define CMD_SID_INSERT_SPINBUTTON ".uno:Spinbutton" +#define CMD_SID_DRAW_SQUARE ".uno:Square" +#define CMD_SID_DRAW_SQUARE_ROUND ".uno:Square_Rounded" +#define CMD_SID_DRAW_SQUARE_ROUND_NOFILL ".uno:Square_Rounded_Unfilled" +#define CMD_SID_DRAW_SQUARE_NOFILL ".uno:Square_Unfilled" +#define CMD_SID_3D_STATE ".uno:State3D" +#define CMD_SID_ATTR_CHAR_STRIKEOUT ".uno:Strikeout" +#define CMD_SID_SET_SUB_SCRIPT ".uno:SubScript" +#define CMD_SID_POLY_SUBSTRACT ".uno:Substract" +#define CMD_SID_SET_SUPER_SCRIPT ".uno:SuperScript" +#define CMD_SID_SW_EDITOPTIONS ".uno:SwEditOptions" +#define CMD_SID_FM_TAB_DIALOG ".uno:TabDialog" +#define CMD_SID_ATTR_TABSTOP ".uno:Tabstops" +#define CMD_SID_ATTR_TABSTOP_VERTICAL ".uno:TabstopsVertical" +#define CMD_SID_DIALOG_TESTMODE ".uno:TestMode" +#define CMD_SID_ATTR_CHAR ".uno:Text" +#define CMD_SID_DRAW_TEXT ".uno:DrawText" +#define CMD_SID_DRAW_TEXT_MARQUEE ".uno:Text_Marquee" +#define CMD_SID_TEXTDIRECTION_LEFT_TO_RIGHT ".uno:TextdirectionLeftToRight" +#define CMD_SID_TEXTDIRECTION_TOP_TO_BOTTOM ".uno:TextdirectionTopToBottom" +#define CMD_SID_ATTR_TEXT_FITTOSIZE ".uno:TextFitToSize" +#define CMD_SID_THESAURUS ".uno:Thesaurus" +#define CMD_SID_INSERT_TIMEFIELD ".uno:InsertTimeField" +#define CMD_SID_FM_TIMEFIELD ".uno:TimeField" +#define CMD_SID_BEZIER_EDIT ".uno:ToggleObjectBezierMode" +#define CMD_SID_OBJECT_ROTATE ".uno:ToggleObjectRotateMode" +#define CMD_SID_TEXTEDIT ".uno:ToolEdit" +#define CMD_SID_OBJECT_SELECT ".uno:SelectObject" +#define CMD_SID_ATTR_ULSPACE ".uno:TopBottomMargin" +#define CMD_SID_ATTR_TRANSFORM ".uno:TransformDialog" +#define CMD_SID_TWAIN_SELECT ".uno:TwainSelect" +#define CMD_SID_TWAIN_TRANSFER ".uno:TwainTransfer" +#define CMD_SID_ATTR_CHAR_UNDERLINE ".uno:Underline" +#define CMD_SID_ATTR_CHAR_OVERLINE ".uno:Overline" +#define CMD_SID_OUTLINE_REMOVE ".uno:Ungroup" +#define CMD_SID_INSERT_URLBUTTON ".uno:URLButton" +#define CMD_SID_FM_USE_WIZARDS ".uno:UseWizards" +#define CMD_SID_DRAW_CAPTION_VERTICAL ".uno:VerticalCaption" +#define CMD_SID_DRAW_TEXT_VERTICAL ".uno:VerticalText" +#define CMD_SID_INSERT_VFIXEDLINE ".uno:VFixedLine" +#define CMD_SID_FM_VIEW_AS_GRID ".uno:ViewFormAsGrid" +#define CMD_SID_INSERT_VSCROLLBAR ".uno:VScrollbar" +#define CMD_SID_ATTR_PARA_WIDOWS ".uno:Widow" +#define CMD_SID_3D_WIN ".uno:Window3D" +#define CMD_SID_ATTR_CHAR_WORDLINEMODE ".uno:WordMode" +#define CMD_SID_ATTR_LINE_COLOR ".uno:XLineColor" +#define CMD_SID_ATTR_LINE_STYLE ".uno:XLineStyle" +#define CMD_SID_ATTR_ZOOM ".uno:Zoom" +#define CMD_SID_SIZE_REAL ".uno:Zoom100Percent" +#define CMD_SID_SIZE_OPTIMAL ".uno:ZoomObjects" +#define CMD_SID_SIZE_ALL ".uno:ZoomOptimal" +#define CMD_SID_SIZE_PAGE ".uno:ZoomPage" +#define CMD_SID_SIZE_PAGE_WIDTH ".uno:ZoomPageWidth" +#define CMD_SID_SIZE_VISAREA ".uno:ZoomVisArea" +#define CMD_SID_FM_GRABCONTROLFOCUS ".uno:GrabControlFocus" +#define CMD_SID_FM_CREATE_FIELDCONTROL ".uno:CreateFieldControl" +#define CMD_SID_INSERT_SELECT ".uno:SelectMode" +#define CMD_SID_PARA_VERTALIGN ".uno:VerticalParagraphAlignment" +#define CMD_SID_ATTR_CHAR_RELIEF ".uno:CharacterRelief" +#define CMD_SID_ATTR_BRUSH_CHAR ".uno:CharacterBackgroundPattern" +#define CMD_SID_ATTR_CHAR_ROTATED ".uno:CharacterRotation" +#define CMD_SID_ATTR_CHAR_SCALEWIDTH ".uno:CharacterWidthScalingFactor" +#define CMD_SID_ATTR_NUMBERFORMAT_VALUE ".uno:NumberFormatValue" +#define CMD_SID_ATTR_ALIGN_HOR_JUSTIFY ".uno:HorizontalJustification" +#define CMD_SID_ATTR_ALIGN_VER_JUSTIFY ".uno:VerticalJustification" +#define CMD_SID_ATTR_ALIGN_INDENT ".uno:AlignmentIndent" +#define CMD_SID_ATTR_ALIGN_HYPHENATION ".uno:AlignmentHyphenation" +#define CMD_SID_ATTR_ALIGN_DEGREES ".uno:AlignmentRotation" +#define CMD_SID_ATTR_ALIGN_LOCKPOS ".uno:AlignmentRotationMode" +#define CMD_SID_ATTR_ALIGN_MARGIN ".uno:AlignmentMargin" +#define CMD_SID_ATTR_ALIGN_STACKED ".uno:AlignmentStacked" +#define CMD_SID_ATTR_PARA_LEFT_TO_RIGHT ".uno:ParaLeftToRight" +#define CMD_SID_ATTR_PARA_RIGHT_TO_LEFT ".uno:ParaRightToLeft" +#define CMD_SID_RULER_TEXT_RIGHT_TO_LEFT ".uno:TextRTL" +#define CMD_SID_OPEN_HYPERLINK ".uno:OpenHyperlinkOnCursor" +#define CMD_SID_CTLFONT_STATE ".uno:CTLFontState" +#define CMD_SID_VERTICALTEXT_STATE ".uno:VerticalTextState" +#define CMD_SID_OPEN_XML_FILTERSETTINGS ".uno:OpenXMLFilterSettings" +#define CMD_SID_HANGUL_HANJA_CONVERSION ".uno:HangulHanjaConversion" +#define CMD_SID_CHINESE_CONVERSION ".uno:ChineseConversion" +#define CMD_SID_SPELL_DIALOG ".uno:SpellDialog" +#define CMD_SID_RULER_ROWS ".uno:RulerRows" +#define CMD_SID_RULER_ROWS_VERTICAL ".uno:RulerRowsVertical" +#define CMD_SID_ATTR_CHAR_FONTLIST ".uno:FontNameList" +#define CMD_SID_EXTRUSION_TOOGLE ".uno:ExtrusionToggle" +#define CMD_SID_EXTRUSION_TILT_DOWN ".uno:ExtrusionTiltDown" +#define CMD_SID_EXTRUSION_TILT_UP ".uno:ExtrusionTiltUp" +#define CMD_SID_EXTRUSION_TILT_LEFT ".uno:ExtrusionTiltLeft" +#define CMD_SID_EXTRUSION_TILT_RIGHT ".uno:ExtrusionTiltRight" +#define CMD_SID_EXTRUSION_DEPTH_FLOATER ".uno:ExtrusionDepthFloater" +#define CMD_SID_EXTRUSION_DEPTH_DIALOG ".uno:ExtrusionDepthDialog" +#define CMD_SID_EXTRUSION_DIRECTION_FLOATER ".uno:ExtrusionDirectionFloater" +#define CMD_SID_EXTRUSION_LIGHTING_FLOATER ".uno:ExtrusionLightingFloater" +#define CMD_SID_EXTRUSION_SURFACE_FLOATER ".uno:ExtrusionSurfaceFloater" +#define CMD_SID_EXTRUSION_3D_COLOR ".uno:Extrusion3DColor" +#define CMD_SID_EXTRUSION_DEPTH ".uno:ExtrusionDepth" +#define CMD_SID_EXTRUSION_DIRECTION ".uno:ExtrusionDirection" +#define CMD_SID_EXTRUSION_PROJECTION ".uno:ExtrusionProjection" +#define CMD_SID_EXTRUSION_LIGHTING_DIRECTION ".uno:ExtrusionLightingDirection" +#define CMD_SID_EXTRUSION_LIGHTING_INTENSITY ".uno:ExtrusionLightingIntensity" +#define CMD_SID_EXTRUSION_SURFACE ".uno:ExtrusionSurface" +#define CMD_SID_FONTWORK_GALLERY_FLOATER ".uno:FontworkGalleryFloater" +#define CMD_SID_FONTWORK_SHAPE_TYPE ".uno:FontworkShapeType" +#define CMD_SID_FONTWORK_SAME_LETTER_HEIGHTS ".uno:FontworkSameLetterHeights" +#define CMD_SID_FONTWORK_ALIGNMENT_FLOATER ".uno:FontworkAlignmentFloater" +#define CMD_SID_FONTWORK_CHARACTER_SPACING_FLOATER ".uno:FontworkCharacterSpacingFloater" +#define CMD_SID_FONTWORK_SHAPE ".uno:FontworkShape" +#define CMD_SID_FONTWORK_ALIGNMENT ".uno:FontworkAlignment" +#define CMD_SID_FONTWORK_CHARACTER_SPACING ".uno:FontworkCharacterSpacing" +#define CMD_SID_FONTWORK_CHARACTER_SPACING_DIALOG ".uno:FontworkCharacterSpacingDialog" +#define CMD_SID_FONTWORK_KERN_CHARACTER_PAIRS ".uno:FontworkKernCharacterPairs" +#define CMD_SID_GET_COLORTABLE ".uno:GetColorTable" +#define CMD_SID_SPELLCHECKER_CHANGED ".uno:SpellCheckerChanged" +#define CMD_SID_ATTR_YEAR2000 ".uno:Year2000" +#define CMD_SID_INC_INDENT ".uno:IncrementIndent" +#define CMD_SID_DEC_INDENT ".uno:DecrementIndent" +#define CMD_SID_TABLE_CELL ".uno:StateTableCell" +#define CMD_SID_OUTLINE_TO_IMPRESS ".uno:SendOutlineToImpress" +#define CMD_SID_ATTR_DEFTABSTOP ".uno:DefTabStop" +#define CMD_SID_ATTR_LANGUAGE ".uno:DocumentLanguage" +#define CMD_SID_ATTR_CHAR_CJK_LANGUAGE ".uno:DocumentLanguageCJK" +#define CMD_SID_ATTR_CHAR_CTL_LANGUAGE ".uno:DocumentLanguageCTL" +#define CMD_SID_OPT_LOCALE_CHANGED ".uno:OptionsLocaleChanged" +#define CMD_SID_SBA_BRW_INSERT ".uno:SbaBrwInsert" +#define CMD_SID_DRAWTBX_CS_BASIC ".uno:BasicShapes" +#define CMD_SID_DRAWTBX_CS_SYMBOL ".uno:SymbolShapes" +#define CMD_SID_DRAWTBX_CS_ARROW ".uno:ArrowShapes" +#define CMD_SID_DRAWTBX_CS_FLOWCHART ".uno:FlowChartShapes" +#define CMD_SID_DRAWTBX_CS_CALLOUT ".uno:CalloutShapes" +#define CMD_SID_DRAWTBX_CS_STAR ".uno:StarShapes" +#define CMD_SID_DRAW_CS_ID ".uno:CustomShape" +#define CMD_SID_DASH_LIST ".uno:DashListState" +#define CMD_SID_LINEEND_LIST ".uno:LineEndListState" +#define CMD_SID_COLOR_TABLE ".uno:ColorTableState" +#define CMD_SID_GRADIENT_LIST ".uno:GradientListState" +#define CMD_SID_HATCH_LIST ".uno:HatchListState" +#define CMD_SID_BITMAP_LIST ".uno:BitmapListState" +#define CMD_SID_ATTR_CHAR_EMPHASISMARK ".uno:EmphasisMark" +#define CMD_SID_FM_SHOW_DATANAVIGATOR ".uno:ShowDataNavigator" +#define CMD_SID_FM_DATANAVIGATOR_CONTROL ".uno:FmDataNavigatorController" +#define CMD_SID_ALIGN_ANY_LEFT ".uno:CommonAlignLeft" +#define CMD_SID_ALIGN_ANY_HCENTER ".uno:CommonAlignHorizontalCenter" +#define CMD_SID_ALIGN_ANY_RIGHT ".uno:CommonAlignRight" +#define CMD_SID_ALIGN_ANY_JUSTIFIED ".uno:CommonAlignJustified" +#define CMD_SID_ALIGN_ANY_TOP ".uno:CommonAlignTop" +#define CMD_SID_ALIGN_ANY_VCENTER ".uno:CommonAlignVerticalCenter" +#define CMD_SID_ALIGN_ANY_BOTTOM ".uno:CommonAlignBottom" +#define CMD_SID_ALIGN_ANY_HDEFAULT ".uno:CommonAlignHorizontalDefault" +#define CMD_SID_ALIGN_ANY_VDEFAULT ".uno:CommonAlignVerticalDefault" +#define CMD_SID_AVMEDIA_TOOLBOX ".uno:AVMediaToolBox" +#define CMD_SID_BORDER_REDUCED_MODE ".uno:BorderReducedMode" +#define CMD_SID_COLOR_SETTINGS ".uno:ColorSettings" +#define CMD_SID_MAIL_EXPORT_FINISHED ".uno:MailExportFinished" +#define CMD_SID_INSERT_ZWSP ".uno:InsertZWSP" +#define CMD_SID_INSERT_ZWNBSP ".uno:InsertZWNBSP" +#define CMD_SID_INSERT_LRM ".uno:InsertLRM" +#define CMD_SID_INSERT_RLM ".uno:InsertRLM" +#define CMD_FN_INSERT_SOFT_HYPHEN ".uno:InsertSoftHyphen" +#define CMD_FN_INSERT_HARDHYPHEN ".uno:InsertHardHyphen" +#define CMD_FN_INSERT_HARD_SPACE ".uno:InsertNonBreakingSpace" +#define CMD_SID_BASICIDE_MANAGE_LANG ".uno:ManageLanguage" +#define CMD_SID_BASICIDE_CURRENT_LANG ".uno:CurrentLanguage" +#define CMD_SID_TABLE_MERGE_CELLS ".uno:MergeCells" +#define CMD_SID_TABLE_SPLIT_CELLS ".uno:SplitCell" +#define CMD_SID_OPTIMIZE_TABLE ".uno:OptimizeTable" +#define CMD_SID_TABLE_VERT_BOTTOM ".uno:CellVertBottom" +#define CMD_SID_TABLE_VERT_CENTER ".uno:CellVertCenter" +#define CMD_SID_TABLE_VERT_NONE ".uno:CellVertTop" +#define CMD_SID_TABLE_INSERT_ROW ".uno:InsertRows" +#define CMD_SID_TABLE_INSERT_COL ".uno:InsertColumns" +#define CMD_SID_TABLE_DELETE_ROW ".uno:DeleteRows" +#define CMD_SID_TABLE_DELETE_COL ".uno:DeleteColumns" +#define CMD_SID_TABLE_SELECT_ALL ".uno:SelectTable" +#define CMD_SID_TABLE_SELECT_COL ".uno:EntireColumn" +#define CMD_SID_TABLE_SELECT_ROW ".uno:EntireRow" +#define CMD_SID_FORMAT_TABLE_DLG ".uno:TableDialog" +#define CMD_SID_TABLE_AUTOSUM ".uno:AutoSum" +#define CMD_SID_TABLE_SORT_DIALOG ".uno:TableSort" +#define CMD_SID_OPEN_SMARTTAGMENU ".uno:OpenSmartTagMenuOnCursor" +#define CMD_SID_ATTR_ZOOMSLIDER ".uno:ZoomSlider" +#define CMD_SID_FONTNAMELIST ".uno:FontNameStringList" +#define CMD_SID_LANGUAGE_STATUS ".uno:LanguageStatus" +#define CMD_SID_CHAR_DLG_FOR_PARAGRAPH ".uno:FontDialogForParagraph" +#define CMD_SID_GROW_FONT_SIZE ".uno:Grow" +#define CMD_SID_SHRINK_FONT_SIZE ".uno:Shrink" +#define CMD_SID_RECHECK_DOCUMENT ".uno:RecheckDocument" +#define CMD_SID_TABLE_INSERT_COL_DLG ".uno:InsertColumnDialog" +#define CMD_SID_TABLE_INSERT_ROW_DLG ".uno:InsertRowDialog" + +#endif diff --git a/svx/inc/svx/svxdlg.hxx b/svx/inc/svx/svxdlg.hxx index df11041b38a8..983a048a4ff7 100644 --- a/svx/inc/svx/svxdlg.hxx +++ b/svx/inc/svx/svxdlg.hxx @@ -195,9 +195,9 @@ class AbstractSvxNameDialog :public VclAbstractDialog //add for SvxNameDialog public: virtual void GetName( String& rName ) = 0; virtual void SetCheckNameHdl( const Link& rLink, bool bCheckImmediately = false ) = 0; - virtual void SetEditHelpId(ULONG nHelpId) = 0; + virtual void SetEditHelpId(const rtl::OString&) = 0; //from class Window - virtual void SetHelpId( ULONG nHelpId ) = 0; + virtual void SetHelpId( const rtl::OString& ) = 0; virtual void SetText( const XubString& rStr ) = 0; }; @@ -243,7 +243,7 @@ public: //from SvxMultiPathDialog virtual void SetClassPathMode() = 0; //From Class Window - virtual void SetHelpId( ULONG nHelpId ) = 0; + virtual void SetHelpId( const rtl::OString& ) = 0; }; class AbstractSvxHpLinkDlg : public VclAbstractDialog //add for SvxHpLinkDlg @@ -500,7 +500,7 @@ public: virtual SvxAbstractNewTableDialog* CreateSvxNewTableDialog( Window* pParent ) = 0; - virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, ULONG nHelpId ) = 0; + virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( Window* pParent, bool bCol, const rtl::OString& sHelpId ) = 0; }; #endif diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 7d2f508d9d21..24dfe87f78e4 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -18,6 +18,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\global\accelerator\es ..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res mkdir: %_DEST%\inc%_EXT%\svx +..\inc\svx\svxcommands.h %_DEST%\inc%_EXT%\svx\svxcommands.h ..\sdi\svx.sdi %_DEST%\inc%_EXT%\svx\svx.sdi ..\sdi\svxitems.sdi %_DEST%\inc%_EXT%\svx\svxitems.sdi ..\sdi\xoitems.sdi %_DEST%\inc%_EXT%\svx\xoitems.sdi diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src index 445a46025dd0..e65ce8c119aa 100644 --- a/svx/source/dialog/bmpmask.src +++ b/svx/source/dialog/bmpmask.src @@ -37,7 +37,7 @@ // RID_SVXDLG_BMPMASK ---------------------------------------------------- DockingWindow RID_SVXDLG_BMPMASK { - HelpId = SID_BMPMASK ; + HelpId = CMD_SID_BMPMASK ; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index 124f7fdd2910..503814823467 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -636,8 +636,7 @@ SvxTPView::SvxTPView( Window * pParent) { FreeResource(); - // FIXME: HELPID - aViewData.SetHelpId(""/*HID_REDLINING_VIEW_DG_VIEW_TABLE*/); + aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE); aViewData.SetHeaderBarHelpId(HID_REDLINING_VIEW_DG_VIEW_HEADER); aMinSize=GetSizePixel(); @@ -1178,15 +1177,13 @@ void SvxTPFilter::ShowAction(BOOL bShow) { aCbRange.Hide(); aLbAction.Hide(); - // FIXME: HELPID - aCbRange.SetHelpId(""/*HID_REDLINING_FILTER_CB_RANGE*/); + aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_RANGE); } else { HideRange(); aCbRange.SetText(aActionStr); - // FIXME: HELPID - aCbRange.SetHelpId(""/*HID_REDLINING_FILTER_CB_ACTION*/); + aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_ACTION); aCbRange.Show(); aLbAction.Show(); @@ -1402,8 +1399,7 @@ SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, WinBits nWinStyle) aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); aTCAccept.SetTabPage( TP_VIEW, pTPView); aTCAccept.SetTabPage( TP_FILTER, pTPFilter); - // FIXME: HELPID - aTCAccept.SetHelpId(""/*HID_REDLINING_TABCONTROL*/); + aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); aTCAccept.SetTabPageSizePixel(aMinSize); Size aSize=aTCAccept.GetSizePixel(); @@ -1430,8 +1426,7 @@ SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, const ResId& rResId ) aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); aTCAccept.SetTabPage( TP_VIEW, pTPView); aTCAccept.SetTabPage( TP_FILTER, pTPFilter); - // FIXME: HELPID - aTCAccept.SetHelpId(""/*HID_REDLINING_TABCONTROL*/); + aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); aTCAccept.SetTabPageSizePixel(aMinSize); Size aSize=aTCAccept.GetSizePixel(); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 6437b193a793..95c27a5dcec8 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -1009,12 +1009,9 @@ SvxLightCtl3D::SvxLightCtl3D( Window* pParent, WinBits nStyle ) void SvxLightCtl3D::Init() { // #i58240# set HelpIDs for scrollbars and switcher - // FIXME: HELPID - maHorScroller.SetHelpId(""/*HID_CTRL3D_HSCROLL*/); - // FIXME: HELPID - maVerScroller.SetHelpId(""/*HID_CTRL3D_VSCROLL*/); - // FIXME: HELPID - maSwitcher.SetHelpId(""/*HID_CTRL3D_SWITCHER*/); + maHorScroller.SetHelpId(HID_CTRL3D_HSCROLL); + maVerScroller.SetHelpId(HID_CTRL3D_VSCROLL); + maSwitcher.SetHelpId(HID_CTRL3D_SWITCHER); // Light preview maLightControl.Show(); diff --git a/svx/source/dialog/fontwork.src b/svx/source/dialog/fontwork.src index b0c63d9313d4..c6239dc5ef09 100644 --- a/svx/source/dialog/fontwork.src +++ b/svx/source/dialog/fontwork.src @@ -34,7 +34,7 @@ // RID_SVXDLG_FONTWORK --------------------------------------------------- DockingWindow RID_SVXDLG_FONTWORK { - HelpId = SID_FONTWORK ; + HelpId = CMD_SID_FONTWORK ; OutputSize = TRUE ; SVLook = TRUE ; Hide = TRUE ; diff --git a/svx/source/dialog/hyprlink.src b/svx/source/dialog/hyprlink.src index abefc7832d8b..c59a2f8eb52a 100644 --- a/svx/source/dialog/hyprlink.src +++ b/svx/source/dialog/hyprlink.src @@ -98,7 +98,7 @@ ToolBox RID_SVXDLG_HYPERLINK }; ToolBoxItem { - HelpID = SID_HYPERLINK_SETLINK ; + HelpID = CMD_SID_HYPERLINK_SETLINK ; Identifier = BTN_LINK ; Disable = TRUE ; DropDown = TRUE ; @@ -106,7 +106,7 @@ ToolBox RID_SVXDLG_HYPERLINK }; ToolBoxItem { - HelpID = SID_CREATELINK ; + HelpID = CMD_SID_CREATELINK ; Identifier = BTN_INSERT_BOOKMARK ; Disable = TRUE ; Hide = TRUE; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 5f3aa24394a3..8e717b309151 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -427,7 +427,7 @@ void lcl_MoveDown( Window& rWindow, sal_Int32 nOffset ) void SvxSearchDialog::Construct_Impl() { #if ENABLE_LAYOUT - SetHelpId (SID_SEARCH_DLG); + SetHelpId (".uno:SearchDialog"); #endif /* ENABLE_LAYOUT */ // temporary to avoid incompatibility diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src index 52c91d17587d..a724edbe28bb 100644 --- a/svx/source/dialog/srchdlg.src +++ b/svx/source/dialog/srchdlg.src @@ -29,6 +29,7 @@ #include #include "srchdlg.hrc" +#include #define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } ; @@ -51,7 +52,7 @@ String RID_SVXSTR_REPLACE ModelessDialog RID_SVXDLG_SEARCH { - HelpId = SID_SEARCH_DLG ; + HelpId = CMD_SID_SEARCH_DLG ; OutputSize = TRUE ; Hide = TRUE ; SvLook = TRUE ; diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src index b3e8992f4338..3e80dc9fe485 100644 --- a/svx/source/engine3d/float3d.src +++ b/svx/source/engine3d/float3d.src @@ -27,6 +27,8 @@ #include #include "float3d.hrc" +#include + #define WIDTH 158 #define HEIGHT 209 #define BORDER 3 @@ -64,7 +66,7 @@ DockingWindow RID_SVXFLOAT_3D { - HelpID = SID_3D_WIN ; + HelpID = CMD_SID_3D_WIN ; Border = TRUE ; Hide = TRUE ; SVLook = TRUE ; diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index fe6a2372b7a0..9d596d529774 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1977,10 +1977,7 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V String sPattern; sPattern.AssignAscii("HID:"); if (sHelpURL.Equals(sPattern, 0, sPattern.Len())) - { - // FIXME: HELPID - pGrid->SetHelpId(rtl::OUStringToOString(sHelpURL, RTL_TEXTENCODING_UTF8)); - } + pGrid->SetHelpId(rtl::OUStringToOString(sHelpURL, RTL_TEXTENCODING_UTF8)); } else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) { diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 2c63880afd05..8cc52e4c0b7d 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -366,20 +366,13 @@ DbGridControl::NavigationBar::NavigationBar(Window* pParent, WinBits nStyle) m_aLastBtn.SetSymbol(SYMBOL_LAST); m_aNewBtn.SetModeImage(((DbGridControl*)pParent)->GetImage(DbGridControl_Base::NEW)); - // FIXME: HELPID - m_aFirstBtn.SetHelpId(""/*HID_GRID_TRAVEL_FIRST*/); - // FIXME: HELPID - m_aPrevBtn.SetHelpId(""/*HID_GRID_TRAVEL_PREV*/); - // FIXME: HELPID - m_aNextBtn.SetHelpId(""/*HID_GRID_TRAVEL_NEXT*/); - // FIXME: HELPID - m_aLastBtn.SetHelpId(""/*HID_GRID_TRAVEL_LAST*/); - // FIXME: HELPID - m_aNewBtn.SetHelpId(""/*HID_GRID_TRAVEL_NEW*/); - // FIXME: HELPID - m_aAbsolute.SetHelpId(""/*HID_GRID_TRAVEL_ABSOLUTE*/); - // FIXME: HELPID - m_aRecordCount.SetHelpId(""/*HID_GRID_NUMBEROFRECORDS*/); + m_aFirstBtn.SetHelpId(HID_GRID_TRAVEL_FIRST); + m_aPrevBtn.SetHelpId(HID_GRID_TRAVEL_PREV); + m_aNextBtn.SetHelpId(HID_GRID_TRAVEL_NEXT); + m_aLastBtn.SetHelpId(HID_GRID_TRAVEL_LAST); + m_aNewBtn.SetHelpId(HID_GRID_TRAVEL_NEW); + m_aAbsolute.SetHelpId(HID_GRID_TRAVEL_ABSOLUTE); + m_aRecordCount.SetHelpId(HID_GRID_NUMBEROFRECORDS); // Handler fuer Buttons einrichten m_aFirstBtn.SetClickHdl(LINK(this,NavigationBar,OnClick)); diff --git a/svx/source/fmcomp/gridctrl.src b/svx/source/fmcomp/gridctrl.src index e974f5b28b1a..60e43a19f41e 100644 --- a/svx/source/fmcomp/gridctrl.src +++ b/svx/source/fmcomp/gridctrl.src @@ -29,6 +29,8 @@ #include #include "globlmn.hrc" #include "fmhelp.hrc" +#include + Menu RID_SVXMNU_ROWS { ItemList = @@ -36,19 +38,19 @@ Menu RID_SVXMNU_ROWS MenuItem { Identifier = SID_FM_DELETEROWS ; - HelpID = SID_FM_DELETEROWS ; +// HelpId = CMD_SID_FM_DELETEROWS ; Text [ en-US ] = "Delete Rows" ; }; MenuItem { Identifier = SID_FM_RECORD_SAVE ; - HelpID = SID_FM_RECORD_SAVE ; + HelpId = CMD_SID_FM_RECORD_SAVE ; Text [ en-US ] = "Save Record" ; }; MenuItem { Identifier = SID_FM_RECORD_UNDO ; - HelpID = SID_FM_RECORD_UNDO ; + HelpId = CMD_SID_FM_RECORD_UNDO ; Text [ en-US ] = "Undo: Data entry" ; }; }; @@ -60,7 +62,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_INSERTCOL ; - HelpID = SID_FM_INSERTCOL ; +// HelpId = CMD_SID_FM_INSERTCOL ; Text [ en-US ] = "Insert ~Column" ; SubMenu = Menu { @@ -69,61 +71,61 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_EDIT ; - HelpID = SID_FM_EDIT ; + HelpId = CMD_SID_FM_EDIT ; Text [ en-US ] = "Text Box" ; }; MenuItem { Identifier = SID_FM_CHECKBOX ; - HelpID = SID_FM_CHECKBOX ; + HelpId = CMD_SID_FM_CHECKBOX ; Text [ en-US ] = "Check Box" ; }; MenuItem { Identifier = SID_FM_COMBOBOX ; - HelpID = SID_FM_COMBOBOX ; + HelpId = CMD_SID_FM_COMBOBOX ; Text [ en-US ] = "Combo Box" ; }; MenuItem { Identifier = SID_FM_LISTBOX ; - HelpID = SID_FM_LISTBOX ; + HelpId = CMD_SID_FM_LISTBOX ; Text [ en-US ] = "List Box" ; }; MenuItem { Identifier = SID_FM_DATEFIELD ; - HelpID = SID_FM_DATEFIELD ; + HelpId = CMD_SID_FM_DATEFIELD ; Text [ en-US ] = "Date Field" ; }; MenuItem { Identifier = SID_FM_TIMEFIELD ; - HelpID = SID_FM_TIMEFIELD ; + HelpId = CMD_SID_FM_TIMEFIELD ; Text [ en-US ] = "Time Field" ; }; MenuItem { Identifier = SID_FM_NUMERICFIELD ; - HelpID = SID_FM_NUMERICFIELD ; + HelpId = CMD_SID_FM_NUMERICFIELD ; Text [ en-US ] = "Numeric Field" ; }; MenuItem { Identifier = SID_FM_CURRENCYFIELD ; - HelpID = SID_FM_CURRENCYFIELD ; + HelpId = CMD_SID_FM_CURRENCYFIELD ; Text [ en-US ] = "Currency Field" ; }; MenuItem { Identifier = SID_FM_PATTERNFIELD ; - HelpID = SID_FM_PATTERNFIELD ; + HelpId = CMD_SID_FM_PATTERNFIELD ; Text [ en-US ] = "Pattern Field" ; }; MenuItem { Identifier = SID_FM_FORMATTEDFIELD ; - HelpID = SID_FM_FORMATTEDFIELD ; + HelpId = CMD_SID_FM_FORMATTEDFIELD ; Text [ en-US ] = "Formatted Field" ; }; MenuItem @@ -140,25 +142,25 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_CHANGECOL ; - HelpID = SID_FM_CHANGECOL ; +// HelpId = CMD_SID_FM_CHANGECOL ; Text [ en-US ] = "~Replace with" ; }; MenuItem { Identifier = SID_FM_DELETECOL ; - HelpID = SID_FM_DELETECOL ; +// HelpId = CMD_SID_FM_DELETECOL ; Text [ en-US ] = "Delete Column" ; }; MenuItem { Identifier = SID_FM_HIDECOL ; - HelpID = SID_FM_HIDECOL ; +// HelpId = CMD_SID_FM_HIDECOL ; Text [ en-US ] = "~Hide Column"; }; MenuItem { Identifier = SID_FM_SHOWCOLS ; - HelpID = SID_FM_SHOWCOLS ; +// HelpId = CMD_SID_FM_SHOWCOLS ; SubMenu = Menu { ItemList = @@ -166,7 +168,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_SHOWCOLS_MORE ; - HelpID = SID_FM_SHOWCOLS_MORE ; +// HelpId = CMD_SID_FM_SHOWCOLS_MORE ; Text [ en-US ] = "~More..."; }; MenuItem @@ -176,7 +178,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_SHOWALLCOLS ; - HelpID = SID_FM_SHOWALLCOLS ; +// HelpId = CMD_SID_FM_SHOWALLCOLS ; Text [ en-US ] = "~All"; }; }; @@ -186,7 +188,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_SHOW_PROPERTY_BROWSER ; - HelpID = SID_FM_SHOW_PROPERTY_BROWSER ; + HelpId = CMD_SID_FM_SHOW_PROPERTY_BROWSER ; Text [ en-US ] = "Column..." ; }; }; diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index e3425c00b130..e02e8664c6ac 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -2388,8 +2388,7 @@ namespace svxform { DBG_CTOR(DataNavigator,NULL); - // FIXME: HELPID - SetHelpId( ""/*HID_DATA_NAVIGATOR_WIN*/ ); + SetHelpId( HID_DATA_NAVIGATOR_WIN ); SetText( SVX_RES( RID_STR_DATANAVIGATOR ) ); Size aSize = m_aDataWin.GetOutputSizePixel(); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index c985c34f12f1..9d1b65208fdf 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1168,8 +1168,7 @@ FmFilterNavigator::FmFilterNavigator( Window* pParent ) ,m_aTimerCounter( 0 ) ,m_aDropActionType( DA_SCROLLUP ) { - // FIXME: HELPID - SetHelpId( ""/*HID_FILTER_NAVIGATOR*/ ); + SetHelpId( HID_FILTER_NAVIGATOR ); { { @@ -1942,8 +1941,7 @@ FmFilterNavigatorWin::FmFilterNavigatorWin( SfxBindings* _pBindings, SfxChildWin :SfxDockingWindow( _pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE|WB_ROLLABLE|WB_3DLOOK|WB_DOCKABLE) ) ,SfxControllerItem( SID_FM_FILTER_NAVIGATOR_CONTROL, *_pBindings ) { - // FIXME: HELPID - SetHelpId( ""/*HID_FILTER_NAVIGATOR_WIN*/ ); + SetHelpId( HID_FILTER_NAVIGATOR_WIN ); m_pNavigator = new FmFilterNavigator( this ); m_pNavigator->Show(); diff --git a/svx/source/form/filtnav.src b/svx/source/form/filtnav.src index 82b74e84331c..c03e90df7130 100644 --- a/svx/source/form/filtnav.src +++ b/svx/source/form/filtnav.src @@ -34,25 +34,21 @@ Menu RID_FM_FILTER_MENU MenuItem { Identifier = SID_FM_DELETE ; - HelpID = SID_FM_DELETE ; Text [ en-US ] = "~Delete" ; }; MenuItem { Identifier = SID_FM_FILTER_EDIT ; - HelpID = SID_FM_FILTER_EDIT ; Text [ en-US ] = "~Edit" ; }; MenuItem { Identifier = SID_FM_FILTER_IS_NULL ; - HelpID = SID_FM_FILTER_IS_NULL ; Text [ en-US ] = "~Is Null" ; }; MenuItem { Identifier = SID_FM_FILTER_IS_NOT_NULL ; - HelpID = SID_FM_FILTER_IS_NOT_NULL ; Text [ en-US ] = "I~s not Null" ; }; }; diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx index 939253dec5bb..bcc275896410 100644 --- a/svx/source/form/fmPropBrw.cxx +++ b/svx/source/form/fmPropBrw.cxx @@ -223,8 +223,7 @@ FmPropBrw::FmPropBrw( const Reference< XMultiServiceFactory >& _xORB, SfxBinding ::Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y); SetMinOutputSizePixel(::Size(STD_MIN_SIZE_X,STD_MIN_SIZE_Y)); SetOutputSizePixel(aPropWinSize); - // FIXME: HELPID - SetUniqueId(""/*UID_FORMPROPBROWSER_FRAME*/); + SetUniqueId(UID_FORMPROPBROWSER_FRAME); try { diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index a2e1469418f0..c27b5b69d075 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -592,8 +592,7 @@ namespace svxform ,SfxControllerItem( SID_FM_FMEXPLORER_CONTROL, *_pBindings ) { DBG_CTOR(NavigatorFrame,NULL); - // FIXME: HELPID - SetHelpId( ""/*HID_FORM_NAVIGATOR_WIN*/ ); + SetHelpId( HID_FORM_NAVIGATOR_WIN ); m_pNavigatorTree = new NavigatorTree(comphelper::getProcessServiceFactory(), this ); m_pNavigatorTree->Show(); diff --git a/svx/source/form/fmexpl.src b/svx/source/form/fmexpl.src index 17881727cd5f..d1d8001eeec0 100644 --- a/svx/source/form/fmexpl.src +++ b/svx/source/form/fmexpl.src @@ -29,6 +29,8 @@ #include "fmresids.hrc" #include "fmexpl.hrc" #include "globlmn.hrc" +#include + Menu RID_FMEXPLORER_POPUPMENU { ItemList = @@ -36,7 +38,7 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_NEW ; - HelpID = SID_FM_NEW ; +// HelpId = CMD_SID_FM_NEW ; Text [ en-US ] = "~New" ; SubMenu = Menu { @@ -45,13 +47,13 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_NEW_FORM ; - HelpID = SID_FM_NEW_FORM ; +// HelpId = CMD_SID_FM_NEW_FORM ; Text [ en-US ] = "Form" ; }; MenuItem { Identifier = SID_FM_NEW_HIDDEN ; - HelpID = SID_FM_NEW_HIDDEN ; +// HelpId = CMD_SID_FM_NEW_HIDDEN ; Text [ en-US ] = "Hidden Control" ; }; }; @@ -60,7 +62,7 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_CHANGECONTROLTYPE ; - HelpID = SID_FM_CHANGECONTROLTYPE ; + HelpId = CMD_SID_FM_CHANGECONTROLTYPE ; Text [ en-US ] = "Replace with"; }; MenuItem { ITEM_EDIT_CUT }; @@ -69,37 +71,37 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_DELETE ; - HelpID = SID_FM_DELETE ; +// HelpId = CMD_SID_FM_DELETE ; Text [ en-US ] = "~Delete" ; }; MenuItem { Identifier = SID_FM_TAB_DIALOG ; - HelpID = SID_FM_TAB_DIALOG ; + HelpId = CMD_SID_FM_TAB_DIALOG ; Text [ en-US ] = "Tab Order..." ; }; MenuItem { Identifier = SID_FM_RENAME_OBJECT ; - HelpID = SID_FM_RENAME_OBJECT ; +// HelpId = CMD_SID_FM_RENAME_OBJECT ; Text [ en-US ] = "~Rename" ; }; MenuItem { Identifier = SID_FM_SHOW_PROPERTY_BROWSER ; - HelpID = SID_FM_SHOW_PROPERTY_BROWSER ; + HelpId = CMD_SID_FM_SHOW_PROPERTY_BROWSER ; Text [ en-US ] = "Propert~ies" ; }; MenuItem { Identifier = SID_FM_OPEN_READONLY ; - HelpID = SID_FM_OPEN_READONLY ; + HelpId = CMD_SID_FM_OPEN_READONLY ; Text [ en-US ] = "Open in Design Mode" ; }; MenuItem { Identifier = SID_FM_AUTOCONTROLFOCUS ; - HelpID = SID_FM_AUTOCONTROLFOCUS ; + HelpId = CMD_SID_FM_AUTOCONTROLFOCUS ; Text [ en-US ] = "Automatic Control Focus"; }; }; @@ -112,140 +114,140 @@ Menu RID_FMSHELL_CONVERSIONMENU MenuItem { Identifier = SID_FM_CONVERTTO_EDIT ; - HelpID = SID_FM_CONVERTTO_EDIT ; + HelpId = CMD_SID_FM_CONVERTTO_EDIT ; Command = ".uno:ConvertToEdit" ; Text [ en-US ] = "~Text Box"; }; MenuItem { Identifier = SID_FM_CONVERTTO_BUTTON ; - HelpID = SID_FM_CONVERTTO_BUTTON ; + HelpId = CMD_SID_FM_CONVERTTO_BUTTON ; Command = ".uno:ConvertToButton" ; Text [ en-US ] = "~Button"; }; MenuItem { Identifier = SID_FM_CONVERTTO_FIXEDTEXT ; - HelpID = SID_FM_CONVERTTO_FIXEDTEXT ; + HelpId = CMD_SID_FM_CONVERTTO_FIXEDTEXT ; Command = ".uno:ConvertToFixed" ; Text [ en-US ] = "La~bel field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_GROUPBOX ; - HelpID = SID_FM_CONVERTTO_GROUPBOX ; + HelpId = CMD_SID_FM_CONVERTTO_GROUPBOX ; Command = ".uno:ConvertToGroup" ; Text [ en-US ] = "G~roup Box"; }; MenuItem { Identifier = SID_FM_CONVERTTO_LISTBOX ; - HelpID = SID_FM_CONVERTTO_LISTBOX ; + HelpId = CMD_SID_FM_CONVERTTO_LISTBOX ; Command = ".uno:ConvertToList" ; Text [ en-US ] = "L~ist Box"; }; MenuItem { Identifier = SID_FM_CONVERTTO_CHECKBOX ; - HelpID = SID_FM_CONVERTTO_CHECKBOX ; + HelpId = CMD_SID_FM_CONVERTTO_CHECKBOX ; Command = ".uno:ConvertToCheckBox" ; Text [ en-US ] = "~Check Box"; }; MenuItem { Identifier = SID_FM_CONVERTTO_RADIOBUTTON ; - HelpID = SID_FM_CONVERTTO_RADIOBUTTON ; + HelpId = CMD_SID_FM_CONVERTTO_RADIOBUTTON ; Command = ".uno:ConvertToRadio" ; Text [ en-US ] = "~Radio Button"; }; MenuItem { Identifier = SID_FM_CONVERTTO_COMBOBOX ; - HelpID = SID_FM_CONVERTTO_COMBOBOX ; + HelpId = CMD_SID_FM_CONVERTTO_COMBOBOX ; Command = ".uno:ConvertToCombo" ; Text [ en-US ] = "Combo Bo~x"; }; MenuItem { Identifier = SID_FM_CONVERTTO_IMAGEBUTTON ; - HelpID = SID_FM_CONVERTTO_IMAGEBUTTON ; + HelpId = CMD_SID_FM_CONVERTTO_IMAGEBUTTON ; Command = ".uno:ConvertToImageBtn" ; Text [ en-US ] = "I~mage Button"; }; MenuItem { Identifier = SID_FM_CONVERTTO_FILECONTROL ; - HelpID = SID_FM_CONVERTTO_FILECONTROL ; + HelpId = CMD_SID_FM_CONVERTTO_FILECONTROL ; Command = ".uno:ConvertToFileControl" ; Text [ en-US ] = "~File Selection"; }; MenuItem { Identifier = SID_FM_CONVERTTO_DATE ; - HelpID = SID_FM_CONVERTTO_DATE ; + HelpId = CMD_SID_FM_CONVERTTO_DATE ; Command = ".uno:ConvertToDate" ; Text [ en-US ] = "~Date Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_TIME ; - HelpID = SID_FM_CONVERTTO_TIME ; + HelpId = CMD_SID_FM_CONVERTTO_TIME ; Command = ".uno:ConvertToTime" ; Text [ en-US ] = "Tim~e Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_NUMERIC ; - HelpID = SID_FM_CONVERTTO_NUMERIC ; + HelpId = CMD_SID_FM_CONVERTTO_NUMERIC ; Command = ".uno:ConvertToNumeric" ; Text [ en-US ] = "~Numerical Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_CURRENCY ; - HelpID = SID_FM_CONVERTTO_CURRENCY ; + HelpId = CMD_SID_FM_CONVERTTO_CURRENCY ; Command = ".uno:ConvertToCurrency" ; Text [ en-US ] = "C~urrency Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_PATTERN ; - HelpID = SID_FM_CONVERTTO_PATTERN ; + HelpId = CMD_SID_FM_CONVERTTO_PATTERN ; Command = ".uno:ConvertToPattern" ; Text [ en-US ] = "~Pattern Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_IMAGECONTROL ; - HelpID = SID_FM_CONVERTTO_IMAGECONTROL ; + HelpId = CMD_SID_FM_CONVERTTO_IMAGECONTROL ; Command = ".uno:ConvertToImageControl" ; Text [ en-US ] = "Ima~ge Control"; }; MenuItem { Identifier = SID_FM_CONVERTTO_FORMATTED ; - HelpID = SID_FM_CONVERTTO_FORMATTED ; + HelpId = CMD_SID_FM_CONVERTTO_FORMATTED ; Command = ".uno:ConvertToFormatted" ; Text [ en-US ] = "Fo~rmatted Field"; }; MenuItem { Identifier = SID_FM_CONVERTTO_SCROLLBAR ; - HelpID = SID_FM_CONVERTTO_SCROLLBAR ; + HelpId = CMD_SID_FM_CONVERTTO_SCROLLBAR ; Command = ".uno:ConvertToScrollBar" ; Text [ en-US ] = "Scroll bar"; }; MenuItem { Identifier = SID_FM_CONVERTTO_SPINBUTTON; - HelpID = SID_FM_CONVERTTO_SPINBUTTON; + HelpId = CMD_SID_FM_CONVERTTO_SPINBUTTON; Command = ".uno:ConvertToSpinButton" ; Text [ en-US ] = "Spin Button"; }; MenuItem { Identifier = SID_FM_CONVERTTO_NAVIGATIONBAR; - HelpID = SID_FM_CONVERTTO_NAVIGATIONBAR; + HelpId = CMD_SID_FM_CONVERTTO_NAVIGATIONBAR; Command = ".uno:ConvertToNavigationBar" ; Text [ en-US ] = "Navigation Bar" ; }; diff --git a/svx/source/form/formshell.src b/svx/source/form/formshell.src index 5a7e25e14f13..b36590354b17 100644 --- a/svx/source/form/formshell.src +++ b/svx/source/form/formshell.src @@ -47,7 +47,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_STYLE; - HelpID = MENU_FM_TEXTATTRIBITES_STYLE; +// HelpID = MENU_FM_TEXTATTRIBITES_STYLE; Text [ en-US ] = "St~yle"; SubMenu = Menu { @@ -96,7 +96,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_ALIGNMENT; - HelpID = MENU_FM_TEXTATTRIBITES_ALIGNMENT; +// HelpID = MENU_FM_TEXTATTRIBITES_ALIGNMENT; Text [ en-US ] = "~Alignment"; RadioCheck = TRUE; SubMenu = Menu @@ -129,7 +129,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_SPACING; - HelpID = MENU_FM_TEXTATTRIBITES_SPACING; +// HelpID = MENU_FM_TEXTATTRIBITES_SPACING; Text [ en-US ] = "~Line Spacing"; _MenuItemFlags = MIB_RADIOCHECK; SubMenu = Menu diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 5e37d88126c3..0c83655042d2 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -200,8 +200,7 @@ namespace svxform ,m_bKeyboardCut( sal_False ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "NavigatorTree::NavigatorTree" ); - // FIXME: HELPID - SetHelpId( ""/*HID_FORM_NAVIGATOR*/ ); + SetHelpId( HID_FORM_NAVIGATOR ); m_aNavigatorImages = ImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL ) ); m_aNavigatorImagesHC = ImageList( SVX_RES( RID_SVXIMGLIST_FMEXPL_HC ) ); diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx index 1a87a06010e1..7a51348dfaa3 100644 --- a/svx/source/form/tabwin.cxx +++ b/svx/source/form/tabwin.cxx @@ -104,8 +104,7 @@ FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent ) ,pTabWin( pParent ) { DBG_CTOR(FmFieldWinListBox,NULL); - // FIXME: HELPID - SetHelpId( ""/*HID_FIELD_SEL*/ ); + SetHelpId( HID_FIELD_SEL ); SetHighlightRange( ); } @@ -193,8 +192,7 @@ FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, Window* _ ,m_pChangeListener(NULL) { DBG_CTOR(FmFieldWin,NULL); - // FIXME: HELPID - SetHelpId( ""/*HID_FIELD_SEL_WIN*/ ); + SetHelpId( HID_FIELD_SEL_WIN ); SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); pListBox = new FmFieldWinListBox( this ); diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx index 85babb34a1a7..f275fd9efd72 100644 --- a/svx/source/form/tbxform.cxx +++ b/svx/source/form/tbxform.cxx @@ -318,8 +318,7 @@ void SvxFmTbxCtlAbsRec::StateChanged( USHORT nSID, SfxItemState eState, const Sf Window* SvxFmTbxCtlAbsRec::CreateItemWindow( Window* pParent ) { SvxFmAbsRecWin* pWin = new SvxFmAbsRecWin( pParent, this ); - // FIXME: HELPID - pWin->SetUniqueId( ""/*UID_ABSOLUTE_RECORD_WINDOW*/ ); + pWin->SetUniqueId( UID_ABSOLUTE_RECORD_WINDOW ); return pWin; } diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 29c38653b4ac..ccbcd40862de 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -152,8 +152,7 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, { StartListening( *mpGallery ); - // FIXME: HELPID - maNewTheme.SetHelpId( ""/*HID_GALLERY_NEWTHEME*/ ); + maNewTheme.SetHelpId( HID_GALLERY_NEWTHEME ); maNewTheme.SetText( String( GAL_RESID( RID_SVXSTR_GALLERY_CREATETHEME ) ) ); maNewTheme.SetClickHdl( LINK( this, GalleryBrowser1, ClickNewThemeHdl ) ); @@ -161,8 +160,7 @@ GalleryBrowser1::GalleryBrowser1( GalleryBrowser* pParent, const ResId& rResId, if( mpGallery->GetUserURL().GetProtocol() == INET_PROT_NOT_VALID ) maNewTheme.Disable(); - // FIXME: HELPID - mpThemes->SetHelpId( ""/*HID_GALLERY_THEMELIST*/ ); + mpThemes->SetHelpId( HID_GALLERY_THEMELIST ); mpThemes->SetSelectHdl( LINK( this, GalleryBrowser1, SelectThemeHdl ) ); for( ULONG i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; i++ ) diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index ae1fc2f0e086..0483a1bc1425 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -325,14 +325,12 @@ GalleryBrowser2::GalleryBrowser2( GalleryBrowser* pParent, const ResId& rResId, maViewBox.InsertItem( TBX_ID_ICON, aDummyImage ); maViewBox.SetItemBits( TBX_ID_ICON, TIB_RADIOCHECK | TIB_AUTOCHECK ); - // FIXME: HELPID - maViewBox.SetHelpId( TBX_ID_ICON, ""/*HID_GALLERY_ICONVIEW*/ ); + maViewBox.SetHelpId( TBX_ID_ICON, HID_GALLERY_ICONVIEW ); maViewBox.SetQuickHelpText( TBX_ID_ICON, String( GAL_RESID( RID_SVXSTR_GALLERY_ICONVIEW ) ) ); maViewBox.InsertItem( TBX_ID_LIST, aDummyImage ); maViewBox.SetItemBits( TBX_ID_LIST, TIB_RADIOCHECK | TIB_AUTOCHECK ); - // FIXME: HELPID - maViewBox.SetHelpId( TBX_ID_LIST, ""/*HID_GALLERY_LISTVIEW*/ ); + maViewBox.SetHelpId( TBX_ID_LIST, HID_GALLERY_LISTVIEW ); maViewBox.SetQuickHelpText( TBX_ID_LIST, String( GAL_RESID( RID_SVXSTR_GALLERY_LISTVIEW ) ) ); maViewBox.SetBorder( 0, 1 ); diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index ccfb931f2d29..8022cecc0fbe 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -61,8 +61,7 @@ GalleryPreview::GalleryPreview( GalleryBrowser2* pParent, GalleryTheme* pTheme ) DragSourceHelper( this ), mpTheme( pTheme ) { - // FIXME: HELPID - SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); + SetHelpId( HID_GALLERY_WINDOW ); InitSettings(); } @@ -74,8 +73,7 @@ GalleryPreview::GalleryPreview( Window* pParent, const ResId & rResId ) : DragSourceHelper( this ), mpTheme( NULL ) { - // FIXME: HELPID - SetHelpId( ""/*HID_GALLERY_PREVIEW*/ ); + SetHelpId( HID_GALLERY_PREVIEW ); InitSettings(); } @@ -311,8 +309,7 @@ GalleryIconView::GalleryIconView( GalleryBrowser2* pParent, GalleryTheme* pTheme { EnableFullItemMode( FALSE ); - // FIXME: HELPID - SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); + SetHelpId( HID_GALLERY_WINDOW ); InitSettings(); SetExtraSpacing( 2 ); SetItemWidth( S_THUMB + 6 ); @@ -478,8 +475,7 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme mnCurRow( 0 ), mbInit( FALSE ) { - // FIXME: HELPID - SetHelpId( ""/*HID_GALLERY_WINDOW*/ ); + SetHelpId( HID_GALLERY_WINDOW ); InitSettings(); diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src index fae88c0db251..81ab0f1ac6d9 100644 --- a/svx/source/gallery2/gallery.src +++ b/svx/source/gallery2/gallery.src @@ -35,7 +35,7 @@ DockingWindow RID_SVXDLG_GALLERYBROWSER { - HelpId = SID_GALLERY; + HelpId = CMD_SID_GALLERY; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx index 676c8b0dc842..2ca1c5b5cfdd 100644 --- a/svx/source/stbctrls/insctrl.cxx +++ b/svx/source/stbctrls/insctrl.cxx @@ -57,8 +57,6 @@ SvxInsertStatusBarControl::SvxInsertStatusBarControl( USHORT _nSlotId, SfxStatusBarControl( _nSlotId, _nId, rStb ), bInsert( TRUE ) { - // FIXME: HELPID - rStb.SetHelpId( _nId, ""/*_nSlotId*/ ); } // ----------------------------------------------------------------------- diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index fbcb925fd579..e980ece5c8b6 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -176,6 +176,10 @@ struct SvxPosSizeStatusBarControl_Impl Images fu"r die Position und Gro"sse laden. */ +#define STR_POSITION ".uno:Position" +#define STR_TABLECELL ".uno:StateTableCell" +#define STR_FUNC ".uno:StatusBarFunc" + SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( USHORT _nSlotId, USHORT _nId, StatusBar& rStb ) : @@ -190,9 +194,9 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( USHORT _nSlotId, pImp->aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); pImp->aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); - addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Position" ))); - addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:StateTableCell" ))); - addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:StatusBarFunc" ))); + addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STR_POSITION ))); // SID_ATTR_POSITION + addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STR_TABLECELL ))); // SID_TABLE_CELL + addStatusListener( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( STR_FUNC ))); // SID_PSZ_FUNCTION } // ----------------------------------------------------------------------- @@ -233,8 +237,14 @@ void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, // da Kombi-Controller, immer die aktuelle Id als HelpId setzen // gecachten HelpText vorher l"oschen GetStatusBar().SetHelpText( GetId(), String() ); - // FIXME: HELPID - GetStatusBar().SetHelpId( GetId(), ""/*nSID*/ ); + + switch ( nSID ) + { + case SID_ATTR_POSITION : GetStatusBar().SetHelpId( GetId(), STR_POSITION ); break; + case SID_TABLE_CELL: GetStatusBar().SetHelpId( GetId(), STR_TABLECELL ); break; + case SID_PSZ_FUNCTION: GetStatusBar().SetHelpId( GetId(), STR_FUNC ); break; + default: break; + } if ( nSID == SID_PSZ_FUNCTION ) { diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx index 3df835510ed6..92d8f7ad0746 100644 --- a/svx/source/stbctrls/xmlsecctrl.cxx +++ b/svx/source/stbctrls/xmlsecctrl.cxx @@ -107,14 +107,8 @@ XmlSecStatusBarControl::~XmlSecStatusBarControl() delete mpImpl; } -void XmlSecStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, const SfxPoolItem* pState ) +void XmlSecStatusBarControl::StateChanged( USHORT, SfxItemState eState, const SfxPoolItem* pState ) { - GetStatusBar().SetHelpText( GetId(), String() );// necessary ? - - // FIXME: HELPID - (void)nSID; - GetStatusBar().SetHelpId( GetId(), ""/*nSID*/ ); // necessary ? - if( SFX_ITEM_AVAILABLE != eState ) { mpImpl->mnState = (UINT16)SIGNATURESTATE_UNKNOWN; diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index c9374ab27fb6..a4cab5f3ef16 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -111,8 +111,7 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow( void ExtrusionDirectionWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_EXTRUSION_DIRECTION*/ ); + SetHelpId( HID_POPUP_EXTRUSION_DIRECTION ); USHORT i; for( i = DIRECTION_NW; i <= DIRECTION_SE; i++ ) @@ -125,15 +124,12 @@ void ExtrusionDirectionWindow::implInit() // mpProjectionForewarder = new SfxStatusForwarder( SID_EXTRUSION_PROJECTION, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_DIRECTION*/ ); + mpMenu->SetHelpId( HID_MENU_EXTRUSION_DIRECTION ); mpMenu->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) ); mpDirectionSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - // FIXME: HELPID - mpDirectionSet->SetHelpId( ""/*HID_VALUESET_EXTRUSION_DIRECTION*/ ); + mpDirectionSet->SetHelpId( HID_VALUESET_EXTRUSION_DIRECTION ); - // FIXME: HELPID - mpDirectionSet->SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); + mpDirectionSet->SetHelpId( HID_POPUP_LINEEND_CTRL ); mpDirectionSet->SetSelectHdl( LINK( this, ExtrusionDirectionWindow, SelectHdl ) ); mpDirectionSet->SetColCount( 3 ); mpDirectionSet->EnableFullItemMode( FALSE ); @@ -505,15 +501,13 @@ ExtrusionDepthWindow::ExtrusionDepthWindow( USHORT nId, void ExtrusionDepthWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_EXTRUSION_DEPTH*/ ); + SetHelpId( HID_POPUP_EXTRUSION_DEPTH ); // mpDepthForewarder = new SfxStatusForwarder( SID_EXTRUSION_DEPTH, *this ); // mpMetricForewarder = new SfxStatusForwarder( SID_ATTR_METRIC, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_DEPTH*/ ); + mpMenu->SetHelpId( HID_MENU_EXTRUSION_DEPTH ); mpMenu->SetSelectHdl( LINK( this, ExtrusionDepthWindow, SelectHdl ) ); @@ -854,8 +848,7 @@ ExtrusionLightingWindow::ExtrusionLightingWindow( void ExtrusionLightingWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_EXTRUSION_LIGHTING*/ ); + SetHelpId( HID_POPUP_EXTRUSION_LIGHTING ); USHORT i; for( i = FROM_TOP_LEFT; i <= FROM_BOTTOM_RIGHT; i++ ) @@ -875,16 +868,13 @@ void ExtrusionLightingWindow::implInit() // mpLightingIntensityForewarder = new SfxStatusForwarder( SID_EXTRUSION_LIGHTING_INTENSITY, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_LIGHTING*/ ); + mpMenu->SetHelpId( HID_MENU_EXTRUSION_LIGHTING ); mpMenu->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) ); mpLightingSet = new ValueSet( mpMenu, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT ); - // FIXME: HELPID - mpLightingSet->SetHelpId( ""/*HID_VALUESET_EXTRUSION_LIGHTING*/ ); + mpLightingSet->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING ); - // FIXME: HELPID - mpLightingSet->SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); + mpLightingSet->SetHelpId( HID_POPUP_LINEEND_CTRL ); mpLightingSet->SetSelectHdl( LINK( this, ExtrusionLightingWindow, SelectHdl ) ); mpLightingSet->SetColCount( 3 ); mpLightingSet->EnableFullItemMode( FALSE ); @@ -1236,16 +1226,14 @@ ExtrusionSurfaceWindow::ExtrusionSurfaceWindow( void ExtrusionSurfaceWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_EXTRUSION_SURFACE*/ ); + SetHelpId( HID_POPUP_EXTRUSION_SURFACE ); bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); // mpSurfaceForewarder = new SfxStatusForwarder( SID_EXTRUSION_SURFACE, *this ); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_MENU_EXTRUSION_SURFACE*/ ); + mpMenu->SetHelpId( HID_MENU_EXTRUSION_SURFACE ); mpMenu->SetSelectHdl( LINK( this, ExtrusionSurfaceWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_WIREFRAME ) ), bHighContrast ? maImgSurface1h : maImgSurface1 ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 5a16fc41e90b..31c77e221d62 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -504,10 +504,8 @@ Window* SvxFillToolBoxControl::CreateItemWindow( Window *pParent ) pFillAttrLB = (SvxFillAttrBox*)pFillControl->pLbFillAttr; pFillTypeLB = (SvxFillTypeBox*)pFillControl->pLbFillType; - // FIXME: HELPID - pFillAttrLB->SetUniqueId( ""/*HID_FILL_ATTR_LISTBOX*/ ); - // FIXME: HELPID - pFillTypeLB->SetUniqueId( ""/*HID_FILL_TYPE_LISTBOX */); + pFillAttrLB->SetUniqueId( HID_FILL_ATTR_LISTBOX ); + pFillTypeLB->SetUniqueId( HID_FILL_TYPE_LISTBOX ); return pFillControl; } diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index dbd815ae3d14..1b4f89ca1e8c 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -361,8 +361,7 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow( mxFrame( rFrame ), mbPopupMode( true ) { - // FIXME: HELPID - SetHelpId( ""/*HID_WIN_FONTWORK_ALIGN*/ ); + SetHelpId( HID_WIN_FONTWORK_ALIGN ); implInit(); } @@ -387,21 +386,18 @@ FontWorkAlignmentWindow::FontWorkAlignmentWindow( mxFrame( rFrame ), mbPopupMode( true ) { - // FIXME: HELPID - SetHelpId( ""/*HID_WIN_FONTWORK_ALIGN*/ ); + SetHelpId( HID_WIN_FONTWORK_ALIGN ); implInit(); } void FontWorkAlignmentWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_FONTWORK_ALIGN*/ ); + SetHelpId( HID_POPUP_FONTWORK_ALIGN ); bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_POPUP_FONTWORK_ALIGN*/ ); + mpMenu->SetHelpId( HID_POPUP_FONTWORK_ALIGN ); mpMenu->SetSelectHdl( LINK( this, FontWorkAlignmentWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_ALIGN_LEFT ) ), bHighContrast ? maImgAlgin1h : maImgAlgin1 ); @@ -614,8 +610,7 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( mxFrame( rFrame ), mbPopupMode( true ) { - // FIXME: HELPID - SetHelpId( ""/*HID_WIN_FONTWORK_CHARSPACE*/ ); + SetHelpId( HID_WIN_FONTWORK_CHARSPACE ); implInit(); } @@ -631,21 +626,18 @@ FontWorkCharacterSpacingWindow::FontWorkCharacterSpacingWindow( mxFrame( rFrame ), mbPopupMode( true ) { - // FIXME: HELPID - SetHelpId( ""/*HID_WIN_FONTWORK_CHARSPACE*/ ); + SetHelpId( HID_WIN_FONTWORK_CHARSPACE ); implInit(); } void FontWorkCharacterSpacingWindow::implInit() { - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_FONTWORK_CHARSPACE*/ ); + SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); // bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); mpMenu = new ToolbarMenu( this, WB_CLIPCHILDREN ); - // FIXME: HELPID - mpMenu->SetHelpId( ""/*HID_POPUP_FONTWORK_CHARSPACE*/ ); + mpMenu->SetHelpId( HID_POPUP_FONTWORK_CHARSPACE ); mpMenu->SetSelectHdl( LINK( this, FontWorkCharacterSpacingWindow, SelectHdl ) ); mpMenu->appendEntry( 0, String( SVX_RES( STR_CHARS_SPACING_VERY_TIGHT ) ), MIB_RADIOCHECK ); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index aae0bd4fc12b..849d495e214e 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -316,7 +316,7 @@ public: // ----------------------------------------------------------------------------- -ImplGrafControl::ImplGrafControl( Window* pParent, USHORT nSlotId, const rtl::OUString& rCmd, const Reference< XFrame >& rFrame ) : +ImplGrafControl::ImplGrafControl( Window* pParent, USHORT, const rtl::OUString& rCmd, const Reference< XFrame >& rFrame ) : Control( pParent, WB_TABSTOP ), maImage ( this ), maField ( this, rCmd, rFrame ) @@ -353,9 +353,6 @@ ImplGrafControl::ImplGrafControl( Window* pParent, USHORT nSlotId, const rtl::OU maImage.Show(); - // FIXME: HELPID - (void)nSlotId; - // maField.SetHelpId( nSlotId ); maField.SetHelpId( rtl::OUStringToOString( rCmd, RTL_TEXTENCODING_UTF8 ) ); maField.Show(); } diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index f3e208f3e6ce..6deab3eca30b 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -423,10 +423,8 @@ void SvxLineEndWindow::implInit() SfxObjectShell* pDocSh = SfxObjectShell::Current(); const SfxPoolItem* pItem = NULL; - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_LINEEND*/ ); - // FIXME: HELPID - aLineEndSet.SetHelpId( ""/*HID_POPUP_LINEEND_CTRL*/ ); + SetHelpId( HID_POPUP_LINEEND ); + aLineEndSet.SetHelpId( HID_POPUP_LINEEND_CTRL ); if ( pDocSh ) { diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk index 47da008e87a3..8abfa24938f9 100644 --- a/svx/source/tbxctrls/makefile.mk +++ b/svx/source/tbxctrls/makefile.mk @@ -74,7 +74,6 @@ SRC1FILES = \ lboxctrl.src \ linectrl.src \ tbcontrl.src \ - tbxdraw.src \ grafctrl.src # --- Targets ------------------------------------------------------- diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 6b5998a3f1b9..5c99e84e6a47 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -905,10 +905,8 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, lcl_CalcSizeValueSet( *this, aColorSet, aSize12 ); - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_COLOR*/ ); - // FIXME: HELPID - aColorSet.SetHelpId( ""/*HID_POPUP_COLOR_CTRL*/ ); + SetHelpId( HID_POPUP_COLOR ); + aColorSet.SetHelpId( HID_POPUP_COLOR_CTRL ); SetText( rWndTitle ); aColorSet.Show(); @@ -1092,8 +1090,7 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( USHORT nId, const Reference< XFrame >& lcl_CalcSizeValueSet( *this, aFrameSet,Size( 20, 20 )); - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_FRAME*/ ); + SetHelpId( HID_POPUP_FRAME ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME) ); aFrameSet.Show(); } @@ -1353,8 +1350,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( USHORT nId, const Reference< XFrame >& r lcl_CalcSizeValueSet( *this, aLineSet, aBmpSize ); - // FIXME: HELPID - SetHelpId( ""/*HID_POPUP_LINE*/ ); + SetHelpId( HID_POPUP_LINE ); SetText( SVX_RESSTR(RID_SVXSTR_FRAME_STYLE) ); aLineSet.Show(); } diff --git a/svx/source/tbxctrls/tbxdraw.src b/svx/source/tbxctrls/tbxdraw.src deleted file mode 100644 index 0641ff39e1bf..000000000000 --- a/svx/source/tbxctrls/tbxdraw.src +++ /dev/null @@ -1,265 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - // include --------------------------------------------------------------- -#include "tbxdraw.hrc" -#include -#include "helpid.hrc" -#include - // pragma ---------------------------------------------------------------- - - // ----------------------------------------------------------------------- -#define IMAGE_STDBTN_COLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; } -FloatingWindow RID_SVXTBX_DRAW -{ - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_DRAWTOOL_TBX ; - ToolBox TBX_DRAW - { - HelpId = HID_SVXTBX_DRAW ; - SVLook = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_OBJECT_SELECT ; - HelpID = SID_OBJECT_SELECT ; - RadioCheck = TRUE ; - Text [ en-US ] = "Selection" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_LINE ; - HelpID = SID_DRAW_LINE ; - RadioCheck = TRUE ; - Text [ en-US ] = "Line" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_RECT ; - HelpID = SID_DRAW_RECT ; - RadioCheck = TRUE ; - Text [ en-US ] = "Rectangle" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_ELLIPSE ; - HelpID = SID_DRAW_ELLIPSE ; - RadioCheck = TRUE ; - Text [ en-US ] = "Ellipse" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_POLYGON_NOFILL ; - HelpID = SID_DRAW_POLYGON_NOFILL ; - RadioCheck = TRUE ; - Text [ en-US ] = "Polygon" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_BEZIER_NOFILL ; - HelpID = SID_DRAW_BEZIER_NOFILL ; - RadioCheck = TRUE ; - Text [ en-US ] = "Curve"; - }; - ToolBoxItem - { - Identifier = SID_DRAW_FREELINE_NOFILL ; - HelpID = SID_DRAW_FREELINE_NOFILL ; - RadioCheck = TRUE ; - Text [ en-US ] = "Freeform Line"; - }; - ToolBoxItem - { - Identifier = SID_DRAW_ARC ; - HelpID = SID_DRAW_ARC ; - RadioCheck = TRUE ; - Text [ en-US ] = "Arc" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_PIE ; - HelpID = SID_DRAW_PIE ; - RadioCheck = TRUE ; - Text [ en-US ] = "Ellipse Pie" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_CIRCLECUT ; - HelpID = SID_DRAW_CIRCLECUT ; - RadioCheck = TRUE ; - Text [ en-US ] = "Circle Segment" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_TEXT ; - HelpID = SID_DRAW_TEXT ; - RadioCheck = TRUE ; - Text [ en-US ] = "Text" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_TEXT_VERTICAL ; - HelpID = SID_DRAW_TEXT_VERTICAL ; - RadioCheck = TRUE ; - Text [ en-US ] = "Vertical Text"; - }; - ToolBoxItem - { - Identifier = SID_DRAW_TEXT_MARQUEE ; - HelpID = SID_DRAW_TEXT_MARQUEE ; - RadioCheck = TRUE ; - Text [ en-US ] = "Text Animation" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_CAPTION ; - HelpID = SID_DRAW_CAPTION ; - RadioCheck = TRUE ; - Text [ en-US ] = "Callouts" ; - }; - ToolBoxItem - { - Identifier = SID_DRAW_CAPTION_VERTICAL ; - HelpID = SID_DRAW_CAPTION_VERTICAL ; - RadioCheck = TRUE ; - Text [ en-US ] = "Vertical Callout"; - }; - }; - }; - Text [ en-US ] = "Draw Functions" ; -}; -FloatingWindow RID_SVXTBX_ALIGNMENT -{ - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - HelpID = HID_ALIGN_TBX ; - SVLook = TRUE ; - Text [ en-US ] = "Alignment" ; - ToolBox TBX_ALIGNMENT - { - HelpId = HID_SVXTBX_ALIGNMENT ; - SVLook = TRUE ; - HelpID = SID_OBJECT_ALIGN ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_LEFT ; - HelpID = SID_OBJECT_ALIGN_LEFT ; - Text [ en-US ] = "Left" ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_CENTER ; - HelpID = SID_OBJECT_ALIGN_CENTER ; - Text [ en-US ] = "Center" ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_RIGHT ; - HelpID = SID_OBJECT_ALIGN_RIGHT ; - Text [ en-US ] = "Right" ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_UP ; - HelpID = SID_OBJECT_ALIGN_UP ; - Text [ en-US ] = "Top" ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_MIDDLE ; - HelpID = SID_OBJECT_ALIGN_MIDDLE ; - Text [ en-US ] = "Centered" ; - }; - ToolBoxItem - { - Identifier = SID_OBJECT_ALIGN_DOWN ; - HelpID = SID_OBJECT_ALIGN_DOWN ; - Text [ en-US ] = "Bottom" ; - }; - }; - }; -}; - // ********************************************************************** EOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/svx/source/toolbars/extrusionbar.src b/svx/source/toolbars/extrusionbar.src index 3e6c6ad7e5cb..dd6f3066a51e 100644 --- a/svx/source/toolbars/extrusionbar.src +++ b/svx/source/toolbars/extrusionbar.src @@ -1,65 +1,6 @@ #include #include -ToolBox RID_SVX_EXTRUSION_BAR -{ - HelpId = RID_SVX_EXTRUSION_BAR ; - Align = BOXALIGN_BOTTOM ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_EXTRUSION_TOOGLE ; - HelpID = SID_EXTRUSION_TOOGLE ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_TILT_DOWN ; - HelpID = SID_EXTRUSION_TILT_DOWN ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_TILT_UP ; - HelpID = SID_EXTRUSION_TILT_UP ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_TILT_LEFT ; - HelpID = SID_EXTRUSION_TILT_LEFT ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_TILT_RIGHT ; - HelpID = SID_EXTRUSION_TILT_RIGHT ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_DEPTH_FLOATER ; - HelpID = SID_EXTRUSION_DEPTH_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_DIRECTION_FLOATER ; - HelpID = SID_EXTRUSION_DIRECTION_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_LIGHTING_FLOATER ; - HelpID = SID_EXTRUSION_LIGHTING_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_SURFACE_FLOATER ; - HelpID = SID_EXTRUSION_SURFACE_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_EXTRUSION_3D_COLOR ; - HelpID = SID_EXTRUSION_3D_COLOR ; - }; - }; -}; - String RID_SVX_EXTRUSION_BAR { Text [ en-US ] = "Extrusion"; diff --git a/svx/source/toolbars/fontworkbar.src b/svx/source/toolbars/fontworkbar.src index 79279b3432db..a7bdd2cccada 100644 --- a/svx/source/toolbars/fontworkbar.src +++ b/svx/source/toolbars/fontworkbar.src @@ -27,40 +27,6 @@ #include -ToolBox RID_SVX_FONTWORK_BAR -{ - HelpId = RID_SVX_FONTWORK_BAR ; - Align = BOXALIGN_BOTTOM ; - ItemList = - { - ToolBoxItem - { - Identifier = SID_FONTWORK_GALLERY_FLOATER ; - HelpID = SID_FONTWORK_GALLERY_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_FONTWORK_SHAPE_TYPE ; - HelpID = SID_FONTWORK_SHAPE_TYPE ; - }; - ToolBoxItem - { - Identifier = SID_FONTWORK_SAME_LETTER_HEIGHTS ; - HelpID = SID_FONTWORK_SAME_LETTER_HEIGHTS ; - }; - ToolBoxItem - { - Identifier = SID_FONTWORK_ALIGNMENT_FLOATER ; - HelpID = SID_FONTWORK_ALIGNMENT_FLOATER ; - }; - ToolBoxItem - { - Identifier = SID_FONTWORK_CHARACTER_SPACING_FLOATER ; - HelpID = SID_FONTWORK_CHARACTER_SPACING_FLOATER ; - }; - }; -}; - String RID_SVX_FONTWORK_BAR { Text [ en-US ] = "Fontwork"; diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 97bcf74e6c10..dda324cb98d1 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -485,18 +485,13 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) { FreeResource(); - // FIXME: HELPID - m_aRB_To_Simplified.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED*/ ); - // FIXME: HELPID - m_aRB_To_Traditional.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL*/ ); + m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_SIMPLIFIED ); + m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL ); - // FIXME: HELPID - m_aCB_Reverse.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_CB_REVERSE*/ ); + m_aCB_Reverse.SetHelpId( HID_SVX_CHINESE_DICTIONARY_CB_REVERSE ); - // FIXME: HELPID - m_aCT_DictionaryToSimplified.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED*/ ); - // FIXME: HELPID - m_aCT_DictionaryToTraditional.SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL*/ ); + m_aCT_DictionaryToSimplified.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_SIMPLIFIED ); + m_aCT_DictionaryToTraditional.SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_TO_TRADITIONAL ); SvtLinguConfig aLngCfg; sal_Bool bValue = sal_Bool(); @@ -583,8 +578,7 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( Window* pParent ) m_pHeaderBar = m_aCT_DictionaryToSimplified.createHeaderBar( aColumn1, aColumn2, aColumn3, nWidth1, nWidth2, nWidth3 ); if(m_pHeaderBar) - // FIXME: HELPID - m_pHeaderBar->SetHelpId( ""/*HID_SVX_CHINESE_DICTIONARY_LB_HEADER*/ ); + m_pHeaderBar->SetHelpId( HID_SVX_CHINESE_DICTIONARY_LB_HEADER ); long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 }; m_aCT_DictionaryToSimplified.SetTabs( &pTabs[0], MAP_PIXEL ); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx index a2f308248224..213ddc22bace 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx @@ -72,12 +72,9 @@ ChineseTranslationDialog::ChineseTranslationDialog( Window* pParent ) { FreeResource(); - // FIXME: HELPID - m_aRB_To_Simplified.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED*/ ); - // FIXME: HELPID - m_aRB_To_Traditional.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL*/ ); - // FIXME: HELPID - m_aCB_Use_Variants.SetHelpId( ""/*HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS*/ ); + m_aRB_To_Simplified.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED ); + m_aRB_To_Traditional.SetHelpId( HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL ); + m_aCB_Use_Variants.SetHelpId( HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS ); SvtLinguConfig aLngCfg; sal_Bool bValue = sal_Bool(); diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 9bf5856bc270..a75cd02b17b8 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -167,20 +167,17 @@ #define ERRCODE_UUI_SSLWARN_INVALID_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 1) #define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3) -#define HID_DLG_LOGIN (HID_UUI_START + 0) -#define HID_DLG_COOKIES (HID_UUI_START + 1) -#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START+2) -#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START+3) -#define HID_DLG_FILTER_SELECT (HID_UUI_START+4) -#define HID_DLG_PASSWORD_UUI (HID_UUI_START+5) -#define HID_DLG_PASSWORD_CRT (HID_UUI_START+6) -#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START+7) -#define HID_DLG_SSLWARN_UUI (HID_UUI_START+8) -#define HID_XMLSECDLG_MACROWARN (HID_UUI_START+9) -#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START+10) - -// HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in -// sfx2/util/hidother.src +#define HID_DLG_LOGIN "UUI_HID_DLG_LOGIN" +#define HID_DLG_COOKIES "UUI_HID_DLG_COOKIES" +#define HID_DLG_MASTERPASSWORD_UUI "UUI_HID_DLG_MASTERPASSWORD_UUI" +#define HID_DLG_MASTERPASSWORD_CRT "UUI_HID_DLG_MASTERPASSWORD_CRT" +#define HID_DLG_FILTER_SELECT "UUI_HID_DLG_FILTER_SELECT" +#define HID_DLG_PASSWORD_UUI "UUI_HID_DLG_PASSWORD_UUI" +#define HID_DLG_PASSWORD_CRT "UUI_HID_DLG_PASSWORD_CRT" +#define HID_DLG_UNKNOWNAUTH_UUI "UUI_HID_DLG_UNKNOWNAUTH_UUI" +#define HID_DLG_SSLWARN_UUI "UUI_HID_DLG_SSLWARN_UUI" +#define HID_XMLSECDLG_MACROWARN "UUI_HID_XMLSECDLG_MACROWARN" +#define HID_DLG_NEWERVERSIONWARNING "UUI_HID_DLG_NEWERVERSIONWARNING" #endif // UUI_IDS_HRC -- cgit From 7aa177e87e43d6db6134cd08282181f905a4dcf1 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 12 Jul 2010 09:09:07 +0200 Subject: mib17: #162973# implementation of 'Empty' symbol from AB --- basic/source/runtime/props.cxx | 7 +++++++ basic/source/runtime/rtlproto.hxx | 1 + basic/source/runtime/stdobj.cxx | 1 + 3 files changed, 9 insertions(+) diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx index cec74444e7a2..663d12fbcd72 100644 --- a/basic/source/runtime/props.cxx +++ b/basic/source/runtime/props.cxx @@ -76,6 +76,13 @@ RTLFUNC(False) rPar.Get(0)->PutBool( FALSE ); } +RTLFUNC(Empty) +{ + (void)pBasic; + (void)bWrite; + (void)rPar; +} + RTLFUNC(Nothing) { (void)pBasic; diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx index 1a1ae4f32283..5437654f69a0 100644 --- a/basic/source/runtime/rtlproto.hxx +++ b/basic/source/runtime/rtlproto.hxx @@ -38,6 +38,7 @@ extern RTLFUNC(Date); extern RTLFUNC(Err); extern RTLFUNC(Erl); extern RTLFUNC(False); +extern RTLFUNC(Empty); extern RTLFUNC(Nothing); extern RTLFUNC(Null); extern RTLFUNC(True); diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 60d2e9cf448d..4455901bfeba 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -221,6 +221,7 @@ static Methods aMethods[] = { { "FileSpec", SbxSTRING, 0,NULL,0 }, { "DumpAll", SbxINTEGER, _OPT, NULL,0 }, +{ "Empty", SbxVARIANT, _CPROP, RTLNAME(Empty),0 }, { "EqualUnoObjects",SbxBOOL, 2 | _FUNCTION, RTLNAME(EqualUnoObjects),0 }, { "Variant", SbxVARIANT, 0,NULL,0 }, { "Variant", SbxVARIANT, 0,NULL,0 }, -- cgit From aea943b27855a9f3f3795f092139947d3ee02b65 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 12 Jul 2010 10:26:26 +0200 Subject: jl154 #162868# additional private sub-command for unopkg for use in setup --- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index a9a0c8271373..9434b69653a1 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -587,6 +587,15 @@ extern "C" int unopkg_main() xDialog->startExecuteModal(xListener); dialogEnded.wait(); } + else if (subCommand.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("sync"))) + { + //This sub command may be removed later and is only there to have a + //possibility to start extension synching without any output. + //This is just here so we do not get an error, because of an unknown + //sub-command. We do synching before + //the sub-commands are processed. + + } else { dp_misc::writeConsoleError( -- cgit From adf3c10549e3a755f8705e3b97939f4488ee7381 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 12 Jul 2010 11:17:00 +0200 Subject: mib17: #i112634# API changes --- vbahelper/inc/vbahelper/vbaeventshelperbase.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx index a84b0e28f9db..b7216746c81d 100755 --- a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx +++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx @@ -29,7 +29,7 @@ #define VBAHELPER_VBAEVENTSHELPERBASE_HXX #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ namespace com { namespace sun { namespace star { // ============================================================================ -typedef ::cppu::WeakImplHelper2< css::script::vba::XEventProcessor, css::lang::XEventListener > VbaEventsHelperBase_BASE; +typedef ::cppu::WeakImplHelper2< css::script::vba::XVBAEventProcessor, css::lang::XEventListener > VbaEventsHelperBase_BASE; class VBAHELPER_DLLPUBLIC VbaEventsHelperBase : public VbaEventsHelperBase_BASE { @@ -51,7 +51,7 @@ public: const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~VbaEventsHelperBase(); - // XEventProcessor + // XVBAEventProcessor virtual void SAL_CALL setIgnoreEvents( sal_Bool bIgnoreEvents ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getIgnoreEvents() throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL hasVbaEventHandler( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); -- cgit From 096e86da1c50f53c798d61801ac2643962160631 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Mon, 12 Jul 2010 14:04:55 +0200 Subject: jl154 #162868# OOo Improvement dialog will now show at the second start --- .../registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs index 7b0b221f15a9..7ff91464727d 100755 --- a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs @@ -15,7 +15,7 @@ OpenOffice.org Improvement Program. If this is zero the user will get asked. - 2 + 1 -- cgit From 59e208d9037efc74525de69c2a892a30e61648c5 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Mon, 12 Jul 2010 19:32:20 +0200 Subject: calc56: #i102690# correct attribute names diagonal-bl-tr-widths and diagonal-tl-br-widths --- xmloff/inc/xmloff/xmltoken.hxx | 3 +++ xmloff/source/core/xmltoken.cxx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index d892c10f4f5d..f4843d54ace1 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3107,6 +3107,9 @@ namespace xmloff { namespace token { XML_N_CHART_EXT, XML_COORDINATE_REGION, + XML_DIAGONAL_BL_TR_WIDTHS, + XML_DIAGONAL_TL_BR_WIDTHS, + XML_TOKEN_END }; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 2e92c4a6a97d..a3d4a0c48d02 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3107,6 +3107,9 @@ namespace xmloff { namespace token { TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ), TOKEN( "coordinate-region", XML_COORDINATE_REGION ), + TOKEN( "diagonal-bl-tr-widths", XML_DIAGONAL_BL_TR_WIDTHS ), + TOKEN( "diagonal-tl-br-widths", XML_DIAGONAL_TL_BR_WIDTHS ), + #if OSL_DEBUG_LEVEL > 0 { 0, NULL, NULL, XML_TOKEN_END } #else -- cgit From 9a7bec4a045fa95f849c729b0be3bc295aa6d0ff Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 13 Jul 2010 13:30:24 +0200 Subject: vcl113: #i112411# fix output format handling (thanks muthusuba!) --- fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index c6b0acd6a33f..8f9796b71719 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -935,6 +935,9 @@ uno::Sequence SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { static const OUString aStarDot = OUString::createFromAscii( "*." ); + ::rtl::OUString aNewFilter; + ::rtl::OUString aOldFilter = getCurrentFilter(); + sal_Bool bChangeFilter = sal_True; for ( FilterList::iterator aListIter = m_pFilterList->begin(); aListIter != m_pFilterList->end(); ++aListIter @@ -942,11 +945,17 @@ uno::Sequence SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 ) { - setCurrentFilter( aListIter->getTitle() ); + if( !aNewFilter.getLength() ) + aNewFilter = aListIter->getTitle(); + + if( aOldFilter == aListIter->getTitle() ) + bChangeFilter = sal_False; + bExtensionTypedIn = true; - break; } } + if( bChangeFilter ) + setCurrentFilter( aNewFilter ); } } -- cgit From d1d5a4eadbb4ac501951d58deef975d3f7f3641d Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 14 Jul 2010 12:07:17 +0200 Subject: unxlngxnewbaseline: #162926# some fixes for 64 bit linux baseline --- connectivity/source/drivers/kab/makefile.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk index 2a0dc5cd8999..6a47664890da 100644 --- a/connectivity/source/drivers/kab/makefile.mk +++ b/connectivity/source/drivers/kab/makefile.mk @@ -46,6 +46,9 @@ CFLAGS+=$(KDE_CFLAGS) .IF "$(KDE_ROOT)"!="" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib +.IF "$(HOSTTYPE)" == "x86_64-linux" +EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 +.ENDIF .ENDIF # === KAB base library ========================== -- cgit From 3ff5cbc45f24f6edead8957dd889817d1f4f23b0 Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 14 Jul 2010 13:47:44 +0200 Subject: impress194: #i109282# applied patch (reading negative enhanced-path parameter) --- xmloff/source/draw/ximpcustomshape.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 9d7856348516..98255edf68d0 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -708,6 +708,7 @@ void GetEnhancedPath( std::vector< com::sun::star::beans::PropertyValue >& rDest case '8' : case '9' : case '.' : + case '-' : { com::sun::star::drawing::EnhancedCustomShapeParameterPair aPair; if ( GetNextParameter( aPair.First, nIndex, rValue ) && -- cgit From 1994888550bf52767e668d3b7f08fb01204e764c Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 14 Jul 2010 14:09:08 +0200 Subject: jl154: #162868# Added sync code to improve startup time with bundled extensions --- desktop/source/app/app.cxx | 220 +++++++++++++++++++++++++++++++++++++ desktop/source/app/userinstall.cxx | 6 +- desktop/source/app/userinstall.hxx | 2 + 3 files changed, 227 insertions(+), 1 deletion(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 7e78d7e43ec2..01c07b9d3e4a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -122,6 +122,7 @@ #include #include #include +#include #include #include #include @@ -468,6 +469,208 @@ void ReplaceStringHookProc( UniString& rStr ) } } +static const char pPresetsFolder[] = "presets"; +static const char pBundledFolder[] = BUNDLED_FOLDER_NAME; +static const char pLastSyncFileName[] = "lastsynchronized"; +static const sal_Int32 nStrLenLastSync = 16; + +static bool needsSynchronization( + ::rtl::OUString const & baseSynchronizedURL, ::rtl::OUString const & userSynchronizedURL ) +{ + bool bNeedsSync( false ); + + ::osl::DirectoryItem itemUserFile; + ::osl::File::RC err1 = + ::osl::DirectoryItem::get(userSynchronizedURL, itemUserFile); + + //If it does not exist, then there is nothing to be done + if (err1 == ::osl::File::E_NOENT) + { + return true; + } + else if (err1 != ::osl::File::E_None) + { + OSL_ENSURE(0, "Cannot access lastsynchronized in user layer"); + return true; //sync just in case + } + + //If last synchronized does not exist in base layer, then do nothing + ::osl::DirectoryItem itemBaseFile; + ::osl::File::RC err2 = ::osl::DirectoryItem::get(baseSynchronizedURL, itemBaseFile); + if (err2 == ::osl::File::E_NOENT) + { + return true; + + } + else if (err2 != ::osl::File::E_None) + { + OSL_ENSURE(0, "Cannot access file lastsynchronized in base layer"); + return true; //sync just in case + } + + //compare the modification time of the extension folder and the last + //modified file + ::osl::FileStatus statUser(FileStatusMask_ModifyTime); + ::osl::FileStatus statBase(FileStatusMask_ModifyTime); + if (itemUserFile.getFileStatus(statUser) == ::osl::File::E_None) + { + if (itemBaseFile.getFileStatus(statBase) == ::osl::File::E_None) + { + TimeValue timeUser = statUser.getModifyTime(); + TimeValue timeBase = statBase.getModifyTime(); + + if (timeUser.Seconds < timeBase.Seconds) + bNeedsSync = true; + } + else + { + OSL_ASSERT(0); + bNeedsSync = true; + } + } + else + { + OSL_ASSERT(0); + bNeedsSync = true; + } + + return bNeedsSync; +} + +static ::rtl::OUString getBasePresetsPathURL() +{ + ::rtl::OUString aBaseInstallURL; + ::utl::Bootstrap::PathStatus aBaseInstallStatus = ::utl::Bootstrap::locateBaseInstallation( aBaseInstallURL ); + + if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) + { + ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); + ::sal_uInt32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); + + if ( nLastIndex != aBaseInstallURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pPresetsFolder ); + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pBundledFolder ); + aBaseInstallURL = aTmp.makeStringAndClear(); + } + + return aBaseInstallURL; +} + +static ::rtl::OUString getUserBundledExtPathURL() +{ + ::rtl::OUString folder( RTL_CONSTASCII_USTRINGPARAM( "$BUNDLED_EXTENSIONS_USER" )); + ::rtl::Bootstrap::expandMacros(folder); + + return folder; +} + +static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() +{ + ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); + ::sal_uInt32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + + ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); + + if ( nLastIndex != aBasePresetPathURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pLastSyncFileName ); + + return aTmp.makeStringAndClear(); +} + +static ::rtl::OUString getLastSyncFileURLFromUserInstallation() +{ + ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL(); + ::sal_uInt32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); + + ::rtl::OUStringBuffer aTmp( aUserBundledPathURL ); + + if ( nLastIndex != aUserBundledPathURL.getLength()-1 ) + aTmp.appendAscii( "/" ); + aTmp.appendAscii( pLastSyncFileName ); + + return aTmp.makeStringAndClear(); +} + +static osl::FileBase::RC copy_bundled_recursive( + const rtl::OUString& srcUnqPath, + const rtl::OUString& dstUnqPath, + sal_Int32 TypeToCopy ) +throw() +{ + osl::FileBase::RC err = osl::FileBase::E_None; + + if( TypeToCopy == -1 ) // Document + { + err = osl::File::copy( srcUnqPath,dstUnqPath ); + } + else if( TypeToCopy == +1 ) // Folder + { + osl::Directory aDir( srcUnqPath ); + aDir.open(); + + err = osl::Directory::create( dstUnqPath ); + osl::FileBase::RC next = err; + if( err == osl::FileBase::E_None || + err == osl::FileBase::E_EXIST ) + { + err = osl::FileBase::E_None; + sal_Int32 n_Mask = FileStatusMask_FileURL | FileStatusMask_FileName | FileStatusMask_Type; + + osl::DirectoryItem aDirItem; + + while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None ) + { + sal_Bool IsDoc = false; + sal_Bool bFilter = false; + osl::FileStatus aFileStatus( n_Mask ); + aDirItem.getFileStatus( aFileStatus ); + if( aFileStatus.isValid( FileStatusMask_Type ) ) + IsDoc = aFileStatus.getFileType() == osl::FileStatus::Regular; + + // Getting the information for the next recursive copy + sal_Int32 newTypeToCopy = IsDoc ? -1 : +1; + + rtl::OUString newSrcUnqPath; + if( aFileStatus.isValid( FileStatusMask_FileURL ) ) + newSrcUnqPath = aFileStatus.getFileURL(); + + rtl::OUString newDstUnqPath = dstUnqPath; + rtl::OUString tit; + if( aFileStatus.isValid( FileStatusMask_FileName ) ) + { + ::rtl::OUString aFileName = aFileStatus.getFileName(); + tit = rtl::Uri::encode( aFileName, + rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + + // Special treatment for "lastsychronized" file. Must not be + // copied from the bundled folder! + if ( IsDoc && aFileName.equalsAscii( pLastSyncFileName )) + bFilter = true; + } + + if( newDstUnqPath.lastIndexOf( sal_Unicode('/') ) != newDstUnqPath.getLength()-1 ) + newDstUnqPath += rtl::OUString::createFromAscii( "/" ); + + newDstUnqPath += tit; + + if (( newSrcUnqPath != dstUnqPath ) && !bFilter ) + err = copy_bundled_recursive( newSrcUnqPath,newDstUnqPath, newTypeToCopy ); + } + + if( err == osl::FileBase::E_None && next != osl::FileBase::E_NOENT ) + err = next; + } + aDir.close(); + } + + return err; +} + Desktop::Desktop() : m_bServicesRegistered( false ) , m_aBootstrapError( BE_OK ) @@ -485,6 +688,23 @@ void Desktop::Init() RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" ); SetBootstrapStatus(BS_OK); + // Check for lastsynchronized file for bundled extensions in the user directory + // and test if synchronzation is necessary! + { + ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation(); + ::rtl::OUString aBaseLastSyncFilePathURL = getLastSyncFileURLFromBaseInstallation(); + + if ( needsSynchronization( aBaseLastSyncFilePathURL, aUserLastSyncFilePathURL )) + { + rtl::OUString aUserPath = getUserBundledExtPathURL(); + rtl::OUString aBasePresetsBundledPath = getBasePresetsPathURL(); + + // copy bundled folder to the user directory + osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); + copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); + } + } + // create service factory... Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager(); if( rSMgr.is() ) diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx index 546a6f0ad13c..0a31bed791ec 100644 --- a/desktop/source/app/userinstall.cxx +++ b/desktop/source/app/userinstall.cxx @@ -207,8 +207,12 @@ namespace desktop { if (newDstUnqPath.lastIndexOf(sal_Unicode('/')) != newDstUnqPath.getLength()-1) newDstUnqPath += rtl::OUString::createFromAscii("/"); newDstUnqPath += itemname; + // recursion - err = copy_recursive(newSrcUnqPath, newDstUnqPath); + // Filer out bundled folder which is treated by a special + // implementation. + if ( !itemname.equalsAscii( BUNDLED_FOLDER_NAME )) + err = copy_recursive(newSrcUnqPath, newDstUnqPath); } aDir.close(); diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx index 8d6a51cd66be..8a8740eaa28b 100644 --- a/desktop/source/app/userinstall.hxx +++ b/desktop/source/app/userinstall.hxx @@ -29,6 +29,8 @@ #include #include +#define BUNDLED_FOLDER_NAME "bundled" + namespace desktop { -- cgit From 10bd37c4ce83606833f4addb1832600380e175a6 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 14 Jul 2010 14:35:59 +0200 Subject: dba33g: #i110067# correct word occurred --- connectivity/source/resource/conn_shared_res.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src index 87f69a4aabd0..3c384cbaa232 100644 --- a/connectivity/source/resource/conn_shared_res.src +++ b/connectivity/source/resource/conn_shared_res.src @@ -131,7 +131,7 @@ String STR_STMT_TYPE_NOT_SUPPORTED String STR_UNSPECIFIED_ERROR { - Text [ en-US ] = "An unknown error occured."; + Text [ en-US ] = "An unknown error occurred."; }; String STR_COULD_NOT_CREATE_ADDRESSBOOK -- cgit From aa183d45c83d5465ad77e8902e2314f2477ba2c5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 14 Jul 2010 14:17:11 +0100 Subject: emailmerge33fix: #i113134# --- scripting/source/pyprov/mailmerge.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index 55c204f87dbf..6592a59d1843 100644 --- a/scripting/source/pyprov/mailmerge.py +++ b/scripting/source/pyprov/mailmerge.py @@ -153,8 +153,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService): if len(textbody): mimeEncoding = re.sub("charset=.*", "charset=UTF-8", flavor.MimeType) - if mimeEncoding.find('charset=UTF-8') == -1: - mimeEncoding = mimeEncoding + "; charset=UTF-8" + if mimeEncoding.find('charset=UTF-8') == -1: + mimeEncoding = mimeEncoding + "; charset=UTF-8" textmsg['Content-Type'] = mimeEncoding textmsg['MIME-Version'] = '1.0' textmsg.set_payload(textbody) -- cgit From 68eea8200bde2d0d7228579b3eefe01451ff0ddd Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 14 Jul 2010 15:17:57 +0200 Subject: jl154 #162868# removing registration data folder if the last extension was removed --- desktop/source/deployment/manager/dp_manager.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 44bc4d469f2f..f42940d5c21b 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -949,6 +949,15 @@ void PackageManagerImpl::removePackage( contentRemoved.writeStream( xData, true /* replace existing */ ); } m_activePackagesDB->erase( id, fileName ); // to be removed upon next start + //Remove the database folder (user installation) completely if this was + //the last extension. Do not do this for tmp because it is used often + ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); + if (id2temp.size() && !m_context.equals(OUSTR("tmp"))) + { + erase_path( m_registrationData, + Reference(), + false /* no throw: ignore errors */ ); + } } try_dispose( xPackage ); -- cgit From a95d6a3fb831f13fefd316e5147fb183e8ed3b0d Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 14 Jul 2010 15:25:10 +0200 Subject: dba33g: #i111345# handle string sep corrected --- connectivity/source/drivers/flat/ETable.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index eff2464ce533..70be592405eb 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -159,7 +159,10 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) (m_cStringDelimiter && m_cStringDelimiter == aField.GetChar(0))) { bNumeric = FALSE; - nStartPosFirstLine2 = nStartPosFirstLine; + if ( m_cStringDelimiter != '\0' ) + aFirstLine.GetTokenSpecial(aField,nStartPosFirstLine2,m_cFieldDelimiter,m_cStringDelimiter); + else + nStartPosFirstLine2 = nStartPosFirstLine; } else { -- cgit From 0348b3a8bcec9ec8a6b06be61bdd997b835efd16 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 14 Jul 2010 15:34:49 +0200 Subject: dba33g: #i110067# reverting --- connectivity/source/resource/conn_shared_res.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src index 3c384cbaa232..87f69a4aabd0 100644 --- a/connectivity/source/resource/conn_shared_res.src +++ b/connectivity/source/resource/conn_shared_res.src @@ -131,7 +131,7 @@ String STR_STMT_TYPE_NOT_SUPPORTED String STR_UNSPECIFIED_ERROR { - Text [ en-US ] = "An unknown error occurred."; + Text [ en-US ] = "An unknown error occured."; }; String STR_COULD_NOT_CREATE_ADDRESSBOOK -- cgit From 07daaab0760e97b8449ec7f123b005d7b4e4a94a Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 15 Jul 2010 07:46:31 +0200 Subject: dba33g: #i111345# wrong error message used when opening invalid table format --- connectivity/source/drivers/dbase/DTable.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 8544e4affda7..157d1f7b68fa 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -2607,7 +2607,7 @@ void ODbaseTable::throwInvalidDbaseFormat() // no dbase file const ::rtl::OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( - STR_SQL_NAME_ERROR, + STR_INVALID_DBASE_FILE, "$filename$", getEntry(m_pConnection,m_Name) ) ); ::dbtools::throwGenericSQLException( sError, *this ); -- cgit From a186784b389b90d15976d84172682927080f1197 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 15:38:43 +0200 Subject: jl154 #162868# fix warnings caused by 990df1d5ff27 --- desktop/source/app/app.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 01c07b9d3e4a..65059555ba35 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -545,7 +545,7 @@ static ::rtl::OUString getBasePresetsPathURL() if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) { ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); - ::sal_uInt32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); if ( nLastIndex != aBaseInstallURL.getLength()-1 ) aTmp.appendAscii( "/" ); @@ -569,7 +569,7 @@ static ::rtl::OUString getUserBundledExtPathURL() static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() { ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); - ::sal_uInt32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); @@ -583,7 +583,7 @@ static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() static ::rtl::OUString getLastSyncFileURLFromUserInstallation() { ::rtl::OUString aUserBundledPathURL = getUserBundledExtPathURL(); - ::sal_uInt32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); + ::sal_Int32 nLastIndex = aUserBundledPathURL.lastIndexOf('/'); ::rtl::OUStringBuffer aTmp( aUserBundledPathURL ); @@ -701,6 +701,7 @@ void Desktop::Init() // copy bundled folder to the user directory osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); + (void) rc; copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); } } -- cgit From eafd07c25e04d525d726ac5427ea4f619b95daae Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 15 Jul 2010 11:11:50 +0200 Subject: jl154 #162868# undoing: removing registration data folder if the last extension was removed, which was instroduced with eaf4b98ce57a --- desktop/source/deployment/manager/dp_manager.cxx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index f42940d5c21b..44bc4d469f2f 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -949,15 +949,6 @@ void PackageManagerImpl::removePackage( contentRemoved.writeStream( xData, true /* replace existing */ ); } m_activePackagesDB->erase( id, fileName ); // to be removed upon next start - //Remove the database folder (user installation) completely if this was - //the last extension. Do not do this for tmp because it is used often - ActivePackages::Entries id2temp( m_activePackagesDB->getEntries() ); - if (id2temp.size() && !m_context.equals(OUSTR("tmp"))) - { - erase_path( m_registrationData, - Reference(), - false /* no throw: ignore errors */ ); - } } try_dispose( xPackage ); -- cgit From dfb885a53b8e92b766f13b8f67660f0b58882761 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 15 Jul 2010 14:30:44 +0200 Subject: mib17: #i112634# do not use an UNO interface to handle VBA BeforeSave and BeforePrint events --- sfx2/inc/sfx2/objsh.hxx | 3 +++ sfx2/source/doc/objserv.cxx | 23 +++-------------------- sfx2/source/doc/objstor.cxx | 7 +++++++ sfx2/source/doc/objxtor.cxx | 7 +++++++ sfx2/source/view/viewprn.cxx | 14 ++------------ 5 files changed, 22 insertions(+), 32 deletions(-) diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 49223c23de75..abe6a8068513 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -346,6 +346,9 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); virtual void UpdateLinks(); + // called for a few slots like SID_SAVE[AS]DOC, SID_PRINTDOC[DIRECT], derived classes may abort the action + virtual sal_Bool QuerySlotExecutable( USHORT nSlotId ); + sal_Bool SaveChildren(BOOL bObjectsOnly=FALSE); sal_Bool SaveAsChildren( SfxMedium &rMedium ); sal_Bool SwitchChildrenPersistance( diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ae3b527ff7a6..066f366b09bd 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -100,7 +100,6 @@ #include #include #include -#include #include "helpid.hrc" @@ -490,21 +489,12 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_SAVEASDOC: case SID_SAVEDOC: { - // ask VBA emulation at document model whether to save the document - if( nId == SID_SAVEDOC || nId == SID_SAVEASDOC ) try + // derived class may decide to abort this + if( !QuerySlotExecutable( nId ) ) { - Reference< script::vba::XCoreEventProcessor > xEventProcessor( GetModel(), UNO_QUERY_THROW ); - xEventProcessor->processCoreVbaEvent( nId ); - } - catch( util::VetoException& ) - { - // VBA event handler indicates to cancel saving the document - rReq.SetReturnValue( SfxBoolItem( 0, TRUE ) ); + rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); return; } - catch( Exception& ) - { - } //!! detaillierte Auswertung eines Fehlercodes SfxObjectShellRef xLock( this ); @@ -914,13 +904,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) //------------------------------------------------------------------------- -sal_Bool SfxObjectShell::IsInPrepareClose() const -{ - return pImp->bInPrepareClose; -} - -//-------------------------------------------------------------------- - void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) { DBG_CHKTHIS(SfxObjectShell, 0); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 6e1d89f2a8cd..e1b22ca26a22 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -195,6 +195,13 @@ sal_Bool SfxObjectShell::SaveAs( SfxMedium& rMedium ) //------------------------------------------------------------------------- +sal_Bool SfxObjectShell::QuerySlotExecutable( USHORT /*nSlotId*/ ) +{ + return sal_True; +} + +//------------------------------------------------------------------------- + sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd ) { const SfxPoolItem* pItem = NULL; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 6502eeaeb78c..f8b6cfe44407 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -524,6 +524,13 @@ SfxObjectShell* SfxObjectShell::Current() return pFrame ? pFrame->GetObjectShell() : 0; } +//------------------------------------------------------------------------- + +sal_Bool SfxObjectShell::IsInPrepareClose() const +{ + return pImp->bInPrepareClose; +} + //------------------------------------------------------------------------ struct BoolEnv_Impl diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index faf392c90f32..227099e7d783 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -29,7 +29,6 @@ #include "precompiled_sfx2.hxx" #include -#include #include #include "com/sun/star/view/XRenderable.hpp" @@ -699,21 +698,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) { SfxObjectShell* pDoc = GetObjectShell(); - // ask VBA emulation at document model whether to print the document - try + // derived class may decide to abort this + if( !pDoc->QuerySlotExecutable( nId ) ) { - uno::Reference< script::vba::XCoreEventProcessor > xEventProcessor( pDoc->GetModel(), uno::UNO_QUERY_THROW ); - xEventProcessor->processCoreVbaEvent( nId ); - } - catch( util::VetoException& ) - { - // VBA event handler indicates to cancel printing the document rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) ); return; } - catch( uno::Exception& ) - { - } bool bDetectHidden = ( !bSilent && pDoc ); if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) -- cgit From 4d5f552378c194e195c7d20f3b90d2e582a70c7c Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 15 Jul 2010 15:24:06 +0200 Subject: CWS changehid: #i111874#: fix warning --- framework/inc/uielement/commandinfo.hxx | 2 +- framework/source/uielement/toolbarmanager.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/inc/uielement/commandinfo.hxx b/framework/inc/uielement/commandinfo.hxx index 5b9822af86e6..58aa382bc6eb 100644 --- a/framework/inc/uielement/commandinfo.hxx +++ b/framework/inc/uielement/commandinfo.hxx @@ -53,7 +53,7 @@ struct CommandInfo bRotated( false ) {} USHORT nId; - sal_uInt32 nWidth; + sal_uInt16 nWidth; ::std::vector< USHORT > aIds; sal_Int16 nImageInfo; sal_Bool bMirrored : 1, diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 7010fe1de8be..cae11097a7be 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -953,7 +953,7 @@ void ToolBarManager::CreateControllers() sal_Bool bCreate( sal_True ); Reference< XStatusListener > xController; CommandToInfoMap::iterator pCommandIter = m_aCommandMap.find( aCommandURL ); - sal_Int32 nWidth = ( pCommandIter != m_aCommandMap.end() ? pCommandIter->second.nWidth : 0 ); + sal_Int16 nWidth = ( pCommandIter != m_aCommandMap.end() ? pCommandIter->second.nWidth : 0 ); svt::ToolboxController* pController( 0 ); @@ -1299,7 +1299,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine rtl::OUString aHelpURL; rtl::OUString aTooltip; sal_uInt16 nType( ::com::sun::star::ui::ItemType::DEFAULT ); - sal_uInt32 nWidth( 0 ); + sal_uInt16 nWidth( 0 ); sal_Bool bIsVisible( sal_True ); sal_uInt32 nStyle( 0 ); -- cgit From f63122a36c49fddb002aa366c656baace37c25d8 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 15 Jul 2010 15:24:55 +0200 Subject: CWS changehid: #i111874#: remove unnecessary HelpIds --- sfx2/util/hidother.src | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 38e5577a72be..262bfdf4639d 100644 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src @@ -159,7 +159,6 @@ hidspecial HID_HELP_TOOLBOXITEM_PRINT { HelpID = HID_HELP_TOOLBOXITEM_ hidspecial HID_HELP_TOOLBOXITEM_BOOKMARKS { HelpID = HID_HELP_TOOLBOXITEM_BOOKMARKS; }; hidspecial HID_HELP_TOOLBOXITEM_SEARCHDIALOG { HelpID = HID_HELP_TOOLBOXITEM_SEARCHDIALOG; }; hidspecial HID_TBXCONTROL_FILENEW { HelpID = HID_TBXCONTROL_FILENEW; }; -hidspecial HID_GLOBAL_FALLBACK { HelpID = HID_GLOBAL_FALLBACK; }; hidspecial HID_CLOSE_WARNING { HelpID = HID_CLOSE_WARNING; }; hidspecial HID_DID_SAVE_PACKED_XML { HelpID = HID_DID_SAVE_PACKED_XML; }; hidspecial HID_HELP_ONHELP { HelpID = HID_HELP_ONHELP; }; -- cgit From ac14f52fbfc33dc2fd8e0cdc2d51282aca15df34 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 16 Jul 2010 08:47:44 +0100 Subject: cmcfixes77: #i80021# system libtextcat --- officecfg/registry/data/org/openoffice/Office/Paths.xcu | 3 ++- officecfg/registry/data/org/openoffice/Office/makefile.mk | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index 91a26137b24d..d3fc01869793 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -169,7 +169,8 @@ - + + diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk index e65b03371da3..167f3d5bc144 100644 --- a/officecfg/registry/data/org/openoffice/Office/makefile.mk +++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk @@ -87,6 +87,8 @@ MODULEFILES= \ Paths-macosx.xcu \ Paths-unxwnt.xcu \ Paths-unixdesktop.xcu \ + Paths-internallibtextcat.xcu \ + Paths-externallibtextcat.xcu \ Writer-cjk.xcu \ Impress-ogltrans.xcu \ Embedding-calc.xcu \ -- cgit From 3ceb8dd77e9750449f20e01966b1b466741a922f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 16 Jul 2010 11:06:18 +0200 Subject: mib17: #162980# Force Broadcast in StepIS for SbxEmpty --- basic/source/runtime/step0.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 1d9333ff7555..bdbb22678bf3 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -312,9 +312,21 @@ void SbiRuntime::StepIS() { SbxVariableRef refVar1 = PopVar(); SbxVariableRef refVar2 = PopVar(); - BOOL bRes = BOOL( - refVar1->GetType() == SbxOBJECT - && refVar2->GetType() == SbxOBJECT ); + + SbxDataType eType1 = refVar1->GetType(); + SbxDataType eType2 = refVar2->GetType(); + if ( eType1 == SbxEMPTY ) + { + refVar1->Broadcast( SBX_HINT_DATAWANTED ); + eType1 = refVar1->GetType(); + } + if ( eType2 == SbxEMPTY ) + { + refVar2->Broadcast( SBX_HINT_DATAWANTED ); + eType2 = refVar2->GetType(); + } + + BOOL bRes = BOOL( eType1 == SbxOBJECT && eType2 == SbxOBJECT ); if ( bVBAEnabled && !bRes ) Error( SbERR_INVALID_USAGE_OBJECT ); bRes = ( bRes && refVar1->GetObject() == refVar2->GetObject() ); -- cgit From 2fdbe093bbc806002fa0fa1b9c6eb124939c433e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 16 Jul 2010 14:44:32 +0100 Subject: cmcfixes77: #i80021# system libtextcat --- officecfg/registry/data/org/openoffice/Office/Paths.xcu | 4 ++-- officecfg/registry/data/org/openoffice/Office/makefile.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Paths.xcu b/officecfg/registry/data/org/openoffice/Office/Paths.xcu index d3fc01869793..37eebe5c2a22 100644 --- a/officecfg/registry/data/org/openoffice/Office/Paths.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Paths.xcu @@ -169,8 +169,8 @@ - - + + diff --git a/officecfg/registry/data/org/openoffice/Office/makefile.mk b/officecfg/registry/data/org/openoffice/Office/makefile.mk index 167f3d5bc144..2af1e8629bd9 100644 --- a/officecfg/registry/data/org/openoffice/Office/makefile.mk +++ b/officecfg/registry/data/org/openoffice/Office/makefile.mk @@ -87,8 +87,8 @@ MODULEFILES= \ Paths-macosx.xcu \ Paths-unxwnt.xcu \ Paths-unixdesktop.xcu \ - Paths-internallibtextcat.xcu \ - Paths-externallibtextcat.xcu \ + Paths-internallibtextcatdata.xcu \ + Paths-externallibtextcatdata.xcu \ Writer-cjk.xcu \ Impress-ogltrans.xcu \ Embedding-calc.xcu \ -- cgit From f1482b059a1906c9098e0c37df315ad1ca8a83b1 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 16 Jul 2010 15:51:02 +0200 Subject: CWS changehid: #i111784#: helpid fallback on command name used --- framework/source/uielement/macrosmenucontroller.cxx | 2 -- framework/source/uielement/toolbarmanager.cxx | 1 - 2 files changed, 3 deletions(-) diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index 44f968a45788..afe2e7173086 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -102,7 +102,6 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo String aDisplayName = RetrieveLabelFromCommand( aCommand ); pPopupMenu->InsertItem( 2, aDisplayName ); pPopupMenu->SetItemCommand( 2, aCommand ); - pPopupMenu->SetHelpId( 2, ".uno:MacroDialog" ); // insert providers but not basic or java addScriptItems( pPopupMenu, 4); @@ -222,7 +221,6 @@ void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, USHORT startIt aDisplayName.Append( ellipsis ); pPopupMenu->InsertItem( itemId, aDisplayName ); pPopupMenu->SetItemCommand( itemId, aCommand ); - pPopupMenu->SetHelpId( itemId, rtl::OString( aCommand.GetBuffer(), aCommand.Len(), RTL_TEXTENCODING_UTF8 ) ); itemId++; break; } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index cae11097a7be..ebaf097bb79f 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -957,7 +957,6 @@ void ToolBarManager::CreateControllers() svt::ToolboxController* pController( 0 ); - m_pToolBar->SetHelpId( nId, "" ); // reset value again if ( bHasDisabledEntries ) { aURL.Complete = aCommandURL; -- cgit From 2d07734f316c1795bc59ed0974b3dc6612ed3f24 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 16 Jul 2010 15:51:27 +0200 Subject: CWS changehid: #i111784#: remve wrong commit --- idl/source/prj/command.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx index 9509219eb99a..4b2535a7e61b 100644 --- a/idl/source/prj/command.cxx +++ b/idl/source/prj/command.cxx @@ -276,8 +276,6 @@ SvCommand::SvCommand( int argc, char ** argv ) if( 's' == aFirstChar ) { // Name der Slot-Ausgabe aSlotMapFile = aName; - aName += String::CreateFromAscii(".csv"); - aCSVFile = aName; } else if( 'l' == aFirstChar ) { // Name der Listing -- cgit From f4fb9d6add29f3904f48928e3b1b25f0f226ce41 Mon Sep 17 00:00:00 2001 From: "Eike Rathke [er]" Date: Fri, 16 Jul 2010 20:13:45 +0200 Subject: calc56: #i108385# make TEXT return text if text was passed, handling text formats that include a @ code --- formula/inc/formula/errorcodes.hxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/formula/inc/formula/errorcodes.hxx b/formula/inc/formula/errorcodes.hxx index f9b04e012fab..f08af17e095e 100644 --- a/formula/inc/formula/errorcodes.hxx +++ b/formula/inc/formula/errorcodes.hxx @@ -64,7 +64,8 @@ const USHORT errInterpOverflow = 527; // Not displayed, temporary for TrackFormulas, // Cell depends on another cell that has errCircularReference const USHORT errTrackFromCircRef = 528; -// Interpreter internal: existing cell has no value but value queried +// ScInterpreter internal: no numeric value but numeric queried. If this is +// set as mnStringNoValueError no error is generated but 0 returned. const USHORT errCellNoValue = 529; // Interpreter: needed AddIn not found const USHORT errNoAddin = 530; @@ -74,6 +75,11 @@ const USHORT errNoMacro = 531; const USHORT errDivisionByZero = 532; // #DIV/0! // Compiler: a non-simple (str,err,val) value was put in an array const USHORT errNestedArray = 533; +// ScInterpreter internal: no numeric value but numeric queried. If this is +// temporarily (!) set as mnStringNoValueError, the error is generated and can +// be used to distinguish that condition from all other (inherited) errors. Do +// not use for anything else! Never push or inherit the error otherwise! +const USHORT errNotNumericString = 534; // Interpreter: NA() not available condition, not a real error const USHORT NOTAVAILABLE = 0x7fff; -- cgit From 98fa152c8e66fd881c5ed9ee4e81d709d7533d03 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 17 Sep 2010 11:15:04 +0200 Subject: sb123: #i112778# disabled some xmloff.*.XML*Exporter::com::sun::star::document::XFilter for now --- xmloff/qa/unoapi/knownissues.xcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmloff/qa/unoapi/knownissues.xcl b/xmloff/qa/unoapi/knownissues.xcl index ac15aad11e71..55e277017e3f 100644 --- a/xmloff/qa/unoapi/knownissues.xcl +++ b/xmloff/qa/unoapi/knownissues.xcl @@ -14,3 +14,8 @@ xmloff.Impress.XMLStylesImporter::com::sun::star::xml::sax::XDocumentHandler xmloff.Draw.XMLStylesExporter xmloff.Impress.XMLStylesExporter #-> disabled in xmloff.sce + +### i112778 ### +xmloff.Draw.XMLContentExporter::com::sun::star::document::XFilter +xmloff.Draw.XMLMetaExporter::com::sun::star::document::XFilter +xmloff.Impress.XMLMetaExporter::com::sun::star::document::XFilter -- cgit From 4dc2f5baaa474397e66bd554cbd7111b7356b071 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 19 Jul 2010 15:16:41 +0200 Subject: sb123: #i113245# disabled fwl.TypeDetection for now --- framework/qa/unoapi/framework.sce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/qa/unoapi/framework.sce b/framework/qa/unoapi/framework.sce index cb8b36605820..76f3d1b089ac 100755 --- a/framework/qa/unoapi/framework.sce +++ b/framework/qa/unoapi/framework.sce @@ -2,7 +2,7 @@ -o fwl.FilterFactory -o fwl.FrameLoaderFactory -o fwl.SubstituteVariables --o fwl.TypeDetection +#i113245 -o fwl.TypeDetection #i84346 -o fwl.PathSettings -o fwk.DispatchRecorder -o fwk.DispatchRecorderSupplier -- cgit From fc36d6a80a11f89c6a155f737e6a42665c039564 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Jul 2010 17:13:56 +0200 Subject: CWS changehid: #i111784#: use mhids.pl to generate conversion list for HIDs --- avmedia/inc/helpids.hrc | 2 -- desktop/source/inc/helpid.hrc | 2 -- editeng/inc/helpid.hrc | 5 ----- formula/inc/helpids.hrc | 4 ---- formula/util/hidother.src | 4 ---- framework/inc/helpid.hrc | 6 ------ sfx2/source/inc/helpid.hrc | 1 - sfx2/util/hidother.src | 41 ----------------------------------------- svx/inc/fmhelp.hrc | 3 --- svx/inc/helpid.hrc | 3 --- svx/inc/svx/exthelpid.hrc | 4 ---- svx/util/hidother.src | 5 ----- 12 files changed, 80 deletions(-) diff --git a/avmedia/inc/helpids.hrc b/avmedia/inc/helpids.hrc index 902230466053..4b1d2e04d628 100644 --- a/avmedia/inc/helpids.hrc +++ b/avmedia/inc/helpids.hrc @@ -28,8 +28,6 @@ #ifndef _AVMEDIA_HELPIDS_HRC #define _AVMEDIA_HELPIDS_HRC -#include - #define HID_AVMEDIA_TOOLBOXITEM_PLAY "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PLAY" #define HID_AVMEDIA_TOOLBOXITEM_PAUSE "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_PAUSE" #define HID_AVMEDIA_TOOLBOXITEM_STOP "AVMEDIA_HID_AVMEDIA_TOOLBOXITEM_STOP" diff --git a/desktop/source/inc/helpid.hrc b/desktop/source/inc/helpid.hrc index 1dfae71768b3..d96b12196342 100644 --- a/desktop/source/inc/helpid.hrc +++ b/desktop/source/inc/helpid.hrc @@ -28,8 +28,6 @@ #if ! defined INCLUDED_DESKTOP_HELPID_HRC #define INCLUDED_DESKTOP_HELPID_HRC -#include "svl/solar.hrc" - #define HID_PACKAGE_MANAGER "DESKTOP_HID_PACKAGE_MANAGER" #define HID_PACKAGE_MANAGER_TREELISTBOX "DESKTOP_HID_PACKAGE_MANAGER_TREELISTBOX" #define HID_PACKAGE_MANAGER_PROGRESS "DESKTOP_HID_PACKAGE_MANAGER_PROGRESS" diff --git a/editeng/inc/helpid.hrc b/editeng/inc/helpid.hrc index 4b6a745c4415..6d6c4822b037 100644 --- a/editeng/inc/helpid.hrc +++ b/editeng/inc/helpid.hrc @@ -30,11 +30,6 @@ #ifndef _EDITENG_HELPID_HRC #define _EDITENG_HELPID_HRC -// include --------------------------------------------------------------- - -#include - -// Help-Ids -------------------------------------------------------------- #define HID_EDITENG_SPELLER_WORDLANGUAGE "EDITENG_HID_EDITENG_SPELLER_WORDLANGUAGE" #define HID_EDITENG_SPELLER_PARALANGUAGE "EDITENG_HID_EDITENG_SPELLER_PARALANGUAGE" #define HID_EDITENG_SPELLER_ADDWORD "EDITENG_HID_EDITENG_SPELLER_ADDWORD" diff --git a/formula/inc/helpids.hrc b/formula/inc/helpids.hrc index 796f46752411..5502c4370d58 100644 --- a/formula/inc/helpids.hrc +++ b/formula/inc/helpids.hrc @@ -27,10 +27,6 @@ #ifndef FORMULA_HELPID_HRC #define FORMULA_HELPID_HRC -#ifndef _SOLAR_HRC -#include // HID_FORMULA_START -#endif - #define HID_FORMULADLG_FORMULA "FORMULA_HID_FORMULADLG_FORMULA" #define HID_FORMULA_FAP_FORMULA "FORMULA_HID_FORMULA_FAP_FORMULA" #define HID_FORMULA_FAP_STRUCT "FORMULA_HID_FORMULA_FAP_STRUCT" diff --git a/formula/util/hidother.src b/formula/util/hidother.src index 8cf49660e919..09a79b694e87 100644 --- a/formula/util/hidother.src +++ b/formula/util/hidother.src @@ -27,10 +27,6 @@ #include "../inc/helpids.hrc" -#ifndef _SBASLTID_HRC -#include -#endif - hidspecial HID_FORMULADLG_FORMULA { HelpId = HID_FORMULADLG_FORMULA; }; hidspecial HID_FORMULA_FAP_FORMULA { HelpId = HID_FORMULA_FAP_FORMULA; }; hidspecial HID_FORMULA_FAP_STRUCT { HelpId = HID_FORMULA_FAP_STRUCT; }; diff --git a/framework/inc/helpid.hrc b/framework/inc/helpid.hrc index 3f9068e65d26..b5cd1f6a4ac1 100644 --- a/framework/inc/helpid.hrc +++ b/framework/inc/helpid.hrc @@ -27,12 +27,6 @@ #ifndef _FRAMEWORK_HELPID_HRC #define _FRAMEWORK_HELPID_HRC -// include ------------------------------------------------------------------ - -#include - -// Help-Ids ----------------------------------------------------------------- - #define HID_BACKINGWINDOW "FWK_HID_BACKINGWINDOW" #define HID_LICENSEDIALOG "FWK_HID_LICENSEDIALOG" #define HID_STATUSBAR "FWK_HID_STATUSBAR" diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index d15a8b0f9962..c9054643fc11 100755 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -29,7 +29,6 @@ // include ------------------------------------------------------------------ -#include #include // Help-Ids ----------------------------------------------------------------- diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index 262bfdf4639d..ccce4820cf2f 100644 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src @@ -26,9 +26,6 @@ ************************************************************************/ #include "../source/inc/helpid.hrc" // HID_XXX -#include "../inc/sfx2/sfxsids.hrc" // SID_XXX -#include "../inc/sfx2/sfx.hrc" - hidspecial HID_APP_WIN { HelpID = HID_APP_WIN; }; hidspecial HID_DESKTOP { HelpID = HID_DESKTOP; }; @@ -40,27 +37,15 @@ hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; }; hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; }; hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; }; -hidspecial HID_INTERFACE_SFXMAILVIEW { HelpID = HID_INTERFACE_SFXMAILVIEW; }; -hidspecial HID_INTERFACE_SFXEXPLVIEWSH { HelpID = HID_INTERFACE_SFXEXPLVIEWSH; }; -hidspecial HID_INTERFACE_SFXFRAMESETVIEW { HelpID = HID_INTERFACE_SFXFRAMESETVIEW; }; -hidspecial HID_INTERFACE_SFXFRAMESETSOURCEVIEW { HelpID = HID_INTERFACE_SFXFRAMESETSOURCEVIEW; }; -hidspecial HID_INTERFACE_SFXHELP_VIEWSH { HelpID = HID_INTERFACE_SFXHELP_VIEWSH; }; hidspecial HID_PREVIEW_FRAME { HelpID = HID_PREVIEW_FRAME; }; hidspecial HID_PRINT_OPTIONS { HelpID = HID_PRINT_OPTIONS; }; hidspecial HID_TEMPLATE_FILTER { HelpID = HID_TEMPLATE_FILTER; }; hidspecial HID_TEMPLATE_FMT { HelpID = HID_TEMPLATE_FMT; }; hidspecial HID_SEARCH_DLG_TABLB { HelpID = HID_SEARCH_DLG_TABLB; }; -hidspecial SID_STYLE_FAMILY1 { HelpID = SID_STYLE_FAMILY1; }; -hidspecial SID_STYLE_FAMILY2 { HelpID = SID_STYLE_FAMILY2; }; -hidspecial SID_STYLE_FAMILY3 { HelpID = SID_STYLE_FAMILY3; }; -hidspecial SID_STYLE_FAMILY4 { HelpID = SID_STYLE_FAMILY4; }; -hidspecial SID_STYLE_FAMILY5 { HelpID = SID_STYLE_FAMILY5; }; -hidspecial SID_FILTER_NAME { HelpID = SID_FILTER_NAME; }; hidspecial HID_NAVIGATOR_WINDOW { HelpID = HID_NAVIGATOR_WINDOW; }; hidspecial HID_HELPAGENT_TIP_BOX { HelpId = HID_HELPAGENT_TIP_BOX; }; hidspecial HID_TEMPLDLG_TOOLBOX_LEFT { HelpId = HID_TEMPLDLG_TOOLBOX_LEFT;}; hidspecial HID_EXPLORER_SRCH_COUNT { HelpId = HID_EXPLORER_SRCH_COUNT;}; -hidspecial HID_INTERFACE_SFXPLUGINVIEW { HelpID = HID_INTERFACE_SFXPLUGINVIEW; }; hidspecial HID_TABDLG_RESET_BTN { HelpID = HID_TABDLG_RESET_BTN; }; hidspecial HID_TABDLG_STANDARD_BTN { HelpID = HID_TABDLG_STANDARD_BTN; }; hidspecial HID_CONFIG_EVENT_OFFICE_BASED { HelpID = HID_CONFIG_EVENT_OFFICE_BASED; }; @@ -70,35 +55,10 @@ hidspecial HID_EXPLORERMENU_ARRANGEICONS { HelpID = HID_EXPLORERMENU_ARRA hidspecial HID_EXPLORERMENU_STDTEMPLATE { HelpID = HID_EXPLORERMENU_STDTEMPLATE; }; hidspecial HID_EXPLORER_DOCVIEW_ICON { HelpID = HID_EXPLORER_DOCVIEW_ICON; }; hidspecial HID_EXPLORER_DOCVIEW_DETAILS { HelpID = HID_EXPLORER_DOCVIEW_DETAILS; }; -hidspecial HID_CHAOSDOC_WIN { HelpID = HID_CHAOSDOC_WIN; }; -hidspecial HID_CHAOSDOC_WIN_HEADER { HelpID = HID_CHAOSDOC_WIN_HEADER; }; -hidspecial HID_CHAOSDOC_WIN_PARTS { HelpID = HID_CHAOSDOC_WIN_PARTS; }; -hidspecial HID_CHAOSDOC_WIN_BODY { HelpID = HID_CHAOSDOC_WIN_BODY; }; hidspecial HID_BRWBOX_HEADERBAR { HelpID = HID_BRWBOX_HEADERBAR; }; hidspecial HID_TASKBAR { HelpID = HID_TASKBAR; }; hidspecial HID_TASKBUTTONBAR { HelpID = HID_TASKBUTTONBAR; }; hidspecial HID_TASKTOOLBAR { HelpID = HID_TASKTOOLBAR; }; -hidspecial HID_CHAOS_NEW_IMAP_BOX { HelpID = HID_CHAOS_NEW_IMAP_BOX; }; -hidspecial HID_CHAOS_NEW_IMAP_MSG { HelpID = HID_CHAOS_NEW_IMAP_MSG; }; -hidspecial HID_CHAOS_NEW_IMAP_FLD { HelpID = HID_CHAOS_NEW_IMAP_FLD; }; -hidspecial HID_CHAOS_NEW_NEWS_BOX { HelpID = HID_CHAOS_NEW_NEWS_BOX; }; -hidspecial HID_CHAOS_NEW_NEWS_MSG { HelpID = HID_CHAOS_NEW_NEWS_MSG; }; -hidspecial HID_CHAOS_NEW_IMAP_BOX { HelpID = HID_CHAOS_NEW_IMAP_BOX; }; -hidspecial HID_CHAOS_NEW_FSYS_FLD { HelpID = HID_CHAOS_NEW_FSYS_FLD; }; -hidspecial HID_CHAOS_NEW_FSYS_LNK { HelpID = HID_CHAOS_NEW_FSYS_LNK; }; -hidspecial HID_CHAOS_NEW_FTP_BOX { HelpID = HID_CHAOS_NEW_FTP_BOX; }; -hidspecial HID_CHAOS_NEW_FTP_FLD { HelpID = HID_CHAOS_NEW_FTP_FLD; }; -hidspecial HID_CHAOS_NEW_OUT_BOX { HelpID = HID_CHAOS_NEW_OUT_BOX; }; -hidspecial HID_CHAOS_NEW_OUT_MSG { HelpID = HID_CHAOS_NEW_OUT_MSG; }; -hidspecial HID_CHAOS_NEW_POP3_BOX { HelpID = HID_CHAOS_NEW_POP3_BOX; }; -hidspecial HID_CHAOS_NEW_POP3_MSG { HelpID = HID_CHAOS_NEW_POP3_MSG; }; -hidspecial HID_CHAOS_NEW_SEARCH { HelpID = HID_CHAOS_NEW_SEARCH; }; -hidspecial HID_CHAOS_NEW_VIM_BOX { HelpID = HID_CHAOS_NEW_VIM_BOX; }; -hidspecial HID_CHAOS_NEW_VIM_MSG { HelpID = HID_CHAOS_NEW_VIM_MSG; }; -hidspecial HID_CHAOS_NEW_SUBSCR_BOX { HelpID = HID_CHAOS_NEW_SUBSCR_BOX; }; -hidspecial HID_CHAOS_NEW_BOOKMARK { HelpID = HID_CHAOS_NEW_BOOKMARK; }; -hidspecial HID_CHAOS_NEW_PUB_BOX { HelpID = HID_CHAOS_NEW_PUB_BOX; }; -hidspecial HID_UUI_END { HelpID = HID_UUI_END; }; // aka HID_CHAOS_NEW_DATABASE hidspecial HID_CNT_DLG_SEARCH_BT_SHOW { HelpID = HID_CNT_DLG_SEARCH_BT_SHOW; }; hidspecial HID_CNT_DLG_SEARCH_BT_UPDATE { HelpID = HID_CNT_DLG_SEARCH_BT_UPDATE; }; hidspecial HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE { HelpID = HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE; }; @@ -107,7 +67,6 @@ hidspecial HID_CNT_PAGE_HEADER { HelpID = HID_CNT_PAGE_HEADER; hidspecial HID_CNT_PAGE_DESCRIPTION { HelpID = HID_CNT_PAGE_DESCRIPTION; }; hidspecial HID_CNT_LB_HEADER { HelpID = HID_CNT_LB_HEADER; }; hidspecial HID_CNT_LB_DESCRIPTION { HelpID = HID_CNT_LB_DESCRIPTION; }; -hidspecial SID_GROUPVIEW { HelpID = SID_GROUPVIEW; }; hidspecial HID_GROUPVIEW_CONTENT_BIG { HelpID = HID_GROUPVIEW_CONTENT_BIG; }; hidspecial HID_GROUPVIEW_CONTENT_SMALL { HelpID = HID_GROUPVIEW_CONTENT_SMALL; }; hidspecial HID_GROUPVIEW_CONTENT_TREE { HelpID = HID_GROUPVIEW_CONTENT_TREE; }; diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index 6c4787cd1fbc..1222145655c1 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -27,9 +27,6 @@ #ifndef _SVX_FMHELP_HRC #define _SVX_FMHELP_HRC -// include ----------------------------------------------------------- -#include - // Help-Ids -------------------------------------------------------------- #define HID_DLG_DBMSG "SVX_HID_DLG_DBMSG" #define HID_FORM_NAVIGATOR "SVX_HID_FORM_NAVIGATOR" diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc index 21912fdc2829..be75fe019f96 100644 --- a/svx/inc/helpid.hrc +++ b/svx/inc/helpid.hrc @@ -26,9 +26,6 @@ ************************************************************************/ #ifndef _SVX_HELPID_HRC #define _SVX_HELPID_HRC -// include --------------------------------------------------------------- - -#include #include #include diff --git a/svx/inc/svx/exthelpid.hrc b/svx/inc/svx/exthelpid.hrc index 4d885e422b70..360a4914c10e 100644 --- a/svx/inc/svx/exthelpid.hrc +++ b/svx/inc/svx/exthelpid.hrc @@ -28,8 +28,6 @@ #define _SVX_EXTHELPID_HRC // include --------------------------------------------------------------- -#include - // these HIDs are used in SVX and also in other modules, mainly CUI // the reason is that different controls have the same help texts assigned // but are implemented in different libraries @@ -40,7 +38,5 @@ #define HID_GALLERY_ACTUALIZE "SVX_HID_GALLERY_ACTUALIZE" #define HID_GALLERY_TITLE "SVX_HID_GALLERY_TITLE" -// please adjust ACT_SVX_EXT_HID_END2 below if you add entries here! - #endif diff --git a/svx/util/hidother.src b/svx/util/hidother.src index dd566cf9abdc..e3c1f72cce4d 100644 --- a/svx/util/hidother.src +++ b/svx/util/hidother.src @@ -25,8 +25,6 @@ * ************************************************************************/ #include "../inc/helpid.hrc" // HID_XXX -#include "hidother.hrc" -#include #include "../inc/fmhelp.hrc" /* #define HID_AUTOCORR_HELP_CHGNONBRKSPACE HID_AUTOCORR_HELP_START+20 */ @@ -54,7 +52,6 @@ hidspecial HID_GRID_TRAVEL_LAST { HelpID = HID_GRID_TRAVEL_LAST ;}; hidspecial HID_GRID_TRAVEL_NEW { HelpID = HID_GRID_TRAVEL_NEW ;}; hidspecial HID_GRID_TRAVEL_NEXT { HelpID = HID_GRID_TRAVEL_NEXT ;}; hidspecial HID_GRID_TRAVEL_PREV { HelpID = HID_GRID_TRAVEL_PREV ;}; -hidspecial HID_INTERFACE_BASIDE_VIEWSH { HelpID = HID_INTERFACE_BASIDE_VIEWSH; }; hidspecial HID_POPUP_COLOR { HelpID = HID_POPUP_COLOR; }; hidspecial HID_POPUP_COLOR_CTRL { HelpID = HID_POPUP_COLOR_CTRL; }; hidspecial HID_POPUP_FRAME { HelpID = HID_POPUP_FRAME; }; @@ -74,6 +71,4 @@ hidspecial HID_SVX_CHINESE_DICTIONARY_RB_CONVERSION_TO_TRADITIONAL { HelpId = HI hidspecial HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS { HelpId = HID_SVX_CHINESE_TRANSLATION_CB_USE_VARIANTS; }; hidspecial HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED { HelpId = HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_SIMPLIFIED; }; hidspecial HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL { HelpId = HID_SVX_CHINESE_TRANSLATION_RB_CONVERSION_TO_TRADITIONAL; }; -hidspecial SID_DSBROWSER_EXPLORER { HelpID = SID_DSBROWSER_EXPLORER ;}; -hidspecial SID_GALLERY_IMPORTTHEME { HelpID = SID_GALLERY_IMPORTTHEME; }; hidspecial UID_FORMPROPBROWSER_FRAME { HelpID = UID_FORMPROPBROWSER_FRAME ;}; -- cgit From ab22ac073431af69a5c59cecbff92db6737bd3db Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Jul 2010 17:20:31 +0200 Subject: CWS changehid: #i111784#: fix error in fpicker HelpURL --- fpicker/source/office/OfficeControlAccess.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index 1e34b2eee840..7d33030ed2a9 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -224,7 +224,8 @@ namespace svt // the file view "overloaded" the SetHelpId aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); - rtl::OUString sHelpURL( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); + ::rtl::OUString sHelpURL( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); + sHelpURL += rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ); return sHelpURL; } -- cgit From 61fbf48ab38bb3b3a6cc41de3435f327ccccf830 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Jul 2010 22:04:23 +0200 Subject: CWS changehid: remove code dealing with obsolete SID_INSERT_APPLET --- sfx2/inc/sfx2/sfxsids.hrc | 1 - sfx2/source/appl/appcfg.cxx | 18 --- sfx2/source/appl/appuno.cxx | 1 - sfx2/source/doc/applet.cxx | 383 -------------------------------------------- sfx2/source/doc/makefile.mk | 2 - sfx2/source/inc/applet.hxx | 122 -------------- svx/inc/globlmn_tmpl.hrc | 12 -- svx/sdi/svx.sdi | 27 ---- 8 files changed, 566 deletions(-) delete mode 100644 sfx2/source/doc/applet.cxx delete mode 100644 sfx2/source/inc/applet.hxx diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 26e1991c24b8..9ab4a50b63d8 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -421,7 +421,6 @@ #define SID_INSERT_PLUGIN (SID_SFX_START + 672) #define SID_INSERT_SOUND (SID_SFX_START + 676) #define SID_INSERT_VIDEO (SID_SFX_START + 677) -#define SID_INSERT_APPLET (SID_SFX_START + 673) #define SID_HYPERLINK_DIALOG (SID_SFX_START + 678) diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 6afa8c68ed83..0b5e94ea24f0 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -58,8 +58,6 @@ #include #include -//#include -//#include #include #include @@ -828,22 +826,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) #endif } - // INet Session neu aufsetzen - if ( bResetSession ) - { - // no more sj2 - #if 0 - try - { - SjApplet2::settingsChanged(); - } - catch ( ... ) - { - DBG_ERRORFILE( "SjApplet2::settingsChanged() throws an exception" ); - } - #endif - } - // geaenderte Daten speichern aInetOptions.flush(); } diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 6f9d3b258745..a9c6bd5630ae 100755 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -134,7 +134,6 @@ using namespace ::com::sun::star::io; #include "brokenpackageint.hxx" #include "eventsupplier.hxx" #include "xpackcreator.hxx" -// #include "applet.hxx" #include "plugin.hxx" #include "iframe.hxx" #include diff --git a/sfx2/source/doc/applet.cxx b/sfx2/source/doc/applet.cxx deleted file mode 100644 index 844eb5726b1a..000000000000 --- a/sfx2/source/doc/applet.cxx +++ /dev/null @@ -1,383 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#include "applet.hxx" -#include -#include - -#include "com/sun/star/uno/XComponentContext.hpp" -#include "cppuhelper/factory.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace ::com::sun::star; -using namespace ::comphelper; - -namespace sfx2 -{ -class AppletWindow_Impl : public SystemChildWindow -{ -public: - SjApplet2* pApplet; - AppletWindow_Impl( Window* pParent, SjApplet2* pApp ) - : SystemChildWindow( pParent, WB_CLIPCHILDREN ) - , pApplet(pApp) - {} - - virtual void Resize(); -}; - -void AppletWindow_Impl::Resize() -{ - Size aSize( GetOutputSizePixel() ); - if ( pApplet ) - pApplet->setSizePixel( aSize ); -} - -class AppletWrapper_Impl : public SjApplet2 -{ - virtual void appletResize( const Size & ); - virtual void showDocument( const INetURLObject &, const XubString & ); - virtual void showStatus( const XubString & ); -}; - -void AppletWrapper_Impl::appletResize( const Size & ) {} -void AppletWrapper_Impl::showDocument( const INetURLObject &, const XubString & ) {} -void AppletWrapper_Impl::showStatus( const XubString & ) {} - -#define PROPERTY_UNBOUND 0 -#define PROPERTY_MAYBEVOID ::com::sun::star::beans::PropertyAttribute::MAYBEVOID - -#define WID_APPLET_CODE 1 -#define WID_APPLET_CODEBASE 2 -#define WID_APPLET_COMMANDS 3 -#define WID_APPLET_DOCBASE 4 -#define WID_APPLET_ISSCRIPT 5 -#define WID_APPLET_NAME 6 -const SfxItemPropertyMapEntry* lcl_GetAppletPropertyMap_Impl() -{ - static SfxItemPropertyMapEntry aAppletPropertyMap_Impl[] = - { - { MAP_CHAR_LEN("AppletCode") , WID_APPLET_CODE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletCodeBase"), WID_APPLET_CODEBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletCommands"), WID_APPLET_COMMANDS , CPPU_E2T(CPPUTYPE_PROPERTYVALUE), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletDocBase"), WID_APPLET_DOCBASE , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletIsScript"), WID_APPLET_ISSCRIPT , CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_UNBOUND, 0 }, - { MAP_CHAR_LEN("AppletName") , WID_APPLET_NAME , CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_UNBOUND, 0 }, - {0,0,0,0,0,0} - }; -return aAppletPropertyMap_Impl; -} - -::rtl::OUString AppletObject::getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ) -{ - return impl_getStaticImplementationName(); -} - -::sal_Bool AppletObject::supportsService( const ::rtl::OUString& sServiceName ) - throw( ::com::sun::star::uno::RuntimeException ) -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames = - getSupportedServiceNames(); - const ::rtl::OUString* pArray = seqServiceNames.getConstArray(); - for ( ::sal_Int32 nCounter=0; nCounter -AppletObject::getSupportedServiceNames() - throw( ::com::sun::star::uno::RuntimeException ) -{ - return impl_getStaticSupportedServiceNames(); -} - -::com::sun::star::uno::Sequence< ::rtl::OUString > -AppletObject::impl_getStaticSupportedServiceNames() -{ - ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames( 1 ); - seqServiceNames.getArray() [0] = ::rtl::OUString::createFromAscii( - "com.sun.star.embed.SpecialEmbeddedObject" ); - return seqServiceNames ; -} - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -AppletObject::impl_createInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext >& xContext ) - throw( ::com::sun::star::uno::Exception ) -{ - return static_cast< ::cppu::OWeakObject * >( new AppletObject( xContext ) ); -} - -::rtl::OUString AppletObject::impl_getStaticImplementationName() -{ - return ::rtl::OUString::createFromAscii( - "com.sun.star.comp.sfx2.AppletObject" ); -} - -::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > -AppletObject::impl_createFactory() -{ - return uno::Reference< uno::XInterface >( - cppu::createSingleComponentFactory( - impl_createInstance, impl_getStaticImplementationName(), - impl_getStaticSupportedServiceNames() ), - uno::UNO_QUERY_THROW ); -} - -AppletObject::AppletObject( - const uno::Reference < uno::XComponentContext >& rContext ) - : mxContext( rContext ) - , maPropMap( lcl_GetAppletPropertyMap_Impl() ) - , mpApplet( NULL ) - , mbMayScript( FALSE ) -{ -} - -AppletObject::~AppletObject() -{ -} - -void SAL_CALL AppletObject::initialize( const uno::Sequence< uno::Any >& aArguments ) throw ( uno::Exception, uno::RuntimeException ) -{ - if ( aArguments.getLength() ) - aArguments[0] >>= mxObj; -} - -sal_Bool SAL_CALL AppletObject::load( - const uno::Sequence < com::sun::star::beans::PropertyValue >& /*lDescriptor*/, - const uno::Reference < frame::XFrame >& xFrame ) -throw( uno::RuntimeException ) -{ - if ( SvtJavaOptions().IsExecuteApplets() && SvtMiscOptions().IsPluginsEnabled() ) - { - mpApplet = new AppletWrapper_Impl; - - Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); - Window* pWin = new AppletWindow_Impl( pParent, mpApplet ); - pWin->SetBackground(); - pWin->Show(); - - // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "width" ) ), String( aPosSize.GetWidth() ) ); - // aCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "height" ) ), String( aPosSize.GetHeight() ) ); - - if( maName.getLength() ) - maCmdList.Append( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "name" ) ), maName ); - - if( maCodeBase.getLength() ) - { - for ( sal_uInt32 nParams=0; nParamsInit( mxContext, pWin, aDocBase, maCmdList ); - uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY ); - - // we must destroy the applet before the parent is destroyed - xWindow->addEventListener( this ); - - xFrame->setComponent( xWindow, uno::Reference < frame::XController >() ); - return TRUE; - } - - return FALSE; -} - -void SAL_CALL AppletObject::cancel() throw( com::sun::star::uno::RuntimeException ) -{ - if ( mpApplet ) - { - mpApplet->appletClose(); // reparenting window - DELETEZ( mpApplet ); - } -} - -void SAL_CALL AppletObject::close( sal_Bool /*bDeliverOwnership*/ ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::disposing( const com::sun::star::lang::EventObject& ) throw (com::sun::star::uno::RuntimeException) -{ - cancel(); -} - -uno::Reference< beans::XPropertySetInfo > SAL_CALL AppletObject::getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException ) -{ - static uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo( &maPropMap ); - return xInfo; -} - -void SAL_CALL AppletObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const uno::Any& aAny) - throw ( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) -{ - - const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); - if( !pEntry ) - throw beans::UnknownPropertyException(); - switch( pEntry->nWID ) - { - case WID_APPLET_CODE : - aAny >>= maClass; - break; - case WID_APPLET_CODEBASE : - //pImpl->aCodeBase = rURL.GetMainURL( INetURLObject::NO_DECODE ); - //if( rURL.GetProtocol() == INET_PROT_FILE - // && pImpl->aCodeBase.GetChar( 9 ) == INET_ENC_DELIM_TOKEN ) - // // Laufwerksbuchstabe auf ':' patchen - // pImpl->aCodeBase.SetChar( 9, INET_DELIM_TOKEN ); - - aAny >>= maCodeBase; - break; - case WID_APPLET_COMMANDS : - { - maCmdList.Clear(); - uno::Sequence < beans::PropertyValue > aCommandSequence; - if( aAny >>= aCommandSequence ) - maCmdList.FillFromSequence( aCommandSequence ); - } - break; - case WID_APPLET_DOCBASE : - aAny >>= maDocBase; - break; - case WID_APPLET_ISSCRIPT : - aAny >>= mbMayScript; - break; - case WID_APPLET_NAME : - aAny >>= maName; - break; - default:; - - } -} - -uno::Any SAL_CALL AppletObject::getPropertyValue(const ::rtl::OUString& aPropertyName) throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) -{ - uno::Any aAny; - const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); - if( !pEntry ) - throw beans::UnknownPropertyException(); - switch( pEntry->nWID ) - { - case WID_APPLET_CODE : - aAny <<= maClass; - break; - case WID_APPLET_CODEBASE : - aAny <<= maCodeBase; - break; - case WID_APPLET_COMMANDS : - { - uno::Sequence< beans::PropertyValue > aCommandSequence; - maCmdList.FillSequence( aCommandSequence ); - aAny <<= aCommandSequence; - } - break; - case WID_APPLET_DOCBASE : - break; - case WID_APPLET_ISSCRIPT : - aAny <<= mbMayScript; - break; - case WID_APPLET_NAME : - aAny <<= maName; - break; - default:; - - } - return aAny; -} - -void SAL_CALL AppletObject::addPropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removePropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::addVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -void SAL_CALL AppletObject::removeVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) -{ -} - -::sal_Int16 SAL_CALL AppletObject::execute() throw (::com::sun::star::uno::RuntimeException) -{ - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - uno::Reference < beans::XPropertySet > xSet( this ); - VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, SID_INSERT_APPLET, mxObj ); - if ( pDlg ) - pDlg->Execute(); - return 0; -} - -void SAL_CALL AppletObject::setTitle( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException) -{ -} - -} diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk index b1bddf82e428..d663d34cf5ba 100644 --- a/sfx2/source/doc/makefile.mk +++ b/sfx2/source/doc/makefile.mk @@ -87,8 +87,6 @@ SLOFILES = \ $(SLO)$/syspath.obj \ $(SLO)$/syspathw32.obj -# $(SLO)$/applet.obj \ - .IF "$(GUI)" == "WNT" #HACK TO DISABLE PCH diff --git a/sfx2/source/inc/applet.hxx b/sfx2/source/inc/applet.hxx deleted file mode 100644 index 5b7d61ebe314..000000000000 --- a/sfx2/source/inc/applet.hxx +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _SFX_APPLET_HXX -#define _SFX_APPLET_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace com { namespace sun { namespace star { namespace uno { - class XComponentContext; - class XInterface; -} } } } - -class SjApplet2; -namespace sfx2 -{ - -class AppletObject : public ::cppu::WeakImplHelper6 < - com::sun::star::util::XCloseable, - com::sun::star::lang::XEventListener, - com::sun::star::frame::XSynchronousFrameLoader, - com::sun::star::ui::dialogs::XExecutableDialog, - com::sun::star::lang::XInitialization, - com::sun::star::beans::XPropertySet > -{ - com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > - mxContext; - com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > mxObj; - SfxItemPropertyMap maPropMap; - SvCommandList maCmdList; - ::rtl::OUString maClass; - ::rtl::OUString maName; - ::rtl::OUString maCodeBase; - ::rtl::OUString maDocBase; - SjApplet2* mpApplet; - sal_Bool mbMayScript; - - AppletObject( AppletObject & ); // not defined - void operator =( AppletObject & ); // not defined - - AppletObject( const com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext >& rContext ); - ~AppletObject(); - - virtual sal_Bool SAL_CALL load( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& lDescriptor, - const com::sun::star::uno::Reference < com::sun::star::frame::XFrame >& xFrame ) throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL cancel() throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ; - virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - - virtual ::rtl::OUString SAL_CALL getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::sal_Bool SAL_CALL supportsService( - const ::rtl::OUString& sServiceName ) - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - - static ::com::sun::star::uno::Sequence< ::rtl::OUString > - impl_getStaticSupportedServiceNames(); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - SAL_CALL impl_createInstance( - const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext >& xContext ) - throw( ::com::sun::star::uno::Exception ); - -public: - static ::rtl::OUString impl_getStaticImplementationName(); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > - impl_createFactory(); -}; - -} -#endif diff --git a/svx/inc/globlmn_tmpl.hrc b/svx/inc/globlmn_tmpl.hrc index b71e872ffd92..e86a684d93f2 100644 --- a/svx/inc/globlmn_tmpl.hrc +++ b/svx/inc/globlmn_tmpl.hrc @@ -601,17 +601,6 @@ Text [ en-US ] = "~Video..." ; \ }; -#ifdef SOLAR_JAVA -#define TMP_SID_INSERT_APPLET \ - MenuItem\ - {\ - Identifier = SID_INSERT_APPLET ; \ - Command = ".uno:InsertApplet" ; \ - Text [ en-US ] = "~Applet..." ; \ - }; -#else -#define TMP_SID_INSERT_APPLET -#endif #define ITEM_INSERT_OBJECT_MN \ MenuItem\ {\ @@ -631,7 +620,6 @@ TMP_SID_INSERT_PLUGIN\ TMP_SID_INSERT_SOUND\ TMP_SID_INSERT_VIDEO\ - TMP_SID_INSERT_APPLET\ MenuItem\ {\ Identifier = SID_INSERT_MATH ; \ diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 240ca9cbd4e1..87eb3062833b 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -6204,33 +6204,6 @@ SfxVoidItem PreviousAnnotation SID_PREVIOUS_POSTIT GroupId = GID_VIEW; ] -//-------------------------------------------------------------------------- -SfxVoidItem InsertApplet SID_INSERT_APPLET -(SfxStringItem Class FN_PARAM_1, - SfxStringItem ClassLocation FN_PARAM_2, - SfxStringItem Commands FN_PARAM_3) -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = TRUE, - ReadOnlyDoc = FALSE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Asynchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_INSERT; -] - //-------------------------------------------------------------------------- SfxUInt32Item InsertGalleryPic SID_GALLERY_FORMATS () -- cgit From 6b7cfcf20984092bb9907083bcf089709d005da5 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Jul 2010 22:05:23 +0200 Subject: CWS changehid: #i111784#: SetDialogHelpId changed --- sfx2/inc/sfx2/filedlghelper.hxx | 2 +- sfx2/inc/sfx2/opengrf.hxx | 2 +- sfx2/source/appl/opengrf.cxx | 2 +- sfx2/source/dialog/filedlghelper.cxx | 4 ++-- sfx2/source/dialog/filedlgimpl.hxx | 2 +- svx/inc/pfiledlg.hxx | 2 +- svx/source/dialog/pfiledlg.cxx | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index 392c5d47d3ca..e56aea052d18 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -282,7 +282,7 @@ public: a corresponding element herein. */ void SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); - void SetDialogHelpId( const sal_Int32 _nHelpId ); + void SetDialogHelpId( const rtl::OString& _nHelpId ); void CreateMatcher( const String& rName ); /** sets the context of the dialog and trigger necessary actions e.g. loading config, setting help id diff --git a/sfx2/inc/sfx2/opengrf.hxx b/sfx2/inc/sfx2/opengrf.hxx index a041f6687c62..1c307111cdd0 100644 --- a/sfx2/inc/sfx2/opengrf.hxx +++ b/sfx2/inc/sfx2/opengrf.hxx @@ -57,7 +57,7 @@ public: /// Set dialog help id at FileDlgHelper void SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId ); /// Set control help ids at FileDlgHelper - void SetDialogHelpId( const INT32 _nHelpId ); + void SetDialogHelpId( const rtl::OString& _rHelpId ); private: // disable copy and assignment SFX2_DLLPRIVATE SvxOpenGraphicDialog (const SvxOpenGraphicDialog&); diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 23fb100c7895..d83e93157902 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -289,7 +289,7 @@ void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const ch mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId ); } -void SvxOpenGraphicDialog::SetDialogHelpId( const INT32 _nHelpId ) +void SvxOpenGraphicDialog::SetDialogHelpId( const rtl::OString& _nHelpId ) { mpImpl->aFileDlg.SetDialogHelpId( _nHelpId ); } diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 870e521f3849..552dc8f11fc9 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1235,7 +1235,7 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con } // ------------------------------------------------------------------------ -void FileDialogHelper_Impl::setDialogHelpId( sal_Int32 _nHelpId ) +void FileDialogHelper_Impl::setDialogHelpId( const rtl::OString& _nHelpId ) { svt::SetDialogHelpId( mxFileDlg, _nHelpId ); } @@ -2498,7 +2498,7 @@ void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const ch } // ------------------------------------------------------------------------ -void FileDialogHelper::SetDialogHelpId( const sal_Int32 _nHelpId ) +void FileDialogHelper::SetDialogHelpId( const rtl::OString& _nHelpId ) { mpImp->setDialogHelpId( _nHelpId ); } diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 5f4782e72bfb..30b516a84ac5 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -143,7 +143,7 @@ namespace sfx2 void correctVirtualDialogType(); void setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); - void setDialogHelpId( sal_Int32 nId ); + void setDialogHelpId( const rtl::OString& ); sal_Bool CheckFilterOptionsCapability( const SfxFilter* _pFilter ); diff --git a/svx/inc/pfiledlg.hxx b/svx/inc/pfiledlg.hxx index 646575ac4e0c..694881920f8d 100644 --- a/svx/inc/pfiledlg.hxx +++ b/svx/inc/pfiledlg.hxx @@ -55,7 +55,7 @@ public: static bool IsAvailable (USHORT nKind); // setting HelpId and/or context of FileDialogHelper - void SetDialogHelpId( const sal_Int32 nHelpId ); + void SetDialogHelpId( const rtl::OString& nHelpId ); void SetContext( sfx2::FileDialogHelper::Context eNewContext ); }; diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index aa6e0b835e2c..f53ba885f2a0 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -274,7 +274,7 @@ bool SvxPluginFileDlg::IsAvailable (sal_uInt16 nKind) return bFound; } -void SvxPluginFileDlg::SetDialogHelpId( const sal_Int32 _nHelpId ) +void SvxPluginFileDlg::SetDialogHelpId( const rtl::OString& _nHelpId ) { maFileDlg.SetDialogHelpId( _nHelpId ); } -- cgit From cf2e818a242c1d84e313a054625905883ecf583e Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 19 Jul 2010 23:54:06 +0200 Subject: mib17: add Application.Visible --- oovbaapi/ooo/vba/XApplicationBase.idl | 15 ++++++--------- vbahelper/inc/vbahelper/vbaapplicationbase.hxx | 12 +++++++----- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 13 +++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/oovbaapi/ooo/vba/XApplicationBase.idl b/oovbaapi/ooo/vba/XApplicationBase.idl index 7f59ddb75247..d9d32e02f2ce 100644 --- a/oovbaapi/ooo/vba/XApplicationBase.idl +++ b/oovbaapi/ooo/vba/XApplicationBase.idl @@ -24,21 +24,15 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #ifndef __ooo_vba_XApplicationBase_idl__ #define __ooo_vba_XApplicationBase_idl__ -#ifndef __com_sun_star_uno_XInterface_idl__ -#include -#endif - -#ifndef __ooo_vba_XHelperInterface_idl__ #include -#endif module ooo { module vba { -//============================================================================= - +//============================================================================= interface XApplicationBase { @@ -47,8 +41,9 @@ interface XApplicationBase [attribute] boolean ScreenUpdating; [attribute] boolean DisplayStatusBar; [attribute] boolean Interactive; + [attribute] boolean Visible; + [attribute, readonly] string Version; - //mbn [attribute, readonly] any VBE; [attribute, readonly] any VBProjects; @@ -61,6 +56,8 @@ interface XApplicationBase void Undo(); }; +//============================================================================= + }; }; #endif diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx index 73c1aa0d94e7..6902bc7b5042 100644 --- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx +++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx @@ -53,18 +53,20 @@ public: virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException); virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL getInteractive() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getInteractive() throw (css::uno::RuntimeException); + virtual void SAL_CALL setInteractive( ::sal_Bool bInteractive ) throw (css::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); + virtual void SAL_CALL setVisible( ::sal_Bool bVisible ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getVBProjects() throw (css::uno::RuntimeException); virtual void SAL_CALL Run( const ::rtl::OUString& MacroName, const css::uno::Any& varg1, const css::uno::Any& varg2, const css::uno::Any& varg3, const css::uno::Any& varg4, const css::uno::Any& varg5, const css::uno::Any& varg6, const css::uno::Any& varg7, const css::uno::Any& varg8, const css::uno::Any& varg9, const css::uno::Any& varg10, const css::uno::Any& varg11, const css::uno::Any& varg12, const css::uno::Any& varg13, const css::uno::Any& varg14, const css::uno::Any& varg15, const css::uno::Any& varg16, const css::uno::Any& varg17, const css::uno::Any& varg18, const css::uno::Any& varg19, const css::uno::Any& varg20, const css::uno::Any& varg21, const css::uno::Any& varg22, const css::uno::Any& varg23, const css::uno::Any& varg24, const css::uno::Any& varg25, const css::uno::Any& varg26, const css::uno::Any& varg27, const css::uno::Any& varg28, const css::uno::Any& varg29, const css::uno::Any& varg30 ) throw (css::uno::RuntimeException); - virtual void SAL_CALL OnTime( const ::com::sun::star::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const ::com::sun::star::uno::Any& aLatestTime, const ::com::sun::star::uno::Any& aSchedule ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL OnTime( const css::uno::Any& aEarliestTime, const ::rtl::OUString& aFunction, const css::uno::Any& aLatestTime, const css::uno::Any& aSchedule ) throw (css::uno::RuntimeException); virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException); - virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL Quit( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL Undo() throw (css::uno::RuntimeException); + virtual void SAL_CALL Quit() throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 8af75a6bd043..fc59b9478f5b 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -159,6 +159,9 @@ typedef ::std::hash_map< VbaTimerInfo, VbaTimer*, VbaTimerInfoHash, ::std::equal struct VbaApplicationBase_Impl { VbaTimerHashMap m_aTimerHash; + sal_Bool mbVisible; + + inline VbaApplicationBase_Impl() : mbVisible( sal_True ) {} virtual ~VbaApplicationBase_Impl() { @@ -264,6 +267,16 @@ void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive ) xWindow->setEnable( bInteractive ); } +sal_Bool SAL_CALL VbaApplicationBase::getVisible() throw (uno::RuntimeException) +{ + return m_pImpl->mbVisible; // dummy implementation +} + +void SAL_CALL VbaApplicationBase::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) +{ + m_pImpl->mbVisible = bVisible; // dummy implementation +} + uno::Any SAL_CALL VbaApplicationBase::CommandBars( const uno::Any& aIndex ) throw (uno::RuntimeException) { -- cgit From b57b872f1b0252da4d1622edfaca32ef0c51cbd8 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 20 Jul 2010 11:49:49 +0200 Subject: mib17: #162887# #162899# Changed handling of missing parameters --- basic/source/runtime/step2.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index c9f344c57d32..47f4967eab99 100644 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -678,7 +678,18 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) while( iLoop >= nParamCount ) { p = new SbxVariable(); - p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND) + + if( SbiRuntime::isVBAEnabled() && + (t == SbxOBJECT || t == SbxSTRING) ) + { + if( t == SbxOBJECT ) + p->PutObject( NULL ); + else + p->PutString( String() ); + } + else + p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND) + refParams->Put( p, iLoop ); iLoop--; } -- cgit From 42893428c4396619359aaaa7bdbad521ccb553a1 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 20 Jul 2010 12:50:30 +0200 Subject: mib17: #162900# Support parameters for Property Get calls --- basic/source/classes/sb.cxx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 9012471cac0a..e28b0a304f28 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -599,7 +599,28 @@ void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType { SbxValues aVals; aVals.eType = SbxVARIANT; - pMeth->Get( aVals ); + + SbxArray* pArg = pVar->GetParameters(); + USHORT nVarParCount = (pArg != NULL) ? pArg->Count() : 0; + if( nVarParCount > 1 ) + { + SbxArrayRef xMethParameters = new SbxArray; + xMethParameters->Put( pMeth, 0 ); // Method as parameter 0 + for( USHORT i = 1 ; i < nVarParCount ; ++i ) + { + SbxVariable* pPar = pArg->Get( i ); + xMethParameters->Put( pPar, i ); + } + + pMeth->SetParameters( xMethParameters ); + pMeth->Get( aVals ); + pMeth->SetParameters( NULL ); + } + else + { + pMeth->Get( aVals ); + } + pVar->Put( aVals ); } } -- cgit From db369db99b2f897b1a304a4c010dfd1998e2fa40 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 20 Jul 2010 14:50:49 +0200 Subject: CWS changehid: #i111784#: consolidate usage of HID schema; remove unused SetDialogHelpId methods --- editeng/inc/pch/precompiled_editeng.hxx | 1 - fpicker/source/office/OfficeControlAccess.cxx | 22 +++++++++++++--------- sfx2/inc/pch/precompiled_sfx2.hxx | 1 - sfx2/inc/sfx2/filedlghelper.hxx | 1 - sfx2/inc/sfx2/opengrf.hxx | 3 --- sfx2/source/appl/opengrf.cxx | 5 +---- sfx2/source/dialog/filedlghelper.cxx | 18 ++---------------- sfx2/source/dialog/filedlgimpl.hxx | 1 - sfx2/source/dialog/taskpane.cxx | 11 ++++++----- svx/inc/pch/precompiled_svx.hxx | 1 - svx/inc/pfiledlg.hxx | 2 -- svx/source/dialog/docrecovery.cxx | 1 - svx/source/dialog/pfiledlg.cxx | 5 ----- svx/source/fmcomp/fmgridif.cxx | 10 +++++----- 14 files changed, 27 insertions(+), 55 deletions(-) diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx index d82ecc6cb6b5..9d432f73a731 100644 --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -739,7 +739,6 @@ #include "svtools/parhtml.hxx" #include "svtools/parrtf.hxx" #include "unotools/pathoptions.hxx" -#include "svl/pickerhelper.hxx" #include "svl/poolitem.hxx" #include "unotools/printwarningoptions.hxx" #include "svl/ptitem.hxx" diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx index 7d33030ed2a9..50e99f2b590b 100644 --- a/fpicker/source/office/OfficeControlAccess.cxx +++ b/fpicker/source/office/OfficeControlAccess.cxx @@ -33,9 +33,8 @@ #include #include #include -#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HPP_ #include -#endif +#include #include #include @@ -201,14 +200,15 @@ namespace svt } //--------------------------------------------------------------------- - void OControlAccess::setHelpURL( Window* _pControl, const ::rtl::OUString& _rURL, sal_Bool _bFileView ) + void OControlAccess::setHelpURL( Window* _pControl, const ::rtl::OUString& sHelpURL, sal_Bool _bFileView ) { - String sHelpURL( _rURL ); - if ( COMPARE_EQUAL == sHelpURL.CompareIgnoreCaseToAscii( "HID:", sizeof( "HID:" ) - 1 ) ) - sHelpURL = sHelpURL.Copy( sizeof( "HID:" ) - 1 ); + rtl::OUString sHelpID( sHelpURL ); + INetURLObject aHID( sHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + sHelpID = aHID.GetURLPath(); // URLs should always be UTF8 encoded and escaped - rtl::OString sID( rtl::OUStringToOString( sHelpURL, RTL_TEXTENCODING_UTF8 ) ); + rtl::OString sID( rtl::OUStringToOString( sHelpID, RTL_TEXTENCODING_UTF8 ) ); if ( _bFileView ) // the file view "overloaded" the SetHelpId static_cast< SvtFileView* >( _pControl )->SetHelpId( sID ); @@ -224,8 +224,12 @@ namespace svt // the file view "overloaded" the SetHelpId aHelpId = static_cast< SvtFileView* >( _pControl )->GetHelpId( ); - ::rtl::OUString sHelpURL( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); - sHelpURL += rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ); + ::rtl::OUString sHelpURL; + ::rtl::OUString aTmp( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ) ); + INetURLObject aHID( aTmp ); + if ( aHID.GetProtocol() == INET_PROT_NOT_VALID ) + sHelpURL = rtl::OUString::createFromAscii( INET_HID_SCHEME ); + sHelpURL += aTmp; return sHelpURL; } diff --git a/sfx2/inc/pch/precompiled_sfx2.hxx b/sfx2/inc/pch/precompiled_sfx2.hxx index b43dba7d6673..1d4003fa44e6 100644 --- a/sfx2/inc/pch/precompiled_sfx2.hxx +++ b/sfx2/inc/pch/precompiled_sfx2.hxx @@ -543,7 +543,6 @@ #include "svl/ownlist.hxx" #include "svtools/parhtml.hxx" #include "unotools/pathoptions.hxx" -#include "svl/pickerhelper.hxx" #include "svl/poolitem.hxx" #include "svtools/printoptions.hxx" #include "unotools/printwarningoptions.hxx" diff --git a/sfx2/inc/sfx2/filedlghelper.hxx b/sfx2/inc/sfx2/filedlghelper.hxx index e56aea052d18..619358f077ac 100644 --- a/sfx2/inc/sfx2/filedlghelper.hxx +++ b/sfx2/inc/sfx2/filedlghelper.hxx @@ -282,7 +282,6 @@ public: a corresponding element herein. */ void SetControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); - void SetDialogHelpId( const rtl::OString& _nHelpId ); void CreateMatcher( const String& rName ); /** sets the context of the dialog and trigger necessary actions e.g. loading config, setting help id diff --git a/sfx2/inc/sfx2/opengrf.hxx b/sfx2/inc/sfx2/opengrf.hxx index 1c307111cdd0..df8ae09f90a3 100644 --- a/sfx2/inc/sfx2/opengrf.hxx +++ b/sfx2/inc/sfx2/opengrf.hxx @@ -54,10 +54,7 @@ public: String GetCurrentFilter() const; void SetCurrentFilter(const String&); - /// Set dialog help id at FileDlgHelper void SetControlHelpIds( const INT16* _pControlId, const char** _pHelpId ); - /// Set control help ids at FileDlgHelper - void SetDialogHelpId( const rtl::OString& _rHelpId ); private: // disable copy and assignment SFX2_DLLPRIVATE SvxOpenGraphicDialog (const SvxOpenGraphicDialog&); diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index d83e93157902..fd2043a9a431 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -289,7 +289,4 @@ void SvxOpenGraphicDialog::SetControlHelpIds( const INT16* _pControlId, const ch mpImpl->aFileDlg.SetControlHelpIds( _pControlId, _pHelpId ); } -void SvxOpenGraphicDialog::SetDialogHelpId( const rtl::OString& _nHelpId ) -{ - mpImpl->aFileDlg.SetDialogHelpId( _nHelpId ); -} + diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 552dc8f11fc9..874a430b6bda 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1213,13 +1213,14 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con // forward these ids to the file picker try { - const ::rtl::OUString sHelpIdPrefix( RTL_CONSTASCII_USTRINGPARAM( "HID:" ) ); + const ::rtl::OUString sHelpIdPrefix( RTL_CONSTASCII_USTRINGPARAM( INET_HID_SCHEME ) ); // the ids for the single controls uno::Reference< XFilePickerControlAccess > xControlAccess( mxFileDlg, UNO_QUERY ); if ( xControlAccess.is() ) { while ( *_pControlId ) { + DBG_ASSERT( INetURLObject( rtl::OStringToOUString( *_pHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); ::rtl::OUString sId( sHelpIdPrefix ); sId += ::rtl::OUString( *_pHelpId, strlen( *_pHelpId ), RTL_TEXTENCODING_UTF8 ); xControlAccess->setValue( *_pControlId, ControlActions::SET_HELP_URL, makeAny( sId ) ); @@ -1234,12 +1235,6 @@ void FileDialogHelper_Impl::setControlHelpIds( const sal_Int16* _pControlId, con } } -// ------------------------------------------------------------------------ -void FileDialogHelper_Impl::setDialogHelpId( const rtl::OString& _nHelpId ) -{ - svt::SetDialogHelpId( mxFileDlg, _nHelpId ); -} - // ------------------------------------------------------------------------ IMPL_LINK( FileDialogHelper_Impl, InitControls, void*, NOTINTERESTEDIN ) { @@ -2344,9 +2339,6 @@ void FileDialogHelper_Impl::SetContext( FileDialogHelper::Context _eNewContext ) const OUString* pConfigId = GetLastFilterConfigId( _eNewContext ); if( pConfigId ) LoadLastUsedFilter( *pConfigId ); - -// if( nNewHelpId ) -// this->setDialogHelpId( nNewHelpId ); } // ------------------------------------------------------------------------ @@ -2497,12 +2489,6 @@ void FileDialogHelper::SetControlHelpIds( const sal_Int16* _pControlId, const ch mpImp->setControlHelpIds( _pControlId, _pHelpId ); } -// ------------------------------------------------------------------------ -void FileDialogHelper::SetDialogHelpId( const rtl::OString& _nHelpId ) -{ - mpImp->setDialogHelpId( _nHelpId ); -} - void FileDialogHelper::SetContext( Context _eNewContext ) { mpImp->SetContext( _eNewContext ); diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 30b516a84ac5..91190b575e1c 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -143,7 +143,6 @@ namespace sfx2 void correctVirtualDialogType(); void setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId ); - void setDialogHelpId( const rtl::OString& ); sal_Bool CheckFilterOptionsCapability( const SfxFilter* _pFilter ); diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index d684e3cf124a..3ef6a96bdaf4 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -60,7 +60,7 @@ #include #include #include - +#include #include //...................................................................................................................... @@ -410,10 +410,11 @@ namespace sfx2 static rtl::OString lcl_getHelpId( const ::rtl::OUString& _rHelpURL ) { - rtl::OString aHelpId( _rHelpURL, _rHelpURL.getLength(), RTL_TEXTENCODING_UTF8 ); - if ( 0 == _rHelpURL.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "HID:" ) ) ) - aHelpId = aHelpId.copy( sizeof( "HID:" ) - 1 ); - return aHelpId; + INetURLObject aHID( _rHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + return rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ); + else + return rtl::OUStringToOString( _rHelpURL, RTL_TEXTENCODING_UTF8 ); } //------------------------------------------------------------------------------------------------------------------ diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 95ed1449c846..b53064312a38 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -805,7 +805,6 @@ #include "svtools/parhtml.hxx" #include "svtools/parrtf.hxx" #include "unotools/pathoptions.hxx" -#include "svl/pickerhelper.hxx" #include "svl/poolitem.hxx" #include "unotools/printwarningoptions.hxx" #include "svl/ptitem.hxx" diff --git a/svx/inc/pfiledlg.hxx b/svx/inc/pfiledlg.hxx index 694881920f8d..93d99c4774a2 100644 --- a/svx/inc/pfiledlg.hxx +++ b/svx/inc/pfiledlg.hxx @@ -54,8 +54,6 @@ public: static bool IsAvailable (USHORT nKind); - // setting HelpId and/or context of FileDialogHelper - void SetDialogHelpId( const rtl::OString& nHelpId ); void SetContext( sfx2::FileDialogHelper::Context eNewContext ); }; diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index b4ee4dd2956f..1b77364b6c7e 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -1585,7 +1585,6 @@ void BrokenRecoveryDialog::impl_askForSavePath() { css::uno::Reference< css::ui::dialogs::XFolderPicker > xFolderPicker( m_pCore->getSMGR()->createInstance(SERVICENAME_FOLDERPICKER), css::uno::UNO_QUERY_THROW); -// svt::SetDialogHelpId( xFolderPicker, HID_OPTIONS_PATHS_SELECTFOLDER ); INetURLObject aURL(m_sSavePath, INET_PROT_FILE); xFolderPicker->setDisplayDirectory(aURL.GetMainURL(INetURLObject::NO_DECODE)); diff --git a/svx/source/dialog/pfiledlg.cxx b/svx/source/dialog/pfiledlg.cxx index f53ba885f2a0..af8d283185a6 100644 --- a/svx/source/dialog/pfiledlg.cxx +++ b/svx/source/dialog/pfiledlg.cxx @@ -274,11 +274,6 @@ bool SvxPluginFileDlg::IsAvailable (sal_uInt16 nKind) return bFound; } -void SvxPluginFileDlg::SetDialogHelpId( const rtl::OString& _nHelpId ) -{ - maFileDlg.SetDialogHelpId( _nHelpId ); -} - void SvxPluginFileDlg::SetContext( sfx2::FileDialogHelper::Context _eNewContext ) { maFileDlg.SetContext( _eNewContext ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 9d596d529774..5a033cd77d44 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -38,6 +38,7 @@ #include "sdbdatacolumn.hxx" #include "svx/fmgridcl.hxx" #include "svx/svxids.hrc" +#include /** === begin UNO includes === **/ #include @@ -1973,11 +1974,10 @@ void FmXGridPeer::setProperty( const ::rtl::OUString& PropertyName, const Any& V } else if ( 0 == PropertyName.compareTo( FM_PROP_HELPURL ) ) { - String sHelpURL(::comphelper::getString(Value)); - String sPattern; - sPattern.AssignAscii("HID:"); - if (sHelpURL.Equals(sPattern, 0, sPattern.Len())) - pGrid->SetHelpId(rtl::OUStringToOString(sHelpURL, RTL_TEXTENCODING_UTF8)); + INetURLObject aHID( ::comphelper::getString(Value) ); + DBG_ASSERT( aHID.GetProtocol() == INET_PROT_HID, "Wrong HelpURL!" ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + pGrid->SetHelpId( rtl::OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); } else if ( 0 == PropertyName.compareTo( FM_PROP_DISPLAYSYNCHRON ) ) { -- cgit From 3752b1f31f8ae2603c9887b348346f80c86270c6 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 20 Jul 2010 14:54:39 +0200 Subject: jl154 #i113285# fixing deadlock when starting OOo by the testtool --- desktop/source/app/app.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index d701516ac361..3ab5c6cacc88 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1704,6 +1704,13 @@ void Desktop::Main() ( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.frame.GlobalEventBroadcaster" ) ), UNO_QUERY ); + /* ensure existance of a default window that messages can be dispatched to + This is for the benefit of testtool which uses PostUserEvent extensively + and else can deadlock while creating this window from another tread while + the main thread is not yet in the event loop. + */ + Application::GetDefaultDevice(); + // initialize test-tool library (if available) RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ tools::InitTestToolLib" ); tools::InitTestToolLib(); -- cgit From 248f9c55d3d7f620372c7ff598db44051c95ceb5 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 21 Jul 2010 09:39:33 +0200 Subject: sb123: #i113306# disabled sfx.DocumentTemplates for now --- sfx2/qa/unoapi/sfx.sce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/qa/unoapi/sfx.sce b/sfx2/qa/unoapi/sfx.sce index 6176c0668731..ce72c463ee55 100644 --- a/sfx2/qa/unoapi/sfx.sce +++ b/sfx2/qa/unoapi/sfx.sce @@ -1,5 +1,5 @@ -o sfx.AppDispatchProvider --o sfx.DocumentTemplates +#i113306 -o sfx.DocumentTemplates -o sfx.FrameLoader -o sfx.SfxMacroLoader #i111283 -o sfx.StandaloneDocumentInfo -- cgit From 2986fe6067949eb4aae3cc5ec195783f55033c2b Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 21 Jul 2010 11:54:48 +0200 Subject: fwk150: Make find bar string localizable --- svx/inc/svx/dialogs.hrc | 4 +++- svx/source/tbxctrls/makefile.mk | 1 + svx/source/tbxctrls/tbunosearchcontrollers.cxx | 6 +++-- svx/source/tbxctrls/tbunosearchcontrollers.src | 33 ++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 3 deletions(-) mode change 100755 => 100644 svx/inc/svx/dialogs.hrc create mode 100644 svx/source/tbxctrls/tbunosearchcontrollers.src diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc old mode 100755 new mode 100644 index d193652b57fc..fd7561bb7192 --- a/svx/inc/svx/dialogs.hrc +++ b/svx/inc/svx/dialogs.hrc @@ -956,7 +956,9 @@ #define RID_SVXSTR_OUTLINENUM_DESCRIPTION_6 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 6)//? #define RID_SVXSTR_OUTLINENUM_DESCRIPTION_7 (RID_SVXSTR_OUTLINENUM_DESCRIPTIONS + 7)//? -#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1190) +#define RID_SVXSTR_FINDBAR_FIND (RID_SVX_START + 1190) + +#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1191) // ---------------------------------------------------------------------------- // if we have _a_lot_ time, we should group the resource ids by type, instead diff --git a/svx/source/tbxctrls/makefile.mk b/svx/source/tbxctrls/makefile.mk index 73a178d97594..a9ea745f3cc0 100644 --- a/svx/source/tbxctrls/makefile.mk +++ b/svx/source/tbxctrls/makefile.mk @@ -74,6 +74,7 @@ SRC1FILES = \ lboxctrl.src \ linectrl.src \ tbcontrl.src \ + tbunosearchcontrollers.src \ tbxdraw.src \ grafctrl.src diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 5dcaf6fd5e72..e446d3d3b9d5 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -29,6 +29,8 @@ #include "precompiled_svx.hxx" #include "tbunosearchcontrollers.hxx" +#include +#include #include #include @@ -91,7 +93,7 @@ FindTextFieldControl::~FindTextFieldControl() void FindTextFieldControl::InitControls_Impl() { - SetText( String( ::rtl::OUString::createFromAscii("Find") ) ); + SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); EnableAutocomplete(TRUE, TRUE); @@ -174,7 +176,7 @@ long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) case EVENT_LOSEFOCUS: if ( GetText().Len() == 0 ) { - SetText( String( ::rtl::OUString::createFromAscii("Find") ) ); + SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); m_bToClearTextField = sal_True; } diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.src b/svx/source/tbxctrls/tbunosearchcontrollers.src new file mode 100644 index 000000000000..9a256ae0cabb --- /dev/null +++ b/svx/source/tbxctrls/tbunosearchcontrollers.src @@ -0,0 +1,33 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +String RID_SVXSTR_FINDBAR_FIND +{ + Text [ en-US ] = "Find" ; +}; -- cgit From 62fdc1868672bba91b1976261b1f6b21605e6ac2 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 21 Jul 2010 13:29:14 +0200 Subject: jl154 #i162868# unopkg sync removes share/prereg/bundled, changing registerExtensions --- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 21 ++++++ desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 105 +++++++++++++++++++++++++++ desktop/source/pkgchk/unopkg/unopkg_shared.h | 6 ++ 3 files changed, 132 insertions(+) diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 9434b69653a1..9115cd32cbd4 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -39,6 +39,7 @@ #include "osl/thread.h" #include "osl/process.h" #include "osl/conditn.hxx" +#include "osl/file.hxx" #include "cppuhelper/implbase1.hxx" #include "cppuhelper/exc_hlp.hxx" #include "comphelper/anytostring.hxx" @@ -377,6 +378,26 @@ extern "C" int unopkg_main() if (e != osl_File_E_None && e != osl_File_E_NOENT) throw Exception(OUSTR("Could not delete ") + extensionUnorc, 0); } + else if (subCommand.equals(OUSTR("sync"))) + { + //sync is private!!!! Only for bundled extensions!!! + //For performance reasons unopkg sync is called during the setup and + //creates the registration data for the repository of the bundled + //extensions. It is then copied to the user installation during + //startup of OOo (userdata/extensions/bundled). The registration + //data is in the brand installation and must be removed when + //uninstalling OOo. We do this here, before UNO is + //bootstrapped. Otherwies files could be locked by this process. + + //If there is no folder left in + //$BRAND_BASE_DIR/share/extensions + //then we can delete the registration data at + //$BUNDLED_EXTENSIONS_USER + if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) + removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER")); + return 0; + + } xComponentContext = getUNO( disposeGuard, option_verbose, option_shared, subcmd_gui, diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index 3272810afee2..d7b6e1ca2336 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -528,5 +528,110 @@ Reference getUNO( return xComponentContext; } +//Determines if a folder does not contains a folder. +//Return false may also mean that the status could not be determined +//because some error occurred. +bool hasNoFolder(OUString const & folderUrl) +{ + bool ret = false; + OUString url = folderUrl; + ::rtl::Bootstrap::expandMacros(url); + ::osl::Directory dir(url); + osl::File::RC rc = dir.open(); + if (rc == osl::File::E_None) + { + bool bFolderExist = false; + osl::DirectoryItem i; + osl::File::RC rcNext = osl::File::E_None; + while ( (rcNext = dir.getNextItem(i)) == osl::File::E_None) + { + osl::FileStatus stat(FileStatusMask_Type); + if (i.getFileStatus(stat) == osl::File::E_None) + { + if (stat.getFileType() == osl::FileStatus::Directory) + { + bFolderExist = true; + break; + } + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + break; + } + i = osl::DirectoryItem(); + } + + if (rcNext == osl::File::E_NOENT || + rcNext == osl::File::E_None) + { + if (!bFolderExist) + ret = true; + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + } + + dir.close(); + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + } + return ret; } +void removeFolder(OUString const & folderUrl) +{ + OUString url = folderUrl; + ::rtl::Bootstrap::expandMacros(url); + ::osl::Directory dir(url); + ::osl::File::RC rc = dir.open(); + if (rc == osl::File::E_None) + { + ::osl::DirectoryItem i; + ::osl::File::RC rcNext = ::osl::File::E_None; + while ( (rcNext = dir.getNextItem(i)) == ::osl::File::E_None) + { + ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileURL); + if (i.getFileStatus(stat) == ::osl::File::E_None) + { + ::osl::FileStatus::Type t = stat.getFileType(); + if (t == ::osl::FileStatus::Directory) + { + //remove folder + removeFolder(stat.getFileURL()); + } + else if (t == ::osl::FileStatus::Regular) + { + //remove file + ::osl::File::remove(stat.getFileURL()); + } + else + { + OSL_ASSERT(0); + } + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while investigating ") + url + OUSTR("\n")); + break; + } + i = ::osl::DirectoryItem(); + } + dir.close(); + ::osl::Directory::remove(url); + } + else + { + dp_misc::writeConsole( + OUSTR("unopkg: Error while removing ") + url + OUSTR("\n")); + } +} + +} diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 43f77513b10c..4975cc4c087b 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -178,5 +178,11 @@ css::uno::Reference getUNO( DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui, css::uno::Reference & out_LocalComponentContext); +bool hasNoFolder(::rtl::OUString const & folderUrl); + +void removeFolder(::rtl::OUString const & folderUrl); + } + + -- cgit From e92515df270ea0d52e47d6922a83d968f6445b93 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 21 Jul 2010 17:46:37 +0200 Subject: CWS changehid: #i111784#: rework keyword search --- sfx2/inc/sfxhelp.hxx | 3 +- sfx2/source/appl/sfxhelp.cxx | 92 ++++++++++++++++++++++++++------------------ 2 files changed, 57 insertions(+), 38 deletions(-) diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx index 608361a1e777..17589c7cd399 100644 --- a/sfx2/inc/sfxhelp.hxx +++ b/sfx2/inc/sfxhelp.hxx @@ -45,9 +45,10 @@ class SFX2_DLLPUBLIC SfxHelp : public Help SfxHelp_Impl* pImp; private: + SAL_DLLPRIVATE BOOL Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword ); + SAL_DLLPRIVATE virtual BOOL SearchKeyword( const XubString& rKeyWord ); SAL_DLLPRIVATE virtual BOOL Start( const String& rURL, const Window* pWindow ); SAL_DLLPRIVATE virtual void OpenHelpAgent( const rtl::OString& sHelpId ); - SAL_DLLPRIVATE String GetHelpModuleName_Impl(); SAL_DLLPRIVATE String CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName ); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index a18521e3a289..db3015824134 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -705,8 +705,17 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow return sHelpText; } +BOOL SfxHelp::SearchKeyword( const XubString& rKeyword ) +{ + return Start_Impl( String(), NULL, rKeyword ); +} BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) +{ + return Start_Impl( rURL, pWindow, String() ); +} + +BOOL SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword ) { // check if help is available String aHelpRootURL( DEFINE_CONST_OUSTRING("vnd.sun.star.help://") ); @@ -720,54 +729,63 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) return FALSE; } - // check if it's an URL or a jump mark! - String aHelpURL(rURL ); - INetURLObject aParser (aHelpURL); - ::rtl::OUString sKeyword; + /* rURL may be + - a "real" URL + - a HelpID (formerly a long, now a string) + If rURL is a URL, CreateHelpURL should be called for this URL + If rURL is an arbitrary string, the same should happen, but the URL should be tried out + if it delivers real help content. In case only the Help Error Document is returned, the + parent of the window for that help was called, is asked for its HelpID. + For compatibility reasons this upward search is not implemented for "real" URLs. + Help keyword search now is implemented as own method; in former versions it + was done via Help::Start, but this implementation conflicted with the upward search. + */ + String aHelpURL; + INetURLObject aParser( rURL ); INetProtocol nProtocol = aParser.GetProtocol(); - if ( nProtocol != INET_PROT_VND_SUN_STAR_HELP ) + String aHelpModuleName( GetHelpModuleName_Impl() ); + switch ( nProtocol ) { - String aHelpModuleName( GetHelpModuleName_Impl() ); - aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); - if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + case INET_PROT_NOT_VALID : { - // no help found -> try with parent help id. - Window* pParent = pWindow->GetParent(); - while ( pParent ) + // no URL, just a HelpID (maybe empty in case of keyword search) + aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + if ( pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { - ByteString aHelpId = pParent->GetHelpId(); - aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName ); - if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) - break; - else + // no help found -> try with parent help id. + Window* pParent = pWindow->GetParent(); + while ( pParent ) { - pParent = pParent->GetParent(); - if ( !pParent ) - // create help url of start page ( helpid == 0 -> start page) - aHelpURL = CreateHelpURL( String(), aHelpModuleName ); + ByteString aHelpId = pParent->GetHelpId(); + aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName ); + if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + break; + else + { + pParent = pParent->GetParent(); + if ( !pParent ) + // create help url of start page ( helpid == 0 -> start page) + aHelpURL = CreateHelpURL( String(), aHelpModuleName ); + } } } + break; } - - // pb i91715: strings begin with ".HelpId:" are not words of the basic ide - // they are helpid-strings used by the testtool -> so we ignore them - static const String sHelpIdScheme( DEFINE_CONST_OUSTRING(".HelpId:") ); - if ( rURL.Search( sHelpIdScheme ) != 0 ) - sKeyword = ::rtl::OUString( rURL ); + case INET_PROT_VND_SUN_STAR_HELP: + // already a vnd.sun.star.help URL -> nothing to do + aHelpURL = rURL; + break; + default: + aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); + break; } Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY ); - // check if help is still open - // If not - create new one and return acces directly - // to the internal sub frame, which shows the help content. - - // Note further: We search for this sub frame here directly instead of - // the real top level help task ... It's needed to have the same - // sub frame available - so we can use it for loading (which is done - // in both cases)! - + // check if help window is still open + // If not, create a new one and return access directly to the internal sub frame showing the help content + // search must be done here; search one desktop level could return an arbitraty frame Reference< XFrame > xHelp = xDesktop->findFrame( ::rtl::OUString(DEFINE_CONST_UNICODE("OFFICE_HELP_TASK")), FrameSearchFlag::CHILDREN); @@ -791,8 +809,8 @@ BOOL SfxHelp::Start( const String& rURL, const Window* pWindow ) pHelpWindow->SetHelpURL( aHelpURL ); pHelpWindow->loadHelpContent(aHelpURL); - if ( sKeyword.getLength() > 0 ) - pHelpWindow->OpenKeyword( sKeyword ); + if ( rKeyword.Len() ) + pHelpWindow->OpenKeyword( rKeyword ); Reference < ::com::sun::star::awt::XTopWindow > xTopWindow( xHelp->getContainerWindow(), UNO_QUERY ); if ( xTopWindow.is() ) -- cgit From 6fc85e3c5c85d0fc2e5e9f9516bcce8b8eaf94a6 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 22 Jul 2010 14:10:02 +0200 Subject: jl154 #i162868# unopkg sync now removes the folder when it does no contain a folder --- desktop/source/app/app.cxx | 42 ++++++++++------------------- desktop/source/app/userinstall.cxx | 6 +---- desktop/source/app/userinstall.hxx | 2 -- desktop/source/pkgchk/unopkg/unopkg_app.cxx | 5 +++- 4 files changed, 19 insertions(+), 36 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 3ab5c6cacc88..ace2149036c9 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -469,8 +469,6 @@ void ReplaceStringHookProc( UniString& rStr ) } } -static const char pPresetsFolder[] = "presets"; -static const char pBundledFolder[] = BUNDLED_FOLDER_NAME; static const char pLastSyncFileName[] = "lastsynchronized"; static const sal_Int32 nStrLenLastSync = 16; @@ -537,25 +535,13 @@ static bool needsSynchronization( return bNeedsSync; } -static ::rtl::OUString getBasePresetsPathURL() +static ::rtl::OUString getBrandSharePreregBundledPathURL() { - ::rtl::OUString aBaseInstallURL; - ::utl::Bootstrap::PathStatus aBaseInstallStatus = ::utl::Bootstrap::locateBaseInstallation( aBaseInstallURL ); + ::rtl::OUString url( + RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/share/prereg/bundled")); - if ( aBaseInstallStatus == ::utl::Bootstrap::PATH_EXISTS ) - { - ::rtl::OUStringBuffer aTmp( aBaseInstallURL ); - ::sal_Int32 nLastIndex = aBaseInstallURL.lastIndexOf('/'); - - if ( nLastIndex != aBaseInstallURL.getLength()-1 ) - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pPresetsFolder ); - aTmp.appendAscii( "/" ); - aTmp.appendAscii( pBundledFolder ); - aBaseInstallURL = aTmp.makeStringAndClear(); - } - - return aBaseInstallURL; + ::rtl::Bootstrap::expandMacros(url); + return url; } static ::rtl::OUString getUserBundledExtPathURL() @@ -566,14 +552,14 @@ static ::rtl::OUString getUserBundledExtPathURL() return folder; } -static ::rtl::OUString getLastSyncFileURLFromBaseInstallation() +static ::rtl::OUString getLastSyncFileURLFromBrandInstallation() { - ::rtl::OUString aBasePresetPathURL = getBasePresetsPathURL(); - ::sal_Int32 nLastIndex = aBasePresetPathURL.lastIndexOf('/'); + ::rtl::OUString aURL = getBrandSharePreregBundledPathURL(); + ::sal_Int32 nLastIndex = aURL.lastIndexOf('/'); - ::rtl::OUStringBuffer aTmp( aBasePresetPathURL ); + ::rtl::OUStringBuffer aTmp( aURL ); - if ( nLastIndex != aBasePresetPathURL.getLength()-1 ) + if ( nLastIndex != aURL.getLength()-1 ) aTmp.appendAscii( "/" ); aTmp.appendAscii( pLastSyncFileName ); @@ -692,17 +678,17 @@ void Desktop::Init() // and test if synchronzation is necessary! { ::rtl::OUString aUserLastSyncFilePathURL = getLastSyncFileURLFromUserInstallation(); - ::rtl::OUString aBaseLastSyncFilePathURL = getLastSyncFileURLFromBaseInstallation(); + ::rtl::OUString aPreregSyncFilePathURL = getLastSyncFileURLFromBrandInstallation(); - if ( needsSynchronization( aBaseLastSyncFilePathURL, aUserLastSyncFilePathURL )) + if ( needsSynchronization( aPreregSyncFilePathURL, aUserLastSyncFilePathURL )) { rtl::OUString aUserPath = getUserBundledExtPathURL(); - rtl::OUString aBasePresetsBundledPath = getBasePresetsPathURL(); + rtl::OUString aPreregBundledPath = getBrandSharePreregBundledPathURL(); // copy bundled folder to the user directory osl::FileBase::RC rc = osl::Directory::createPath(aUserPath); (void) rc; - copy_bundled_recursive( aBasePresetsBundledPath, aUserPath, +1 ); + copy_bundled_recursive( aPreregBundledPath, aUserPath, +1 ); } } diff --git a/desktop/source/app/userinstall.cxx b/desktop/source/app/userinstall.cxx index 0a31bed791ec..546a6f0ad13c 100644 --- a/desktop/source/app/userinstall.cxx +++ b/desktop/source/app/userinstall.cxx @@ -207,12 +207,8 @@ namespace desktop { if (newDstUnqPath.lastIndexOf(sal_Unicode('/')) != newDstUnqPath.getLength()-1) newDstUnqPath += rtl::OUString::createFromAscii("/"); newDstUnqPath += itemname; - // recursion - // Filer out bundled folder which is treated by a special - // implementation. - if ( !itemname.equalsAscii( BUNDLED_FOLDER_NAME )) - err = copy_recursive(newSrcUnqPath, newDstUnqPath); + err = copy_recursive(newSrcUnqPath, newDstUnqPath); } aDir.close(); diff --git a/desktop/source/app/userinstall.hxx b/desktop/source/app/userinstall.hxx index 8a8740eaa28b..8d6a51cd66be 100644 --- a/desktop/source/app/userinstall.hxx +++ b/desktop/source/app/userinstall.hxx @@ -29,8 +29,6 @@ #include #include -#define BUNDLED_FOLDER_NAME "bundled" - namespace desktop { diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index 9115cd32cbd4..4545ed862271 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -394,8 +394,11 @@ extern "C" int unopkg_main() //then we can delete the registration data at //$BUNDLED_EXTENSIONS_USER if (hasNoFolder(OUSTR("$BRAND_BASE_DIR/share/extensions"))) + { removeFolder(OUSTR("$BUNDLED_EXTENSIONS_USER")); - return 0; + //return otherwise we create the registration data again + return 0; + } } -- cgit From 124df99b73b2c0b450bd5c9dd74883e16fc2c3e7 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 22 Jul 2010 15:03:48 +0200 Subject: CWS changehid: #i111874#: pickerhelper.hxx removed --- sfx2/source/dialog/filedlghelper.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 874a430b6bda..d5a9abe6b597 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -79,7 +79,6 @@ #include #include #include -#include #include #include #include -- cgit From 74544584d1fd6cfb7b059d5915f6a69da5ec189e Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 23 Jul 2010 09:25:32 +0200 Subject: jl154:#i133370# Remove 'disable' from popup menu for shared extensions --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 87f70e449b9d..78b29624b16e 100755 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -372,11 +372,13 @@ MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long if ( ! GetEntryData( nPos )->m_bLocked ) { - if ( GetEntryData( nPos )->m_eState == REGISTERED ) - aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); - else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) - aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); - + if ( GetEntryData( nPos )->m_bUser ) + { + if ( GetEntryData( nPos )->m_eState == REGISTERED ) + aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); + else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) + aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); + } aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) ); } -- cgit From 93710c8f7fead1b625581b8dbcacd9dfde399c03 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Fri, 23 Jul 2010 14:43:01 +0200 Subject: unxlngxnewbaseline: #162926# use another condition to determine build environment --- connectivity/source/drivers/kab/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk index 6a47664890da..219bdd6cd020 100644 --- a/connectivity/source/drivers/kab/makefile.mk +++ b/connectivity/source/drivers/kab/makefile.mk @@ -46,7 +46,7 @@ CFLAGS+=$(KDE_CFLAGS) .IF "$(KDE_ROOT)"!="" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib -.IF "$(HOSTTYPE)" == "x86_64-linux" +.IF "$(OS)$(CPU)" == "LINUXX" EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64 .ENDIF .ENDIF -- cgit From 8baaab4f34d4e9a39c554a87ea1699c779d74983 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 23 Jul 2010 16:18:47 +0200 Subject: CWS changehid: #i111874#: some HID cleanup --- framework/inc/uielement/toolbarsmenucontroller.hxx | 2 +- framework/source/uielement/toolbarsmenucontroller.cxx | 15 +++++++-------- svx/inc/fmhelp.hrc | 19 +++++++++++++++++++ svx/source/fmcomp/gridctrl.src | 16 ++++++++-------- svx/source/form/filtnav.src | 6 ++++++ svx/source/form/fmexpl.src | 11 ++++++----- svx/source/form/formshell.src | 7 ++++--- 7 files changed, 51 insertions(+), 25 deletions(-) diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index b46ac233a92c..169923b00e47 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -105,7 +105,7 @@ namespace framework ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > > getLayoutManagerToolbars( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& rLayoutManager ); rtl::OUString getUINameFromCommand( const rtl::OUString& rCommandURL ); ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > getDispatchFromCommandURL( const rtl::OUString& rCommandURL ); - void addCommand( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OString& sHelpId, const rtl::OUString& aLabel ); + void addCommand( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OUString& aLabel ); sal_Bool isContextSensitiveToolbarNonVisible(); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState; diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 211df3bee6ab..fffaac0b42df 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -180,7 +180,7 @@ ToolbarsMenuController::~ToolbarsMenuController() } void ToolbarsMenuController::addCommand( - Reference< css::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OString& sHelpId, const rtl::OUString& rLabel ) + Reference< css::awt::XPopupMenu >& rPopupMenu, const rtl::OUString& rCommandURL, const rtl::OUString& rLabel ) { USHORT nItemId = m_xPopupMenu->getItemCount()+1; @@ -215,7 +215,6 @@ void ToolbarsMenuController::addCommand( PopupMenu* pVCLPopupMenu = (PopupMenu *)pPopupMenu->GetMenu(); if ( !!aImage ) pVCLPopupMenu->SetItemImage( nItemId, aImage ); - pVCLPopupMenu->SetHelpId( nItemId, sHelpId ); } m_aCommandVector.push_back( rCommandURL ); @@ -507,14 +506,14 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r m_aModuleIdentifier.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) || m_aModuleIdentifier.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) { - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_HYPERLINKBAR )), CMD_HYPERLINKBAR, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_HYPERLINKBAR )), aEmptyString ); if ( m_aModuleIdentifier.equalsAscii( "com.sun.star.drawing.DrawingDocument" ) || m_aModuleIdentifier.equalsAscii( "com.sun.star.presentation.PresentationDocument" )) - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_COLORBAR )), CMD_COLORBAR, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_COLORBAR )), aEmptyString ); else if ( m_aModuleIdentifier.equalsAscii( "com.sun.star.sheet.SpreadsheetDocument" )) - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_INPUTLINEBAR )), CMD_INPUTLINEBAR, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_INPUTLINEBAR )), aEmptyString ); else - addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_FORMULABAR )), CMD_FORMULABAR, aEmptyString ); + addCommand( m_xPopupMenu, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CMD_FORMULABAR )), aEmptyString ); } sal_Bool bAddCommand( sal_True ); @@ -537,7 +536,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r m_xPopupMenu->insertSeparator( nItemCount+1 ); } - addCommand( m_xPopupMenu, aConfigureToolbar, CONFIGURE_TOOLBARS, aEmptyString ); + addCommand( m_xPopupMenu, aConfigureToolbar, aEmptyString ); } // Add separator if no configure has been added @@ -553,7 +552,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r String aLabelStr = String( FwkResId( STR_RESTORE_TOOLBARS )); rtl::OUString aRestoreCmd( RTL_CONSTASCII_USTRINGPARAM( CMD_RESTOREVISIBILITY )); - addCommand( m_xPopupMenu, aRestoreCmd, CMD_RESTOREVISIBILITY, aLabelStr ); + addCommand( m_xPopupMenu, aRestoreCmd, aLabelStr ); } } diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc index 1222145655c1..7230df0c6da6 100644 --- a/svx/inc/fmhelp.hrc +++ b/svx/inc/fmhelp.hrc @@ -89,6 +89,25 @@ #define HID_XFORMS_ADDINSTANCE_DLG "SVX_HID_XFORMS_ADDINSTANCE_DLG" #define HID_XFORMS_MID_INSERT_CONTROL "SVX_HID_XFORMS_MID_INSERT_CONTROL" #define HID_XFORMS_TAB_CONTROL "SVX_HID_XFORMS_TAB_CONTROL" +#define HID_FM_DELETEROWS "SVX_HID_FM_DELETEROWS" +#define HID_FM_INSERTCOL "SVX_HID_FM_INSERTCOL" +#define HID_FM_CHANGECOL "SVX_HID_FM_CHANGECOL" +#define HID_FM_DELETECOL "SVX_HID_FM_DELETECOL" +#define HID_FM_HIDECOL "SVX_HID_FM_HIDECOL" +#define HID_FM_SHOWCOLS "SVX_HID_FM_SHOWCOLS" +#define HID_FM_SHOWCOLS_MORE "SVX_HID_FM_SHOWCOLS_MORE" +#define HID_FM_SHOWALLCOLS "SVX_HID_FM_SHOWALLCOLS" +#define HID_FM_DELETE "SVX_HID_FM_DELETE" +#define HID_FM_FILTER_EDIT "SVX_HID_FM_EDIT" +#define HID_FM_FILTER_IS_NULL "SVX_HID_FM_FILTER_IS_NULL" +#define HID_FM_FILTER_IS_NOT_NULL "SVX_HID_FM_IS_NOT_NULL" +#define HID_FM_NEW "SVX_HID_FM_NEW" +#define HID_FM_NEW_FORM "SVX_HID_FM_NEW_FORM" +#define HID_FM_NEW_HIDDEN "SVX_HID_FM_NEW_HIDDEN" +#define HID_FM_RENAME_OBJECT "SVX_HID_FM_RENAME_OBJECT" +#define HID_MENU_FM_TEXTATTRIBUTES_STYLE "SVX_HID_MENU_FM_TEXTATTRIBUTES_STYLE" +#define HID_MENU_FM_TEXTATTRIBUTES_ALIGNMENT "SVX_HID_MENU_FM_TEXTATTRIBUTES_ALIGNMENT" +#define HID_MENU_FM_TEXTATTRIBUTES_SPACING "SVX_HID_MENU_FM_TEXTATTRIBUTES_SPACING" #endif diff --git a/svx/source/fmcomp/gridctrl.src b/svx/source/fmcomp/gridctrl.src index 60e43a19f41e..88651ebbe04f 100644 --- a/svx/source/fmcomp/gridctrl.src +++ b/svx/source/fmcomp/gridctrl.src @@ -38,7 +38,7 @@ Menu RID_SVXMNU_ROWS MenuItem { Identifier = SID_FM_DELETEROWS ; -// HelpId = CMD_SID_FM_DELETEROWS ; + HelpId = HID_FM_DELETEROWS ; Text [ en-US ] = "Delete Rows" ; }; MenuItem @@ -62,7 +62,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_INSERTCOL ; -// HelpId = CMD_SID_FM_INSERTCOL ; + HelpId = HID_FM_INSERTCOL ; Text [ en-US ] = "Insert ~Column" ; SubMenu = Menu { @@ -142,25 +142,25 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_CHANGECOL ; -// HelpId = CMD_SID_FM_CHANGECOL ; + HelpId = HID_FM_CHANGECOL ; Text [ en-US ] = "~Replace with" ; }; MenuItem { Identifier = SID_FM_DELETECOL ; -// HelpId = CMD_SID_FM_DELETECOL ; + HelpId = HID_FM_DELETECOL ; Text [ en-US ] = "Delete Column" ; }; MenuItem { Identifier = SID_FM_HIDECOL ; -// HelpId = CMD_SID_FM_HIDECOL ; + HelpId = HID_FM_HIDECOL ; Text [ en-US ] = "~Hide Column"; }; MenuItem { Identifier = SID_FM_SHOWCOLS ; -// HelpId = CMD_SID_FM_SHOWCOLS ; + HelpId = HID_FM_SHOWCOLS ; SubMenu = Menu { ItemList = @@ -168,7 +168,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_SHOWCOLS_MORE ; -// HelpId = CMD_SID_FM_SHOWCOLS_MORE ; + HelpId = HID_FM_SHOWCOLS_MORE ; Text [ en-US ] = "~More..."; }; MenuItem @@ -178,7 +178,7 @@ Menu RID_SVXMNU_COLS MenuItem { Identifier = SID_FM_SHOWALLCOLS ; -// HelpId = CMD_SID_FM_SHOWALLCOLS ; + HelpId = HID_FM_SHOWALLCOLS ; Text [ en-US ] = "~All"; }; }; diff --git a/svx/source/form/filtnav.src b/svx/source/form/filtnav.src index c03e90df7130..feaba66729db 100644 --- a/svx/source/form/filtnav.src +++ b/svx/source/form/filtnav.src @@ -27,6 +27,8 @@ #include #include "fmresids.hrc" +#include "fmhelp.hrc" + Menu RID_FM_FILTER_MENU { ItemList = @@ -34,21 +36,25 @@ Menu RID_FM_FILTER_MENU MenuItem { Identifier = SID_FM_DELETE ; + HelpId = HID_FM_DELETE; Text [ en-US ] = "~Delete" ; }; MenuItem { Identifier = SID_FM_FILTER_EDIT ; + HelpId = HID_FM_FILTER_EDIT; Text [ en-US ] = "~Edit" ; }; MenuItem { Identifier = SID_FM_FILTER_IS_NULL ; + HelpId = HID_FM_FILTER_IS_NULL; Text [ en-US ] = "~Is Null" ; }; MenuItem { Identifier = SID_FM_FILTER_IS_NOT_NULL ; + HelpId = HID_FM_FILTER_IS_NOT_NULL; Text [ en-US ] = "I~s not Null" ; }; }; diff --git a/svx/source/form/fmexpl.src b/svx/source/form/fmexpl.src index d1d8001eeec0..8aca6d9ad86d 100644 --- a/svx/source/form/fmexpl.src +++ b/svx/source/form/fmexpl.src @@ -30,6 +30,7 @@ #include "fmexpl.hrc" #include "globlmn.hrc" #include +#include "fmhelp.hrc" Menu RID_FMEXPLORER_POPUPMENU { @@ -38,7 +39,7 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_NEW ; -// HelpId = CMD_SID_FM_NEW ; + HelpId = HID_FM_NEW ; Text [ en-US ] = "~New" ; SubMenu = Menu { @@ -47,13 +48,13 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_NEW_FORM ; -// HelpId = CMD_SID_FM_NEW_FORM ; + HelpId = HID_FM_NEW_FORM ; Text [ en-US ] = "Form" ; }; MenuItem { Identifier = SID_FM_NEW_HIDDEN ; -// HelpId = CMD_SID_FM_NEW_HIDDEN ; + HelpId = HID_FM_NEW_HIDDEN ; Text [ en-US ] = "Hidden Control" ; }; }; @@ -71,7 +72,7 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_DELETE ; -// HelpId = CMD_SID_FM_DELETE ; + HelpId = HID_FM_DELETE ; Text [ en-US ] = "~Delete" ; }; MenuItem @@ -83,7 +84,7 @@ Menu RID_FMEXPLORER_POPUPMENU MenuItem { Identifier = SID_FM_RENAME_OBJECT ; -// HelpId = CMD_SID_FM_RENAME_OBJECT ; + HelpId = HID_FM_RENAME_OBJECT ; Text [ en-US ] = "~Rename" ; }; MenuItem diff --git a/svx/source/form/formshell.src b/svx/source/form/formshell.src index b36590354b17..f7e2419aae7d 100644 --- a/svx/source/form/formshell.src +++ b/svx/source/form/formshell.src @@ -31,6 +31,7 @@ #include #include "globlmn.hrc" #include "helpid.hrc" +#include "fmhelp.hrc" Menu RID_FM_TEXTATTRIBUTE_MENU { @@ -47,7 +48,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_STYLE; -// HelpID = MENU_FM_TEXTATTRIBITES_STYLE; + HelpID = HID_MENU_FM_TEXTATTRIBUTES_STYLE; Text [ en-US ] = "St~yle"; SubMenu = Menu { @@ -96,7 +97,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_ALIGNMENT; -// HelpID = MENU_FM_TEXTATTRIBITES_ALIGNMENT; + HelpID = HID_MENU_FM_TEXTATTRIBUTES_ALIGNMENT; Text [ en-US ] = "~Alignment"; RadioCheck = TRUE; SubMenu = Menu @@ -129,7 +130,7 @@ Menu RID_FM_TEXTATTRIBUTE_MENU MenuItem { Identifier = MENU_FM_TEXTATTRIBITES_SPACING; -// HelpID = MENU_FM_TEXTATTRIBITES_SPACING; + HelpID = HID_MENU_FM_TEXTATTRIBUTES_SPACING; Text [ en-US ] = "~Line Spacing"; _MenuItemFlags = MIB_RADIOCHECK; SubMenu = Menu -- cgit From dec8e657ceffb60df8585ab16887bffaa2cdda6e Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 23 Jul 2010 17:21:05 +0200 Subject: cws tl83: #i113276# changes to Greek symbol set because of new OpenSymbol font --- officecfg/registry/data/org/openoffice/Office/Math.xcu | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 officecfg/registry/data/org/openoffice/Office/Math.xcu diff --git a/officecfg/registry/data/org/openoffice/Office/Math.xcu b/officecfg/registry/data/org/openoffice/Office/Math.xcu old mode 100644 new mode 100755 index 6778873e3386..b65c2422c433 --- a/officecfg/registry/data/org/openoffice/Office/Math.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Math.xcu @@ -48,6 +48,8 @@ 0 + + OpenSymbol @@ -65,10 +67,11 @@ 0 - 2 + 0 + -- cgit From c1419160f52222a3ed85c4a309df2ab10fceb2ed Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 26 Jul 2010 13:11:58 +0200 Subject: cws tl82: #i106993# thesaurus code clean-up --- sfx2/source/menu/mnumgr.cxx | 3 ++- sfx2/source/menu/thessubmenu.cxx | 33 --------------------------------- sfx2/source/menu/thessubmenu.hxx | 4 ---- 3 files changed, 2 insertions(+), 38 deletions(-) mode change 100644 => 100755 sfx2/source/menu/thessubmenu.hxx diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index b264a5b47861..cec1cbdac985 100755 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -60,6 +60,7 @@ #include #include #include +#include #include @@ -244,7 +245,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) //! item ids should start with values > 0, since 0 has special meaning const USHORT nId = i + 1; - String aItemText( GetThesaurusReplaceText_Impl( aSynonyms[i] ) ); + String aItemText( linguistic::GetThesaurusReplaceText( aSynonyms[i] ) ); pThesSubMenu->InsertItem( nId, aItemText ); ::rtl::OUString aCmd( ::rtl::OUString::createFromAscii( ".uno:ThesaurusFromContext?WordReplace:string=" ) ); aCmd += aItemText; diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index de1137bd6a74..d82c0a6dbdf3 100755 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -61,39 +61,6 @@ SFX_IMPL_MENU_CONTROL(SfxThesSubMenuControl, SfxStringItem); //////////////////////////////////////////////////////////// -String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText ) -{ - // The strings returned by the thesaurus sometimes have some - // explanation text put in between '(' and ')' or a trailing '*'. - // These parts should not be put in the ReplaceEdit Text that may get - // inserted into the document. Thus we strip them from the text. - - String aText( rText ); - - xub_StrLen nPos = aText.Search( sal_Unicode('(') ); - while (STRING_NOTFOUND != nPos) - { - xub_StrLen nEnd = aText.Search( sal_Unicode(')'), nPos ); - if (STRING_NOTFOUND != nEnd) - aText.Erase( nPos, nEnd-nPos+1 ); - else - break; - nPos = aText.Search( sal_Unicode('(') ); - } - - nPos = aText.Search( sal_Unicode('*') ); - if (STRING_NOTFOUND != nPos) - aText.Erase( nPos ); - - // remove any possible remaining ' ' that may confuse the thesaurus - // when it gets called with the text - aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); - - return aText; -} - -//////////////////////////////////////////////////////////// - /* Ctor; setzt Select-Handler am Menu und traegt Menu diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx old mode 100644 new mode 100755 index 14d7473cb7c0..0b86a534de52 --- a/sfx2/source/menu/thessubmenu.hxx +++ b/sfx2/source/menu/thessubmenu.hxx @@ -46,10 +46,6 @@ namespace css = ::com::sun::star; //////////////////////////////////////////////////////////// -String GetThesaurusReplaceText_Impl( const ::rtl::OUString &rText ); - -//////////////////////////////////////////////////////////// - class SfxThesSubMenuControl : public SfxMenuControl { PopupMenu* pMenu; -- cgit From c6431e762cd7fedb380160db13dbbe2a9a7e7f9d Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 26 Jul 2010 14:20:03 +0200 Subject: mib17: #163025# Basic Trace functionality for debugging (inactive by default) --- basic/source/classes/disas.cxx | 32 +++- basic/source/classes/sbxmod.cxx | 29 +++- basic/source/comp/sbcomp.cxx | 307 ++++++++++++++++++++++++++++++++++++++- basic/source/inc/sbtrace.hxx | 42 ++++++ basic/source/runtime/runtime.cxx | 19 +++ 5 files changed, 420 insertions(+), 9 deletions(-) mode change 100644 => 100755 basic/source/comp/sbcomp.cxx create mode 100755 basic/source/inc/sbtrace.hxx diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx index 87b4cad4e94b..a837a3dc4f24 100644 --- a/basic/source/classes/disas.cxx +++ b/basic/source/classes/disas.cxx @@ -35,6 +35,7 @@ #include "sb.hxx" #include "iosys.hxx" #include "disas.hxx" +#include "sbtrace.hxx" static const char* pOp1[] = { @@ -361,6 +362,11 @@ BOOL SbiDisas::DisasLine( String& rText ) rText.Erase(); if( !Fetch() ) return FALSE; + +#ifdef DBG_TRACE_BASIC + String aTraceStr_STMNT; +#endif + // New line? if( eOp == _STMNT && nOp1 != nLine ) { @@ -393,8 +399,13 @@ BOOL SbiDisas::DisasLine( String& rText ) rText.AppendAscii( "; " ); rText += s; rText.AppendAscii( _crlf() ); + +#ifdef DBG_TRACE_BASIC + aTraceStr_STMNT = s; +#endif } } + // Label? const char* p = ""; if( cLabels[ nPC >> 3 ] & ( 1 << ( nPC & 7 ) ) ) @@ -432,20 +443,29 @@ BOOL SbiDisas::DisasLine( String& rText ) rText.AppendAscii( _crlf() ); } snprintf( cBuf, sizeof(cBuf), pMask[ nParts ], nPC, (USHORT) eOp, nOp1, nOp2 ); - rText.AppendAscii( cBuf ); + + String aPCodeStr; + aPCodeStr.AppendAscii( cBuf ); int n = eOp; if( eOp >= SbOP2_START ) n -= SbOP2_START; else if( eOp >= SbOP1_START ) n -= SbOP1_START; - rText += '\t'; - rText.AppendAscii( pOps[ nParts-1 ][ n ] ); - rText += '\t'; + aPCodeStr += '\t'; + aPCodeStr.AppendAscii( pOps[ nParts-1 ][ n ] ); + aPCodeStr += '\t'; switch( nParts ) { - case 2: (this->*( pOperand2[ n ] ) )( rText ); break; - case 3: (this->*( pOperand3[ n ] ) )( rText ); break; + case 2: (this->*( pOperand2[ n ] ) )( aPCodeStr ); break; + case 3: (this->*( pOperand3[ n ] ) )( aPCodeStr ); break; } + + rText += aPCodeStr; + +#ifdef DBG_TRACE_BASIC + dbg_RegisterTraceTextForPC( pMod, nPC, aTraceStr_STMNT, aPCodeStr ); +#endif + return TRUE; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 30d856fda40e..0f52eef2d825 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -45,6 +45,7 @@ #include "runtime.hxx" #include "token.hxx" #include "sbunoobj.hxx" +#include "sbtrace.hxx" //#include @@ -1044,6 +1045,9 @@ USHORT SbModule::Run( SbMethod* pMeth ) StarBASICRef xBasic; if( bDelInst ) { +#ifdef DBG_TRACE_BASIC + dbg_InitTrace(); +#endif // #32779: Basic waehrend der Ausfuehrung festhalten xBasic = (StarBASIC*) GetParent(); @@ -1122,18 +1126,28 @@ USHORT SbModule::Run( SbMethod* pMeth ) SbModule* pOldMod = pMOD; pMOD = this; SbiRuntime* pRt = new SbiRuntime( this, pMeth, pMeth->nStart ); + +#ifdef DBG_TRACE_BASIC + dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl ); +#endif + pRt->pNext = pINST->pRun; if( pRt->pNext ) pRt->pNext->block(); pINST->pRun = pRt; if ( mbVBACompat ) - { + { pINST->EnableCompatibility( TRUE ); - } + } while( pRt->Step() ) {} if( pRt->pNext ) pRt->pNext->unblock(); +#ifdef DBG_TRACE_BASIC + bool bLeave = true; + dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl, bLeave ); +#endif + // #63710 Durch ein anderes Thread-Handling bei Events kann es passieren, // dass show-Aufruf an einem Dialog zurueckkehrt (durch schliessen des // Dialogs per UI), BEVOR ein per Event ausgeloester weitergehender Call, @@ -1227,9 +1241,20 @@ void SbModule::RunInit() pMOD = this; // Der Init-Code beginnt immer hier SbiRuntime* pRt = new SbiRuntime( this, NULL, 0 ); + +#ifdef DBG_TRACE_BASIC + dbg_traceNotifyCall( this, NULL, 0 ); +#endif + pRt->pNext = pINST->pRun; pINST->pRun = pRt; while( pRt->Step() ) {} + +#ifdef DBG_TRACE_BASIC + bool bLeave = true; + dbg_traceNotifyCall( this, NULL, 0, bLeave ); +#endif + pINST->pRun = pRt->pNext; delete pRt; pMOD = pOldMod; diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx old mode 100644 new mode 100755 index faabba046c99..e6fe73177dd2 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -31,10 +31,310 @@ #include #include "sbcomp.hxx" #include "image.hxx" +#include "sbtrace.hxx" +//========================================================================== +// Tracing, for debugging only + +// To activate tracing enable in sbtrace.hxx +#ifdef DBG_TRACE_BASIC + +#include + +// Trace Settings +static const char* GpTraceFileName = "d:\\zBasic.Asm\\BasicTrace.txt"; +static const bool GbIncludePCodes = false; +static const int GnIndentPerCallLevel = 4; +static const int GnIndentForPCode = 2; + +struct TraceTextData +{ + rtl::OString m_aTraceStr_STMNT; + rtl::OString m_aTraceStr_PCode; +}; +typedef std::hash_map< sal_Int32, TraceTextData > PCToTextDataMap; +typedef std::hash_map< ::rtl::OUString, PCToTextDataMap*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleTraceMap; + +ModuleTraceMap GaModuleTraceMap; +ModuleTraceMap& rModuleTraceMap = GaModuleTraceMap; + +static void lcl_PrepareTraceForModule( SbModule* pModule ) +{ + String aModuleName = pModule->GetName(); + ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName ); + if( it != rModuleTraceMap.end() ) + { + PCToTextDataMap* pInnerMap = it->second; + delete pInnerMap; + rModuleTraceMap.erase( it ); + } + + String aDisassemblyStr; + pModule->Disassemble( aDisassemblyStr ); +} + +static void lcl_lineOut( const char* pFileName, const char* pStr, const char* pPreStr = NULL ) +{ + const char* pPrintFirst = (pPreStr != NULL) ? pPreStr : ""; + FILE* pFile = fopen( pFileName, "a+" ); + if( pFile != NULL ) + { + fprintf( pFile, "%s%s\n", pPrintFirst, pStr ); + fclose( pFile ); + } +} + +const char* lcl_getSpaces( int nSpaceCount ) +{ + static sal_Char Spaces[] = " " + " " + " "; + static int nAvailableSpaceCount = strlen( Spaces ); + static sal_Char* pSpacesEnd = Spaces + nAvailableSpaceCount; + + if( nSpaceCount > nAvailableSpaceCount ) + nSpaceCount = nAvailableSpaceCount; + + return pSpacesEnd - nSpaceCount; +} + +static rtl::OString lcl_toOStringSkipLeadingWhites( const String& aStr ) +{ + static sal_Char Buffer[1000]; + + rtl::OString aOStr = OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US ); + const sal_Char* pStr = aOStr.getStr(); + + // Skip whitespace + sal_Char c = *pStr; + while( c == ' ' || c == '\t' ) + { + pStr++; + c = *pStr; + } + + int nLen = strlen( pStr ); + strncpy( Buffer, pStr, nLen ); + Buffer[nLen] = 0; + + rtl::OString aORetStr( Buffer ); + return aORetStr; +} + +String dumpMethodParameters( SbMethod* pMethod ) +{ + String aStr; + if( pMethod == NULL ) + return aStr; + + SbxError eOld = SbxBase::GetError(); + + SbxArray* pParams = pMethod->GetParameters(); + SbxInfo* pInfo = pMethod->GetInfo(); + if ( pParams ) + { + aStr += '('; + // 0 is sub itself + for ( USHORT nParam = 1; nParam < pParams->Count(); nParam++ ) + { + SbxVariable* pVar = pParams->Get( nParam ); + DBG_ASSERT( pVar, "Parameter?!" ); + if ( pVar->GetName().Len() ) + aStr += pVar->GetName(); + else if ( pInfo ) + { + const SbxParamInfo* pParam = pInfo->GetParam( nParam ); + if ( pParam ) + aStr += pParam->aName; + } + aStr += '='; + if( pVar->GetType() & SbxARRAY ) + aStr += String( RTL_CONSTASCII_USTRINGPARAM( "..." ) ); + else + aStr += pVar->GetString(); + if ( nParam < ( pParams->Count() - 1 ) ) + aStr += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) ); + } + aStr += ')'; + } + + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + + return aStr; +} + +// Public functions +void dbg_InitTrace( void ) +{ + FILE* pFile = fopen( GpTraceFileName, "w" ); + if( pFile != NULL ) + fclose( pFile ); +} + +void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl ) +{ + SbModule* pTraceMod = pModule; + if( pTraceMod->ISA(SbClassModuleObject) ) + { + SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod; + pTraceMod = pClassModuleObj->getClassModule(); + } + + String aModuleName = pTraceMod->GetName(); + ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName ); + if( it == rModuleTraceMap.end() ) + { + const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr(); + char Buffer[200]; + sprintf( Buffer, "TRACE ERROR: Unknown module \"%s\"", pModuleNameStr ); + lcl_lineOut( GpTraceFileName, Buffer ); + return; + } + + PCToTextDataMap* pInnerMap = it->second; + if( pInnerMap == NULL ) + { + lcl_lineOut( GpTraceFileName, "TRACE INTERNAL ERROR: No inner map" ); + return; + } + + PCToTextDataMap::iterator itInner = pInnerMap->find( nPC ); + if( itInner == pInnerMap->end() ) + { + const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr(); + char Buffer[200]; + sprintf( Buffer, "TRACE ERROR: No info for PC = %d in module \"%s\"", nPC, pModuleNameStr ); + lcl_lineOut( GpTraceFileName, Buffer ); + return; + } + + //nCallLvl--; + //if( nCallLvl < 0 ) + // nCallLvl = 0; + int nIndent = nCallLvl * GnIndentPerCallLevel; + + const TraceTextData& rTraceTextData = itInner->second; + const rtl::OString& rStr_STMNT = rTraceTextData.m_aTraceStr_STMNT; + if( rStr_STMNT.getLength() ) + lcl_lineOut( GpTraceFileName, rStr_STMNT.getStr(), lcl_getSpaces( nIndent ) ); + + if( !GbIncludePCodes ) + return; + + nIndent += GnIndentForPCode; + const rtl::OString& rStr_PCode = rTraceTextData.m_aTraceStr_PCode; + if( rStr_PCode.getLength() ) + lcl_lineOut( GpTraceFileName, rStr_PCode.getStr(), lcl_getSpaces( nIndent ) ); +} + +void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave ) +{ + static const char* pSeparator = "' ================================================================================"; + + SbModule* pTraceMod = pModule; + SbClassModuleObject* pClassModuleObj = NULL; + if( pTraceMod->ISA(SbClassModuleObject) ) + { + pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod; + pTraceMod = pClassModuleObj->getClassModule(); + } + + if( nCallLvl > 0 ) + nCallLvl--; + int nIndent = nCallLvl * GnIndentPerCallLevel; + if( !bLeave ) + { + lcl_lineOut( GpTraceFileName, "" ); + lcl_lineOut( GpTraceFileName, pSeparator, lcl_getSpaces( nIndent ) ); + } + + String aStr; + if( bLeave ) + { + lcl_lineOut( GpTraceFileName, "}", lcl_getSpaces( nIndent ) ); + aStr.AppendAscii( "' Leaving " ); + } + else + { + aStr.AppendAscii( "Entering " ); + } + String aModuleName = pModule->GetName(); + aStr += aModuleName; + if( pMethod != NULL ) + { + aStr.AppendAscii( "::" ); + String aMethodName = pMethod->GetName(); + aStr += aMethodName; + } + else + { + aStr.AppendAscii( "/RunInit" ); + } + + if( pClassModuleObj != NULL ) + { + aStr.AppendAscii( "[this=" ); + aStr += pClassModuleObj->GetName(); + aStr.AppendAscii( "]" ); + } + if( !bLeave ) + aStr += dumpMethodParameters( pMethod ); + + lcl_lineOut( GpTraceFileName, OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US ).getStr(), lcl_getSpaces( nIndent ) ); + if( !bLeave ) + lcl_lineOut( GpTraceFileName, "{", lcl_getSpaces( nIndent ) ); + + if( bLeave ) + lcl_lineOut( GpTraceFileName, "" ); +} + +void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl ) +{ + rtl::OString aOTraceErrMsg = OUStringToOString( rtl::OUString( aTraceErrMsg ), RTL_TEXTENCODING_ASCII_US ); + + char Buffer[200]; + const char* pHandledStr = bTraceErrHandled ? " / HANDLED" : ""; + sprintf( Buffer, "*** ERROR%s, Id = %d, Msg = \"%s\" ***", pHandledStr, (int)nTraceErr, aOTraceErrMsg.getStr() ); + int nIndent = nCallLvl * GnIndentPerCallLevel; + lcl_lineOut( GpTraceFileName, Buffer, lcl_getSpaces( nIndent ) ); +} + +void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC, + const String& aTraceStr_STMNT, const String& aTraceStr_PCode ) +{ + String aModuleName = pModule->GetName(); + ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName ); + PCToTextDataMap* pInnerMap; + if( it == rModuleTraceMap.end() ) + { + pInnerMap = new PCToTextDataMap(); + rModuleTraceMap[ aModuleName ] = pInnerMap; + } + else + { + pInnerMap = it->second; + } + + TraceTextData aData; + + rtl::OString aOTraceStr_STMNT = lcl_toOStringSkipLeadingWhites( aTraceStr_STMNT ); + aData.m_aTraceStr_STMNT = aOTraceStr_STMNT; + + rtl::OString aOTraceStr_PCode = lcl_toOStringSkipLeadingWhites( aTraceStr_PCode ); + aData.m_aTraceStr_PCode = aOTraceStr_PCode; + + (*pInnerMap)[nPC] = aData; +} + +#endif + + +//========================================================================== // For debugging only -// #define DBG_SAVE_DISASSEMBLY +//#define DBG_SAVE_DISASSEMBLY #ifdef DBG_SAVE_DISASSEMBLY static bool dbg_bDisassemble = true; @@ -99,6 +399,7 @@ void dbg_SaveDisassembly( SbModule* pModule ) } #endif + // Diese Routine ist hier definiert, damit der Compiler als eigenes Segment // geladen werden kann. @@ -155,6 +456,10 @@ BOOL SbModule::Compile() dbg_SaveDisassembly( this ); #endif +#ifdef DBG_TRACE_BASIC + lcl_PrepareTraceForModule( this ); +#endif + return bRet; } diff --git a/basic/source/inc/sbtrace.hxx b/basic/source/inc/sbtrace.hxx new file mode 100755 index 000000000000..e8a482c2f6e9 --- /dev/null +++ b/basic/source/inc/sbtrace.hxx @@ -0,0 +1,42 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SBTRACE_HXX +#define _SBTRACE_HXX + +// #define DBG_TRACE_BASIC + +#ifdef DBG_TRACE_BASIC +void dbg_InitTrace( void ); +void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl ); +void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave = false ); +void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl ); +void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC, + const String& aTraceStr_STMNT, const String& aTraceStr_PCode ); +#endif + +#endif diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index c3419adbfdb3..1bb6fb82e113 100755 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -44,6 +44,7 @@ #include #include "sbunoobj.hxx" #include "errobject.hxx" +#include "sbtrace.hxx" using namespace ::com::sun::star; @@ -720,6 +721,12 @@ BOOL SbiRuntime::Step() if( pInst->IsReschedule() && bStaticGlobalEnableReschedule ) Application::Reschedule(); } + +#ifdef DBG_TRACE_BASIC + UINT32 nPC = ( pCode - (const BYTE* )pImg->GetCode() ); + dbg_traceStep( pMod, nPC, pINST->nCallLvl ); +#endif + SbiOpcode eOp = (SbiOpcode ) ( *pCode++ ); UINT32 nOp1, nOp2; if( eOp <= SbOP0_END ) @@ -756,6 +763,11 @@ BOOL SbiRuntime::Step() // (insbesondere nicht nach Compiler-Fehlern zur Laufzeit) if( nError && bRun ) { +#ifdef DBG_TRACE_BASIC + SbError nTraceErr = nError; + String aTraceErrMsg = GetSbData()->aErrMsg; + bool bTraceErrHandled = true; +#endif SbError err = nError; ClearExprStack(); nError = 0; @@ -836,12 +848,19 @@ BOOL SbiRuntime::Step() // Kein Error-Hdl gefunden -> altes Vorgehen else { +#ifdef DBG_TRACE_BASIC + bTraceErrHandled = false; +#endif pInst->Abort(); } // ALT: Nur // pInst->Abort(); } + +#ifdef DBG_TRACE_BASIC + dbg_traceNotifyError( nTraceErr, aTraceErrMsg, bTraceErrHandled, pINST->nCallLvl ); +#endif } } return bRun; -- cgit From 85a4e97dc97a88c59ab0cf8a4d89d9f9413adf9f Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 26 Jul 2010 15:06:38 +0200 Subject: OOO330 masterix: #113247#: disable checking against network based DTD, build must not depend on network resources --- readlicense_oo/util/makefile.pmk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readlicense_oo/util/makefile.pmk b/readlicense_oo/util/makefile.pmk index 30e07779457b..0efd9712f11d 100755 --- a/readlicense_oo/util/makefile.pmk +++ b/readlicense_oo/util/makefile.pmk @@ -57,7 +57,7 @@ $(MISC)$/readme_text.xsl : virtual $(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual' @@-$(MKDIRHIER) $(@:d) - $(XSLTPROC) --nonet -o $@ \ + $(XSLTPROC) --nonet --novalid -o $@ \ --stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \ --stringparam cp1 $(CPUNAME) --stringparam type html --stringparam lang1 $* \ ..$/readme.xsl $(MERGEDXRM) @@ -67,7 +67,7 @@ $(MISC)$/$(GUI)$/$(eq,$(GUI),WNT readme README)_%.html : 'virtual' $(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual' @@-$(MKDIRHIER) $(@:d) - $(XSLTPROC) --nonet -o $@ \ + $(XSLTPROC) --nonet --novalid -o $@ \ --stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \ --stringparam cp1 $(CPUNAME) --stringparam type html --stringparam lang1 $* \ ..$/readme.xsl $(MERGEDXRM) @@ -75,7 +75,7 @@ $(MISC)$/$(GUI)$/$(eq,$(GUI),OS2 readme README)_%.html : 'virtual' # no percent-rule to avoid ambiguous inference chains for README_.html $(SYSTEXTDOCS) : $(MISC)$/readme_text.xsl @@-$(MKDIRHIER) $(@:d) - $(XSLTPROC) --nonet -o $@ \ + $(XSLTPROC) --nonet --novalid -o $@ \ --stringparam os1 $(OS) --stringparam gui1 $(GUI) --stringparam com1 $(COM) \ --stringparam cp1 $(CPUNAME) --stringparam type text --stringparam lang1 $(@:b:s/readme_//:s/README_//) \ $< $(MERGEDXRM) -- cgit From a11c345f88392632016ca0d4dd1e21188dae9e6c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 26 Jul 2010 19:13:47 +0200 Subject: mib17: prevent crash when VBAGlobals object is missing (this causes that document modules do not have an associated UNO object thus the DocObjectWrapper does not have a type provider) --- basic/source/classes/sbxmod.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0f52eef2d825..e42193ac2696 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -121,16 +121,16 @@ class DocObjectWrapper : public DocObjectWrapper_BASE public: DocObjectWrapper( SbModule* pMod ); - ~DocObjectWrapper(); + virtual ~DocObjectWrapper(); virtual void SAL_CALL acquire() throw(); virtual void SAL_CALL release() throw(); - virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() - throw ( com::sun::star::uno::RuntimeException ) + virtual Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (RuntimeException) { + if( !m_xAggregateTypeProv.is() ) + throw RuntimeException(); return m_xAggregateTypeProv->getImplementationId(); - } virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (RuntimeException); -- cgit From 521b922314728107ea4c63dde76a1f5afe0b0855 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 27 Jul 2010 11:46:28 +0200 Subject: mib17: #163102# transport declaration class name for WithEvents --- basic/source/runtime/step0.cxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index bdbb22678bf3..29965c7e9da5 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -532,9 +532,10 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b // Handle withevents BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); - Reference< XInterface > xComListener; - if( bWithEvents ) + if ( bWithEvents ) { + Reference< XInterface > xComListener; + SbxBase* pObj = refVal->GetObject(); SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL; if( pUnoObj != NULL ) @@ -545,13 +546,17 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b ::rtl::OUString aPrefix = refVar->GetName(); SbxObjectRef xScopeObj = refVar->GetParent(); xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); - } - } - *refVar = *refVal; + refVal->SetDeclareClassName( aDeclareClassName ); + refVal->SetComListener( xComListener ); // Hold reference + } - if( bWithEvents ) - refVar->SetComListener( xComListener ); // Hold reference + *refVar = *refVal; + } + else + { + *refVar = *refVal; + } // lhs is a property who's value is currently (Empty e.g. no broadcast yet) // in this case if there is a default prop involved the value of the -- cgit From 4cc4f719538888c7f97048e9a7c1693ef9e6f344 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 27 Jul 2010 11:53:35 +0200 Subject: mib17: #i112634# prepare loading VBA with document events from ODF and XLSM --- vbahelper/inc/vbahelper/vbaeventshelperbase.hxx | 3 --- vbahelper/source/vbahelper/vbaeventshelperbase.cxx | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx index b7216746c81d..89d355db71f9 100755 --- a/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx +++ b/vbahelper/inc/vbahelper/vbaeventshelperbase.hxx @@ -52,8 +52,6 @@ public: virtual ~VbaEventsHelperBase(); // XVBAEventProcessor - virtual void SAL_CALL setIgnoreEvents( sal_Bool bIgnoreEvents ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getIgnoreEvents() throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL hasVbaEventHandler( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); virtual void SAL_CALL processVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException, css::script::provider::ScriptFrameworkErrorException, css::util::VetoException, css::uno::RuntimeException); @@ -156,7 +154,6 @@ private: typedef ::std::map< sal_Int32, EventHandlerInfo > EventHandlerMap; EventHandlerMap maEvents; - bool mbIgnoreEvents; bool mbDisposed; }; diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx index ea5448482a89..16a8671df601 100755 --- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx +++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx @@ -35,7 +35,6 @@ using namespace ::ooo::vba; VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs, const uno::Reference< uno::XComponentContext >& /*xContext*/ ) : mpShell( 0 ), - mbIgnoreEvents( false ), mbDisposed( false ) { try @@ -57,16 +56,6 @@ VbaEventsHelperBase::~VbaEventsHelperBase() stopListening(); } -void SAL_CALL VbaEventsHelperBase::setIgnoreEvents( sal_Bool bIgnoreEvents ) throw (uno::RuntimeException) -{ - mbIgnoreEvents = bIgnoreEvents; -} - -sal_Bool SAL_CALL VbaEventsHelperBase::getIgnoreEvents() throw (uno::RuntimeException) -{ - return mbIgnoreEvents; -} - sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs ) throw (lang::IllegalArgumentException, uno::RuntimeException) { @@ -87,7 +76,7 @@ void SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, const un /* bEnabled will track if event processing is enabled. Every event handler may disable handling of other events. */ - bool bEnabled = !mbIgnoreEvents; + bool bEnabled = true; /* bCancel will contain the current Cancel value. It is possible that multiple events will try to modify the Cancel value. Every event -- cgit From b7d6f018da399d350d778acf0d76b210242b3939 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 27 Jul 2010 12:16:05 +0200 Subject: mib17: #i110822# Fixed named parameter handling in automation bridge --- basic/source/runtime/step2.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 basic/source/runtime/step2.cxx diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx old mode 100644 new mode 100755 index 47f4967eab99..0e95bf66631d --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -378,7 +378,8 @@ void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 ) bool bError_ = true; SbUnoMethod* pUnoMethod = PTR_CAST(SbUnoMethod,p); - if( pUnoMethod ) + SbUnoProperty* pUnoProperty = PTR_CAST(SbUnoProperty,p); + if( pUnoMethod || pUnoProperty ) { SbUnoObject* pParentUnoObj = PTR_CAST( SbUnoObject,p->GetParent() ); if( pParentUnoObj ) -- cgit From 25291f60b2d3626cbf289233af1a9f796bcf227b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 27 Jul 2010 14:38:42 +0200 Subject: jl154 #i113463# unopkg sync fails on solaris, when there was one extension removed --- desktop/source/deployment/registry/dp_registry.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index c5e440a2a825..0f309a5b729f 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -129,7 +129,9 @@ public: virtual Reference SAL_CALL bindPackage( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference const & xCmdEnv ) - throw (deployment::DeploymentException, CommandFailedException, + throw (deployment::DeploymentException, + deployment::InvalidRemovedParameterException, + CommandFailedException, lang::IllegalArgumentException, RuntimeException); virtual Sequence< Reference > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -461,7 +463,8 @@ void PackageRegistryImpl::update() throw (RuntimeException) Reference PackageRegistryImpl::bindPackage( OUString const & url, OUString const & mediaType_, sal_Bool bRemoved, OUString const & identifier, Reference const & xCmdEnv ) - throw (deployment::DeploymentException, CommandFailedException, + throw (deployment::DeploymentException, deployment::InvalidRemovedParameterException, + CommandFailedException, lang::IllegalArgumentException, RuntimeException) { check(); -- cgit From e1461c4204ffc1c099fb8b877c3b7a58c35437dd Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 27 Jul 2010 14:43:33 +0200 Subject: mib17: move VBA specific interfaces into vba subdir --- basic/source/basmgr/basmgr.cxx | 12 ++++++------ basic/source/classes/sbxmod.cxx | 6 +++--- basic/source/inc/namecont.hxx | 10 +++++----- basic/source/inc/scriptcont.hxx | 4 ++-- basic/source/uno/namecont.cxx | 4 ++-- basic/source/uno/scriptcont.cxx | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index b76a2b5e249e..84763468e64c 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -67,8 +67,8 @@ #include #include #include -#include -#include +#include +#include #include @@ -240,7 +240,7 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr, Any aElement = xLibNameAccess->getByName( aModuleName ); ::rtl::OUString aMod; aElement >>= aMod; - Reference< XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY ); + Reference< vba::XVBAModuleInfo > xVBAModuleInfo( xLibNameAccess, UNO_QUERY ); if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aModuleName ) ) { ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aModuleName ); @@ -285,9 +285,9 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent StarBASIC* pLib = mpMgr->GetLib( aName ); if ( pLib ) { - Reference xVBACompat( xScriptCont, UNO_QUERY ); + Reference< vba::XVBACompatibility > xVBACompat( xScriptCont, UNO_QUERY ); if ( xVBACompat.is() ) - pLib->SetVBAEnabled( xVBACompat->getVBACompatModeOn() ); + pLib->SetVBAEnabled( xVBACompat->getVBACompatibilityMode() ); } } else @@ -302,7 +302,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent { ::rtl::OUString aMod; Event.Element >>= aMod; - Reference< XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY ); + Reference< vba::XVBAModuleInfo > xVBAModuleInfo( Event.Source, UNO_QUERY ); if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( aName ) ) { ModuleInfo mInfo = xVBAModuleInfo->getModuleInfo( aName ); diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index e42193ac2696..8b1069bbeab3 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include using namespace com::sun::star; @@ -461,9 +461,9 @@ bool getDefaultVBAMode( StarBASIC* pb ) uno::Reference< beans::XPropertySet > xProp( aDoc, uno::UNO_QUERY ); if ( xProp.is() ) { - uno::Reference< script::XVBACompat > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY ); + uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProp->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BasicLibraries") ) ), uno::UNO_QUERY ); if ( xVBAMode.is() ) - bResult = ( xVBAMode->getVBACompatModeOn() == sal_True ); + bResult = xVBAMode->getVBACompatibilityMode() == sal_True; } } } diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx index 4df1c48557d2..10150daf96b8 100644 --- a/basic/source/inc/namecont.hxx +++ b/basic/source/inc/namecont.hxx @@ -60,7 +60,7 @@ #include #include #include -#include +#include class BasicManager; @@ -73,7 +73,7 @@ typedef ::cppu::WeakComponentImplHelper7< ::com::sun::star::script::XLibraryContainerPassword, ::com::sun::star::script::XLibraryContainerExport, ::com::sun::star::container::XContainer, - ::com::sun::star::script::XVBACompat, + ::com::sun::star::script::vba::XVBACompatibility, ::com::sun::star::lang::XServiceInfo > LibraryContainerHelper; typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer, @@ -500,9 +500,9 @@ public: throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0; - // Methods XVBACompat - virtual ::sal_Bool SAL_CALL getVBACompatModeOn() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException); + // Methods XVBACompatibility + virtual ::sal_Bool SAL_CALL getVBACompatibilityMode() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setVBACompatibilityMode( ::sal_Bool _vbacompatmodeon ) throw (::com::sun::star::uno::RuntimeException); }; class LibraryContainerMethodGuard diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx index d184a2d558e2..091fbc24cdbe 100644 --- a/basic/source/inc/scriptcont.hxx +++ b/basic/source/inc/scriptcont.hxx @@ -30,7 +30,7 @@ #include "namecont.hxx" #include -#include +#include #include class BasicManager; @@ -141,7 +141,7 @@ public: //============================================================================ typedef std::hash_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInfoMap; -typedef ::cppu::ImplHelper1 < ::com::sun::star::script::XVBAModuleInfo +typedef ::cppu::ImplHelper1 < ::com::sun::star::script::vba::XVBAModuleInfo > SfxScriptLibrary_BASE; class SfxScriptLibrary : public SfxLibrary diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index f692277fc5ba..b4cd118533fd 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -2789,12 +2789,12 @@ OUString SfxLibraryContainer::expand_url( const OUString& url ) } } -::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatModeOn() throw (RuntimeException) +::sal_Bool SAL_CALL SfxLibraryContainer::getVBACompatibilityMode() throw (RuntimeException) { return mbVBACompat; } -void SAL_CALL SfxLibraryContainer::setVBACompatModeOn( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException) +void SAL_CALL SfxLibraryContainer::setVBACompatibilityMode( ::sal_Bool _vbacompatmodeon ) throw (RuntimeException) { BasicManager* pBasMgr = getBasicManager(); if( pBasMgr ) diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 5622adc19af1..ef8e1f459472 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -216,7 +216,7 @@ void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement Any aElement = xLib->getByName( aElementName ); aElement >>= aMod.aCode; - Reference < script::XVBAModuleInfo > xModInfo( xLib, UNO_QUERY ); + Reference < script::vba::XVBAModuleInfo > xModInfo( xLib, UNO_QUERY ); if( xModInfo.is() && xModInfo->hasModuleInfo( aElementName ) ) { @@ -312,9 +312,9 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement // aMod.aName ignored if( aMod.aModuleType.getLength() > 0 ) { - if( !getVBACompatModeOn() ) + if( !getVBACompatibilityMode() ) { - setVBACompatModeOn( sal_True ); + setVBACompatibilityMode( sal_True ); Any aGlobs; Sequence< Any > aArgs(1); @@ -381,7 +381,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement } } - Reference< script::XVBAModuleInfo > xVBAModuleInfo( xLib, + Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY ); if( xVBAModuleInfo.is() ) { -- cgit From 4ed0e085d2a1730f201bf584c22c0a9fe32c98e2 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Tue, 27 Jul 2010 15:55:17 +0200 Subject: l10nfixer01: #i113440# fixed resource --- sfx2/source/dialog/securitypage.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src index fee60404d01c..ee334234c802 100755 --- a/sfx2/source/dialog/securitypage.src +++ b/sfx2/source/dialog/securitypage.src @@ -79,9 +79,9 @@ TabPage TP_DOCINFOSECURITY Pos = MAP_APPFONT( 12, 48 ); Size = MAP_APPFONT( 236, 3 * RSC_CD_FIXEDTEXT_HEIGHT ); Text [ en-US ] = - "Note: After a password has been set, the document will only open "\ - "with the password. Should you lose the password, there will be "\ - "no way to recover the document. Please also note that this password "\ + "Note: After a password has been set, the document will only open " + "with the password. Should you lose the password, there will be " + "no way to recover the document. Please also note that this password " "is case-sensitive."; WordBreak = TRUE; }; -- cgit From 7492878a15774e9741ea2fefbf183fbec557c1c1 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- configmgr/source/rootaccess.cxx | 5 +++-- .../source/accelerators/acceleratorconfiguration.cxx | 19 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 95a346d720c2..f5d0bb137202 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -96,11 +96,12 @@ void RootAccess::initBroadcaster( for (ChangesListeners::iterator i(changesListeners_.begin()); i != changesListeners_.end(); ++i) { + cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this); + css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY ); broadcaster->addChangesNotification( *i, css::util::ChangesEvent( - static_cast< cppu::OWeakObject * >(this), - css::uno::makeAny(pathRepresentation_), set)); + pSource, makeAny( xBase ), set)); } } } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 15070eed7c98..e63c41173df6 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1264,26 +1264,21 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: aChange.Accessor >>= sOrgPath; sPath = sOrgPath; - ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sPrimarySecondary); - - ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sGlobalModules); + ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) { ::rtl::OUString sModule; - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) ) { - ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath); - ::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']"); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule); - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } } -- cgit From b3a5ee2e9cc75c522abc81f7a6e0dd8e963b2a96 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 27 Jul 2010 18:11:00 +0200 Subject: fwk151: Fixed problems that configuration changes notifications were not correctly sent/processed --- configmgr/source/rootaccess.cxx | 5 +++-- .../source/accelerators/acceleratorconfiguration.cxx | 19 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 95a346d720c2..f5d0bb137202 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -96,11 +96,12 @@ void RootAccess::initBroadcaster( for (ChangesListeners::iterator i(changesListeners_.begin()); i != changesListeners_.end(); ++i) { + cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this); + css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY ); broadcaster->addChangesNotification( *i, css::util::ChangesEvent( - static_cast< cppu::OWeakObject * >(this), - css::uno::makeAny(pathRepresentation_), set)); + pSource, makeAny( xBase ), set)); } } } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 15070eed7c98..e63c41173df6 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1264,26 +1264,21 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: aChange.Accessor >>= sOrgPath; sPath = sOrgPath; - ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sPrimarySecondary); - - ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sGlobalModules); + ::rtl::OUString sPrimarySecondary = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + ::rtl::OUString sGlobalModules = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); if ( sGlobalModules.equals(CFG_ENTRY_GLOBAL) ) { ::rtl::OUString sModule; - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } else if ( sGlobalModules.equals(CFG_ENTRY_MODULES) ) { - ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath); - ::rtl::OUString sDropModule = ::rtl::OUString::createFromAscii("Module['") + sModule + ::rtl::OUString::createFromAscii("']"); - sPath = ::utl::dropPrefixFromConfigurationPath(sPath, sDropModule); - sKey = ::utl::extractFirstFromConfigurationPath(sPath); - if ( sKey.getLength() ) + ::rtl::OUString sModule = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + sKey = ::utl::extractFirstFromConfigurationPath(sPath, &sPath); + if (( sKey.getLength() > 0 ) && ( sPath.getLength() > 0 )) reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); } } -- cgit From 0319bf68ea594167312e15df50148994daa31357 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 28 Jul 2010 09:46:36 +0200 Subject: cws tl83: #i113276# default layout for 'Greek' characters changed; added new property 'GreekCharStyle' --- .../registry/schema/org/openoffice/Office/Math.xcs | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs index caa8726b7c72..31f6e00a230a 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs @@ -402,7 +402,28 @@ false - + + + + TL + Specifies the default layout for symbols from the 'Greek' symbol set. + + + + + + Specifies the minimum value allowed + + + + + Specifies the maximum value allowed + + + + 0 + + -- cgit From 69d41381ba6e808153508ccd09ea73b8d77dbe76 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 28 Jul 2010 11:53:03 +0200 Subject: mib17: resolved conflict after rebase corrected --- basic/source/runtime/step0.cxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 1051a0b514f5..29965c7e9da5 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -558,9 +558,6 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b *refVar = *refVal; } - if( bWithEvents ) - refVar->SetComListener( xComListener ); // Hold reference - // lhs is a property who's value is currently (Empty e.g. no broadcast yet) // in this case if there is a default prop involved the value of the // default property may infact be void so the type will also be SbxEMPTY -- cgit From ac751d3424a43ef3729a14036473bfda71280ef9 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 28 Jul 2010 12:19:34 +0200 Subject: jl154 #i113463# processPackage_ in dp_configuration.cxx threw an IOException when revoking xcs files --- .../registry/configuration/dp_configuration.cxx | 62 +++++++++------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 9ea6e8227340..3c6680065db5 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -359,16 +359,11 @@ void BackendImpl::configmgrini_verify_init( do { OUString token( line.getToken( 0, ' ', index ).trim() ); if (token.getLength() > 0) { - // cleanup, check if existing: - if (create_ucb_content( - 0, expandUnoRcTerm(token), xCmdEnv, - false /* no throw */ )) { - //The file may not exist anymore if a shared or bundled - //extension was removed, but it can still be in the configmgrini. - //After running XExtensionManager::synchronize, the configmgrini is - //cleaned up - m_xcs_files.push_back( token ); - } + //The file may not exist anymore if a shared or bundled + //extension was removed, but it can still be in the configmgrini. + //After running XExtensionManager::synchronize, the configmgrini is + //cleaned up + m_xcs_files.push_back( token ); } } while (index >= 0); @@ -378,31 +373,15 @@ void BackendImpl::configmgrini_verify_init( sal_Int32 index = sizeof ("DATA=") - 1; do { OUString token( line.getToken( 0, ' ', index ).trim() ); - if (token.getLength() > 0) { + if (token.getLength() > 0) + { if (token[ 0 ] == '?') token = token.copy( 1 ); - // cleanup, check if existing: - if (create_ucb_content( - 0, expandUnoRcTerm(token), - xCmdEnv, false /* no throw */ )) { - //The file may not exist anymore if a shared or bundled - //extension was removed, but it can still be in the configmgrini. - //After running XExtensionManager::synchronize, the configmgrini is - //cleaned up - m_xcu_files.push_back( token ); - } - else - { - //Check if it was removed. Only when the file contained %origin, so that - //a new file was writen in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) - //See also ConfigurationBackendDb.iniEntry - ::std::list iniEntries = getAllIniEntries(); - if (::std::find(iniEntries.begin(), iniEntries.end(), token) - != iniEntries.end()) - m_xcu_files.push_back( token ); - else - OSL_ENSURE(0, "Extension manager: Invalid configmgr.ini entry."); - } + //The file may not exist anymore if a shared or bundled + //extension was removed, but it can still be in the configmgrini. + //After running XExtensionManager::synchronize, the configmgrini is + //cleaned up + m_xcu_files.push_back( token ); } } while (index >= 0); @@ -502,6 +481,8 @@ bool BackendImpl::removeFromConfigmgrIni( { //in case the xcu contained %origin% then the configmr.ini contains the //url to the file in the user installation (e.g. $BUNDLED_EXTENSIONS_USER) + //However, m_url (getURL()) contains the URL for the file in the actual + //extension installatation. ::boost::optional data = readDataFromDb(url_); if (data) i = std::find(rSet.begin(), rSet.end(), data->iniEntry); @@ -757,10 +738,17 @@ void BackendImpl::PackageImpl::processPackage_( } that->m_registeredPackages->erase(i->first); } - ::ucbhelper::Content( - makeURL( that->getCachePath(), OUSTR("registry") ), - xCmdEnv ).executeCommand( - OUSTR("delete"), Any( true /* delete physically */ ) ); + try + { + ::ucbhelper::Content( + makeURL( that->getCachePath(), OUSTR("registry") ), + xCmdEnv ).executeCommand( + OUSTR("delete"), Any( true /* delete physically */ ) ); + } + catch(Exception&) + { + OSL_ASSERT(0); + } } that->deleteDataFromDb(getURL()); -- cgit From de9172871b29cea2fddbce9d5c55730f6d64754b Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 28 Jul 2010 13:01:55 +0200 Subject: fwk152: #i113454# accept broken .xcs files containing empty --- configmgr/source/xcsparser.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 79e122759fc8..37b46494c6a7 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -321,15 +321,19 @@ void XcsParser::endElement(XmlReader const & reader) { } else { switch (state_) { case STATE_COMPONENT_SCHEMA: + // To support old, broken extensions with .xcs files that contain + // empty elements: + state_ = STATE_COMPONENT_DONE; + break; + case STATE_TEMPLATES: + state_ = STATE_TEMPLATES_DONE; + break; case STATE_TEMPLATES_DONE: throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("no component element in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); - case STATE_TEMPLATES: - state_ = STATE_TEMPLATES_DONE; - break; case STATE_COMPONENT_DONE: break; default: -- cgit From c34ae9ba3c48c793a78ae86729d112ea1a282236 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 28 Jul 2010 13:27:00 +0200 Subject: mib17: resolved conflict after rebase corrected --- vbahelper/inc/vbahelper/vbaapplicationbase.hxx | 3 --- vbahelper/inc/vbahelper/vbadocumentbase.hxx | 3 --- vbahelper/source/vbahelper/vbadocumentbase.cxx | 1 - 3 files changed, 7 deletions(-) diff --git a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx index 8611a46a6bfc..6902bc7b5042 100644 --- a/vbahelper/inc/vbahelper/vbaapplicationbase.hxx +++ b/vbahelper/inc/vbahelper/vbaapplicationbase.hxx @@ -68,9 +68,6 @@ public: virtual void SAL_CALL Undo() throw (css::uno::RuntimeException); virtual void SAL_CALL Quit() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getVBE() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL SAL_CALL getVBProjects() throw (css::uno::RuntimeException); - // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence getServiceNames(); diff --git a/vbahelper/inc/vbahelper/vbadocumentbase.hxx b/vbahelper/inc/vbahelper/vbadocumentbase.hxx index 8e14a0a8662e..2588b7da1720 100644 --- a/vbahelper/inc/vbahelper/vbadocumentbase.hxx +++ b/vbahelper/inc/vbahelper/vbadocumentbase.hxx @@ -54,9 +54,6 @@ public: virtual void SAL_CALL setSaved( sal_Bool bSave ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); - virtual css::uno::Any SAL_CALL getVBProject() throw (css::uno::RuntimeException); // Michhael E. Bohn - - // Methods virtual void SAL_CALL Close( const css::uno::Any &bSaveChanges, const css::uno::Any &aFileName, diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index 01cd63cde7ac..65f7f4bcfbeb 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -35,7 +35,6 @@ #include #include //Michael E. Bohn #include -#include #include #include -- cgit From 5136d89453c5a28a7143afcf58c547517d4b6758 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 28 Jul 2010 13:54:38 +0200 Subject: fwk152: #i113249# Fix broken HTML clipboard --- editeng/source/editeng/eehtml.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 569b80639b6b..e8a2aaad22e2 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -43,7 +43,7 @@ #include #include #include - +#include #define ACTION_INSERTTEXT 1 #define ACTION_INSERTPARABRK 2 @@ -66,6 +66,16 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu nNumberingLevel = 0; bFieldsInserted = FALSE; + DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" ); + DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" ); + + // Altough the real default encoding is ISO8859-1, we use MS-1252 + // als default encoding. + SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); + + // If the file starts with a BOM, switch to UCS2. + SetSwitchToUCS2( TRUE ); + if ( pHTTPHeaderAttrs ) SetEncodingByHTTPHeader( pHTTPHeaderAttrs ); } -- cgit From a8f1ad65612c0e54969cabc541b183062ae3d905 Mon Sep 17 00:00:00 2001 From: Henning Brinkmann Date: Wed, 28 Jul 2010 14:17:26 +0200 Subject: writerfilter08ooo330: applied patch for writerfilter08 --- sfx2/source/doc/sfxbasemodel.cxx | 6 ++++++ sfx2/source/view/frame2.cxx | 5 +---- sfx2/source/view/viewfrm.cxx | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b5a9536b12c5..7ef9fe0d2f19 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -977,6 +977,8 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& aArgs.remove( "BreakMacroSignature" ); aArgs.remove( "Stream" ); aArgs.remove( "InputStream" ); + aArgs.remove( "URL" ); + aArgs.remove( "Frame" ); // TODO/LATER: all the parameters that are accepted by ItemSet of the DocShell must be removed here @@ -988,6 +990,10 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString& SfxAllItemSet aSet( pObjectShell->GetPool() ); TransformParameters( SID_OPENDOC, rArgs, aSet ); + // the arguments are not allowed to reach the medium + aSet.ClearItem( SID_FILE_NAME ); + aSet.ClearItem( SID_FILLFRAME ); + pMedium->GetItemSet()->Put( aSet ); SFX_ITEMSET_ARG( &aSet, pItem, SfxStringItem, SID_FILTER_NAME, sal_False ); if ( pItem ) diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index d99ad8733e03..d43512ac791d 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI aLoadArgs = aArgs.getPropertyValues(); // load the doc into that frame - ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() ); - if ( sLoaderURL.getLength() == 0 ) - sLoaderURL = rDoc.GetFactory().GetFactoryURL(); - + ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sLoaderURL, diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 035fd3f794de..feced28efb11 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2144,6 +2144,8 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc aTransformLoadArgs.remove( "Hidden" ); ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); + if ( !sURL.getLength() ) + sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); xLoader->loadComponentFromURL( sURL, ::rtl::OUString::createFromAscii( "_self" ), 0, -- cgit From d4853323d5834584b360b5874643ea719471a49b Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Wed, 28 Jul 2010 16:27:07 +0200 Subject: jl154 #i113463# some comments and rollback even when runtime exception is thrown --- .../deployment/manager/dp_extensionmanager.cxx | 8 ++++++++ .../deployment/registry/package/dp_package.cxx | 22 ++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index de9d97db2b48..c82973f1b680 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -1136,6 +1136,14 @@ sal_Bool ExtensionManager::synchronize( bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv); progressBundled.update(OUSTR("\n\n")); + //Always determine the active extension. This is necessary for the + //first-start optimization. The setup creates the registration data for the + //bundled extensions (brand_layer/share/prereg/bundled), which is copied to the user + //installation (user_installation/extension/bundled) when a user starts OOo + //for the first time after running setup. All bundled extensions are registered + //at that moment. However, extensions with the same identifier can be in the + //shared or user repository, in which case the respective bundled extensions must + //be revoked. try { const uno::Sequence > > diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 2ad6478b665c..feb55d0af3bf 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -866,14 +866,10 @@ void BackendImpl::PackageImpl::processPackage_( try { xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv ); } - catch (RuntimeException &) { - throw; - } - catch (ucb::CommandAbortedException &) { - throw; - } - catch (Exception &) { - // CommandFailedException, DeploymentException: + catch (Exception &) + { + //We even try a rollback if the user cancelled the action (CommandAbortedException) + //in order to prevent invalid database entries. Any exc( ::cppu::getCaughtException() ); // try to handle exception, notify: bool approve = false, abort = false; @@ -904,14 +900,8 @@ void BackendImpl::PackageImpl::processPackage_( bundle[ pos ]->revokePackage( xSubAbortChannel, xCmdEnv ); } - catch (RuntimeException &) { - throw; - } - catch (ucb::CommandAbortedException &) { - throw; - } - catch (Exception &) { - // bundle rollback error: + catch (Exception &) + { OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), -- cgit From a18c6fe8f3f353d78f58563d8d39bf4c922712ac Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 29 Jul 2010 13:49:40 +0200 Subject: writerfilter08ooo300: #i112415# on reload the filter should not set document readonly --- sfx2/source/view/viewfrm.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index feced28efb11..ed924623c700 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -813,6 +813,13 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) xNewObj->SetModifyPasswordEntered( sal_False ); xNewObj->SetReadOnly(); } + else if ( rReq.GetSlot() == SID_EDITDOC && bForEdit && !xNewObj->IsReadOnlyMedium() ) + { + // the filter might request setting of the document to readonly state + // but in case of SID_EDITDOC it should not happen if the document + // can be opened for editing + xNewObj->SetReadOnlyUI( sal_False ); + } if ( xNewObj->IsDocShared() ) { -- cgit From 603d34f5ae0fe8cd63a1b16452432991bfa29f29 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 29 Jul 2010 14:57:46 +0200 Subject: sw33bf08: #i113461#: SvxAutoCorrect::AutoCorrect(): apply patch by dtardon: do not freeze after erasing non-breaking space inserted by French AutoCorrection --- editeng/source/misc/svxacorr.cxx | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 64343517c69f..f969a8033f08 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1243,27 +1243,25 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, else if ( bIsNextRun && !IsAutoCorrectChar( cChar ) ) { // Remove the NBSP if it wasn't an autocorrection - if ( NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) && + if ( nInsPos != 0 && NeedsHardspaceAutocorr( rTxt.GetChar( nInsPos - 1 ) ) && cChar != ' ' && cChar != '\t' && cChar != CHAR_HARDBLANK ) { // Look for the last HARD_SPACE xub_StrLen nPos = nInsPos - 1; - bool bFound = false; - while ( nPos != STRING_NOTFOUND && !bFound ) + bool bContinue = true; + while ( bContinue ) { - sal_Unicode cTmpChar = rTxt.GetChar( nPos ); + const sal_Unicode cTmpChar = rTxt.GetChar( nPos ); if ( cTmpChar == CHAR_HARDBLANK ) - bFound = true; - else if ( !NeedsHardspaceAutocorr( cTmpChar ) ) - nPos = STRING_NOTFOUND; + { + rDoc.Delete( nPos, nPos + 1 ); + nRet = AddNonBrkSpace; + bContinue = false; + } + else if ( !NeedsHardspaceAutocorr( cTmpChar ) || nPos == 0 ) + bContinue = false; nPos--; } - - if ( bFound && nPos != STRING_NOTFOUND ) - { - rDoc.Delete( nPos + 1, nPos + 2 ); - nRet = AddNonBrkSpace; - } } } } -- cgit From d505716fb2df2fcadd050f9e90e27327931a375a Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 30 Jul 2010 13:42:03 +0200 Subject: l10nfixer01: back out of last changeset --- sfx2/source/dialog/securitypage.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src index ee334234c802..fee60404d01c 100755 --- a/sfx2/source/dialog/securitypage.src +++ b/sfx2/source/dialog/securitypage.src @@ -79,9 +79,9 @@ TabPage TP_DOCINFOSECURITY Pos = MAP_APPFONT( 12, 48 ); Size = MAP_APPFONT( 236, 3 * RSC_CD_FIXEDTEXT_HEIGHT ); Text [ en-US ] = - "Note: After a password has been set, the document will only open " - "with the password. Should you lose the password, there will be " - "no way to recover the document. Please also note that this password " + "Note: After a password has been set, the document will only open "\ + "with the password. Should you lose the password, there will be "\ + "no way to recover the document. Please also note that this password "\ "is case-sensitive."; WordBreak = TRUE; }; -- cgit From ad7fbe5ff52f49fca835d7100e1b892b5a362c40 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 30 Jul 2010 17:28:42 +0200 Subject: mib17: #163146# XLS import: do not skip hidden names, do not rename sheet-local names, add Worksheet.Names VBA symbol -- #i112849# fix crash when closing Calc document --- oovbaapi/ooo/vba/excel/XWorksheet.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index 271cd81d4d0e..fb6261bc06c0 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -114,6 +114,7 @@ interface XWorksheet XRange Rows([in] any aIndex); XRange Columns([in] any aIndex); any Hyperlinks( [in] any aIndex ); + any Names( [in] any Index ); any Evaluate( [in] string Name); -- cgit From 536570325d39dfc9559640b13800f976725ac2c3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 3 Aug 2010 10:01:07 +0100 Subject: cmcfixes77: #i113503# system non-stlport cppunit with OOo stlport --- sfx2/qa/cppunit/makefile.mk | 7 +++++++ sfx2/qa/cppunit/test_metadatable.cxx | 2 ++ 2 files changed, 9 insertions(+) diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk index 2794c2ae92bb..dce0b86a0619 100644 --- a/sfx2/qa/cppunit/makefile.mk +++ b/sfx2/qa/cppunit/makefile.mk @@ -35,6 +35,13 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +#building with stlport, but cppunit was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_CPPUNIT)"=="YES" +CFLAGSCXX+=-DADAPT_EXT_STL +.ENDIF +.ENDIF + CFLAGSCXX += $(CPPUNIT_CFLAGS) DLLPRE = # no leading "lib" on .so files diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx index 903be6920327..6a0be13a9c53 100644 --- a/sfx2/qa/cppunit/test_metadatable.cxx +++ b/sfx2/qa/cppunit/test_metadatable.cxx @@ -27,10 +27,12 @@ #include "precompiled_sfx2.hxx" +#include "preextstl.h" #include #include #include #include +#include "postextstl.h" #include -- cgit From 5f31862d1d90a95359c1b41c4d379192cc6e00be Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 3 Aug 2010 12:19:44 +0100 Subject: cmcfixes77: #i113615# WaE fix NULL/0 --- avmedia/source/gstreamer/gstwindow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avmedia/source/gstreamer/gstwindow.cxx b/avmedia/source/gstreamer/gstwindow.cxx index 3b24e9974a3f..12606ad5e88b 100644 --- a/avmedia/source/gstreamer/gstwindow.cxx +++ b/avmedia/source/gstreamer/gstwindow.cxx @@ -259,7 +259,7 @@ value in sequence of arguments" ); if( !mpPlayerWindow && ( rArguments.getLength() > 2 ) ) { SystemChildWindow* pParentWindow = NULL; - sal_IntPtr pIntPtr = NULL; + sal_IntPtr pIntPtr = 0; // we are not interested in the first argument, which is a pure X11 window handle; // this backend relies on a SystemChildWindow as parent for the PlayerWindow, given -- cgit From 73b1fb3f842f654e253bacb8d04bf5b95ad272fc Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Tue, 3 Aug 2010 15:21:37 +0200 Subject: dv21 #i113524# prevent online update for bundled extensions --- desktop/source/deployment/misc/dp_update.cxx | 84 ++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 17 deletions(-) mode change 100755 => 100644 desktop/source/deployment/misc/dp_update.cxx diff --git a/desktop/source/deployment/misc/dp_update.cxx b/desktop/source/deployment/misc/dp_update.cxx old mode 100755 new mode 100644 index 52011f1f0ca0..fb6efe0b79aa --- a/desktop/source/deployment/misc/dp_update.cxx +++ b/desktop/source/deployment/misc/dp_update.cxx @@ -90,8 +90,6 @@ getUpdateInformation( Reference const & Sequence >(); } -//Put in anonymous namespace - void getOwnUpdateInfos( Reference const & xContext, Reference const & updateInformation, @@ -185,6 +183,56 @@ void getDefaultUpdateInfos( } } +bool containsBundledOnly(Sequence > const & sameIdExtensions) +{ + OSL_ASSERT(sameIdExtensions.getLength() == 3); + if (!sameIdExtensions[0].is() && !sameIdExtensions[1].is() && sameIdExtensions[2].is()) + return true; + else + return false; +} +/** Returns true if the list of extensions are bundled extensions and there are no + other extensions with the same identifier in the shared or user repository. + If extensionList is NULL, then it is checked if there are only bundled extensions. +*/ +bool onlyBundledExtensions( + Reference const & xExtMgr, + std::vector< Reference > const * extensionList) +{ + OSL_ASSERT(xExtMgr.is()); + bool onlyBundled = true; + if (extensionList) + { + typedef std::vector >::const_iterator CIT; + for (CIT i = extensionList->begin(); i != extensionList->end(); i++) + { + Sequence > seqExt = xExtMgr->getExtensionsWithSameIdentifier( + dp_misc::getIdentifier(*i), (*i)->getName(), Reference()); + + if (!containsBundledOnly(seqExt)) + { + onlyBundled = false; + break; + } + + } + } + else + { + const uno::Sequence< uno::Sequence< Reference > > seqAllExt = + xExtMgr->getAllExtensions(Reference(), Reference()); + + for (int pos = seqAllExt.getLength(); pos --; ) + { + if (!containsBundledOnly(seqAllExt[pos])) + { + onlyBundled = false; + break; + } + } + } + return onlyBundled; +} } // anon namespace @@ -233,13 +281,14 @@ UPDATE_SOURCE isUpdateUserExtension( retVal = UPDATE_SOURCE_ONLINE; } - else if (bundledVersion.getLength()) - { - int index = determineHighestVersion( - OUString(), OUString(), bundledVersion, onlineVersion); - if (index == 3) - retVal = UPDATE_SOURCE_ONLINE; - } + //No update for bundled extensions, they are updated only by the setup + //else if (bundledVersion.getLength()) + //{ + // int index = determineHighestVersion( + // OUString(), OUString(), bundledVersion, onlineVersion); + // if (index == 3) + // retVal = UPDATE_SOURCE_ONLINE; + //} } else { @@ -278,13 +327,14 @@ UPDATE_SOURCE isUpdateSharedExtension( else if (index == 3) retVal = UPDATE_SOURCE_ONLINE; } - else if (bundledVersion.getLength()) - { - int index = determineHighestVersion( - OUString(), OUString(), bundledVersion, onlineVersion); - if (index == 3) - retVal = UPDATE_SOURCE_ONLINE; - } + //No update for bundled extensions, they are updated only by the setup + //else if (bundledVersion.getLength()) + //{ + // int index = determineHighestVersion( + // OUString(), OUString(), bundledVersion, onlineVersion); + // if (index == 3) + // retVal = UPDATE_SOURCE_ONLINE; + //} return retVal; } @@ -332,7 +382,7 @@ UpdateInfoMap getOnlineUpdateInfos( { OSL_ASSERT(xExtMgr.is()); UpdateInfoMap infoMap; - if (!xExtMgr.is()) + if (!xExtMgr.is() || onlyBundledExtensions(xExtMgr, extensionList)) return infoMap; if (!extensionList) -- cgit From d5bb7f0a4a1b9e6a0fbc1f597a1c30ddea67838a Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 09:56:54 +0200 Subject: mib18: #162937# extract all integer and floating values from an 'Any' for Boolean parameters --- vbahelper/inc/vbahelper/vbahelper.hxx | 7 +++++++ vbahelper/source/vbahelper/vbahelper.cxx | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx index a1eca84bbdf8..ccabb9114f2d 100644 --- a/vbahelper/inc/vbahelper/vbahelper.hxx +++ b/vbahelper/inc/vbahelper/vbahelper.hxx @@ -90,6 +90,13 @@ namespace ooo VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection ); VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* ); + /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value. + Returns false, if the Any is empty or contains an incompatible type. */ + VBAHELPER_DLLPUBLIC bool extractBoolFromAny( bool& rbValue, const css::uno::Any& rAny ); + /** Extracts a boolean value from the passed Any, which may contain sal_Bool or an integer or floating-point value. + Throws, if the Any is empty or contains an incompatible type. */ + VBAHELPER_DLLPUBLIC bool extractBoolFromAny( const css::uno::Any& rAny ) throw (css::uno::RuntimeException); + VBAHELPER_DLLPUBLIC rtl::OUString getAnyAsString( const css::uno::Any& pvargItem ) throw ( css::uno::RuntimeException ); VBAHELPER_DLLPUBLIC rtl::OUString VBAToRegexp(const rtl::OUString &rIn, bool bForLike = false); // needs to be in an uno service ( already this code is duplicated in basic ) VBAHELPER_DLLPUBLIC double getPixelTo100thMillimeterConversionFactor( css::uno::Reference< css::awt::XDevice >& xDevice, sal_Bool bVertical); diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 7cd82dff9536..14f4e3ff1363 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -625,6 +625,30 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: dispatchExecute( pViewShell, SID_VIEWSHELL1 ); } +bool extractBoolFromAny( bool& rbValue, const uno::Any& rAny ) +{ + if( rAny >>= rbValue ) return true; + + sal_Int64 nSigned = 0; + if( rAny >>= nSigned ) { rbValue = nSigned != 0; return true; } + + sal_uInt64 nUnsigned = 0; + if( rAny >>= nUnsigned ) { rbValue = nUnsigned > 0; return true; } + + double fDouble = 0.0; + if( rAny >>= fDouble ) { rbValue = fDouble != 0.0; return true; } + + return false; +} + +bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) +{ + bool bValue = false; + if( extractBoolFromAny( bValue, rAny ) ) + return bValue; + throw uno::RuntimeException(); +} + rtl::OUString getAnyAsString( const uno::Any& pvargItem ) throw ( uno::RuntimeException ) { uno::Type aType = pvargItem.getValueType(); -- cgit From 63be9a19153d112ecfbc01f40522f1a388c5bb56 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Wed, 4 Aug 2010 13:26:33 +0200 Subject: #i10000# fixed d.lst --- oovbaapi/prj/d.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oovbaapi/prj/d.lst b/oovbaapi/prj/d.lst index ac5924e2d684..86e801a15d93 100644 --- a/oovbaapi/prj/d.lst +++ b/oovbaapi/prj/d.lst @@ -8,7 +8,7 @@ mkdir: %COMMON_DEST%\idl%_EXT%\ooo\vba\word ..\%__SRC%\ucr\oovbaapi.db %_DEST%\bin%_EXT%\oovbaapi.rdb -..\ooo\vba\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\ +..\ooo\vba\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba ..\ooo\vba\constants\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\constants ..\ooo\vba\excel\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\excel ..\ooo\vba\msforms\*.idl %COMMON_DEST%\idl%_EXT%\ooo\vba\msforms -- cgit From 22e60c73ba7dd3b8a7dae727d5682578c6677217 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 4 Aug 2010 13:56:16 +0200 Subject: fwk151: #i110127# Better formatting --- framework/source/accelerators/acceleratorconfiguration.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index e63c41173df6..b81ef5aecf0e 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -96,6 +96,8 @@ #include +#include + //_______________________________________________ // const @@ -1248,7 +1250,6 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: const sal_Int32 c = aEvent.Changes.getLength(); sal_Int32 i = 0; - for (i=0; i 0 ) && ( sPath.getLength() > 0 )) + { reloadChanged(sPrimarySecondary, sGlobalModules, sModule, sKey); + } } } } @@ -1380,8 +1384,8 @@ void XCUBasedAcceleratorConfiguration::impl_ts_load( sal_Bool bPreferred, const aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD1; else if (sToken[k].equalsAscii("MOD2")) aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD2; - else if (sToken[k].equalsAscii("MOD3")) - aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; + else if (sToken[k].equalsAscii("MOD3")) + aKeyEvent.Modifiers |= css::awt::KeyModifier::MOD3; else { bValid = sal_False; -- cgit From 2ecf87efeb1ec5f4185b80cdb333b84f352a011e Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 4 Aug 2010 18:13:02 +0200 Subject: mib18: #162938# add VBA symbol Worksheet.AutoFilterMode --- oovbaapi/ooo/vba/excel/XWorksheet.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index fb6261bc06c0..1907fb004cab 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -72,6 +72,7 @@ interface XWorksheet [attribute, readonly] string CodeName; [attribute, readonly] short Index; [attribute] long EnableSelection; + [attribute] boolean AutoFilterMode; void Activate(); void Calculate( ); -- cgit From f4f1756a4c4cd35d77ccd2b9ca0f38799e6555af Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 5 Aug 2010 11:52:07 +0200 Subject: mib18: #163025# Changed RunInit handling for class modules to get right order --- basic/inc/basic/sbmod.hxx | 4 +- basic/source/classes/sb.cxx | 93 ++++++++++++++++++++++++++++++++++++++- basic/source/comp/codegen.cxx | 8 ++-- basic/source/comp/dim.cxx | 3 ++ basic/source/inc/parser.hxx | 5 ++- basic/source/inc/sbintern.hxx | 6 +++ basic/source/runtime/methods1.cxx | 2 - 7 files changed, 112 insertions(+), 9 deletions(-) diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index bccf8212f10e..abb482f7bfe5 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -44,6 +44,7 @@ class SbProcedureProperty; class SbIfaceMapperMethod; class SbClassModuleObject; +struct ClassModuleRunInitItem; struct SbClassData; class SbModuleImpl; @@ -71,6 +72,7 @@ protected: SbxObjectRef pDocObject; // an impl object ( used by Document Modules ) bool bIsProxyModule; + static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem ); void StartDefinitions(); SbMethod* GetMethod( const String&, SbxDataType ); SbProperty* GetProperty( const String&, SbxDataType ); @@ -134,7 +136,7 @@ public: void SetVBACompat( BOOL bCompat ); INT32 GetModuleType() { return mnType; } void SetModuleType( INT32 nType ) { mnType = nType; } - bool GetIsProxyModule() { return bIsProxyModule; } + bool isProxyModule() { return bIsProxyModule; } void AddVarName( const String& aName ); void RemoveVars(); ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > GetUnoModule(); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index e28b0a304f28..d4520025953e 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -57,6 +57,7 @@ #include #include #include "errobject.hxx" +#include #include #include @@ -726,6 +727,7 @@ SbClassData::SbClassData( void ) void SbClassData::clear( void ) { mxIfaces->Clear(); + maRequiredTypes.clear(); } SbClassFactory::SbClassFactory( void ) @@ -981,6 +983,72 @@ SbModule* StarBASIC::FindModule( const String& rName ) return NULL; } + +struct ClassModuleRunInitItem +{ + SbModule* m_pModule; + bool m_bProcessing; + bool m_bRunInitDone; + //ModuleVector m_vModulesDependingOnThisModule; + + ClassModuleRunInitItem( void ) + : m_pModule( NULL ) + , m_bProcessing( false ) + , m_bRunInitDone( false ) + {} + ClassModuleRunInitItem( SbModule* pModule ) + : m_pModule( pModule ) + , m_bProcessing( false ) + , m_bRunInitDone( false ) + {} +}; + +typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem, + ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap; + +static ModuleInitDependencyMap* GpMIDMap = NULL; + +void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) +{ + ModuleInitDependencyMap& rMIDMap = *GpMIDMap; + + rItem.m_bProcessing = true; + + //bool bAnyDependencies = true; + SbModule* pModule = rItem.m_pModule; + if( pModule->pClassData != NULL ) + { + StringVector& rReqTypes = pModule->pClassData->maRequiredTypes; + if( rReqTypes.size() > 0 ) + { + for( StringVector::iterator it = rReqTypes.begin() ; it != rReqTypes.end() ; ++it ) + { + String& rStr = *it; + + // Is required type a class module? + ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr ); + if( itFind != rMIDMap.end() ) + { + ClassModuleRunInitItem& rParentItem = itFind->second; + if( rParentItem.m_bProcessing ) + { + // TODO: raise error? + DBG_ERROR( "Cyclic module dependency detected" ); + continue; + } + + if( !rParentItem.m_bRunInitDone ) + implProcessModuleRunInit( rParentItem ); + } + } + } + } + + pModule->RunInit(); + rItem.m_bRunInitDone = true; + rItem.m_bProcessing = false; +} + // Run Init-Code of all modules (including inserted libraries) void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) { @@ -994,10 +1062,33 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // compile modules first then RunInit ( otherwise there is // can be order dependency, e.g. classmodule A has a member // of of type classmodule B and classmodule B hasn't been compiled yet ) + + // Consider required types to init in right order. Class modules + // that are required by other modules have to be initialized first. + ModuleInitDependencyMap aMIDMap; + GpMIDMap = &aMIDMap; + for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pModules->Get( nMod ); + String aModuleName = pModule->GetName(); + if( pModule->isProxyModule() ) + aMIDMap[aModuleName] = ClassModuleRunInitItem( pModule ); + } + + ModuleInitDependencyMap::iterator it; + for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it ) + { + ClassModuleRunInitItem& rItem = it->second; + SbModule::implProcessModuleRunInit( rItem ); + } + GpMIDMap = NULL; + + // Call RunInit on standard modules for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); - pModule->RunInit(); + if( !pModule->isProxyModule() ) + pModule->RunInit(); } // Check all objects if they are BASIC, diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 46f829b382e8..e0f23c15d224 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -138,11 +138,10 @@ void SbiCodeGen::Save() pCLASSFAC->AddClassModule( &rMod ); nIfaceCount = pParser->aIfaceVector.size(); + if( !rMod.pClassData ) + rMod.pClassData = new SbClassData; if( nIfaceCount ) { - if( !rMod.pClassData ) - rMod.pClassData = new SbClassData; - for( int i = 0 ; i < nIfaceCount ; i++ ) { const String& rIfaceName = pParser->aIfaceVector[i]; @@ -152,6 +151,8 @@ void SbiCodeGen::Save() pIfaces->Insert( pIfaceVar, pIfaces->Count() ); } } + + rMod.pClassData->maRequiredTypes = pParser->aRequiredTypes; } else { @@ -161,6 +162,7 @@ void SbiCodeGen::Save() rMod.mnType = com::sun::star::script::ModuleType::NORMAL; rMod.bIsProxyModule = false; } + if( pParser->bText ) p->SetFlag( SBIMG_COMPARETEXT ); // GlobalCode-Flag diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index bff3d22dd9b0..b8fa3c089fd8 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -161,6 +161,9 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed ) // In den String-Pool uebernehmen rDef.SetTypeId( aGblStrings.Add( aCompleteName ) ); + + if( rDef.IsNew() && pProc == NULL ) + aRequiredTypes.push_back( aCompleteName ); } eType = SbxOBJECT; break; diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 1161c4ed259d..733a65db7f61 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -34,7 +34,7 @@ #include -typedef ::std::vector< String > IfaceVector; +typedef ::std::vector< String > StringVector; struct SbiParseStack; @@ -81,7 +81,8 @@ public: BOOL bText; // OPTION COMPARE TEXT BOOL bExplicit; // TRUE: OPTION EXPLICIT BOOL bClassModule; // TRUE: OPTION ClassModule - IfaceVector aIfaceVector; // Holds all interfaces implemented by a class module + StringVector aIfaceVector; // Holds all interfaces implemented by a class module + StringVector aRequiredTypes; // Types used in Dim As New outside subs SbxDataType eDefTypes[26]; // DEFxxx-Datentypen SbiParser( StarBASIC*, SbModule* ); diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx index 59cfe21d25a8..4c54e2301bd5 100644 --- a/basic/source/inc/sbintern.hxx +++ b/basic/source/inc/sbintern.hxx @@ -50,10 +50,16 @@ public: virtual SbxObject* CreateObject( const String& ); }; +typedef ::std::vector< String > StringVector; + struct SbClassData { SbxArrayRef mxIfaces; + // types this module depends on because of use in Dim As New + // needed for initialization order of class modules + StringVector maRequiredTypes; + SbClassData( void ); ~SbClassData( void ) { clear(); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 8c7da2403705..9d806cac933a 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1586,8 +1586,6 @@ RTLFUNC(Join) } -typedef ::std::vector< String > StringVector; - RTLFUNC(Split) { (void)pBasic; -- cgit From 048631266fa9fafc357dfb02eb023b409c93e5b1 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 5 Aug 2010 11:53:41 +0200 Subject: fwk152: #i112452# let restart functionality restart quickstarter as well --- desktop/inc/app.hxx | 3 + desktop/source/app/app.cxx | 7 ++ desktop/source/app/appfirststart.cxx | 104 +++++++++++++++------ desktop/win32/source/officeloader/officeloader.cxx | 1 + officecfg/registry/schema/org/openoffice/Setup.xcs | 9 +- 5 files changed, 94 insertions(+), 30 deletions(-) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 8867a940a6ad..fa7550812bbe 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -134,6 +134,9 @@ class Desktop : public Application static sal_Bool IsFirstStartWizardNeeded(); static sal_Bool CheckExtensionDependencies(); + static void DoRestartActionsIfNecessary( sal_Bool bQuickStart ); + static void SetRestartState(); + void SynchronizeExtensionRepositories(); void SetSplashScreenText( const ::rtl::OUString& rText ); void SetSplashScreenProgress( sal_Int32 ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 731ffe85d83b..cabec4a05691 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1659,7 +1659,12 @@ void Desktop::Main() ::comphelper::ComponentContext aContext( xSMgr ); xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) + { + // if this run of the office is triggered by restart, some additional actions should be done + DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ); + Execute(); + } } catch(const com::sun::star::document::CorruptedFilterConfigurationException& exFilterCfg) { @@ -1674,6 +1679,8 @@ void Desktop::Main() // check whether the shutdown is caused by restart sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + if ( bRestartRequested ) + SetRestartState(); if (xGlobalBroadcaster.is()) { diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx index 2f0d4ab9e538..43c88e6eaa8a 100644 --- a/desktop/source/app/appfirststart.cxx +++ b/desktop/source/app/appfirststart.cxx @@ -36,12 +36,14 @@ #include #include #include +#include #include "app.hxx" -using rtl::OUString; -using namespace desktop; -using namespace com::sun::star::beans; +using ::rtl::OUString; +using namespace ::desktop; +using namespace ::com::sun::star; +using namespace ::com::sun::star::beans; static const OUString sConfigSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationProvider" ) ); static const OUString sAccessSrvc( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" ) ); @@ -128,24 +130,29 @@ sal_Bool Desktop::LicenseNeedsAcceptance() */ } -/* Local function - was the wizard completed already? */ -static sal_Bool impl_isFirstStart() +/* Local function - get access to the configuration */ +static Reference< XPropertySet > impl_getConfigurationAccess( const OUString& rPath ) { - try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); + Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); + // get configuration provider + Reference< XMultiServiceFactory > xConfigProvider = Reference< XMultiServiceFactory >( + xFactory->createInstance( sConfigSrvc ), UNO_QUERY_THROW ); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; + Sequence< Any > aArgs( 1 ); + NamedValue aValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NodePath" ) ), makeAny( rPath ) ); + aArgs[0] <<= aValue; + return Reference< XPropertySet >( + xConfigProvider->createInstanceWithArguments( sAccessSrvc, aArgs ), UNO_QUERY_THROW ); +} - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); +/* Local function - was the wizard completed already? */ +static sal_Bool impl_isFirstStart() +{ + try { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); - Any result = pset->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted")); + Any result = xPSet->getPropertyValue(OUString::createFromAscii("FirstStartWizardCompleted")); sal_Bool bCompleted = sal_False; if ((result >>= bCompleted) && bCompleted) return sal_False; // wizard was already completed @@ -219,20 +226,9 @@ static sal_Bool impl_isLicenseAccepted() try { - Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory(); - - // get configuration provider - Reference< XMultiServiceFactory > theConfigProvider = Reference< XMultiServiceFactory >( - xFactory->createInstance(sConfigSrvc), UNO_QUERY_THROW); + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); - Sequence< Any > theArgs(1); - NamedValue v(OUString::createFromAscii("NodePath"), - makeAny(OUString::createFromAscii("org.openoffice.Setup/Office"))); - theArgs[0] <<= v; - Reference< XPropertySet > pset = Reference< XPropertySet >( - theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs), UNO_QUERY_THROW); - - Any result = pset->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate")); + Any result = xPSet->getPropertyValue(OUString::createFromAscii("LicenseAcceptDate")); OUString aAcceptDate; if (result >>= aAcceptDate) @@ -272,3 +268,53 @@ sal_Bool Desktop::IsFirstStartWizardNeeded() return impl_isFirstStart() || !impl_isLicenseAccepted(); } +void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart ) +{ + if ( bQuickStart ) + { + try + { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); + + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) ); + Any aRestart = xPSet->getPropertyValue( sPropName ); + sal_Bool bRestart = sal_False; + if ( ( aRestart >>= bRestart ) && bRestart ) + { + xPSet->setPropertyValue( sPropName, makeAny( sal_False ) ); + Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); + + sal_Bool bQuickstart = sal_True; + sal_Bool bAutostart = sal_True; + Sequence< Any > aSeq( 2 ); + aSeq[0] <<= sal_True; + aSeq[1] <<= sal_True; + + Reference < XInitialization > xQuickstart( ::comphelper::getProcessServiceFactory()->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Quickstart" ) ) ),UNO_QUERY_THROW ); + xQuickstart->initialize( aSeq ); + } + } + catch( uno::Exception& ) + { + // this is no critical operation so it should not prevent office from starting + } + } +} + +void Desktop::SetRestartState() +{ + try + { + Reference< XPropertySet > xPSet = impl_getConfigurationAccess( OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Setup/Office" ) ) ); + OUString sPropName( RTL_CONSTASCII_USTRINGPARAM( "OfficeRestartInProgress" ) ); + xPSet->setPropertyValue( sPropName, makeAny( sal_True ) ); + Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); + } + catch( uno::Exception& ) + { + // this is no critical operation, ignore the exception + } + +} + diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx index 7c2dafc79bbb..b85a72555935 100644 --- a/desktop/win32/source/officeloader/officeloader.cxx +++ b/desktop/win32/source/officeloader/officeloader.cxx @@ -339,6 +339,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) p = desktop_win32::commandLineAppend(p, argv[i]); } } + p = desktop_win32::commandLineAppend( p, MY_STRING(L"\" \"-env:OOO_CWD=")); if (cwdLen == 0) { diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs index 76c4bb17782b..62d3fdcce85d 100644 --- a/officecfg/registry/schema/org/openoffice/Setup.xcs +++ b/officecfg/registry/schema/org/openoffice/Setup.xcs @@ -395,7 +395,14 @@ AS Contains all of the document factories that were installed during setup. - + + + + MAV + The entry specifies that we are in restart process + + false + -- cgit From b8d78852acfa632daa32d5827d0ee64fd6102c80 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 5 Aug 2010 15:59:10 +0200 Subject: renaissance1: #i113685# Avoid (indirect) static BitmapEx. --- svx/source/sdr/contact/viewcontactofsdrpage.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index 29d11b3dfe26..ad65b647001e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -169,24 +169,19 @@ namespace sdr } else { - static vcl::DeleteOnDeinit< BitmapEx > aPageShadow35x35( - new BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr()))); - - if(aPageShadow35x35.get()) + static vcl::DeleteOnDeinit + aDiscreteShadow(new drawinglayer::primitive2d::DiscreteShadow( + BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr())))); + if (aDiscreteShadow.get() != NULL) { - static drawinglayer::primitive2d::DiscreteShadow aDiscreteShadow(*aPageShadow35x35.get()); - const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( aPageMatrix, - aDiscreteShadow)); + *aDiscreteShadow.get())); return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } - else - { - return drawinglayer::primitive2d::Primitive2DSequence(); - } + return drawinglayer::primitive2d::Primitive2DSequence(); } } -- cgit From e2b85f96b67ac4bb9f26a60c11cedc98ec52206f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 09:35:51 +0200 Subject: mib18: #163121# Declare Rework --- basic/source/comp/codegen.cxx | 4 ++ basic/source/comp/dim.cxx | 61 ++++++++++++++++++++++++++++- basic/source/comp/exprgen.cxx | 69 +++++++++------------------------ basic/source/comp/exprtree.cxx | 10 ----- basic/source/inc/expr.hxx | 3 -- basic/source/inc/symtbl.hxx | 3 +- scripting/source/basprov/basmodnode.cxx | 14 +++++-- scripting/source/basprov/basprov.cxx | 2 +- 8 files changed, 96 insertions(+), 70 deletions(-) diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index e0f23c15d224..93fb18baf86e 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -259,6 +259,10 @@ void SbiCodeGen::Save() if( !pProc->IsPublic() ) pMeth->SetFlag( SBX_PRIVATE ); + // Declare? -> Hidden + if( pProc->GetLib().Len() > 0 ) + pMeth->SetFlag( SBX_HIDDEN ); + pMeth->nStart = pProc->GetAddr(); pMeth->nLine1 = pProc->GetLine1(); pMeth->nLine2 = pProc->GetLine2(); diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index b8fa3c089fd8..27b6e0e51871 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -877,7 +877,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) } if( bCompatible && Peek() == PARAMARRAY ) { - if( bByVal || bByVal || bOptional ) + if( bByVal || bOptional ) Error( SbERR_UNEXPECTED, PARAMARRAY ); Next(); bParamArray = TRUE; @@ -949,6 +949,8 @@ void SbiParser::DefDeclare( BOOL bPrivate ) Error( SbERR_UNEXPECTED, eCurTok ); else { + bool bFunction = (eCurTok == FUNCTION); + SbiProcDef* pDef = ProcDecl( TRUE ); if( pDef ) { @@ -973,7 +975,64 @@ void SbiParser::DefDeclare( BOOL bPrivate ) aPublics.Add( pDef ); if ( pDef ) + { pDef->SetPublic( !bPrivate ); + + // New declare handling + if( pDef->GetLib().Len() > 0 ) + { + USHORT nSavLine = nLine; + aGen.Statement(); + pDef->Define(); + pDef->SetLine1( nSavLine ); + pDef->SetLine2( nSavLine ); + + SbiSymPool& rPool = pDef->GetParams(); + USHORT nParCount = rPool.GetSize(); + + SbxDataType eType = pDef->GetType(); + if( bFunction ) + aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) ); + + if( nParCount > 1 ) + { + aGen.Gen( _ARGC ); + + for( USHORT i = 1 ; i < nParCount ; ++i ) + { + SbiSymDef* pParDef = rPool.Get( i ); + SbxDataType eParType = pParDef->GetType(); + + aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) ); + aGen.Gen( _ARGV ); + + USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() ); + if( pParDef->IsByVal() ) + { + // Reset to avoid additional byval in call to wrapper function + pParDef->SetByVal( FALSE ); + nTyp |= 0x8000; + } + aGen.Gen( _ARGTYP, nTyp ); + } + } + + aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) ); + + SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL; + USHORT nId = pDef->GetId(); + if( pDef->GetAlias().Len() ) + nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() ); + if( nParCount > 1 ) + nId |= 0x8000; + aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) ); + + if( bFunction ) + aGen.Gen( _PUT ); + + aGen.Gen( _LEAVE ); + } + } } } } diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 60869307aecf..dc4fda0a4682 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -115,13 +115,8 @@ void SbiExprNode::Gen( RecursiveMode eRecMode ) } else { - SbiProcDef* pProc = aVar.pDef->GetProcDef(); - // per DECLARE definiert? - if( pProc && pProc->GetLib().Len() ) - eOp = pProc->IsCdecl() ? _CALLC : _CALL; - else - eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL : - (aVar.pDef->IsGlobal() ? _FIND_G : _FIND); + eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL : + (aVar.pDef->IsGlobal() ? _FIND_G : _FIND); } if( eOp == _FIND ) @@ -187,17 +182,6 @@ void SbiExprNode::GenElement( SbiOpcode eOp ) aVar.pPar->Gen(); } - SbiProcDef* pProc = aVar.pDef->GetProcDef(); - // per DECLARE definiert? - if( pProc ) - { - // Dann evtl. einen LIB-Befehl erzeugen - if( pProc->GetLib().Len() ) - pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) ); - // und den Aliasnamen nehmen - if( pProc->GetAlias().Len() ) - nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() ); - } pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) ); if( aVar.pvMorePar ) @@ -225,11 +209,6 @@ void SbiExprList::Gen() // AB 10.1.96: Typ-Anpassung bei DECLARE USHORT nCount = 1, nParAnz = 0; SbiSymPool* pPool = NULL; - if( pProc ) - { - pPool = &pProc->GetParams(); - nParAnz = pPool->GetSize(); - } for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) { pExpr->Gen(); @@ -239,6 +218,7 @@ void SbiExprList::Gen() USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() ); pParser->aGen.Gen( _ARGN, nSid ); + /* TODO: Check after Declare concept change // AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen if( pProc ) { @@ -246,39 +226,26 @@ void SbiExprList::Gen() pParser->Error( SbERR_NO_NAMED_ARGS ); // Spaeter, wenn Named Args bei DECLARE moeglich - /* - for( USHORT i = 1 ; i < nParAnz ; i++ ) - { - SbiSymDef* pDef = pPool->Get( i ); - const String& rName = pDef->GetName(); - if( rName.Len() ) - { - if( pExpr->GetName().ICompare( rName ) - == COMPARE_EQUAL ) - { - pParser->aGen.Gen( _ARGTYP, pDef->GetType() ); - break; - } - } - } - */ + //for( USHORT i = 1 ; i < nParAnz ; i++ ) + //{ + // SbiSymDef* pDef = pPool->Get( i ); + // const String& rName = pDef->GetName(); + // if( rName.Len() ) + // { + // if( pExpr->GetName().ICompare( rName ) + // == COMPARE_EQUAL ) + // { + // pParser->aGen.Gen( _ARGTYP, pDef->GetType() ); + // break; + // } + // } + //} } + */ } else { pParser->aGen.Gen( _ARGV ); - - // Funktion mit DECLARE -> Typ-Anpassung - if( pProc && nCount < nParAnz ) - { - SbiSymDef* pDef = pPool->Get( nCount ); - USHORT nTyp = sal::static_int_cast< USHORT >( - pDef->GetType() ); - // Zusätzliches Flag für BYVAL einbauen - if( pDef->IsByVal() ) - nTyp |= 0x8000; - pParser->aGen.Gen( _ARGTYP, nTyp ); - } } } } diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 42969b98d0d8..7a4ea5965558 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -338,15 +338,6 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) // damit erwischen wir n% = 5 : print n eType = eDefType; } - // Funktion? - if( pDef->GetProcDef() ) - { - SbiProcDef* pProc = pDef->GetProcDef(); - if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt? - pPar->SetProc( pProc ); - // Wenn keine Pars, vorerst nichts machen - // Pruefung auf Typ-Anzahl waere denkbar - } // Typcheck bei Variablen: // ist explizit im Scanner etwas anderes angegeben? // Bei Methoden ist dies OK! @@ -868,7 +859,6 @@ SbiExprList::SbiExprList( SbiParser* p ) { pParser = p; pFirst = NULL; - pProc = NULL; nExpr = nDim = 0; bError = diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 9b8f51d09dea..851d0d6f1fe5 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -234,7 +234,6 @@ class SbiExprList { // Basisklasse fuer Parameter und Dims protected: SbiParser* pParser; // Parser SbiExpression* pFirst; // Expressions - SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung) short nExpr; // Anzahl Expressions short nDim; // Anzahl Dimensionen BOOL bError; // TRUE: Fehler @@ -249,8 +248,6 @@ public: SbiExpression* Get( short ); BOOL Test( const SbiProcDef& ); // Parameter-Checks void Gen(); // Code-Erzeugung - // Setzen einer Funktionsdefinition zum Abgleich der Parameter - void SetProc( SbiProcDef* p ) { pProc = p; } void addExpression( SbiExpression* pExpr ); }; diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index 9bd8cfd49754..f2fbaa0ac1f1 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -159,7 +159,8 @@ public: void SetOptional() { bOpt = TRUE; } void SetParamArray() { bParamArray = TRUE; } void SetWithEvents() { bWithEvents = TRUE; } - void SetByVal() { bByVal = TRUE; } + void SetByVal( BOOL bByVal_ = TRUE ) + { bByVal = bByVal_; } void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; } void SetNew() { bNew = TRUE; } void SetDefinedAs() { bAs = TRUE; } diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx index 22f9e40571a4..fe6ed69fccab 100644 --- a/scripting/source/basprov/basmodnode.cxx +++ b/scripting/source/basprov/basmodnode.cxx @@ -97,14 +97,22 @@ namespace basprov if ( pMethods ) { sal_Int32 nCount = pMethods->Count(); - aChildNodes.realloc( nCount ); + sal_Int32 nRealCount = 0; + for ( sal_Int32 i = 0; i < nCount; ++i ) + { + SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) ); + if ( pMethod && !pMethod->IsHidden() ) + ++nRealCount; + } + aChildNodes.realloc( nRealCount ); Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray(); + sal_Int32 iTarget = 0; for ( sal_Int32 i = 0; i < nCount; ++i ) { SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< USHORT >( i ) ) ); - if ( pMethod ) - pChildNodes[i] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) ); + if ( pMethod && !pMethod->IsHidden() ) + pChildNodes[iTarget++] = static_cast< browse::XBrowseNode* >( new BasicMethodNodeImpl( m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript ) ); } } } diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index abd61f6c1285..69cc6f40cd3d 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -412,7 +412,7 @@ namespace basprov if ( pMethods ) { SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Find( aMethod, SbxCLASS_METHOD ) ); - if ( pMethod ) + if ( pMethod && !pMethod->IsHidden() ) { if ( m_pDocBasicManager == pBasicMgr ) xScript = new BasicScriptImpl( aDescription, pMethod, *m_pDocBasicManager, m_xInvocationContext ); -- cgit From df1e6343ba123c0a45b25eb7ed3ae6d53749b33f Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 6 Aug 2010 11:14:17 +0200 Subject: mib18: #163175# Implement DoEvents empty --- basic/source/runtime/methods1.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 9d806cac933a..62e9c388f5c5 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -528,11 +528,13 @@ RTLFUNC(DoEvents) (void)pBasic; (void)bWrite; (void)rPar; - Timer aTimer; - aTimer.SetTimeout( 1 ); - aTimer.Start(); - while ( aTimer.IsActive() ) - Application::Yield(); + // Dummy implementation as the following code leads + // to performance problems for unknown reasons + //Timer aTimer; + //aTimer.SetTimeout( 1 ); + //aTimer.Start(); + //while ( aTimer.IsActive() ) + // Application::Reschedule(); } RTLFUNC(GetGUIVersion) -- cgit From 08e2fc04ba183a19609518c7f4fb1c210bfe826e Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 9 Aug 2010 10:47:38 +0200 Subject: fwk152: #i108004# check the URLs correctly --- framework/source/loadenv/loadenv.cxx | 3 ++- sfx2/inc/sfx2/docfile.hxx | 1 - sfx2/source/doc/docfile.cxx | 47 ------------------------------------ sfx2/source/doc/doctemplates.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 2 +- sfx2/source/doc/objstor.cxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 3 ++- 7 files changed, 7 insertions(+), 53 deletions(-) diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 99dd3107f162..75bcc4c4587f 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -103,6 +103,7 @@ #include #include #include +#include #include #include #include @@ -1407,7 +1408,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() // don't check the complete URL here. // use its main part - ignore optional jumpmarks! const ::rtl::OUString sURL = xModel->getURL(); - if (!m_aURL.Main.equals(sURL)) + if (!::utl::UCBContentHelper::EqualURLs( m_aURL.Main, sURL )) { xTask.clear (); continue; diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx index e4d3ff023b3b..24885fc27363 100644 --- a/sfx2/inc/sfx2/docfile.hxx +++ b/sfx2/inc/sfx2/docfile.hxx @@ -323,7 +323,6 @@ public: static com::sun::star::uno::Sequence < com::sun::star::util::RevisionTag > GetVersionList( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage ); - static sal_Bool EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ); static ::rtl::OUString CreateTempCopyWithExt( const ::rtl::OUString& aURL ); static sal_Bool CallApproveHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler, ::com::sun::star::uno::Any aRequest, sal_Bool bAllowAbort ); diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 1dea202e0d0e..29081e8e8418 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3717,53 +3717,6 @@ void SfxMedium::SetCachedSignatureState_Impl( sal_uInt16 nState ) pImp->m_nSignatureState = nState; } -//---------------------------------------------------------------- -sal_Bool SfxMedium::EqualURLs( const ::rtl::OUString& aFirstURL, const ::rtl::OUString& aSecondURL ) -{ - sal_Bool bResult = sal_False; - - if ( aFirstURL.getLength() && aSecondURL.getLength() ) - { - INetURLObject aFirst( aFirstURL ); - INetURLObject aSecond( aSecondURL ); - - if ( aFirst.GetProtocol() != INET_PROT_NOT_VALID && aSecond.GetProtocol() != INET_PROT_NOT_VALID ) - { - try - { - ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); - if ( !pBroker ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifierFactory > xIdFac - = pBroker->getContentIdentifierFactoryInterface(); - if ( !xIdFac.is() ) - throw uno::RuntimeException(); - - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdFirst - = xIdFac->createContentIdentifier( aFirst.GetMainURL( INetURLObject::NO_DECODE ) ); - uno::Reference< ::com::sun::star::ucb::XContentIdentifier > xIdSecond - = xIdFac->createContentIdentifier( aSecond.GetMainURL( INetURLObject::NO_DECODE ) ); - - if ( xIdFirst.is() && xIdSecond.is() ) - { - uno::Reference< ::com::sun::star::ucb::XContentProvider > xProvider = - pBroker->getContentProviderInterface(); - if ( !xProvider.is() ) - throw uno::RuntimeException(); - bResult = !xProvider->compareContentIds( xIdFirst, xIdSecond ); - } - } - catch( uno::Exception& ) - { - OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" ); - } - } - } - - return bResult; -} - BOOL SfxMedium::HasStorage_Impl() const { return pImp->xStorage.is(); diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index b921f2d97f1f..71f3683c0006 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1919,7 +1919,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aStoreArgs[1].Value <<= rTemplateName; ::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); - if( !SfxMedium::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) + if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs ); else rStorable->store(); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index addb648ef2e9..e386b2382acf 100755 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -732,7 +732,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL ) SetSharedXMLFlag( sal_False ); if ( IsDocShared() && aTempFileURL.getLength() - && !SfxMedium::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) + && !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) ) { if ( pImp->m_bAllowShareControlFileClean ) { diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 49188defc4f1..bfe27ee71d97 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1182,7 +1182,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl if ( pMedium && pMedium->GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL && rMedium.GetName().CompareIgnoreCaseToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) + && ::utl::UCBContentHelper::EqualURLs( pMedium->GetName(), rMedium.GetName() ) ) { bStoreToSameLocation = sal_True; AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index b5a9536b12c5..9e9e09ebcdf5 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -95,6 +95,7 @@ #include #include #include +#include //________________________________________________________________________________________________________ // includes of my own project @@ -2642,7 +2643,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL sal_Bool bSaved = sal_False; if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength() && sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL - && SfxMedium::EqualURLs( getLocation(), sURL ) ) + && ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) ) { // this is the same file URL as the current document location, try to use storeOwn if possible -- cgit From fefe083877e478d7a09299524ffdde85948a2bff Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 9 Aug 2010 15:50:34 +0200 Subject: mib18: #163059# Ignore introspection based COM object members --- basic/source/classes/sbunoobj.cxx | 14 ++++++++++++-- basic/source/inc/sbunoobj.hxx | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index df13bc7ec571..7de2d0c02320 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -71,6 +71,7 @@ #include #include #include +#include using com::sun::star::uno::Reference; @@ -2265,6 +2266,7 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) : SbxObject( aName_ ) , bNeedIntrospection( TRUE ) + , bIgnoreNativeCOMObjectMembers( FALSE ) { static Reference< XIntrospection > xIntrospection; @@ -2310,6 +2312,12 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) bNeedIntrospection = FALSE; return; } + + // Ignore introspection based members for COM objects to avoid + // hiding of equally named COM symbols, e.g. XInvocation::getValue + Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY ); + if( xAutomationObject.is() ) + bIgnoreNativeCOMObjectMembers = TRUE; } maTmpUnoObj = aUnoObj_; @@ -2553,7 +2561,7 @@ SbxVariable* SbUnoObject::Find( const String& rName, SbxClassType t ) if( !pRes ) { ::rtl::OUString aUName( rName ); - if( mxUnoAccess.is() ) + if( mxUnoAccess.is() && !bIgnoreNativeCOMObjectMembers ) { if( mxExactName.is() ) { @@ -2713,10 +2721,12 @@ void SbUnoObject::implCreateAll( void ) // Instrospection besorgen Reference< XIntrospectionAccess > xAccess = mxUnoAccess; - if( !xAccess.is() ) + if( !xAccess.is() || bIgnoreNativeCOMObjectMembers ) { if( mxInvocation.is() ) xAccess = mxInvocation->getIntrospection(); + else if( bIgnoreNativeCOMObjectMembers ) + return; } if( !xAccess.is() ) return; diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index 2d9836e3530e..78afa9783ca8 100644 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -52,6 +52,7 @@ class SbUnoObject: public SbxObject ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation; BOOL bNeedIntrospection; + BOOL bIgnoreNativeCOMObjectMembers; ::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection! // Hilfs-Methode zum Anlegen der dbg_-Properties -- cgit From 476aa1795b08ffeb43e35823e78442a51a04304b Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 10 Aug 2010 10:27:30 +0200 Subject: mib18: #163246# add VBA symbol Worksheet.ProtectScenarios --- oovbaapi/ooo/vba/excel/XWorksheet.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/oovbaapi/ooo/vba/excel/XWorksheet.idl b/oovbaapi/ooo/vba/excel/XWorksheet.idl index 1907fb004cab..3eb8337798d6 100644 --- a/oovbaapi/ooo/vba/excel/XWorksheet.idl +++ b/oovbaapi/ooo/vba/excel/XWorksheet.idl @@ -66,6 +66,7 @@ interface XWorksheet [attribute, readonly] boolean ProtectionMode; [attribute, readonly] boolean ProtectContents; [attribute, readonly] boolean ProtectDrawingObjects; + [attribute, readonly] boolean ProtectScenarios; [attribute, readonly] XRange UsedRange; [attribute, readonly] XWorksheet Next; [attribute, readonly] XWorksheet Previous; -- cgit From 7c457734f3e76c7f9b5eb69d7a917dee9bab6bc3 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 10 Aug 2010 11:05:20 +0200 Subject: mav56: #163253# tread invalid path segments correctly --- ucb/source/ucp/package/makefile.mk | 1 + ucb/source/ucp/package/pkguri.cxx | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk index 8c6dcda31829..a8cdf7430703 100644 --- a/ucb/source/ucp/package/makefile.mk +++ b/ucb/source/ucp/package/makefile.mk @@ -68,6 +68,7 @@ SHL1IMPLIB=i$(TARGET) SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS=\ + $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ diff --git a/ucb/source/ucp/package/pkguri.cxx b/ucb/source/ucp/package/pkguri.cxx index feb8daec7905..8424ed906e92 100644 --- a/ucb/source/ucp/package/pkguri.cxx +++ b/ucb/source/ucp/package/pkguri.cxx @@ -36,6 +36,7 @@ #include "rtl/ustrbuf.hxx" #include "osl/diagnose.h" +#include "comphelper/storagehelper.hxx" #include "../inc/urihelper.hxx" @@ -85,7 +86,7 @@ void PackageUri::init() const if ( ( m_aUri.getLength() < PACKAGE_URL_SCHEME_LENGTH + 4 ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -100,7 +101,7 @@ void PackageUri::init() const != sal_Unicode( '/' ) ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -128,8 +129,8 @@ void PackageUri::init() const { m_aParam += ( m_aParam.getLength() - ? ::rtl::OUString::createFromAscii( "&purezip" ) - : ::rtl::OUString::createFromAscii( "?purezip" ) ); + ? ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "&purezip" ) ) + : ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "?purezip" ) ) ); } aPureUri = aPureUri.replaceAt( 0, @@ -143,7 +144,7 @@ void PackageUri::init() const // Only :/// - Empty authority // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } else if ( nEnd == ( aPureUri.getLength() - 1 ) ) @@ -154,7 +155,7 @@ void PackageUri::init() const // Only ://// or ://// // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -175,7 +176,7 @@ void PackageUri::init() const nStart, aPureUri.getLength() - nStart, aNormPackage ); m_aPackage = ::ucb_impl::urihelper::decodeSegment( aNormPackage ); - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); m_aUri = m_aUri.replaceAt( 0, ( nParam >= 0 ) ? nParam @@ -193,16 +194,19 @@ void PackageUri::init() const { m_aPath = aPureUri.copy( nEnd + 1 ); - // Empty path segments or encoded slashes? - if ( m_aPath.indexOf( - rtl::OUString::createFromAscii( "//" ) ) != -1 - || m_aPath.indexOf( - rtl::OUString::createFromAscii( "%2F" ) ) != -1 - || m_aPath.indexOf( - rtl::OUString::createFromAscii( "%2f" ) ) != -1 ) + // Unexpected sequences of characters: + // - empty path segments + // - encoded slashes + // - parent folder segments ".." + // - current folder segments "." + if ( m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "//" ) ) ) != -1 + || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2F" ) ) ) != -1 + || m_aPath.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "%2f" ) ) ) != -1 + || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".." ) ) ) + || ::comphelper::OStorageHelper::PathHasSegment( m_aPath, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ) ) ) { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); return; } @@ -239,7 +243,7 @@ void PackageUri::init() const else { // error, but remember that we did a init(). - m_aPath = rtl::OUString::createFromAscii( "/" ); + m_aPath = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); } } } -- cgit From 7c2b94d0a3352ee92e0202b1eba64254583798ae Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 16:55:52 +0200 Subject: mib18: #163120# adding the entrypoint for symbol Debug --- oovbaapi/ooo/vba/excel/XGlobals.idl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl index 6ed51b2aa4c4..d05d7a75fefa 100644 --- a/oovbaapi/ooo/vba/excel/XGlobals.idl +++ b/oovbaapi/ooo/vba/excel/XGlobals.idl @@ -55,6 +55,8 @@ interface XGlobals: com::sun::star::uno::XInterface [attribute, readonly] ooo::vba::XAssistant Assistant; [attribute, readonly] any Selection; [attribute, readonly] XWorkbook ThisWorkbook; + [attribute, readonly] any Debug; + void Calculate() raises(com::sun::star::script::BasicErrorException); XRange Cells([in] any RowIndex, [in] any ColumnIndex); -- cgit From a72754d198aeaf328100c4d9cd340ffbb759796e Mon Sep 17 00:00:00 2001 From: "Michael E. Bohn" Date: Tue, 10 Aug 2010 18:14:58 +0200 Subject: mib18: #163259# implementation of global symbol Excel --- oovbaapi/ooo/vba/excel/XGlobals.idl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oovbaapi/ooo/vba/excel/XGlobals.idl b/oovbaapi/ooo/vba/excel/XGlobals.idl index d05d7a75fefa..d79196b00927 100644 --- a/oovbaapi/ooo/vba/excel/XGlobals.idl +++ b/oovbaapi/ooo/vba/excel/XGlobals.idl @@ -42,6 +42,10 @@ #ifndef __ooo_vba_XAssistant_idl__ #include #endif +#ifndef __ooo_vba_excel_XApplication_idl__ +#include +#endif + module ooo { module vba { module excel { interface XRange; @@ -55,6 +59,7 @@ interface XGlobals: com::sun::star::uno::XInterface [attribute, readonly] ooo::vba::XAssistant Assistant; [attribute, readonly] any Selection; [attribute, readonly] XWorkbook ThisWorkbook; + [attribute, readonly] ooo::vba::excel::XApplication Excel; [attribute, readonly] any Debug; -- cgit From c28503c38aec7fdc4cc528fac116f8eac798c6de Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 11 Aug 2010 08:24:45 +0200 Subject: mib18: #163121# Fixed back chain handling for new declare implementation --- basic/source/comp/dim.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 27b6e0e51871..59d77e3f3757 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -981,6 +981,12 @@ void SbiParser::DefDeclare( BOOL bPrivate ) // New declare handling if( pDef->GetLib().Len() > 0 ) { + if( bNewGblDefs && nGblChain == 0 ) + { + nGblChain = aGen.Gen( _JUMP, 0 ); + bNewGblDefs = FALSE; + } + USHORT nSavLine = nLine; aGen.Statement(); pDef->Define(); -- cgit From 949e63c1f4ecb4ef61310cf1c1713fb20854c578 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 11 Aug 2010 09:10:07 +0200 Subject: mib18: #163215# handle the closed dialog correctly --- vbahelper/source/msforms/vbauserform.cxx | 47 ++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index 2a4cecfc2338..a1333e0a655b 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -153,28 +153,41 @@ void SAL_CALL ScVbaUserForm::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) throw (beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException) { uno::Any aObject = getValue( aPropertyName ); - // The Object *must* support XDefaultProperty here because getValue will - // only return properties that are Objects ( e.g. controls ) - // e.g. Userform1.aControl = something - // 'aControl' has to support XDefaultProperty to make sense here - uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW ); - rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName(); - uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) ); - uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW ); - xPropSet->setPropertyValue( aDfltPropName, aValue ); + + // in case the dialog is already closed the VBA implementation should not throw exceptions + if ( aObject.hasValue() ) + { + // The Object *must* support XDefaultProperty here because getValue will + // only return properties that are Objects ( e.g. controls ) + // e.g. Userform1.aControl = something + // 'aControl' has to support XDefaultProperty to make sense here + uno::Reference< script::XDefaultProperty > xDfltProp( aObject, uno::UNO_QUERY_THROW ); + rtl::OUString aDfltPropName = xDfltProp->getDefaultPropertyName(); + uno::Reference< beans::XIntrospectionAccess > xUnoAccess( getIntrospectionAccess( aObject ) ); + uno::Reference< beans::XPropertySet > xPropSet( xUnoAccess->queryAdapter( ::getCppuType( (const uno::Reference< beans::XPropertySet > *)0 ) ), uno::UNO_QUERY_THROW ); + xPropSet->setPropertyValue( aDfltPropName, aValue ); + } } uno::Any SAL_CALL ScVbaUserForm::getValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException, uno::RuntimeException) { - uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); - uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); - ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); - uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); - ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); - pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); - return uno::makeAny( xVBAControl ); + uno::Any aResult; + + // in case the dialog is already closed the VBA implementation should not throw exceptions + if ( m_xDialog.is() ) + { + uno::Reference< awt::XControl > xDialogControl( m_xDialog, uno::UNO_QUERY_THROW ); + uno::Reference< awt::XControlContainer > xContainer( m_xDialog, uno::UNO_QUERY_THROW ); + uno::Reference< awt::XControl > xControl = xContainer->getControl( aPropertyName ); + ScVbaControlFactory aFac( mxContext, xControl, m_xModel ); + uno::Reference< msforms::XControl > xVBAControl( aFac.createControl( xDialogControl->getModel() ) ); + ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() ); + pControl->setGeometryHelper( new UserFormGeometryHelper( mxContext, xControl ) ); + aResult = uno::makeAny( xVBAControl ); + } + + return aResult; } ::sal_Bool SAL_CALL -- cgit From 3fb28911c53d6e156f56a159f458a58fe1b6842f Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 11 Aug 2010 11:11:45 +0200 Subject: mib18: unx compiler warnings --- basic/source/comp/exprgen.cxx | 4 ++-- basic/source/comp/makefile.mk | 33 ++++++++++----------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index dc4fda0a4682..3e034af204f5 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -207,8 +207,8 @@ void SbiExprList::Gen() { pParser->aGen.Gen( _ARGC ); // AB 10.1.96: Typ-Anpassung bei DECLARE - USHORT nCount = 1, nParAnz = 0; - SbiSymPool* pPool = NULL; + USHORT nCount = 1 /*, nParAnz = 0*/; +// SbiSymPool* pPool = NULL; for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) { pExpr->Gen(); diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk index bd3c750df355..d65f6a431e43 100644 --- a/basic/source/comp/makefile.mk +++ b/basic/source/comp/makefile.mk @@ -34,39 +34,26 @@ TARGET=comp .INCLUDE : settings.mk -CXXFILES= \ - sbcomp.cxx \ - dim.cxx \ - exprtree.cxx \ - exprnode.cxx \ - exprgen.cxx \ - codegen.cxx \ - io.cxx \ - loops.cxx \ - parser.cxx \ - scanner.cxx \ - token.cxx \ - symtbl.cxx \ - buffer.cxx - SLOFILES= \ - $(SLO)$/sbcomp.obj \ + $(SLO)$/buffer.obj \ + $(SLO)$/codegen.obj \ $(SLO)$/dim.obj \ - $(SLO)$/exprtree.obj \ - $(SLO)$/exprnode.obj \ $(SLO)$/exprgen.obj \ - $(SLO)$/codegen.obj \ + $(SLO)$/exprnode.obj \ + $(SLO)$/exprtree.obj \ $(SLO)$/io.obj \ $(SLO)$/loops.obj \ $(SLO)$/parser.obj \ + $(SLO)$/sbcomp.obj \ $(SLO)$/scanner.obj \ - $(SLO)$/token.obj \ $(SLO)$/symtbl.obj \ - $(SLO)$/buffer.obj + $(SLO)$/token.obj EXCEPTIONSFILES= \ - $(SLO)$/parser.obj \ - $(SLO)$/exprtree.obj + $(SLO)$/codegen.obj \ + $(SLO)$/dim.obj \ + $(SLO)$/exprtree.obj \ + $(SLO)$/parser.obj # --- Targets -------------------------------------------------------------- -- cgit From b9e6133705ac49d3299aae2d5d62ea04a015cd76 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Wed, 11 Aug 2010 11:50:49 +0200 Subject: oooimprovement6: #i99729# collecting ruler interaction --- svx/source/dialog/svxruler.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) mode change 100644 => 100755 svx/source/dialog/svxruler.cxx diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx old mode 100644 new mode 100755 index 7705a2dd08df..8000de0d2103 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -59,6 +59,28 @@ #define RULER_TAB_RTL ((USHORT)0x0010) #endif +#include + +namespace +{ + void lcl_logRulerUse(const ::rtl::OUString& sURL) //#i99729# + { + using namespace ::com::sun::star; + util::URL aTargetURL; + aTargetURL.Complete = sURL; + aTargetURL.Main = sURL; + if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# + { + ::rtl::OUString sAppName; + uno::Sequence source; + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sAppName, ::rtl::OUString::createFromAscii("SfxRuler")); + ::comphelper::UiEventsLogger::logDispatch(aTargetURL, source); + } + } +} + + + // STATIC DATA ----------------------------------------------------------- #define CTRL_ITEM_COUNT 14 @@ -2806,6 +2828,7 @@ void __EXPORT SvxRuler::Click() */ { + lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/Click")); Ruler::Click(); if( bActive ) { @@ -3440,6 +3463,7 @@ long __EXPORT SvxRuler::StartDrag() */ { + lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/StartDrag")); BOOL bContentProtected = pRuler_Imp->aProtectItem.IsCntntProtected(); if(!bValid) return FALSE; @@ -3559,6 +3583,7 @@ void __EXPORT SvxRuler::EndDrag() */ { + lcl_logRulerUse(::rtl::OUString::createFromAscii(".special://SfxRuler/EndDrag")); const BOOL bUndo = IsDragCanceled(); const long lPos = GetDragPos(); DrawLine_Impl(lTabPos, 6, bHorz); -- cgit From 73e504b3e526fe7bbb01e8947d329f1687d84011 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Wed, 11 Aug 2010 14:18:10 +0200 Subject: mib18: #163237# Changed error handling in StepSET --- basic/source/runtime/step0.cxx | 223 ++++++++++++++++++++--------------------- 1 file changed, 111 insertions(+), 112 deletions(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 29965c7e9da5..596b30b9d691 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -431,144 +431,143 @@ void SbiRuntime::StepPUT() void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp ) { // #67733 Typen mit Array-Flag sind auch ok - SbxDataType eValType = refVal->GetType(); + + // Check var, !object is no error for sure if, only if type is fixed SbxDataType eVarType = refVar->GetType(); - if( (eValType != SbxOBJECT - && eValType != SbxEMPTY -// seems like when using the default method its possible for objects -// to be empty ( no broadcast has taken place yet ) or the actual value is - - && !bHandleDefaultProp - && !(eValType & SbxARRAY)) || - (eVarType != SbxOBJECT - && eVarType != SbxEMPTY - && !bHandleDefaultProp - && !(eVarType & SbxARRAY) ) ) + if( !bHandleDefaultProp && eVarType != SbxOBJECT && !(eVarType & SbxARRAY) && refVar->IsFixed() ) { Error( SbERR_INVALID_USAGE_OBJECT ); + return; } - else + + // Check value, !object is no error for sure if, only if type is fixed + SbxDataType eValType = refVal->GetType(); + bool bGetValObject = false; + if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() ) { - // Getting in here causes problems with objects with default properties - // if they are SbxEMPTY I guess - if ( !bHandleDefaultProp || ( bHandleDefaultProp && refVal->GetType() == SbxOBJECT ) ) + Error( SbERR_INVALID_USAGE_OBJECT ); + return; + } + + // Getting in here causes problems with objects with default properties + // if they are SbxEMPTY I guess + if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) ) + { + // Auf refVal GetObject fuer Collections ausloesen + SbxBase* pObjVarObj = refVal->GetObject(); + if( pObjVarObj ) { - // Auf refVal GetObject fuer Collections ausloesen - SbxBase* pObjVarObj = refVal->GetObject(); - if( pObjVarObj ) - { - SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj); + SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj); - // #67733 Typen mit Array-Flag sind auch ok - if( refObjVal ) - refVal = refObjVal; - else if( !(eValType & SbxARRAY) ) - refVal = NULL; - } + // #67733 Typen mit Array-Flag sind auch ok + if( refObjVal ) + refVal = refObjVal; + else if( !(eValType & SbxARRAY) ) + refVal = NULL; } + } - // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als - // Object deklarierten Variable zugewiesen werden, kann hier - // refVal ungueltig sein! - if( !refVal ) + // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als + // Object deklarierten Variable zugewiesen werden, kann hier + // refVal ungueltig sein! + if( !refVal ) + { + Error( SbERR_INVALID_USAGE_OBJECT ); + } + else + { + // Store auf die eigene Methode (innerhalb einer Function)? + BOOL bFlagsChanged = FALSE; + USHORT n = 0; + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { - Error( SbERR_INVALID_USAGE_OBJECT ); + bFlagsChanged = TRUE; + n = refVar->GetFlags(); + refVar->SetFlag( SBX_WRITE ); } - else - { - // Store auf die eigene Methode (innerhalb einer Function)? - BOOL bFlagsChanged = FALSE; - USHORT n = 0; - if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) - { - bFlagsChanged = TRUE; - n = refVar->GetFlags(); - refVar->SetFlag( SBX_WRITE ); - } - SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar); - if( pProcProperty ) - pProcProperty->setSet( true ); + SbProcedureProperty* pProcProperty = PTR_CAST(SbProcedureProperty,(SbxVariable*)refVar); + if( pProcProperty ) + pProcProperty->setSet( true ); - if ( bHandleDefaultProp ) + if ( bHandleDefaultProp ) + { + // get default properties for lhs & rhs where necessary + // SbxVariable* defaultProp = NULL; unused variable + bool bLHSHasDefaultProp = false; + // LHS try determine if a default prop exists + if ( refVar->GetType() == SbxOBJECT ) { - // get default properties for lhs & rhs where necessary - // SbxVariable* defaultProp = NULL; unused variable - bool bLHSHasDefaultProp = false; - // LHS try determine if a default prop exists - if ( refVar->GetType() == SbxOBJECT ) + SbxVariable* pDflt = getDefaultProp( refVar ); + if ( pDflt ) { - SbxVariable* pDflt = getDefaultProp( refVar ); - if ( pDflt ) - { - refVar = pDflt; - bLHSHasDefaultProp = true; - } + refVar = pDflt; + bLHSHasDefaultProp = true; } - // RHS only get a default prop is the rhs has one - if ( refVal->GetType() == SbxOBJECT ) - { - // check if lhs is a null object - // if it is then use the object not the default property - SbxObject* pObj = NULL; + } + // RHS only get a default prop is the rhs has one + if ( refVal->GetType() == SbxOBJECT ) + { + // check if lhs is a null object + // if it is then use the object not the default property + SbxObject* pObj = NULL; - pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar); + pObj = PTR_CAST(SbxObject,(SbxVariable*)refVar); - // calling GetObject on a SbxEMPTY variable raises - // object not set errors, make sure its an Object - if ( !pObj && refVar->GetType() == SbxOBJECT ) - { - SbxBase* pObjVarObj = refVar->GetObject(); - pObj = PTR_CAST(SbxObject,pObjVarObj); - } - SbxVariable* pDflt = NULL; - if ( pObj || bLHSHasDefaultProp ) - // lhs is either a valid object || or has a defaultProp - pDflt = getDefaultProp( refVal ); - if ( pDflt ) - refVal = pDflt; + // calling GetObject on a SbxEMPTY variable raises + // object not set errors, make sure its an Object + if ( !pObj && refVar->GetType() == SbxOBJECT ) + { + SbxBase* pObjVarObj = refVar->GetObject(); + pObj = PTR_CAST(SbxObject,pObjVarObj); } + SbxVariable* pDflt = NULL; + if ( pObj || bLHSHasDefaultProp ) + // lhs is either a valid object || or has a defaultProp + pDflt = getDefaultProp( refVal ); + if ( pDflt ) + refVal = pDflt; } + } - // Handle withevents - BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); - if ( bWithEvents ) - { - Reference< XInterface > xComListener; - - SbxBase* pObj = refVal->GetObject(); - SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL; - if( pUnoObj != NULL ) - { - Any aControlAny = pUnoObj->getUnoAny(); - String aDeclareClassName = refVar->GetDeclareClassName(); - ::rtl::OUString aVBAType = aDeclareClassName; - ::rtl::OUString aPrefix = refVar->GetName(); - SbxObjectRef xScopeObj = refVar->GetParent(); - xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); - - refVal->SetDeclareClassName( aDeclareClassName ); - refVal->SetComListener( xComListener ); // Hold reference - } + // Handle withevents + BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); + if ( bWithEvents ) + { + Reference< XInterface > xComListener; - *refVar = *refVal; - } - else + SbxBase* pObj = refVal->GetObject(); + SbUnoObject* pUnoObj = (pObj != NULL) ? PTR_CAST(SbUnoObject,pObj) : NULL; + if( pUnoObj != NULL ) { - *refVar = *refVal; + Any aControlAny = pUnoObj->getUnoAny(); + String aDeclareClassName = refVar->GetDeclareClassName(); + ::rtl::OUString aVBAType = aDeclareClassName; + ::rtl::OUString aPrefix = refVar->GetName(); + SbxObjectRef xScopeObj = refVar->GetParent(); + xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); + + refVal->SetDeclareClassName( aDeclareClassName ); + refVal->SetComListener( xComListener ); // Hold reference } - // lhs is a property who's value is currently (Empty e.g. no broadcast yet) - // in this case if there is a default prop involved the value of the - // default property may infact be void so the type will also be SbxEMPTY - // in this case we do not want to call checkUnoStructCopy 'cause that will - // cause an error also - if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) ) - // #67607 Uno-Structs kopieren - checkUnoStructCopy( refVal, refVar ); - if( bFlagsChanged ) - refVar->SetFlags( n ); + *refVar = *refVal; } + else + { + *refVar = *refVal; + } + + // lhs is a property who's value is currently (Empty e.g. no broadcast yet) + // in this case if there is a default prop involved the value of the + // default property may infact be void so the type will also be SbxEMPTY + // in this case we do not want to call checkUnoStructCopy 'cause that will + // cause an error also + if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) ) + // #67607 Uno-Structs kopieren + checkUnoStructCopy( refVal, refVar ); + if( bFlagsChanged ) + refVar->SetFlags( n ); } } -- cgit From 20e2562e7be5ea6009e42d4cb9818642e9daa5f9 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 12 Aug 2010 08:40:35 +0200 Subject: mib18: #163254# Fixed instantiation of class modules for object members --- basic/source/classes/sb.cxx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index d4520025953e..1427e7a74fdf 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -553,6 +553,35 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) USHORT nFlags_ = pProp->GetFlags(); pProp->SetFlag( SBX_NO_BROADCAST ); SbxProperty* pNewProp = new SbxProperty( *pProp ); + + // Special handling for modules instances and collections, they need + // to be instantiated, otherwise all refer to the same base object + SbxDataType eVarType = pProp->GetType(); + if( eVarType == SbxOBJECT ) + { + SbxBase* pObjBase = pProp->GetObject(); + SbxObject* pObj = PTR_CAST(SbxObject,pObjBase); + if( pObj != NULL ) + { + String aObjClass = pObj->GetClassName(); + (void)aObjClass; + + SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase); + if( pClassModuleObj != NULL ) + { + SbModule* pClassModule = pClassModuleObj->getClassModule(); + SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + pNewProp->PutObject( pNewObj ); + } + else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) + { + String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") ); + BasicCollection* pNewCollection = new BasicCollection( aCollectionName ); + pNewProp->PutObject( pNewCollection ); + } + } + } + pNewProp->ResetFlag( SBX_NO_BROADCAST ); pNewProp->SetParent( this ); pProps->PutDirect( pNewProp, i ); -- cgit From 2f61a21f70c9dc5efa8d0e0a54e06da282a68efb Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 12 Aug 2010 10:00:50 +0200 Subject: fwk152: #i10000# fix warning --- desktop/source/app/appfirststart.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/desktop/source/app/appfirststart.cxx b/desktop/source/app/appfirststart.cxx index 43c88e6eaa8a..c06d94fd0812 100644 --- a/desktop/source/app/appfirststart.cxx +++ b/desktop/source/app/appfirststart.cxx @@ -284,8 +284,6 @@ void Desktop::DoRestartActionsIfNecessary( sal_Bool bQuickStart ) xPSet->setPropertyValue( sPropName, makeAny( sal_False ) ); Reference< util::XChangesBatch >( xPSet, UNO_QUERY_THROW )->commitChanges(); - sal_Bool bQuickstart = sal_True; - sal_Bool bAutostart = sal_True; Sequence< Any > aSeq( 2 ); aSeq[0] <<= sal_True; aSeq[1] <<= sal_True; -- cgit From 1423da554b361a3aa020c17469972861a02dcac1 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 12 Aug 2010 10:22:02 +0200 Subject: sb130: #i113096# introduced com.sun.star.configuration.XUpdate.removeExtensionXcuFile --- configmgr/source/README | 1 + configmgr/source/access.cxx | 23 ++-- configmgr/source/additions.hxx | 43 +++++++ configmgr/source/components.cxx | 134 +++++++++++++++++---- configmgr/source/components.hxx | 15 ++- configmgr/source/data.cxx | 44 +++++++ configmgr/source/data.hxx | 23 +++- configmgr/source/update.cxx | 17 +++ configmgr/source/xcdparser.cxx | 2 +- configmgr/source/xcuparser.cxx | 30 +++-- configmgr/source/xcuparser.hxx | 6 +- .../registry/configuration/dp_configuration.cxx | 26 ++-- 12 files changed, 307 insertions(+), 57 deletions(-) create mode 100644 configmgr/source/additions.hxx diff --git a/configmgr/source/README b/configmgr/source/README index b731043d34ed..b00990d1eeb2 100644 --- a/configmgr/source/README +++ b/configmgr/source/README @@ -70,6 +70,7 @@ writemodfile.cxx broadcaster.cxx Notification management. +additions.hxx update.cxx Extension manager interface. diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 190db364cdfe..eda60e6d612a 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -798,13 +798,22 @@ void Access::initBroadcasterAndChanges( css::uno::Any(), css::uno::Any())); //TODO: non-void ReplacedElement } - //TODO: if (allChanges != 0) { - // allChanges->push_back( - // css::util::ElementChange( - // css::uno::makeAny(...), - // css::uno::Any(), css::uno::Any())); - // //TODO: non-void ReplacedElement - //} + if (allChanges != 0) { + rtl::OUStringBuffer path( + getRelativePathRepresentation()); + if (path.getLength() != 0) { + path.append(sal_Unicode('/')); + } + path.append( + Data::createSegment( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), + i->first)); + allChanges->push_back( + css::util::ElementChange( + css::uno::makeAny(path.makeStringAndClear()), + css::uno::Any(), css::uno::Any())); + //TODO: non-void ReplacedElement + } } // else: spurious Modifications::Node not representing a change break; diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx new file mode 100644 index 000000000000..f34373c7f742 --- /dev/null +++ b/configmgr/source/additions.hxx @@ -0,0 +1,43 @@ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* +* for a copy of the LGPLv3 License. +* +************************************************************************/ + +#ifndef INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX +#define INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX + +#include "sal/config.h" + +#include + +#include "path.hxx" + +namespace configmgr { + +typedef std::list< Path > Additions; + +} + +#endif diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 04e6317c959d..733ca05bc147 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -54,10 +54,12 @@ #include "rtl/ustring.hxx" #include "sal/types.h" +#include "additions.hxx" #include "components.hxx" #include "data.hxx" #include "modifications.hxx" #include "node.hxx" +#include "nodemap.hxx" #include "parsemanager.hxx" #include "partial.hxx" #include "rootaccess.hxx" @@ -86,12 +88,12 @@ typedef std::list< UnresolvedListItem > UnresolvedList; void parseXcsFile( rtl::OUString const & url, int layer, Data & data, Partial const * partial, - Modifications * modifications) + Modifications * modifications, Additions * additions) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { - OSL_ASSERT(partial == 0 && modifications == 0); - (void) partial; (void) modifications; + OSL_ASSERT(partial == 0 && modifications == 0 && additions == 0); + (void) partial; (void) modifications; (void) additions; OSL_VERIFY( rtl::Reference< ParseManager >( new ParseManager(url, new XcsParser(layer, data)))->parse()); @@ -99,14 +101,16 @@ void parseXcsFile( void parseXcuFile( rtl::OUString const & url, int layer, Data & data, Partial const * partial, - Modifications * modifications) + Modifications * modifications, Additions * additions) SAL_THROW(( css::container::NoSuchElementException, css::uno::RuntimeException)) { OSL_VERIFY( rtl::Reference< ParseManager >( new ParseManager( - url, new XcuParser(layer, data, partial, modifications)))-> + url, + new XcuParser( + layer, data, partial, modifications, additions)))-> parse()); } @@ -116,6 +120,29 @@ rtl::OUString expand(rtl::OUString const & str) { return s; } +bool hasOnlyEmptySets(rtl::Reference< Node > const & node) { + OSL_ASSERT(node.is()); + switch (node->kind()) { + default: // Node::KIND_LOCALIZED_VALUE + OSL_ASSERT(false); + // fall through + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_PROPERTY: + return true; + case Node::KIND_GROUP: + for (NodeMap::iterator i(node->getMembers().begin()); + i != node->getMembers().end(); ++i) + { + if (!hasOnlyEmptySets(i->second)) { + return false; + } + } + return true; + case Node::KIND_SET: + return node->getMembers().empty(); + } +} + static bool singletonCreated = false; static Components * singleton = 0; @@ -218,7 +245,7 @@ void Components::insertExtensionXcsFile( bool shared, rtl::OUString const & fileUri) { try { - parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0); + parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -233,9 +260,12 @@ void Components::insertExtensionXcuFile( bool shared, rtl::OUString const & fileUri, Modifications * modifications) { OSL_ASSERT(modifications != 0); + int layer = shared ? 10 : 14; + Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer); try { - parseXcuFile(fileUri, shared ? 10 : 14, data_, 0, modifications); + parseXcuFile(fileUri, layer, data_, 0, modifications, adds); } catch (css::container::NoSuchElementException & e) { + data_.removeExtensionXcuAdditions(fileUri); throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -245,6 +275,54 @@ void Components::insertExtensionXcuFile( } } +void Components::removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications) +{ + //TODO: Ideally, exactly the data coming from the specified xcu file would + // be removed. However, not enough information is recorded in the in-memory + // data structures to do so. So, as a workaround, all those set elements + // that were freshly added by the xcu and have afterwards been left + // unchanged are removed (and nothing else). The heuristic to determine + // whether a node has been left unchanged is to check the layer ID (as + // usual) and additionally to check that the node does not recursively + // contain any non-empty sets (multiple extension xcu files are merged into + // one layer, so checking layer ID alone is not enough). Since + // item->additions records all additions of set members in textual order, + // the latter check works well when iterating through item->additions in + // reverse order. + rtl::Reference< Data::ExtensionXcu > item( + data_.removeExtensionXcuAdditions(fileUri)); + if (item.is()) { + for (Additions::reverse_iterator i(item->additions.rbegin()); + i != item->additions.rend(); ++i) + { + rtl::Reference< Node > parent; + NodeMap const * map = &data_.components; + rtl::Reference< Node > node; + for (Path::const_iterator j(i->begin()); j != i->end(); ++j) { + parent = node; + node = Data::findNode(item->layer, *map, *j); + if (!node.is()) { + break; + } + map = &node->getMembers(); + } + if (node.is()) { + OSL_ASSERT(parent.is()); + if (parent->kind() == Node::KIND_SET) { + OSL_ASSERT( + node->kind() == Node::KIND_GROUP || + node->kind() == Node::KIND_SET); + if (hasOnlyEmptySets(node)) { + parent->getMembers().erase(i->back()); + modifications->add(*i); + } + } + } + } + } +} + void Components::insertModificationXcuFile( rtl::OUString const & fileUri, std::set< rtl::OUString > const & includedPaths, @@ -254,7 +332,7 @@ void Components::insertModificationXcuFile( OSL_ASSERT(modifications != 0); try { Partial part(includedPaths, excludedPaths); - parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications); + parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications, 0); } catch (css::uno::Exception & e) { //TODO: more specific exception catching OSL_TRACE( "configmgr error inserting %s: %s", @@ -377,7 +455,8 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":BUNDLED_EXTENSIONS_USER}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); + "PackageRegistryBackend/configmgr.ini"))), + false); parseXcsXcuIniLayer( 9, expand( @@ -386,8 +465,9 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":SHARED_EXTENSIONS_USER}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); - parseXcsXcuLayer( //TODO: migrate + "PackageRegistryBackend/configmgr.ini"))), + true); + parseXcsXcuLayer( 11, expand( rtl::OUString( @@ -396,6 +476,8 @@ Components::Components( ":UNO_USER_PACKAGES_CACHE}/registry/" "com.sun.star.comp.deployment.configuration." "PackageRegistryBackend/registry")))); + // can be dropped once old UserInstallation format can no longer exist + // (probably OOo 4) parseXcsXcuIniLayer( 13, expand( @@ -404,7 +486,8 @@ Components::Components( "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") ":UNO_USER_PACKAGES_CACHE}/registry/" "com.sun.star.comp.deployment.configuration." - "PackageRegistryBackend/configmgr.ini")))); + "PackageRegistryBackend/configmgr.ini"))), + true); try { parseModificationLayer(); } catch (css::uno::Exception & e) { //TODO: more specific exception catching @@ -470,7 +553,7 @@ void Components::parseFiles( file.match(extension, file.getLength() - extension.getLength())) { try { - (*parseFile)(stat.getFileURL(), layer, data_, 0, 0); + (*parseFile)(stat.getFileURL(), layer, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -486,19 +569,26 @@ void Components::parseFiles( void Components::parseFileList( int layer, FileParser * parseFile, rtl::OUString const & urls, - rtl::Bootstrap const & ini) + rtl::Bootstrap const & ini, bool recordAdditions) { for (sal_Int32 i = 0;;) { rtl::OUString url(urls.getToken(0, ' ', i)); if (url.getLength() != 0) { ini.expandMacrosFrom(url); //TODO: detect failure + Additions * adds = 0; + if (recordAdditions) { + adds = data_.addExtensionXcuAdditions(url, layer); + } try { - (*parseFile)(url, layer, data_, 0, 0); + (*parseFile)(url, layer, data_, 0, 0, adds); } catch (css::container::NoSuchElementException & e) { OSL_TRACE( "configmgr file does not exist: %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8).getStr()); + if (adds != 0) { + data_.removeExtensionXcuAdditions(url); + } } } if (i == -1) { @@ -610,18 +700,20 @@ void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) { url + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/data")), false); } -void Components::parseXcsXcuIniLayer(int layer, rtl::OUString const & url) { +void Components::parseXcsXcuIniLayer( + int layer, rtl::OUString const & url, bool recordAdditions) +{ //TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the // global function" rtl::Bootstrap ini(url); rtl::OUString urls; if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls)) { - parseFileList(layer, &parseXcsFile, urls, ini); + parseFileList(layer, &parseXcsFile, urls, ini, false); } if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls)) { - parseFileList(layer + 1, &parseXcuFile, urls, ini); + parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions); } } @@ -650,13 +742,13 @@ rtl::OUString Components::getModificationFileUrl() const { void Components::parseModificationLayer() { try { - parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0); + parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0, 0); } catch (css::container::NoSuchElementException &) { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); // Migrate old user layer data (can be removed once migration is no - // longer relevant; also see hack for xsi namespace in XmlReader - // constructor): + // longer relevant, probably OOo 4; also see hack for xsi namespace in + // XmlReader constructor): parseFiles( Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")), &parseXcuFile, diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 2e635680c1ce..880ac95d34a8 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -38,7 +38,10 @@ #include "com/sun/star/uno/Reference.hxx" #include "rtl/ref.hxx" +#include "additions.hxx" #include "data.hxx" +#include "modifications.hxx" +#include "nodemap.hxx" #include "path.hxx" namespace com { namespace sun { namespace star { @@ -56,7 +59,6 @@ namespace rtl { namespace configmgr { class Broadcaster; -class Modifications; class Node; class Partial; class RootAccess; @@ -98,6 +100,9 @@ public: bool shared, rtl::OUString const & fileUri, Modifications * modifications); + void removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications); + void insertModificationXcuFile( rtl::OUString const & fileUri, std::set< rtl::OUString > const & includedPaths, @@ -109,7 +114,8 @@ public: private: typedef void FileParser( - rtl::OUString const &, int, Data &, Partial const *, Modifications *); + rtl::OUString const &, int, Data &, Partial const *, Modifications *, + Additions *); Components( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > @@ -123,13 +129,14 @@ private: void parseFileList( int layer, FileParser * parseFile, rtl::OUString const & urls, - rtl::Bootstrap const & ini); + rtl::Bootstrap const & ini, bool recordAdditions); void parseXcdFiles(int layer, rtl::OUString const & url); void parseXcsXcuLayer(int layer, rtl::OUString const & url); - void parseXcsXcuIniLayer(int layer, rtl::OUString const & url); + void parseXcsXcuIniLayer( + int layer, rtl::OUString const & url, bool recordAdditions); void parseModuleLayer(int layer, rtl::OUString const & url); diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index e12f9596940b..50466ca0532c 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -36,11 +36,13 @@ #include "osl/diagnose.h" #include "rtl/ref.hxx" #include "rtl/string.h" +#include "rtl/textenc.h" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "additions.hxx" #include "data.hxx" #include "groupnode.hxx" #include "node.hxx" @@ -325,4 +327,46 @@ rtl::Reference< Node > Data::getTemplate( return findNode(layer, templates, fullName); } +Additions * Data::addExtensionXcuAdditions( + rtl::OUString const & url, int layer) +{ + rtl::Reference< ExtensionXcu > item(new ExtensionXcu); + ExtensionXcuAdditions::iterator i( + extensionXcuAdditions_.insert( + ExtensionXcuAdditions::value_type( + url, rtl::Reference< ExtensionXcu >())).first); + if (i->second.is()) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "already added extension xcu ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + i->second = item; + item->layer = layer; + return &item->additions; +} + +rtl::Reference< Data::ExtensionXcu > Data::removeExtensionXcuAdditions( + rtl::OUString const & url) +{ + ExtensionXcuAdditions::iterator i(extensionXcuAdditions_.find(url)); + if (i == extensionXcuAdditions_.end()) { + // This can happen, as migration of pre OOo 3.3 UserInstallation + // extensions in dp_registry::backend::configuration::BackendImpl:: + // PackageImpl::processPackage_ can cause just-in-time creation of + // extension xcu files that are never added via addExtensionXcuAdditions + // (also, there might be url spelling differences between calls to + // addExtensionXcuAdditions and removeExtensionXcuAdditions?): + OSL_TRACE( + "unknown configmgr::Data::removeExtensionXcuAdditions(%s)", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr()); + return rtl::Reference< ExtensionXcu >(); + } + rtl::Reference< ExtensionXcu > item(i->second); + extensionXcuAdditions_.erase(i); + return item; +} + } diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx index 52353d066b67..8f5f7af0d86e 100644 --- a/configmgr/source/data.hxx +++ b/configmgr/source/data.hxx @@ -31,18 +31,20 @@ #include "sal/config.h" #include +#include #include #include "boost/noncopyable.hpp" #include "rtl/ref.hxx" +#include "rtl/ustring.hxx" #include "sal/types.h" +#include "salhelper/simplereferenceobject.hxx" +#include "additions.hxx" #include "modifications.hxx" #include "nodemap.hxx" #include "path.hxx" -namespace rtl { class OUString; } - namespace configmgr { class Node; @@ -50,6 +52,11 @@ class Node; struct Data: private boost::noncopyable { enum { NO_LAYER = INT_MAX }; + struct ExtensionXcu: public salhelper::SimpleReferenceObject { + int layer; + Additions additions; + }; + NodeMap templates; NodeMap components; @@ -80,6 +87,18 @@ struct Data: private boost::noncopyable { rtl::Reference< Node > getTemplate( int layer, rtl::OUString const & fullName) const; + + Additions * addExtensionXcuAdditions( + rtl::OUString const & url, int layer); + + rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions( + rtl::OUString const & url); + +private: + typedef std::map< rtl::OUString, rtl::Reference< ExtensionXcu > > + ExtensionXcuAdditions; + + ExtensionXcuAdditions extensionXcuAdditions_; }; } diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index 4c1d59d5d054..403b761a5abd 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -89,6 +89,9 @@ private: sal_Bool shared, rtl::OUString const & fileUri) throw (css::uno::RuntimeException); + virtual void SAL_CALL removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + virtual void SAL_CALL insertModificationXcuFile( rtl::OUString const & fileUri, css::uno::Sequence< rtl::OUString > const & includedPaths, @@ -120,6 +123,20 @@ void Service::insertExtensionXcuFile( bc.send(); } +void Service::removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ + Broadcaster bc; + { + osl::MutexGuard g(lock); + Modifications mods; + Components::getSingleton().removeExtensionXcuFile(fileUri, &mods); + Components::getSingleton().initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + void Service::insertModificationXcuFile( rtl::OUString const & fileUri, css::uno::Sequence< rtl::OUString > const & includedPaths, diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx index 498254b35644..ad774d5ca3e3 100644 --- a/configmgr/source/xcdparser.cxx +++ b/configmgr/source/xcdparser.cxx @@ -137,7 +137,7 @@ bool XcdParser::startElement( if (ns == XmlReader::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) { - nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0); + nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0); nesting_ = 1; return nestedParser_->startElement(reader, ns, name); } diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index cd1e6e55d085..91f3b244c5a8 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -68,12 +68,13 @@ namespace css = com::sun::star; XcuParser::XcuParser( int layer, Data & data, Partial const * partial, - Modifications * broadcastModifications): + Modifications * broadcastModifications, Additions * additions): valueParser_(layer), data_(data), partial_(partial), broadcastModifications_(broadcastModifications), - recordModifications_(layer == Data::NO_LAYER), + additions_(additions), recordModifications_(layer == Data::NO_LAYER), trackPath_( - partial_ != 0 || broadcastModifications_ != 0 || recordModifications_) + partial_ != 0 || broadcastModifications_ != 0 || additions_ != 0 || + recordModifications_) {} XcuParser::~XcuParser() {} @@ -624,7 +625,7 @@ void XcuParser::handleLocpropValue( pop = true; } if (trackPath_) { - recordModification(); + recordModification(false); if (pop) { path_.pop_back(); } @@ -638,7 +639,7 @@ void XcuParser::handleLocpropValue( locprop->getMembers().erase(i); } state_.push(State(true)); - recordModification(); + recordModification(false); break; default: throw css::uno::RuntimeException( @@ -750,7 +751,7 @@ void XcuParser::handleUnknownGroupProp( prop->setFinalized(valueParser_.getLayer()); } state_.push(State(prop, name, state_.top().locked)); - recordModification(); + recordModification(false); break; } // fall through @@ -800,7 +801,7 @@ void XcuParser::handlePlainGroupProp( property, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - recordModification(); + recordModification(false); break; case OPERATION_REMOVE: if (!property->isExtension()) { @@ -814,7 +815,7 @@ void XcuParser::handlePlainGroupProp( } group->getMembers().erase(propertyIndex); state_.push(State(true)); // ignore children - recordModification(); + recordModification(false); break; } } @@ -863,7 +864,7 @@ void XcuParser::handleLocalizedGroupProp( replacement, name, (state_.top().locked || finalizedLayer < valueParser_.getLayer()))); - recordModification(); + recordModification(false); } break; case OPERATION_REMOVE: @@ -1070,7 +1071,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - recordModification(); + recordModification(i == set->getMembers().end()); } break; case OPERATION_FUSE: @@ -1084,7 +1085,7 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - recordModification(); + recordModification(true); } } else { state_.push( @@ -1104,15 +1105,18 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { set->getMembers().erase(i); } state_.push(State(true)); - recordModification(); + recordModification(false); break; } } -void XcuParser::recordModification() { +void XcuParser::recordModification(bool addition) { if (broadcastModifications_ != 0) { broadcastModifications_->add(path_); } + if (addition && additions_ != 0) { + additions_->push_back(path_); + } if (recordModifications_) { data_.modifications.add(path_); } diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index 64108451b4ef..02ef4e5ff117 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -35,6 +35,7 @@ #include "rtl/ref.hxx" #include "rtl/ustring.hxx" +#include "additions.hxx" #include "node.hxx" #include "nodemap.hxx" #include "parser.hxx" @@ -59,7 +60,7 @@ class XcuParser: public Parser { public: XcuParser( int layer, Data & data, Partial const * partial, - Modifications * broadcastModifications); + Modifications * broadcastModifications, Additions * additions); private: virtual ~XcuParser(); @@ -108,7 +109,7 @@ private: void handleSetNode(XmlReader & reader, SetNode * set); - void recordModification(); + void recordModification(bool addition); struct State { rtl::Reference< Node > node; // empty iff ignore or @@ -141,6 +142,7 @@ private: Data & data_; Partial const * partial_; Modifications * broadcastModifications_; + Additions * additions_; bool recordModifications_; bool trackPath_; rtl::OUString componentName_; diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 9ea6e8227340..22cbcacc9e9d 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -139,7 +139,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data); ::boost::optional readDataFromDb(OUString const & url); - void deleteDataFromDb(OUString const & url); + OUString deleteDataFromDb(OUString const & url); ::std::list getAllIniEntries(); public: @@ -240,10 +240,18 @@ void BackendImpl::addDataToDb( return data; } -void BackendImpl::deleteDataFromDb(OUString const & url) +OUString BackendImpl::deleteDataFromDb(OUString const & url) { - if (m_backendDb.get()) + OUString url2(url); + if (m_backendDb.get()) { + boost::optional< ConfigurationBackendDb::Data > data( + m_backendDb->getEntry(url)); + if (data) { + url2 = expandUnoRcTerm(data->iniEntry); + } m_backendDb->removeEntry(url); + } + return url2; } ::std::list BackendImpl::getAllIniEntries() @@ -736,11 +744,11 @@ void BackendImpl::PackageImpl::processPackage_( //rebuilding the directory structure. rtl::OUString url2( rtl::OStringToOUString(i->first, RTL_TEXTENCODING_UTF8)); - ConfigurationBackendDb::Data data; if (url2 != url) { bool schema = i->second.equalsIgnoreAsciiCase( "vnd.sun.star.configuration-schema"); OUString url_replaced(url2); + ConfigurationBackendDb::Data data; if (!schema) { const OUString sModFolder = that->createFolder(OUString(), xCmdEnv); @@ -753,6 +761,7 @@ void BackendImpl::PackageImpl::processPackage_( deleteTempFolder(sModFolder); } that->addToConfigmgrIni(schema, url_replaced, xCmdEnv); + data.iniEntry = dp_misc::makeRcTerm(url_replaced); that->addDataToDb(url2, data); } that->m_registeredPackages->erase(i->first); @@ -762,9 +771,12 @@ void BackendImpl::PackageImpl::processPackage_( xCmdEnv ).executeCommand( OUSTR("delete"), Any( true /* delete physically */ ) ); } - that->deleteDataFromDb(getURL()); - - //TODO: revoking at runtime, possible, sensible? + url = that->deleteDataFromDb(url); + if (!m_isSchema) { + com::sun::star::configuration::Update::get( + that->m_xComponentContext)->removeExtensionXcuFile( + expandUnoRcUrl(url)); + } } } -- cgit From 7b40b729c0956185ce6bcf6d00b85857fcb9e26b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 Aug 2010 15:05:09 +0200 Subject: sw33bf08: #i108078#: ::sfx2::createBaseURI(): manually expand vnd.sun.star.expand: URIs before calling makeAbsolute(). --- sfx2/source/doc/DocumentMetadataAccess.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 9625ea958830..83ed9b3ccfe8 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -136,6 +137,16 @@ uno::Reference createBaseURI( throw uno::RuntimeException(); } + // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs + // this really should be done somewhere else, not here. + ::rtl::OUString pkgURI(i_rPkgURI); + if (pkgURI.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + { + // expand it here (makeAbsolute requires hierarchical URI) + pkgURI = pkgURI.copy( sizeof("vnd.sun.star.expand:") - 1 ); + ::rtl::Bootstrap::expandMacros(pkgURI); + } + const uno::Reference xServiceFactory( i_xContext->getServiceManager(), uno::UNO_SET_THROW); const uno::Reference xUriFactory( @@ -146,11 +157,12 @@ uno::Reference createBaseURI( uno::Reference< uri::XUriReference > xBaseURI; const uno::Reference< uri::XUriReference > xPkgURI( - xUriFactory->parse(i_rPkgURI), uno::UNO_SET_THROW ); + xUriFactory->parse(pkgURI), uno::UNO_SET_THROW ); xPkgURI->clearFragment(); + // need to know whether the storage is a FileSystemStorage // XServiceInfo would be better, but it is not implemented -// if ( i_rPkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(i_rPkgURI) ) +// if ( pkgURI.getLength() && ::utl::UCBContentHelper::IsFolder(pkgURI) ) if (true) { xBaseURI.set( xPkgURI, uno::UNO_SET_THROW ); #if 0 -- cgit From f47d90f206047b44993671316cfad21eb471a846 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 12 Aug 2010 16:13:11 +0200 Subject: sw33bf08: #i108078#: ::sfx2::createBaseURI(): decode content of expand URI --- sfx2/source/doc/DocumentMetadataAccess.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 83ed9b3ccfe8..df0781be8877 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include @@ -140,11 +141,19 @@ uno::Reference createBaseURI( // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs // this really should be done somewhere else, not here. ::rtl::OUString pkgURI(i_rPkgURI); - if (pkgURI.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + if (pkgURI.matchIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) { // expand it here (makeAbsolute requires hierarchical URI) - pkgURI = pkgURI.copy( sizeof("vnd.sun.star.expand:") - 1 ); - ::rtl::Bootstrap::expandMacros(pkgURI); + pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") ); + if (pkgURI.getLength() != 0) { + pkgURI = ::rtl::Uri::decode( + pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8); + if (pkgURI.getLength() == 0) { + throw uno::RuntimeException(); + } + ::rtl::Bootstrap::expandMacros(pkgURI); + } } const uno::Reference xServiceFactory( -- cgit From d2aa21c67466637572b0fbd06cc941c1d60d9dc4 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 13 Aug 2010 08:01:31 +0200 Subject: mib18: #163254# Set right name and parent for copied object class members --- basic/source/classes/sb.cxx | 4 ++++ basic/source/comp/sbcomp.cxx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 1427e7a74fdf..dab060500e05 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -571,12 +571,16 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) { SbModule* pClassModule = pClassModuleObj->getClassModule(); SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + pNewObj->SetName( pProp->GetName() ); + pNewObj->SetParent( pClassModule->pParent ); pNewProp->PutObject( pNewObj ); } else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) { String aCollectionName( RTL_CONSTASCII_USTRINGPARAM("Collection") ); BasicCollection* pNewCollection = new BasicCollection( aCollectionName ); + pNewCollection->SetName( pProp->GetName() ); + pNewCollection->SetParent( pClassModule->pParent ); pNewProp->PutObject( pNewCollection ); } } diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index e6fe73177dd2..5b7e5c70591d 100755 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -261,7 +261,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, { aStr.AppendAscii( "Entering " ); } - String aModuleName = pModule->GetName(); + String aModuleName = pTraceMod->GetName(); aStr += aModuleName; if( pMethod != NULL ) { -- cgit From 232ee1a3b01e629ba1d2889e226fe66d8c834224 Mon Sep 17 00:00:00 2001 From: Michael Brauer Date: Fri, 13 Aug 2010 12:52:17 +0200 Subject: mib18: #163285#: Set correct error code in Collection.item and Collection.remove --- basic/source/classes/sb.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index dab060500e05..4afe5cab1e97 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -2086,7 +2086,7 @@ void BasicCollection::CollItem( SbxArray* pPar_ ) if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) pRes = xItemArray->Get32( nIndex ); if( !pRes ) - SetError( SbxERR_BAD_INDEX ); + SetError( SbERR_BAD_ARGUMENT ); else *(pPar_->Get(0)) = *pRes; } @@ -2104,6 +2104,6 @@ void BasicCollection::CollRemove( SbxArray* pPar_ ) if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) xItemArray->Remove32( nIndex ); else - SetError( SbxERR_BAD_INDEX ); + SetError( SbERR_BAD_ARGUMENT ); } -- cgit From 4d949990ef1438fcae98262519c6af2b47e5ccf5 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 13 Aug 2010 13:28:45 +0200 Subject: mib18: #163225# support long strings in basic --- basic/inc/basic/sbxvar.hxx | 12 +++-- basic/source/classes/sbunoobj.cxx | 2 +- basic/source/sbx/sbxbool.cxx | 18 +++---- basic/source/sbx/sbxbyte.cxx | 10 ++-- basic/source/sbx/sbxchar.cxx | 15 +++--- basic/source/sbx/sbxconv.hxx | 16 +++--- basic/source/sbx/sbxcurr.cxx | 26 +++++----- basic/source/sbx/sbxdate.cxx | 12 +++-- basic/source/sbx/sbxdbl.cxx | 10 ++-- basic/source/sbx/sbxdec.cxx | 20 ++++---- basic/source/sbx/sbxdec.hxx | 4 +- basic/source/sbx/sbxint.cxx | 38 ++++++-------- basic/source/sbx/sbxlng.cxx | 10 ++-- basic/source/sbx/sbxres.cxx | 2 +- basic/source/sbx/sbxres.hxx | 2 +- basic/source/sbx/sbxscan.cxx | 37 ++++++++------ basic/source/sbx/sbxsng.cxx | 10 ++-- basic/source/sbx/sbxstr.cxx | 50 +++++++++--------- basic/source/sbx/sbxuint.cxx | 10 ++-- basic/source/sbx/sbxulng.cxx | 10 ++-- basic/source/sbx/sbxvalue.cxx | 105 ++++++++++++++++++++------------------ basic/source/sbx/sbxvar.cxx | 40 ++++++++------- 22 files changed, 235 insertions(+), 224 deletions(-) diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index 4d9d19b52a59..0cddcbdf8d17 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -178,7 +178,7 @@ struct SbxValues sal_uInt64 uInt64; int nInt; unsigned int nUInt; - String* pString; + ::rtl::OUString* pOUString; SbxDecimal* pDecimal; SbxBase* pObj; @@ -212,7 +212,7 @@ struct SbxValues SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {} SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {} SbxValues( unsigned int _nUInt ): nUInt( _nUInt ), eType(SbxUINT) {} - SbxValues( const String* _pString ): pString( (String*) _pString ), eType(SbxSTRING) {} + SbxValues( const ::rtl::OUString* _pString ): pOUString( (::rtl::OUString*)_pString ), eType(SbxSTRING) {} SbxValues( SbxBase* _pObj ): pObj( _pObj ), eType(SbxOBJECT) {} SbxValues( sal_Unicode* _pChar ): pChar( _pChar ), eType(SbxLPSTR) {} SbxValues( void* _pData ): pData( _pData ), eType(SbxPOINTER) {} @@ -237,7 +237,8 @@ class SbxValue : public SbxBase SbxValue* TheRealValue() const; protected: SbxValues aData; // Data - String aPic; // Picture-String + ::rtl::OUString aPic; // Picture-String + String aToolString; // tool string copy virtual void Broadcast( ULONG ); // Broadcast-Call virtual ~SbxValue(); @@ -303,6 +304,7 @@ public: UINT16 GetErr() const; const String& GetString() const; const String& GetCoreString() const; + ::rtl::OUString GetOUString() const; SbxDecimal* GetDecimal() const; SbxBase* GetObject() const; BOOL HasObject() const; @@ -325,8 +327,8 @@ public: BOOL PutDate( double ); BOOL PutBool( BOOL ); BOOL PutErr( USHORT ); - BOOL PutStringExt( const String& ); // with extended analysis (International, "TRUE"/"FALSE") - BOOL PutString( const String& ); + BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE") + BOOL PutString( const ::rtl::OUString& ); BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR BOOL PutDecimal( SbxDecimal* pDecimal ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 7de2d0c02320..3e775613198b 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1461,7 +1461,7 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty aRetVal.setValue( &c , getCharCppuType() ); break; } - case TypeClass_STRING: aRetVal <<= ::rtl::OUString( pVar->GetString() ); break; + case TypeClass_STRING: aRetVal <<= pVar->GetOUString(); break; case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break; case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break; //case TypeClass_OCTET: break; diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index 728b8e1472b0..3216e401b707 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -87,21 +87,20 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) case SbxSTRING: case SbxLPSTR: nRes = SbxFALSE; - if( p->pString ) + if ( p->pOUString ) { - if( p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_TRUE ) ) ) + if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_TRUE ) ) ) nRes = SbxTRUE; - else if( !p->pString->EqualsIgnoreCaseAscii( SbxRes( STRING_FALSE ) ) ) + else if( p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) { // Jetzt kann es noch in eine Zahl konvertierbar sein BOOL bError = TRUE; double n; SbxDataType t; USHORT nLen = 0; - String s( *p->pString ); - if( ImpScan( s, n, t, &nLen ) == SbxERR_OK ) + if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK ) { - if( nLen == s.Len() ) + if( nLen == p->pOUString->getLength() ) { bError = FALSE; if( n != 0.0 ) @@ -202,9 +201,10 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - *p->pString = SbxRes( n ? STRING_TRUE : STRING_FALSE ); + if ( !p->pOUString ) + p->pOUString = new ::rtl::OUString( SbxRes( n ? STRING_TRUE : STRING_FALSE ) ); + else + *p->pOUString = SbxRes( n ? STRING_TRUE : STRING_FALSE ); break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index 8485b7105e21..e13c63967fc3 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -165,13 +165,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXBYTE ) { @@ -279,9 +279,9 @@ void ImpPutByte( SbxValues* p, BYTE n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx index f9bca67a28d9..bd4ce91f451b 100644 --- a/basic/source/sbx/sbxchar.cxx +++ b/basic/source/sbx/sbxchar.cxx @@ -39,7 +39,7 @@ using namespace rtl; xub_Unicode ImpGetChar( const SbxValues* p ) { SbxValues aTmp; - xub_Unicode nRes; + xub_Unicode nRes = 0; start: switch( +p->eType ) { @@ -156,13 +156,11 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - nRes = 0; - else + if ( p->pOUString ) { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXCHAR ) { @@ -274,9 +272,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - *p->pString = n; + if ( !p->pOUString ) + p->pOUString = new ::rtl::OUString( n ); + else + *p->pOUString = ::rtl::OUString( n ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx index c1ada75286ab..16fec542cded 100644 --- a/basic/source/sbx/sbxconv.hxx +++ b/basic/source/sbx/sbxconv.hxx @@ -33,13 +33,13 @@ class SbxArray; // SBXSCAN.CXX -extern void ImpCvtNum( double nNum, short nPrec, String& rRes, BOOL bCoreString=FALSE ); +extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE ); extern SbxError ImpScan - ( const String& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, + ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE ); // mit erweiterter Auswertung (International, "TRUE"/"FALSE") -extern BOOL ImpConvStringExt( String& rSrc, SbxDataType eTargetType ); +extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ); // SBXINT.CXX @@ -116,9 +116,9 @@ void ImpPutDate( SbxValues*, double ); // SBXSTR.CXX -String ImpGetString( const SbxValues* ); -String ImpGetCoreString( const SbxValues* ); -void ImpPutString( SbxValues*, const String* ); +::rtl::OUString ImpGetString( const SbxValues* ); +::rtl::OUString ImpGetCoreString( const SbxValues* ); +void ImpPutString( SbxValues*, const ::rtl::OUString* ); // SBXCHAR.CXX @@ -145,7 +145,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* ); void ImpPutBool( SbxValues*, INT16 ); // ByteArry <--> String -SbxArray* StringToByteArray(const String& rStr); -String ByteArrayToString(SbxArray* pArr); +SbxArray* StringToByteArray(const ::rtl::OUString& rStr); +::rtl::OUString ByteArrayToString(SbxArray* pArr); #endif diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx index 74380f84a75f..e27b11d5166c 100644 --- a/basic/source/sbx/sbxcurr.cxx +++ b/basic/source/sbx/sbxcurr.cxx @@ -37,8 +37,8 @@ #include #include "sbxconv.hxx" -static String ImpCurrencyToString( const SbxINT64& ); -static SbxINT64 ImpStringToCurrency( const String& ); +static ::rtl::OUString ImpCurrencyToString( const SbxINT64& ); +static SbxINT64 ImpStringToCurrency( const ::rtl::OUString& ); SbxINT64 ImpGetCurrency( const SbxValues* p ) { @@ -121,10 +121,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes.SetNull(); else - nRes = ImpStringToCurrency( *p->pString ); + nRes = ImpStringToCurrency( *p->pOUString ); break; case SbxOBJECT: { @@ -224,10 +224,10 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; - *p->pString = ImpCurrencyToString( r ); + *p->pOUString = ImpCurrencyToString( r ); break; case SbxOBJECT: { @@ -319,7 +319,7 @@ start: // Hilfs-Funktionen zur Wandlung -static String ImpCurrencyToString( const SbxINT64 &r ) +static ::rtl::OUString ImpCurrencyToString( const SbxINT64 &r ) { BigInt a10000 = 10000; @@ -331,20 +331,20 @@ static String ImpCurrencyToString( const SbxINT64 &r ) aFrac %= a10000; aFrac += a10000; - String aString; + ::rtl::OUString aString; if( r.nHigh < 0 ) - aString = '-'; + aString = ::rtl::OUString( (sal_Unicode)'-' ); aString += aInt.GetString(); - aString += '.'; + aString += ::rtl::OUString( (sal_Unicode)'.' ); aString += aFrac.GetString().GetBuffer()+1; return aString; } -static SbxINT64 ImpStringToCurrency( const String &r ) +static SbxINT64 ImpStringToCurrency( const ::rtl::OUString &r ) { int nDec = 4; String aStr; - const sal_Unicode* p = r.GetBuffer(); + const sal_Unicode* p = r.getStr(); if( *p == '-' ) aStr += *p++; diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index ce532fed0482..3a0636e4e7fc 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -86,7 +86,7 @@ double ImpGetDate( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { @@ -126,7 +126,7 @@ double ImpGetDate( const SbxValues* p ) pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, nIndex, LANGUAGE_GERMAN, eLangType ); - BOOL bSuccess = pFormatter->IsNumberFormat( *p->pString, nIndex, nRes ); + BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes ); if ( bSuccess ) { short nType_ = pFormatter->GetType( nIndex ); @@ -248,8 +248,8 @@ start: case SbxLPSTR: #ifndef DOS { - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; Color* pColor; LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); @@ -299,7 +299,9 @@ start: nIndex, LANGUAGE_GERMAN, eLangType ); - pFormatter->GetOutputString( n, nIndex, *p->pString, &pColor ); + String aTmpString; + pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor ); + *p->pOUString = aTmpString; delete pFormatter; #endif break; diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index 460f331c59b8..be55d3409131 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -76,7 +76,7 @@ double ImpGetDouble( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) { nRes = 0; if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour @@ -86,7 +86,7 @@ double ImpGetDouble( const SbxValues* p ) { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) { nRes = 0; if ( SbiRuntime::isVBAEnabled() )// VBA only behaviour @@ -188,9 +188,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 14, *p->pString, bCoreString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 14, *p->pOUString, bCoreString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 319b0aac366c..2191d91c8d82 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -211,7 +211,7 @@ void SbxDecimal::setUInt( unsigned int val ) // sbxscan.cxx void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ); -bool SbxDecimal::setString( String* pString ) +bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); @@ -224,11 +224,11 @@ bool SbxDecimal::setString( String* pString ) HRESULT hResult; if( cDecimalSep != '.' || cThousandSep != ',' ) { - int nLen = pString->Len(); + int nLen = pOUString->getLength(); sal_Unicode* pBuffer = new sal_Unicode[nLen + 1]; pBuffer[nLen] = 0; - const sal_Unicode* pSrc = pString->GetBuffer(); + const sal_Unicode* pSrc = pOUString->getStr(); int i; for( i = 0 ; i < nLen ; ++i ) pBuffer[i] = pSrc[i]; @@ -248,7 +248,7 @@ bool SbxDecimal::setString( String* pString ) } else { - hResult = VarDecFromStr( (OLECHAR*)pString->GetBuffer(), nLANGID, 0, &maDec ); + hResult = VarDecFromStr( (OLECHAR*)pOUString->getStr(), nLANGID, 0, &maDec ); } bRet = ( hResult == S_OK ); return bRet; @@ -373,7 +373,7 @@ bool SbxDecimal::setSingle( float val ) { (void)val; return false; } bool SbxDecimal::setDouble( double val ) { (void)val; return false; } void SbxDecimal::setInt( int val ) { (void)val; } void SbxDecimal::setUInt( unsigned int val ) { (void)val; } -bool SbxDecimal::setString( String* pString ) { (void)pString; return false; } +bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; } bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; } bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; } @@ -388,7 +388,7 @@ bool SbxDecimal::getUInt( unsigned int& rVal ) { (void)rVal; return false; } #endif -bool SbxDecimal::getString( String& rString ) +bool SbxDecimal::getString( ::rtl::OUString& rString ) { #ifdef WIN32 static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ); @@ -528,7 +528,7 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - pnDecRes->setString( p->pString ); break; + pnDecRes->setString( p->pOUString ); break; case SbxOBJECT: { SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); @@ -670,10 +670,10 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; // ImpCvtNum( (double) n, 0, *p->pString ); - pDec->getString( *p->pString ); + pDec->getString( *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx index 03f97bec5992..cd80bbad282e 100644 --- a/basic/source/sbx/sbxdec.hxx +++ b/basic/source/sbx/sbxdec.hxx @@ -85,7 +85,7 @@ public: bool setDouble( double val ); void setInt( int val ); void setUInt( unsigned int val ); - bool setString( String* pString ); + bool setString( ::rtl::OUString* pOUString ); void setDecimal( SbxDecimal* pDecimal ) { #ifdef WIN32 @@ -106,7 +106,7 @@ public: bool getDouble( double& rVal ); bool getInt( int& rVal ); bool getUInt( unsigned int& rVal ); - bool getString( String& rString ); + bool getString( ::rtl::OUString& rString ); bool operator -= ( const SbxDecimal &r ); bool operator += ( const SbxDecimal &r ); diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index 406b8599e568..47c38aecb1c2 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -154,13 +154,13 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXINT ) { @@ -275,9 +275,9 @@ start: case SbxLPSTR: case SbxSTRING: case SbxBYREF | SbxSTRING: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { @@ -456,20 +456,19 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { - ::rtl::OUString aOUStr( *p->pString ); ::rtl::OString aOStr = ::rtl::OUStringToOString - ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + ( *p->pOUString, RTL_TEXTENCODING_ASCII_US ); nRes = aOStr.toInt64(); if( nRes == 0 ) { // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else nRes = ImpDoubleToSalInt64( d ); @@ -575,13 +574,12 @@ start: case SbxSTRING: case SbxLPSTR: { - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; ::rtl::OString aOStr = ::rtl::OString::valueOf( n ); - ::rtl::OUString aOUStr = ::rtl::OStringToOUString + (*p->pOUString) = ::rtl::OStringToOUString ( aOStr, RTL_TEXTENCODING_ASCII_US ); - (*p->pString) = aOUStr; break; } case SbxOBJECT: @@ -745,20 +743,19 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { - ::rtl::OUString aOUStr( *p->pString ); ::rtl::OString aOStr = ::rtl::OUStringToOString - ( aOUStr, RTL_TEXTENCODING_ASCII_US ); + ( *p->pOUString, RTL_TEXTENCODING_ASCII_US ); sal_Int64 n64 = aOStr.toInt64(); if( n64 == 0 ) { // Check if really 0 or invalid conversion double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXSALUINT64 ) { @@ -879,16 +876,15 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; if( n > SbxMAXSALINT64 ) SbxBase::SetError( SbxERR_CONVERSION ); else { ::rtl::OString aOStr = ::rtl::OString::valueOf( (sal_Int64)n ); - ::rtl::OUString aOUStr = ::rtl::OStringToOUString + (*p->pOUString) = ::rtl::OStringToOUString ( aOStr, RTL_TEXTENCODING_ASCII_US ); - (*p->pString) = aOUStr; } break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index c84b087dfc33..1cf2d84061f9 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -119,13 +119,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXLNG ) { @@ -240,9 +240,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx index f42c400afd91..369349e72069 100644 --- a/basic/source/sbx/sbxres.cxx +++ b/basic/source/sbx/sbxres.cxx @@ -86,6 +86,6 @@ const char* GetSbxRes( USHORT nId ) } SbxRes::SbxRes( USHORT nId ) - : XubString( String::CreateFromAscii( GetSbxRes( nId ) ) ) + : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) ) {} diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx index 8cd0ad26e951..8ed3c7054278 100644 --- a/basic/source/sbx/sbxres.hxx +++ b/basic/source/sbx/sbxres.hxx @@ -75,7 +75,7 @@ #define SBXRES_MAX 44 -class SbxRes : public String +class SbxRes : public ::rtl::OUString { public: SbxRes( USHORT ); diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 3d45818e6401..b8aad9bbf2e4 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -71,10 +71,10 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) // Das ganze gibt auch noch einen Konversionsfehler, wenn der Datentyp // Fixed ist und das ganze nicht hineinpasst! -SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType, +SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType, USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl ) { - ByteString aBStr( rWSrc, RTL_TEXTENCODING_ASCII_US ); + ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) ); // Bei International Komma besorgen char cIntntlComma, cIntntl1000; @@ -100,7 +100,7 @@ SbxError ImpScan( const XubString& rWSrc, double& nVal, SbxDataType& rType, cIntntl1000 = (char)cThousandSep; } - const char* pStart = aBStr.GetBuffer(); + const char* pStart = aBStr.getStr(); const char* p = pStart; char buf[ 80 ], *q = buf; BOOL bRes = TRUE; @@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, #pragma warning(disable: 4748) // "... because optimizations are disabled ..." #endif -void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString ) +void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString ) { char *q; char cBuf[ 40 ], *p = cBuf; @@ -415,18 +415,18 @@ void ImpCvtNum( double nNum, short nPrec, XubString& rRes, BOOL bCoreString ) if( *p == cDecimalSep ) p--; while( *q ) *++p = *q++; *++p = 0; - rRes = String::CreateFromAscii( cBuf ); + rRes = ::rtl::OUString::createFromAscii( cBuf ); } #ifdef _MSC_VER #pragma optimize( "", on ) #endif -BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) +BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) { // Merken, ob ueberhaupt was geaendert wurde BOOL bChanged = FALSE; - String aNewString; + ::rtl::OUString aNewString; // Nur Spezial-Fälle behandeln, als Default tun wir nichts switch( eTargetType ) @@ -436,7 +436,7 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) case SbxDOUBLE: case SbxCURRENCY: { - ByteString aBStr( rSrc, RTL_TEXTENCODING_ASCII_US ); + ::rtl::OString aBStr( ::rtl::OUStringToOString( rSrc, RTL_TEXTENCODING_ASCII_US ) ); // Komma besorgen sal_Unicode cDecimalSep, cThousandSep; @@ -446,10 +446,11 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) // Ersetzen, wenn DecimalSep kein '.' (nur den ersten) if( cDecimalSep != (sal_Unicode)'.' ) { - USHORT nPos = aNewString.Search( cDecimalSep ); - if( nPos != STRING_NOTFOUND ) + sal_Int32 nPos = aNewString.indexOf( cDecimalSep ); + if( nPos != -1 ) { - aNewString.SetChar( nPos, '.' ); + sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr(); + pStr[nPos] = (sal_Unicode)'.'; bChanged = TRUE; } } @@ -459,15 +460,15 @@ BOOL ImpConvStringExt( XubString& rSrc, SbxDataType eTargetType ) // Bei BOOL TRUE und FALSE als String pruefen case SbxBOOL: { - if( rSrc.EqualsIgnoreCaseAscii( "true" ) ) + if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) ) { - aNewString = String::CreateFromInt32(SbxTRUE); + aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE ); bChanged = TRUE; } else - if( rSrc.EqualsIgnoreCaseAscii( "false" ) ) + if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) ) { - aNewString = String::CreateFromInt32(SbxFALSE); + aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE ); bChanged = TRUE; } break; @@ -935,7 +936,11 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const //old: printfmtnum( GetDouble(), rRes, *pFmt ); } else - ImpCvtNum( GetDouble(), nComma, rRes ); + { + ::rtl::OUString aTmpString( rRes ); + ImpCvtNum( GetDouble(), nComma, aTmpString ); + rRes = aTmpString; + } break; case SbxSTRING: if( pFmt ) diff --git a/basic/source/sbx/sbxsng.cxx b/basic/source/sbx/sbxsng.cxx index 82507dbe15e9..70ef1653666b 100644 --- a/basic/source/sbx/sbxsng.cxx +++ b/basic/source/sbx/sbxsng.cxx @@ -112,13 +112,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXSNG ) { @@ -237,9 +237,9 @@ start: case SbxSTRING: case SbxLPSTR: { - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 6, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 6, *p->pOUString ); break; } case SbxOBJECT: diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 6deb2da29ba1..b4156a116ddc 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -44,12 +44,12 @@ using namespace rtl; // Die Konversion eines Items auf String wird ueber die Put-Methoden // der einzelnen Datentypen abgewickelt, um doppelten Code zu vermeiden. -XubString ImpGetString( const SbxValues* p ) +::rtl::OUString ImpGetString( const SbxValues* p ) { SbxValues aTmp; - XubString aRes; + ::rtl::OUString aRes; aTmp.eType = SbxSTRING; - aTmp.pString = &aRes; + aTmp.pOUString = &aRes; switch( +p->eType ) { case SbxNULL: @@ -86,8 +86,8 @@ XubString ImpGetString( const SbxValues* p ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( p->pString ) - aRes = *p->pString; + if ( p->pOUString ) + *aTmp.pOUString = *p->pOUString; break; case SbxOBJECT: { @@ -109,7 +109,7 @@ XubString ImpGetString( const SbxValues* p ) case SbxERROR: // Hier wird der String "Error n" erzeugt aRes = SbxRes( STRING_ERRORMSG ); - aRes += p->nUShort; break; + aRes += ::rtl::OUString( p->nUShort ); break; case SbxDATE: ImpPutDate( &aTmp, p->nDouble ); break; @@ -145,7 +145,7 @@ XubString ImpGetString( const SbxValues* p ) } // AB 10.4.97, neue Funktion fuer SbxValue::GetCoreString() -XubString ImpGetCoreString( const SbxValues* p ) +::rtl::OUString ImpGetCoreString( const SbxValues* p ) { // Vorerst nur fuer double if( ( p->eType & (~SbxBYREF) ) == SbxDOUBLE ) @@ -153,7 +153,6 @@ XubString ImpGetCoreString( const SbxValues* p ) SbxValues aTmp; XubString aRes; aTmp.eType = SbxSTRING; - aTmp.pString = &aRes; if( p->eType == SbxDOUBLE ) ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE ); else @@ -164,15 +163,15 @@ XubString ImpGetCoreString( const SbxValues* p ) return ImpGetString( p ); } -void ImpPutString( SbxValues* p, const XubString* n ) +void ImpPutString( SbxValues* p, const ::rtl::OUString* n ) { SbxValues aTmp; aTmp.eType = SbxSTRING; - XubString* pTmp = NULL; + ::rtl::OUString* pTmp = NULL; // Sicherheitshalber, falls ein NULL-Ptr kommt if( !n ) - n = pTmp = new XubString; - aTmp.pString = (XubString*) n; + n = pTmp = new ::rtl::OUString; + aTmp.pOUString = (::rtl::OUString*)n; switch( +p->eType ) { case SbxCHAR: @@ -209,14 +208,15 @@ void ImpPutString( SbxValues* p, const XubString* n ) case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( n->Len() ) + if( n->getLength() ) { - if( !p->pString ) - p->pString = new XubString; - *p->pString = *n; + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString( *n ); + else + *p->pOUString = *n; } else - delete p->pString, p->pString = NULL; + delete p->pOUString, p->pOUString = NULL; break; case SbxOBJECT: { @@ -258,18 +258,18 @@ void ImpPutString( SbxValues* p, const XubString* n ) } // Convert string to an array of bytes, preserving unicode (2bytes per character) -SbxArray* StringToByteArray(const String& rStr) +SbxArray* StringToByteArray(const ::rtl::OUString& rStr) { - USHORT nArraySize = rStr.Len() * 2; - const sal_Unicode* pSrc = rStr.GetBuffer(); + sal_Int32 nArraySize = rStr.getLength() * 2; + const sal_Unicode* pSrc = rStr.getStr(); SbxDimArray* pArray = new SbxDimArray(SbxBYTE); bool bIncIndex = ( IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); if( nArraySize ) { if( bIncIndex ) - pArray->AddDim( 1, nArraySize ); + pArray->AddDim32( 1, nArraySize ); else - pArray->AddDim( 0, nArraySize-1 ); + pArray->AddDim32( 0, nArraySize-1 ); } else { @@ -290,7 +290,7 @@ SbxArray* StringToByteArray(const String& rStr) } // Convert an array of bytes to string (2bytes per character) -String ByteArrayToString(SbxArray* pArr) +::rtl::OUString ByteArrayToString(SbxArray* pArr) { USHORT nCount = pArr->Count(); OUStringBuffer aStrBuf; @@ -315,7 +315,5 @@ String ByteArrayToString(SbxArray* pArr) aStrBuf.append(aChar); } - String aStr(aStrBuf.makeStringAndClear()); - - return aStr; + return aStrBuf.makeStringAndClear(); } diff --git a/basic/source/sbx/sbxuint.cxx b/basic/source/sbx/sbxuint.cxx index ce0aea70b062..5b75a24d6d26 100644 --- a/basic/source/sbx/sbxuint.cxx +++ b/basic/source/sbx/sbxuint.cxx @@ -151,13 +151,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXUINT ) { @@ -272,9 +272,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx index 3dd81b8c616d..e0f6f3fa421d 100644 --- a/basic/source/sbx/sbxulng.cxx +++ b/basic/source/sbx/sbxulng.cxx @@ -127,13 +127,13 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) + if( !p->pOUString ) nRes = 0; else { double d; SbxDataType t; - if( ImpScan( *p->pString, d, t, NULL ) != SbxERR_OK ) + if( ImpScan( *p->pOUString, d, t, NULL ) != SbxERR_OK ) nRes = 0; else if( d > SbxMAXULNG ) { @@ -246,9 +246,9 @@ start: case SbxBYREF | SbxSTRING: case SbxSTRING: case SbxLPSTR: - if( !p->pString ) - p->pString = new XubString; - ImpCvtNum( (double) n, 0, *p->pString ); + if( !p->pOUString ) + p->pOUString = new ::rtl::OUString; + ImpCvtNum( (double) n, 0, *p->pOUString ); break; case SbxOBJECT: { diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 7ee31af70556..4ea4836b701b 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -236,7 +236,7 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase() case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break; case SbxDATE: case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break; - case SbxSTRING: n |= SbxBYREF; aData.pString = (XubString*) p; break; + case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break; case SbxERROR: case SbxUSHORT: case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break; @@ -280,8 +280,8 @@ SbxValue::SbxValue( const SbxValue& r ) switch( aData.eType ) { case SbxSTRING: - if( aData.pString ) - aData.pString = new XubString( *aData.pString ); + if( aData.pOUString ) + aData.pOUString = new ::rtl::OUString( *aData.pOUString ); break; case SbxOBJECT: if( aData.pObj ) @@ -309,7 +309,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) && aData.pObj && ( aData.pObj->GetType() == (SbxARRAY | SbxBYTE) ) && (r.aData.eType == SbxSTRING) ) { - String aStr = r.GetString(); + ::rtl::OUString aStr = r.GetString(); SbxArray* pArr = StringToByteArray(aStr); PutObject(pArr); return *this; @@ -323,7 +323,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) SbxArray* pArr = PTR_CAST(SbxArray, pObj); if( pArr ) { - String aStr = ByteArrayToString( pArr ); + ::rtl::OUString aStr = ByteArrayToString( pArr ); PutString(aStr); return *this; } @@ -385,7 +385,7 @@ void SbxValue::Clear() case SbxVOID: break; case SbxSTRING: - delete aData.pString; aData.pString = NULL; + delete aData.pOUString; aData.pOUString = NULL; break; case SbxOBJECT: if( aData.pObj ) @@ -551,9 +551,9 @@ BOOL SbxValue::Get( SbxValues& rRes ) const case SbxULONG: rRes.nULong = ImpGetULong( &p->aData ); break; case SbxLPSTR: case SbxSTRING: p->aPic = ImpGetString( &p->aData ); - rRes.pString = &p->aPic; break; + rRes.pOUString = &p->aPic; break; case SbxCoreSTRING: p->aPic = ImpGetCoreString( &p->aData ); - rRes.pString = &p->aPic; break; + rRes.pOUString = &p->aPic; break; case SbxINT: #if SAL_TYPES_SIZEOFINT == 2 rRes.nInt = (int) ImpGetInteger( &p->aData ); @@ -618,13 +618,11 @@ const XubString& SbxValue::GetString() const SbxValues aRes; aRes.eType = SbxSTRING; if( Get( aRes ) ) - // Geht in Ordnung, da Ptr eine Kopie ist - return *aRes.pString; + ((SbxValue*) this)->aToolString = *aRes.pOUString; else - { - ((SbxValue*) this)->aPic.Erase(); - return aPic; - } + ((SbxValue*) this)->aToolString.Erase(); + + return aToolString; } const XubString& SbxValue::GetCoreString() const @@ -632,13 +630,22 @@ const XubString& SbxValue::GetCoreString() const SbxValues aRes; aRes.eType = SbxCoreSTRING; if( Get( aRes ) ) - // Geht in Ordnung, da Ptr eine Kopie ist - return *aRes.pString; + ((SbxValue*) this)->aToolString = *aRes.pOUString; else - { - ((SbxValue*) this)->aPic.Erase(); - return aPic; - } + ((SbxValue*) this)->aToolString.Erase(); + + return aToolString; +} + +::rtl::OUString SbxValue::GetOUString() const +{ + ::rtl::OUString aResult; + SbxValues aRes; + aRes.eType = SbxSTRING; + if( Get( aRes ) ) + aResult = *aRes.pOUString; + + return aResult; } BOOL SbxValue::HasObject() const @@ -727,7 +734,7 @@ BOOL SbxValue::Put( const SbxValues& rVal ) case SbxUSHORT: ImpPutUShort( &p->aData, rVal.nUShort ); break; case SbxULONG: ImpPutULong( &p->aData, rVal.nULong ); break; case SbxLPSTR: - case SbxSTRING: ImpPutString( &p->aData, rVal.pString ); break; + case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break; case SbxINT: #if SAL_TYPES_SIZEOFINT == 2 ImpPutInteger( &p->aData, (INT16) rVal.nInt ); @@ -803,10 +810,10 @@ BOOL SbxValue::Put( const SbxValues& rVal ) // werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs // explizit mit "TRUE" oder "FALSE" angegeben werden. // Implementierung in ImpConvStringExt (SBXSCAN.CXX) -BOOL SbxValue::PutStringExt( const XubString& r ) +BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) { // Kopieren, bei Unicode gleich konvertieren - String aStr( r ); + ::rtl::OUString aStr( r ); // Eigenen Typ bestimmen (nicht wie in Put() mit TheRealValue(), // Objekte werden sowieso nicht behandelt) @@ -820,9 +827,9 @@ BOOL SbxValue::PutStringExt( const XubString& r ) // sonst Original (Unicode bleibt erhalten) BOOL bRet; if( ImpConvStringExt( aStr, eTargetType ) ) - aRes.pString = (XubString*)&aStr; + aRes.pOUString = (::rtl::OUString*)&aStr; else - aRes.pString = (XubString*)&r; + aRes.pOUString = (::rtl::OUString*)&r; // #34939: Bei Strings. die eine Zahl enthalten und wenn this einen // Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird @@ -851,10 +858,10 @@ BOOL SbxValue::PutStringExt( const XubString& r ) BOOL SbxValue::PutString( const xub_Unicode* p ) { - XubString aVal( p ); + ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxSTRING; - aRes.pString = &aVal; + aRes.pOUString = &aVal; Put( aRes ); return BOOL( !IsError() ); } @@ -909,19 +916,19 @@ BOOL SbxValue::fillAutomationDecimal BOOL SbxValue::PutpChar( const xub_Unicode* p ) { - XubString aVal( p ); + ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxLPSTR; - aRes.pString = &aVal; + aRes.pOUString = &aVal; Put( aRes ); return BOOL( !IsError() ); } -BOOL SbxValue::PutString( const XubString& r ) +BOOL SbxValue::PutString( const ::rtl::OUString& r ) { SbxValues aRes; aRes.eType = SbxSTRING; - aRes.pString = (XubString*) &r; + aRes.pOUString = (::rtl::OUString*) &r; Put( aRes ); return BOOL( !IsError() ); } @@ -986,14 +993,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const SbxDataType t = GetType(); if( t == SbxSTRING ) { - if( aData.pString ) + if( aData.pOUString ) { - XubString s( *aData.pString ); + ::rtl::OUString s( *aData.pOUString ); double n; SbxDataType t2; USHORT nLen = 0; if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK ) - return BOOL( nLen == s.Len() ); + return BOOL( nLen == s.getLength() ); } return FALSE; } @@ -1046,7 +1053,7 @@ BOOL SbxValue::SetType( SbxDataType t ) switch( aData.eType ) { case SbxSTRING: - delete aData.pString; + delete aData.pOUString; break; case SbxOBJECT: if( aData.pObj && aData.pObj != this ) @@ -1163,14 +1170,14 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) Get( aL ); // #30576: Erstmal testen, ob Wandlung geklappt hat - if( aL.pString != NULL && aR.pString != NULL ) + if( aL.pOUString != NULL && aR.pOUString != NULL ) { - *aL.pString += *aR.pString; + *aL.pOUString += *aR.pOUString; } // Nicht einmal Left OK? - else if( aL.pString == NULL ) + else if( aL.pOUString == NULL ) { - aL.pString = new String(); + aL.pOUString = new ::rtl::OUString(); } Put( aL ); } @@ -1493,17 +1500,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const if( Get( aL ) && rOp.Get( aR ) ) switch( eOp ) { case SbxEQ: - bRes = BOOL( *aL.pString == *aR.pString ); break; + bRes = BOOL( *aL.pOUString == *aR.pOUString ); break; case SbxNE: - bRes = BOOL( *aL.pString != *aR.pString ); break; + bRes = BOOL( *aL.pOUString != *aR.pOUString ); break; case SbxLT: - bRes = BOOL( *aL.pString < *aR.pString ); break; + bRes = BOOL( *aL.pOUString < *aR.pOUString ); break; case SbxGT: - bRes = BOOL( *aL.pString > *aR.pString ); break; + bRes = BOOL( *aL.pOUString > *aR.pOUString ); break; case SbxLE: - bRes = BOOL( *aL.pString <= *aR.pString ); break; + bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break; case SbxGE: - bRes = BOOL( *aL.pString >= *aR.pString ); break; + bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1668,9 +1675,9 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) XubString aVal; r.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); if( aVal.Len() ) - aData.pString = new XubString( aVal ); + aData.pOUString = new ::rtl::OUString( aVal ); else - aData.pString = NULL; // JSM 22.09.1995 + aData.pOUString = NULL; // JSM 22.09.1995 break; } case SbxERROR: @@ -1781,9 +1788,9 @@ BOOL SbxValue::StoreData( SvStream& r ) const break; } case SbxSTRING: - if( aData.pString ) + if( aData.pOUString ) { - r.WriteByteString( *aData.pString, RTL_TEXTENCODING_ASCII_US ); + r.WriteByteString( *aData.pOUString, RTL_TEXTENCODING_ASCII_US ); } else { diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 20060f1f7493..58e3c1ae92c2 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -239,9 +239,9 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const if( i ) aTmp += ','; if( q->nFlags & SBX_OPTIONAL ) - aTmp += SbxRes( STRING_OPTIONAL ); + aTmp += String( SbxRes( STRING_OPTIONAL ) ); if( q->eType & SbxBYREF ) - aTmp += SbxRes( STRING_BYREF ); + aTmp += String( SbxRes( STRING_BYREF ) ); aTmp += q->aName; cType = ' '; // Kurzer Typ? Dann holen, evtl. ist dieser 0. @@ -263,12 +263,12 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const // langer Typ? if( t != SbxNAME_SHORT ) { - aTmp += SbxRes( STRING_AS ); + aTmp += String( SbxRes( STRING_AS ) ); if( nt < 32 ) - aTmp += SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ); + aTmp += String( SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) ); else - aTmp += SbxRes( STRING_ANY ); + aTmp += String( SbxRes( STRING_ANY ) ); } } } @@ -276,15 +276,15 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const // Langer Typ? Dann holen if( t == SbxNAME_LONG_TYPES && et != SbxEMPTY ) { - aTmp += SbxRes( STRING_AS ); + aTmp += String( SbxRes( STRING_AS ) ); if( et < 32 ) - aTmp += SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + et ) ); + aTmp += String( SbxRes( + sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) ); else - aTmp += SbxRes( STRING_ANY ); + aTmp += String( SbxRes( STRING_ANY ) ); } - ((SbxVariable*) this)->aPic = aTmp; - return aPic; + ((SbxVariable*) this)->aToolString = aTmp; + return aToolString; } // Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet. @@ -431,9 +431,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) if( nType == SbxNULL && GetClass() == SbxCLASS_METHOD ) nType = SbxEMPTY; SbxValues aTmp; - XubString aVal; + String aTmpString; + ::rtl::OUString aVal; aTmp.eType = aData.eType = (SbxDataType) nType; - aTmp.pString = &aVal; + aTmp.pOUString = &aVal; switch( nType ) { case SbxBOOL: @@ -445,10 +446,10 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) case SbxSINGLE: { // Floats als ASCII - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); double d; SbxDataType t; - if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) + if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) { aTmp.nSingle = 0; return FALSE; @@ -460,9 +461,9 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) case SbxDOUBLE: { // Floats als ASCII - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); SbxDataType t; - if( ImpScan( aVal, aTmp.nDouble, t, NULL ) != SbxERR_OK ) + if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK ) { aTmp.nDouble = 0; return FALSE; @@ -470,7 +471,8 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) break; } case SbxSTRING: - rStrm.ReadByteString( aVal, RTL_TEXTENCODING_ASCII_US ); + rStrm.ReadByteString( aTmpString, RTL_TEXTENCODING_ASCII_US ); + aVal = aTmpString; break; case SbxEMPTY: case SbxNULL: -- cgit From 5df1941a50f21012cb1b44c46e57e8b29467544b Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 13 Aug 2010 14:48:18 +0200 Subject: mib18: #163278# handle the internal VBA types correctly --- basic/source/classes/sbunoobj.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 3e775613198b..c9123b06341b 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -301,7 +301,12 @@ SbUnoObject* createOLEObject_Impl( const String& aType ) SbUnoObject* pUnoObj = NULL; if( xOLEFactory.is() ) { - Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aType ); + // some type names available in VBA can not be directly used in COM + ::rtl::OUString aOLEType = aType; + if ( aOLEType.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SAXXMLReader30" ) ) ) ) + aOLEType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Msxml2.SAXXMLReader.3.0" ) ); + + Reference< XInterface > xOLEObject = xOLEFactory->createInstance( aOLEType ); if( xOLEObject.is() ) { Any aAny; -- cgit From dc50b041cf1c549bb4ec9cde37da1ca5e61cdc34 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Fri, 13 Aug 2010 15:25:54 +0200 Subject: dv20:#i95454# Use GetShortName to avoid problems with char versus wchar --- shell/inc/internal/propsheets.hxx | 0 shell/inc/internal/utilities.hxx | 6 ++ .../win32/shlxthandler/columninfo/columninfo.cxx | 5 +- .../win32/shlxthandler/infotips/infotips.cxx | 2 + .../source/win32/shlxthandler/ooofilt/ooofilt.cxx | 3 +- .../win32/shlxthandler/propsheets/propsheets.cxx | 93 +++++++++++++--------- .../win32/shlxthandler/thumbviewer/thumbviewer.cxx | 3 +- .../win32/shlxthandler/util/fileextensions.cxx | 9 +++ shell/source/win32/shlxthandler/util/utilities.cxx | 22 +++++ 9 files changed, 102 insertions(+), 41 deletions(-) mode change 100644 => 100755 shell/inc/internal/propsheets.hxx mode change 100644 => 100755 shell/source/win32/shlxthandler/columninfo/columninfo.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/infotips/infotips.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/util/fileextensions.cxx mode change 100644 => 100755 shell/source/win32/shlxthandler/util/utilities.cxx diff --git a/shell/inc/internal/propsheets.hxx b/shell/inc/internal/propsheets.hxx old mode 100644 new mode 100755 diff --git a/shell/inc/internal/utilities.hxx b/shell/inc/internal/utilities.hxx index 4701a2682446..c67787c5cb9d 100755 --- a/shell/inc/internal/utilities.hxx +++ b/shell/inc/internal/utilities.hxx @@ -84,6 +84,12 @@ bool HasOnlySpaces(const std::wstring& String); Windows Locale Identifier corresponding to input LocaleSet. */ +//--------------------------------- +/** Convert a long path name using Windows api call GetShortPathName +*/ +std::wstring getShortPathName( const std::wstring& aLongName ); + + #ifndef OS2 LCID LocaleSetToLCID( const LocaleSet_t & Locale ); #endif diff --git a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx old mode 100644 new mode 100755 index f8816668f8ab..ab6c8bae2922 --- a/shell/source/win32/shlxthandler/columninfo/columninfo.cxx +++ b/shell/source/win32/shlxthandler/columninfo/columninfo.cxx @@ -152,14 +152,15 @@ HRESULT STDMETHODCALLTYPE CColumnInfo::GetColumnInfo(DWORD dwIndex, SHCOLUMNINFO // //----------------------------- - HRESULT STDMETHODCALLTYPE CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) +HRESULT STDMETHODCALLTYPE CColumnInfo::GetItemData(LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) { if (IsOOFileExtension(pscd->pwszExt)) { try { + std::wstring fname = getShortPathName( std::wstring( pscd->wszFile ) ); - CMetaInfoReader meta_info_accessor(WStringToString(pscd->wszFile)); + CMetaInfoReader meta_info_accessor(WStringToString(fname)); VariantClear(pvarData); diff --git a/shell/source/win32/shlxthandler/infotips/infotips.cxx b/shell/source/win32/shlxthandler/infotips/infotips.cxx old mode 100644 new mode 100755 index 72da8c9e7060..c6bf925ac6a9 --- a/shell/source/win32/shlxthandler/infotips/infotips.cxx +++ b/shell/source/win32/shlxthandler/infotips/infotips.cxx @@ -353,6 +353,8 @@ HRESULT STDMETHODCALLTYPE CInfoTip::Load(LPCOLESTR pszFileName, DWORD /*dwMode*/ m_FileNameOnly = std::wstring(begin, end); + fname = getShortPathName( fname ); + std::string fnameA = WStringToString(fname); // #115531# diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx index adcf2b2f8ddf..30151fc5dd75 100755 --- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx @@ -657,7 +657,8 @@ SCODE STDMETHODCALLTYPE COooFilter::IsDirty() SCODE STDMETHODCALLTYPE COooFilter::Load(LPCWSTR pszFileName, DWORD /*dwMode*/) { // Load just sets the filename for GetChunk to read and ignores the mode - m_pwszFileName = pszFileName; + m_pwszFileName = getShortPathName( pszFileName ); + // Open the file previously specified in call to IPersistFile::Load and get content. try { diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx index a45c7967f233..d668479d5ff5 100755 --- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx +++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx @@ -157,13 +157,26 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize( NULL, 0))) { - DragQueryFileA( - reinterpret_cast(medium.hGlobal), - 0, - m_szFileName, - sizeof(m_szFileName)); - - hr = S_OK; + UINT size = DragQueryFile( reinterpret_cast(medium.hGlobal), 0, 0, 0 ); + if ( size != 0 ) + { + TCHAR * buffer = new TCHAR[ size + 1 ]; + UINT result_size = DragQueryFile( reinterpret_cast(medium.hGlobal), + 0, buffer, size + 1 ); + if ( result_size != 0 ) + { + std::wstring fname = getShortPathName( buffer ); + std::string fnameA = WStringToString( fname ); + ZeroMemory( m_szFileName, sizeof( m_szFileName ) ); + strncpy( m_szFileName, fnameA.c_str(), ( sizeof( m_szFileName ) - 1 ) ); + hr = S_OK; + } + else + hr = E_INVALIDARG; + delete [] buffer; + } + else + hr = E_INVALIDARG; } else hr = E_INVALIDARG; @@ -320,24 +333,29 @@ BOOL CALLBACK CPropertySheet::PropPageStatisticsProc(HWND hwnd, UINT uiMsg, WPAR //################################## void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) { - CMetaInfoReader metaInfo(m_szFileName); - - SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() ); - SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() ); - - // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add - // "\r" before "\n" to form "\r\n" in order to display return in Edit control. - std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str(); - std::wstring::size_type itor = tempStr.find ( L"\n" , 0 ); - while (itor != std::wstring::npos) + try + { + CMetaInfoReader metaInfo(m_szFileName); + + SetWindowText(GetDlgItem(hwnd,IDC_TITLE), metaInfo.getTagData( META_INFO_TITLE ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_AUTHOR), metaInfo.getTagData( META_INFO_AUTHOR ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_SUBJECT), metaInfo.getTagData( META_INFO_SUBJECT ).c_str() ); + SetWindowText(GetDlgItem(hwnd,IDC_KEYWORDS), metaInfo.getTagData( META_INFO_KEYWORDS ).c_str() ); + + // comments read from meta.xml use "\n" for return, but this will not displayable in Edit control, add + // "\r" before "\n" to form "\r\n" in order to display return in Edit control. + std::wstring tempStr = metaInfo.getTagData( META_INFO_DESCRIPTION ).c_str(); + std::wstring::size_type itor = tempStr.find ( L"\n" , 0 ); + while (itor != std::wstring::npos) + { + tempStr.insert(itor, L"\r"); + itor = tempStr.find(L"\n", itor + 2); + } + SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str()); + } + catch (const std::exception&) { - tempStr.insert(itor, L"\r"); - itor = tempStr.find(L"\n", itor + 2); } - SetWindowText(GetDlgItem(hwnd,IDC_COMMENTS), tempStr.c_str()); - } //--------------------------------- @@ -345,22 +363,23 @@ void CPropertySheet::InitPropPageSummary(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) */ void CPropertySheet::InitPropPageStatistics(HWND hwnd, LPPROPSHEETPAGE /*lppsp*/) { - CMetaInfoReader metaInfo(m_szFileName); - - document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo); + try + { + CMetaInfoReader metaInfo(m_szFileName); - statistic_group_list_t sgl; - doc_stat_reader->read(&sgl); + document_statistic_reader_ptr doc_stat_reader = create_document_statistic_reader(m_szFileName, &metaInfo); - list_view_builder_ptr lv_builder = create_list_view_builder( - GetDlgItem(hwnd, IDC_STATISTICSLIST), - GetResString(IDS_PROPERTY), - GetResString(IDS_PROPERTY_VALUE)); + statistic_group_list_t sgl; + doc_stat_reader->read(&sgl); - lv_builder->build(sgl); + list_view_builder_ptr lv_builder = create_list_view_builder( + GetDlgItem(hwnd, IDC_STATISTICSLIST), + GetResString(IDS_PROPERTY), + GetResString(IDS_PROPERTY_VALUE)); + lv_builder->build(sgl); + } + catch (const std::exception&) + { + } } - - - - diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx old mode 100644 new mode 100755 index 13f49c8a2efd..62fd306317be --- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx +++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx @@ -367,7 +367,8 @@ HRESULT STDMETHODCALLTYPE CThumbviewer::Extract(HBITMAP *phBmpImage) try { - std::auto_ptr zipfile(new ZipFile(WStringToString(filename_))); + std::wstring fname = getShortPathName( filename_ ); + std::auto_ptr zipfile( new ZipFile( WStringToString( fname ) ) ); if (zipfile->HasContent(THUMBNAIL_CONTENT)) { diff --git a/shell/source/win32/shlxthandler/util/fileextensions.cxx b/shell/source/win32/shlxthandler/util/fileextensions.cxx old mode 100644 new mode 100755 index b8de490a5c47..13e3535c7aa7 --- a/shell/source/win32/shlxthandler/util/fileextensions.cxx +++ b/shell/source/win32/shlxthandler/util/fileextensions.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_shell.hxx" +#include "algorithm" #include "internal/fileextensions.hxx" //------------------------------------ @@ -87,9 +88,17 @@ std::string get_file_name_extension(const std::string& file_name) /** Return the type of a file */ +char easytolower( char in ) +{ + if( in<='Z' && in>='A' ) + return in-('Z'-'z'); + return in; +} + File_Type_t get_file_type(const std::string& file_name) { std::string fext = get_file_name_extension(file_name); + std::transform(fext.begin(), fext.end(), fext.begin(), easytolower); if (std::string::npos != WRITER_FILE_EXTENSIONS.find(fext)) return WRITER; diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx old mode 100644 new mode 100755 index f721c4113aa8..005e4689cdce --- a/shell/source/win32/shlxthandler/util/utilities.cxx +++ b/shell/source/win32/shlxthandler/util/utilities.cxx @@ -148,6 +148,28 @@ bool HasOnlySpaces(const std::wstring& String) return true; } +//--------------------------------- +/** helper function to convert windows pathes to short form. + @returns + shortend path. +*/ + +std::wstring getShortPathName( const std::wstring& aLongName ) +{ + std::wstring shortName = aLongName; + long length = GetShortPathName( aLongName.c_str(), NULL, 0 ); + + if ( length != 0 ) + { + TCHAR* buffer = new TCHAR[ length+1 ]; + length = GetShortPathName( aLongName.c_str(), buffer, length ); + if ( length != 0 ) + shortName = std::wstring( buffer ); + delete [] buffer; + } + return shortName; +} + /** convert LocaleSet pair into Microsoft List of Locale ID (LCID) according to ISO-639 and ISO-3166. http://etext.lib.virginia.edu/tei/iso639.html -- cgit From a40d24467d45f19bf167a5e2a638a71715162675 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 13 Aug 2010 15:57:34 +0200 Subject: ooo33gsl05: #i113810# fix on behalf of aw --- svx/source/svdraw/svdmrkv.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index fffcac00e46c..ee9e8f48634b 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1063,8 +1063,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) /** handle mouse over effects for handles */ BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin) { - const ULONG nHdlCount = aHdl.GetHdlCount(); - if( nHdlCount ) + if(aHdl.GetHdlCount()) { SdrHdl* pMouseOverHdl = 0; if( !rMEvt.IsLeaveWindow() && pWin ) @@ -1074,6 +1073,8 @@ BOOL SdrMarkView::MouseMove(const MouseEvent& rMEvt, Window* pWin) } // notify last mouse over handle that he lost the mouse + const ULONG nHdlCount = aHdl.GetHdlCount(); + for(ULONG nHdl = 0; nHdl < nHdlCount; nHdl++ ) { SdrHdl* pCurrentHdl = GetHdl(nHdl); -- cgit From 41b94861a16cb202c6aeb42c3e206a43f039e793 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 13 Aug 2010 17:51:00 +0200 Subject: mib18: wae --- basic/source/runtime/step0.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 596b30b9d691..06a8bb19af00 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -442,7 +442,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b // Check value, !object is no error for sure if, only if type is fixed SbxDataType eValType = refVal->GetType(); - bool bGetValObject = false; +// bool bGetValObject = false; if( !bHandleDefaultProp && eValType != SbxOBJECT && !(eValType & SbxARRAY) && refVal->IsFixed() ) { Error( SbERR_INVALID_USAGE_OBJECT ); -- cgit From c26a9b2de55a47496d9cdbf4d75ccdf3572fc008 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Fri, 13 Aug 2010 17:59:32 +0200 Subject: mib18: wae --- basic/source/classes/sb.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 4afe5cab1e97..056c2ea38c4c 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -569,10 +569,10 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase); if( pClassModuleObj != NULL ) { - SbModule* pClassModule = pClassModuleObj->getClassModule(); - SbClassModuleObject* pNewObj = new SbClassModuleObject( pClassModule ); + SbModule* pLclClassModule = pClassModuleObj->getClassModule(); + SbClassModuleObject* pNewObj = new SbClassModuleObject( pLclClassModule ); pNewObj->SetName( pProp->GetName() ); - pNewObj->SetParent( pClassModule->pParent ); + pNewObj->SetParent( pLclClassModule->pParent ); pNewProp->PutObject( pNewObj ); } else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) -- cgit From 4929c034350dbad96804a5c517d3471c1d7b7b14 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 17 Aug 2010 10:13:38 +0200 Subject: fwk153: #i113914# set the new storage for duplicate libraries also --- sfx2/source/doc/objstor.cxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 6c4bdf56ba26..4b77ba4172db 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1917,7 +1917,25 @@ sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( bResult = SaveCompleted( xTmpStorage ); if ( bResult ) + { pImp->pBasicManager->setStorage( xTmpStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xTmpStorage ); + } + catch( uno::Exception& ) + {} + } } catch( uno::Exception& ) {} @@ -2063,6 +2081,22 @@ sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) // TODO/LATER: may be this code will be replaced, but not sure // Set storage in document library containers pImp->pBasicManager->setStorage( xStorage ); + + // Get rid of this workaround after issue i113914 is fixed + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xBasicLibraries( pImp->xBasicLibraries, uno::UNO_QUERY_THROW ); + xBasicLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} + try + { + uno::Reference< script::XStorageBasedLibraryContainer > xDialogLibraries( pImp->xDialogLibraries, uno::UNO_QUERY_THROW ); + xDialogLibraries->setRootStorage( xStorage ); + } + catch( uno::Exception& ) + {} } else { -- cgit From afb2f41ca982b7e0cbc8a5b4952ea3edfbb2a883 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 17 Aug 2010 16:46:36 +0200 Subject: cws sw33bf08: #i113584#, #i113587# transliteration fixed --- editeng/source/editeng/impedit.hxx | 3 + editeng/source/editeng/impedit4.cxx | 369 ++++++++++++++++++++++++++++++------ 2 files changed, 312 insertions(+), 60 deletions(-) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index ede5acacc698..c8f5e2948665 100755 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -1002,6 +1003,8 @@ public: void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); + short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); + void SetAsianCompressionMode( USHORT n ); USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 482cd6d71338..6f216f7b22ca 100755 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -76,6 +76,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -83,6 +86,8 @@ #include #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -2798,8 +2803,23 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW #endif // !SVX_LIGHT } + +struct TransliterationChgData +{ + USHORT nStart; + xub_StrLen nLen; + EditSelection aSelection; + String aNewText; + uno::Sequence< sal_Int32 > aOffsets; +}; + + EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ) { + uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); + if (!_xBI.is()) + return rSelection; + EditSelection aSel( rSelection ); aSel.Adjust( aEditDoc ); @@ -2808,8 +2828,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, EditSelection aNewSel( aSel ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + const USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + const USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); BOOL bChanges = FALSE; BOOL bLenChanged = FALSE; @@ -2832,83 +2852,266 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, USHORT nCurrentEnd = nEndPos; sal_uInt16 nLanguage = LANGUAGE_SYSTEM; - do - { - if ( bConsiderLanguage ) + // since we don't use Hiragana/Katakana or half-width/full-width transliterations here + // it is fine to use ANYWORD_IGNOREWHITESPACES. (ANY_WORD btw is broken and will + // occasionaly miss words in consecutive sentences). Also with ANYWORD_IGNOREWHITESPACES + // text like 'just-in-time' will be converted to 'Just-In-Time' which seems to be the + // proper thing to do. + const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES; + + //! In order to have less trouble with changing text size, e.g. because + //! of ligatures or � (German small sz) being resolved, we need to process + //! the text replacements from end to start. + //! This way the offsets for the yet to be changed words will be + //! left unchanged by the already replaced text. + //! For this we temporarily save the changes to be done in this vector + std::vector< TransliterationChgData > aChanges; + TransliterationChgData aChgData; + + if (nTransliterationMode == i18n::TransliterationModulesExtra::TITLE_CASE) + { + // for 'capitalize every word' we need to iterate over each word + + i18n::Boundary aSttBndry; + i18n::Boundary aEndBndry; + aSttBndry = _xBI->getWordBoundary( + *pNode, nStartPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ), + nWordType, TRUE /*prefer forward direction*/); + aEndBndry = _xBI->getWordBoundary( + *pNode, nEndPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ), + nWordType, FALSE /*prefer backward direction*/); + + // prevent backtracking to the previous word if selection is at word boundary + if (aSttBndry.endPos <= nStartPos) + { + aSttBndry = _xBI->nextWord( + *pNode, aSttBndry.endPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aSttBndry.endPos + 1 ) ) ), + nWordType); + } + // prevent advancing to the next word if selection is at word boundary + if (aEndBndry.startPos >= nEndPos) { - nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd ); - if ( nCurrentEnd > nEndPos ) - nCurrentEnd = nEndPos; + aEndBndry = _xBI->previousWord( + *pNode, aEndBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aEndBndry.startPos + 1 ) ) ), + nWordType); } - xub_StrLen nLen = nCurrentEnd - nCurrentStart; + i18n::Boundary aCurWordBndry( aSttBndry ); + while (aCurWordBndry.startPos <= aEndBndry.startPos) + { + nCurrentStart = (xub_StrLen)aCurWordBndry.startPos; + nCurrentEnd = (xub_StrLen)aCurWordBndry.endPos; + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( pNode->Copy( nCurrentStart, nLen ) ); +#endif + + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + nCurrentStart, nLen, &aOffsets )); + + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); + } +#if OSL_DEBUG_LEVEL > 1 + String aSelTxt ( GetSelected( aChgData.aSelection ) ); + (void) aSelTxt; +#endif + + aCurWordBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + nWordType); + } + DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" ); + } + else if (nTransliterationMode == i18n::TransliterationModulesExtra::SENTENCE_CASE) + { + // for 'sentence case' we need to iterate sentence by sentence + + sal_Int32 nLastStart = _xBI->beginOfSentence( + *pNode, nEndPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ) ); + sal_Int32 nLastEnd = _xBI->endOfSentence( + *pNode, nLastStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ) ); - Sequence aOffsets; - String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) ); + // extend nCurrentStart, nCurrentEnd to the current sentence boundaries + nCurrentStart = _xBI->beginOfSentence( + *pNode, nStartPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ) ); + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); - if( ( nLen != aNewText.Len() ) || !pNode->Equals( aNewText, nCurrentStart, nLen ) ) + // prevent backtracking to the previous sentence if selection starts at end of a sentence + if (nCurrentEnd <= nStartPos) { - bChanges = TRUE; - if ( nLen != aNewText.Len() ) - bLenChanged = TRUE; + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the next real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = _xBI->nextWord( *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + i18n::WordType::DICTIONARY_WORD); + + // now get new current sentence boundaries + nCurrentStart = _xBI->beginOfSentence( + *pNode, aBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); + } + // prevent advancing to the next sentence if selection ends at start of a sentence + if (nLastStart >= nEndPos) + { + // now nCurrentStart is probably located on a non-letter word. (unless we + // are in Asian text with no spaces...) + // Thus to get the real sentence start we should locate the previous real word, + // that is one found by DICTIONARY_WORD + i18n::Boundary aBndry = _xBI->previousWord( *pNode, nLastStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nLastStart + 1 ) ) ), + i18n::WordType::DICTIONARY_WORD); + nLastEnd = _xBI->endOfSentence( + *pNode, aBndry.startPos, + SvxCreateLocale( GetLanguage( EditPaM( pNode, aBndry.startPos + 1 ) ) ) ); + if (nCurrentEnd > nLastEnd) + nCurrentEnd = nLastEnd; + } -#ifndef SVX_LIGHT - // Create UndoAction on Demand.... - if ( !pUndo && IsUndoEnabled() && !IsInUndo() ) - { - ESelection aESel( CreateESel( aSel ) ); - pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode ); + while (nCurrentStart < nLastEnd) + { + sal_Int32 nLen = nCurrentEnd - nCurrentStart; + DBG_ASSERT( nLen > 0, "invalid word length of 0" ); +#if OSL_DEBUG_LEVEL > 1 + String aText( pNode->Copy( nCurrentStart, nLen ) ); +#endif - if ( ( nStartNode == nEndNode ) && !aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ) ) - pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) ); - else - pUndo->SetText( CreateBinTextObject( aSel, NULL ) ); + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, + GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ), + nCurrentStart, nLen, &aOffsets )); + + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } -#endif - // Change text without loosing the attributes - USHORT nCharsAfterTransliteration = - sal::static_int_cast< USHORT >(aOffsets.getLength()); - const sal_Int32* pOffsets = aOffsets.getConstArray(); - short nDiffs = 0; - for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ ) + i18n::Boundary aFirstWordBndry; + aFirstWordBndry = _xBI->nextWord( + *pNode, nCurrentEnd, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentEnd + 1 ) ) ), + nWordType); + nCurrentStart = aFirstWordBndry.startPos; + nCurrentEnd = _xBI->endOfSentence( + *pNode, nCurrentStart, + SvxCreateLocale( GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ) ) ); + } + DBG_ASSERT( nCurrentEnd >= nLastEnd, "failed to reach end of transliteration" ); + } + else + { + do + { + if ( bConsiderLanguage ) { - USHORT nCurrentPos = nCurrentStart+n; - sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n]; + nLanguage = GetLanguage( EditPaM( pNode, nCurrentStart+1 ), &nCurrentEnd ); + if ( nCurrentEnd > nEndPos ) + nCurrentEnd = nEndPos; + } - if ( !nDiff ) - { - DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); - pNode->SetChar( nCurrentPos, aNewText.GetChar(n) ); - } - else if ( nDiff < 0 ) - { - // Replace first char, delete the rest... - DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); - pNode->SetChar( nCurrentPos, aNewText.GetChar(n) ); + xub_StrLen nLen = nCurrentEnd - nCurrentStart; - DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" ); - GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) ); - } - else - { - DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." ); - GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), aNewText.GetChar(n) ); + Sequence< sal_Int32 > aOffsets; + String aNewText( aTranslitarationWrapper.transliterate( *pNode, nLanguage, nCurrentStart, nLen, &aOffsets ) ); - } - nDiffs = sal::static_int_cast< short >(nDiffs + nDiff); + if (!pNode->Equals( aNewText, nCurrentStart, nLen )) + { + aChgData.nStart = nCurrentStart; + aChgData.nLen = nLen; + aChgData.aSelection = EditSelection( EditPaM( pNode, nCurrentStart ), EditPaM( pNode, nCurrentEnd ) ); + aChgData.aNewText = aNewText; + aChgData.aOffsets = aOffsets; + aChanges.push_back( aChgData ); } - if ( nNode == nEndNode ) - aNewSel.Max().GetIndex() = - aNewSel.Max().GetIndex() + nDiffs; + nCurrentStart = nCurrentEnd; + } while( nCurrentEnd < nEndPos ); + } + + if (aChanges.size() > 0) + { +#ifndef SVX_LIGHT + // Create a single UndoAction on Demand for all the changes ... + if ( !pUndo && IsUndoEnabled() && !IsInUndo() ) + { + // adjust selection to include all changes + for (size_t i = 0; i < aChanges.size(); ++i) + { + const EditSelection &rSel = aChanges[i].aSelection; + if (aSel.Min().GetNode() == rSel.Min().GetNode() && + aSel.Min().GetIndex() > rSel.Min().GetIndex()) + aSel.Min().SetIndex( rSel.Min().GetIndex() ); + if (aSel.Max().GetNode() == rSel.Max().GetNode() && + aSel.Max().GetIndex() < rSel.Max().GetIndex()) + aSel.Max().SetIndex( rSel.Max().GetIndex() ); + } + aNewSel = aSel; + + ESelection aESel( CreateESel( aSel ) ); + pUndo = new EditUndoTransliteration( this, aESel, nTransliterationMode ); + + const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode(); + const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); + if (bSingleNode && !bHasAttribs) + pUndo->SetText( aSel.Min().GetNode()->Copy( aSel.Min().GetIndex(), aSel.Max().GetIndex()-aSel.Min().GetIndex() ) ); + else + pUndo->SetText( CreateBinTextObject( aSel, NULL ) ); + } +#endif + + // now apply the changes from end to start to leave the offsets of the + // yet unchanged text parts remain the same. + for (size_t i = 0; i < aChanges.size(); ++i) + { + const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; - ParaPortion* pParaPortion = GetParaPortions()[nNode]; - pParaPortion->MarkSelectionInvalid( nCurrentStart, std::max< USHORT >( nCurrentStart+nLen, nCurrentStart+aNewText.Len() ) ); + bChanges = TRUE; + if (rData.nLen != rData.aNewText.Len()) + bLenChanged = TRUE; + // Change text without loosing the attributes + USHORT nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(), + rData.nStart, rData.nLen, rData.aNewText, rData.aOffsets ); + + // adjust selection in end node to possibly changed size + if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode()) + aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs; + + USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() ); + ParaPortion* pParaPortion = GetParaPortions()[nSelNode]; + pParaPortion->MarkSelectionInvalid( rData.nStart, + std::max< USHORT >( rData.nStart + rData.nLen, + rData.nStart + rData.aNewText.Len() ) ); } - nCurrentStart = nCurrentEnd; - } while( nCurrentEnd < nEndPos ); + } // if (aChanges.size() > 0) } #ifndef SVX_LIGHT @@ -2932,6 +3135,52 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, return aNewSel; } + +short ImpEditEngine::ReplaceTextOnly( + ContentNode* pNode, + USHORT nCurrentStart, xub_StrLen nLen, + const String& rNewText, + const uno::Sequence< sal_Int32 >& rOffsets ) +{ + (void) nLen; + + // Change text without loosing the attributes + USHORT nCharsAfterTransliteration = + sal::static_int_cast< USHORT >(rOffsets.getLength()); + const sal_Int32* pOffsets = rOffsets.getConstArray(); + short nDiffs = 0; + for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ ) + { + USHORT nCurrentPos = nCurrentStart+n; + sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n]; + + if ( !nDiff ) + { + DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); + pNode->SetChar( nCurrentPos, rNewText.GetChar(n) ); + } + else if ( nDiff < 0 ) + { + // Replace first char, delete the rest... + DBG_ASSERT( nCurrentPos < pNode->Len(), "TransliterateText - String smaller than expected!" ); + pNode->SetChar( nCurrentPos, rNewText.GetChar(n) ); + + DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" ); + GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) ); + } + else + { + DBG_ASSERT( nDiff == 1, "TransliterateText - Diff other than expected! But should work..." ); + GetEditDoc().InsertText( EditPaM( pNode, nCurrentPos ), rNewText.GetChar(n) ); + + } + nDiffs = sal::static_int_cast< short >(nDiffs + nDiff); + } + + return nDiffs; +} + + void ImpEditEngine::SetAsianCompressionMode( USHORT n ) { if ( n != nAsianCompressionMode ) -- cgit From d40c2239e14027cef7c281830616c3deacbc9174 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 18 Aug 2010 10:52:09 +0200 Subject: fwk153: #i110127# Provide one instance of module accelerator manager in module ui configuration manager implementation. --- .../moduleuiconfigurationmanager.hxx | 1 + .../accelerators/acceleratorconfiguration.cxx | 5 +- .../moduleuiconfigurationmanager.cxx | 72 ++++++++++++---------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx index 9c5f9c89afe6..856746139b68 100644 --- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx +++ b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx @@ -219,6 +219,7 @@ namespace framework com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceManager; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager; + com::sun::star::uno::Reference< com::sun::star::uno::XInterface > m_xModuleAcceleratorManager; }; } diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index e63c41173df6..aae610f0e3dd 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -1246,12 +1246,13 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::changesOccurred(const css::util: if (! xHAccess.is ()) return; - const sal_Int32 c = aEvent.Changes.getLength(); + css::util::ChangesEvent aReceivedEvents( aEvent ); + const sal_Int32 c = aReceivedEvents.Changes.getLength(); sal_Int32 i = 0; for (i=0; i']/Key['']/Command[]" will // be interesting for use. Sometimes short path values are given also by the broadcaster ... but they must be ignored :-) diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 193bd63b5ad5..607efce4d4d6 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -776,26 +776,29 @@ void SAL_CALL ModuleUIConfigurationManager::dispose() throw (::com::sun::star::u css::lang::EventObject aEvent( xThis ); m_aListenerContainer.disposeAndClear( aEvent ); - { - ResetableGuard aGuard( m_aLock ); - try - { - if ( m_xModuleImageManager.is() ) - m_xModuleImageManager->dispose(); - } - catch ( Exception& ) - { - } + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ + ResetableGuard aGuard( m_aLock ); + Reference< XComponent > xModuleImageManager( m_xModuleImageManager ); + m_xModuleImageManager.clear(); + m_xModuleAcceleratorManager.clear(); + m_aUIElements[LAYER_USERDEFINED].clear(); + m_aUIElements[LAYER_DEFAULT].clear(); + m_xDefaultConfigStorage.clear(); + m_xUserConfigStorage.clear(); + m_xUserRootCommit.clear(); + m_bConfigRead = false; + m_bModified = false; + m_bDisposed = true; + aGuard.unlock(); + /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - m_xModuleImageManager.clear(); - m_aUIElements[LAYER_USERDEFINED].clear(); - m_aUIElements[LAYER_DEFAULT].clear(); - m_xDefaultConfigStorage.clear(); - m_xUserConfigStorage.clear(); - m_xUserRootCommit.clear(); - m_bConfigRead = false; - m_bModified = false; - m_bDisposed = true; + try + { + if ( xModuleImageManager.is() ) + xModuleImageManager->dispose(); + } + catch ( Exception& ) + { } } @@ -1370,30 +1373,35 @@ Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getImageManager() } return Reference< XInterface >( m_xModuleImageManager, UNO_QUERY ); - -// return Reference< XInterface >(); } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getShortCutManager() throw (::com::sun::star::uno::RuntimeException) { ResetableGuard aGuard( m_aLock ); + + if ( m_bDisposed ) + throw DisposedException(); + Reference< XMultiServiceFactory > xSMGR = m_xServiceManager; - ::rtl::OUString aModule = /*m_aModuleShortName*/m_aModuleIdentifier; - aGuard.unlock(); + ::rtl::OUString aModule = m_aModuleIdentifier; - Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); - Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); + if ( !m_xModuleAcceleratorManager.is() ) + { + Reference< XInterface > xManager = xSMGR->createInstance(SERVICENAME_MODULEACCELERATORCONFIGURATION); + Reference< XInitialization > xInit (xManager, UNO_QUERY_THROW); - PropertyValue aProp; - aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); - aProp.Value <<= aModule; + PropertyValue aProp; + aProp.Name = ::rtl::OUString::createFromAscii("ModuleIdentifier"); + aProp.Value <<= aModule; - Sequence< Any > lArgs(1); - lArgs[0] <<= aProp; + Sequence< Any > lArgs(1); + lArgs[0] <<= aProp; - xInit->initialize(lArgs); + xInit->initialize(lArgs); + m_xModuleAcceleratorManager = Reference< XInterface >( xManager, UNO_QUERY ); + } - return xManager; + return m_xModuleAcceleratorManager; } Reference< XInterface > SAL_CALL ModuleUIConfigurationManager::getEventsManager() throw (::com::sun::star::uno::RuntimeException) -- cgit From 668f998c88cc5e3a344dfc0693c0694d5121296a Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Wed, 18 Aug 2010 14:31:49 +0200 Subject: dv20:#i80759# Fixed a memory leak --- shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx old mode 100644 new mode 100755 index 3f495a7aa53d..13d1a57fefd8 --- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx +++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx @@ -237,14 +237,14 @@ HRESULT STDMETHODCALLTYPE CPropertyHdl::Initialize( IStream *pStream, DWORD grfM try { pMetaInfoReader = new CMetaInfoReader( (void*)pStream, &z_filefunc ); + LoadProperties( pMetaInfoReader ); + delete pMetaInfoReader; } catch (const std::exception& e) { OutputDebugStringFormat( "CPropertyHdl::Initialize: Caught exception [%s]", e.what() ); return E_FAIL; } - - LoadProperties( pMetaInfoReader ); /* // load extended properties and search content _LoadExtendedProperties(); -- cgit From 967756108a94191a992d38cc4866a5f2971f56f5 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Wed, 18 Aug 2010 16:43:38 +0200 Subject: fwk153: #i113674# replace backing component if there is one --- framework/inc/classes/framelistanalyzer.hxx | 25 +++++++++---------------- framework/prj/d.lst | 1 + framework/util/makefile.mk | 2 +- sfx2/source/view/viewfrm.cxx | 21 ++++++++++++++++++++- 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/framework/inc/classes/framelistanalyzer.hxx b/framework/inc/classes/framelistanalyzer.hxx index 518870b354f1..4ab3c4532cdc 100644 --- a/framework/inc/classes/framelistanalyzer.hxx +++ b/framework/inc/classes/framelistanalyzer.hxx @@ -28,13 +28,6 @@ #ifndef __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_ #define __FRAMEWORK_CLASSES_FRAMELISTANALYZER_HXX_ -//_______________________________________________ -// my own includes - -#include -#include -#include - //_______________________________________________ // interface includes #include @@ -88,10 +81,10 @@ class FrameListAnalyzer public: /** provides access to the frame container, which should be analyzed. */ - const css::uno::Reference< css::frame::XFramesSupplier >& m_xSupplier; + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& m_xSupplier; /** hold the reference frame, which is used e.g. to detect other frames with the same model. */ - const css::uno::Reference< css::frame::XFrame >& m_xReferenceFrame; + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& m_xReferenceFrame; /** enable/disable some special analyzing steps. see impl_analyze() for further informations. */ @@ -100,19 +93,19 @@ class FrameListAnalyzer /** contains all frames, which uses the same model like the reference frame. Will be filled only if m_eDetectMode has set the flag E_MODEL. The reference frame is never part of this list! */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lModelFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lModelFrames; /** contains all frames, which does not contain the same model like the reference frame. Filling of it can't be supressed by m_eDetectMode. The reference frame is never part of this list! All frames inside this list are visible ones. */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherVisibleFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherVisibleFrames; /** contains all frames, which does not contain the same model like the reference frame. Filling of it can't be supressed by m_eDetectMode. The reference frame is never part of this list! All frames inside this list are hidden ones. */ - css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > m_lOtherHiddenFrames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > > m_lOtherHiddenFrames; /** points to the help frame. Will be set only, if any other frame (means different from the reference frame) @@ -137,7 +130,7 @@ class FrameListAnalyzer Analyzing of the help frame ignores the visible state of any frame. But note: a hidden help frame indicates a wrong state! */ - css::uno::Reference< css::frame::XFrame > m_xHelp; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xHelp; /** points to the frame, which contains the backing component. Will be set only, if any other frame (means different from the reference frame) @@ -163,7 +156,7 @@ class FrameListAnalyzer Analyzing of the help frame ignores the visible state of any frame. But note: a hidden backing mode frame indicates a wrong state! */ - css::uno::Reference< css::frame::XFrame > m_xBackingComponent; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xBackingComponent; /** is set to true only, if the reference frame is a hidden one. This value is undefined if m_eDetectMode doesn't have set the flag E_HIDDEN! */ @@ -200,8 +193,8 @@ class FrameListAnalyzer analyze steps. Note: Some member values will be undefined, if an analyze step will be disabled. */ - FrameListAnalyzer( const css::uno::Reference< css::frame::XFramesSupplier >& xSupplier , - const css::uno::Reference< css::frame::XFrame >& xReferenceFrame , + FrameListAnalyzer( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFramesSupplier >& xSupplier , + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xReferenceFrame , sal_uInt32 eDetectMode ); virtual ~FrameListAnalyzer(); diff --git a/framework/prj/d.lst b/framework/prj/d.lst index 7f260f07cf65..fe6077f57bc8 100644 --- a/framework/prj/d.lst +++ b/framework/prj/d.lst @@ -42,6 +42,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar ..\inc\classes\menuextensionsupplier.hxx %_DEST%\inc%_EXT%\framework\menuextensionsupplier.hxx ..\inc\interaction\preventduplicateinteraction.hxx %_DEST%\inc%_EXT%\framework\preventduplicateinteraction.hxx ..\inc\helper\titlehelper.hxx %_DEST%\inc%_EXT%\framework\titlehelper.hxx +..\inc\classes\framelistanalyzer.hxx %_DEST%\inc%_EXT%\framework\framelistanalyzer.hxx ..\uiconfig\startmodule\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\menubar\*.xml ..\uiconfig\startmodule\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\toolbar\*.xml diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 91532cda76e2..edc5f67ce60a 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -50,7 +50,6 @@ LIB1OBJFILES= \ $(SLO)$/protocolhandlercache.obj \ $(SLO)$/networkdomain.obj \ $(SLO)$/configaccess.obj \ - $(SLO)$/framelistanalyzer.obj \ $(SLO)$/shareablemutex.obj \ $(SLO)$/itemcontainer.obj \ $(SLO)$/rootitemcontainer.obj \ @@ -99,6 +98,7 @@ LIB2OBJFILES= \ $(SLO)$/configimporter.obj \ $(SLO)$/menuextensionsupplier.obj \ $(SLO)$/preventduplicateinteraction.obj \ + $(SLO)$/framelistanalyzer.obj \ $(SLO)$/titlehelper.obj # --- import classes library --------------------------------------------------- diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ed924623c700..a7f5c9d16541 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -96,6 +96,7 @@ #include #include #include +#include #include @@ -2092,7 +2093,25 @@ SfxViewFrame* SfxViewFrame::LoadViewIntoFrame_Impl_NoThrow( const SfxObjectShell { ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); Reference < XFrame > xDesktop( aContext.createComponent( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); - xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + + if ( !i_bHidden ) + { + try + { + // if there is a backing component, use it + Reference< XFramesSupplier > xTaskSupplier( xDesktop , css::uno::UNO_QUERY_THROW ); + ::framework::FrameListAnalyzer aAnalyzer( xTaskSupplier, Reference< XFrame >(), ::framework::FrameListAnalyzer::E_BACKINGCOMPONENT ); + + if ( aAnalyzer.m_xBackingComponent.is() ) + xFrame = aAnalyzer.m_xBackingComponent; + } + catch( uno::Exception& ) + {} + } + + if ( !xFrame.is() ) + xFrame.set( xDesktop->findFrame( DEFINE_CONST_UNICODE("_blank"), 0 ), UNO_SET_THROW ); + bOwnFrame = true; } -- cgit From 3a3e4a7b24f97b14bfa1162e679d12e29bd6e878 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Thu, 19 Aug 2010 16:07:49 +0200 Subject: dv21:#i113524# No update menu entry for bundled extensions --- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 87f70e449b9d..44d1e30f74b6 100755 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -363,24 +363,28 @@ bool ExtBoxWithBtns_Impl::HandleTabKey( bool bReverse ) // ----------------------------------------------------------------------- MENU_COMMAND ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos ) { - if ( nPos >= (long) getItemCount() ) - return CMD_NONE; + if ( ( nPos >= 0 ) && ( nPos < (long) getItemCount() ) ) + { + if ( ! GetEntryData( nPos )->m_bLocked ) + { + PopupMenu aPopup; - PopupMenu aPopup; + aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) ); - aPopup.InsertItem( CMD_UPDATE, DialogHelper::getResourceString( RID_CTX_ITEM_CHECK_UPDATE ) ); + if ( GetEntryData( nPos )->m_bUser ) + { + if ( GetEntryData( nPos )->m_eState == REGISTERED ) + aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); + else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) + aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); + } - if ( ! GetEntryData( nPos )->m_bLocked ) - { - if ( GetEntryData( nPos )->m_eState == REGISTERED ) - aPopup.InsertItem( CMD_DISABLE, DialogHelper::getResourceString( RID_CTX_ITEM_DISABLE ) ); - else if ( GetEntryData( nPos )->m_eState != NOT_AVAILABLE ) - aPopup.InsertItem( CMD_ENABLE, DialogHelper::getResourceString( RID_CTX_ITEM_ENABLE ) ); + aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) ); - aPopup.InsertItem( CMD_REMOVE, DialogHelper::getResourceString( RID_CTX_ITEM_REMOVE ) ); + return (MENU_COMMAND) aPopup.Execute( this, rPos ); + } } - - return (MENU_COMMAND) aPopup.Execute( this, rPos ); + return CMD_NONE; } //------------------------------------------------------------------------------ -- cgit From 67cf4c70603a488816d62f116357aabe130c8b7f Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 19 Aug 2010 18:12:04 +0200 Subject: impress186: #i4499# added default resolution unit (metric/non-metric) depending to the tools/options setting --- officecfg/registry/schema/org/openoffice/Office/Common.xcs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 3284b34ef5f6..9bc07c592f0f 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -4403,8 +4403,13 @@ pixels + + + default (depends to the metric settings in tools/options) + + - 5 + -1 @@ -4478,8 +4483,13 @@ pica + + + default (depends to the metric settings in tools/options) + + - 2 + -1 -- cgit From 42388c96d2d15b636507fc14f75f827916ef24b9 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 20 Aug 2010 09:32:17 +0200 Subject: jl158 #i114008# extension can now contain compiled help. Then XPackage::getRegistrationDataURL points to the help folder within the extension --- .../source/deployment/registry/help/dp_help.cxx | 406 ++++++++++++--------- 1 file changed, 233 insertions(+), 173 deletions(-) diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index bc17a1f7163d..5a5efe825cfb 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -80,6 +80,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend ::rtl::Reference const & abortChannel, Reference const & xCmdEnv ); + bool extensionContainsCompiledHelp(); public: PackageImpl( ::rtl::Reference const & myBackend, @@ -100,7 +101,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference const & xCmdEnv ); void implProcessHelp( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, - Reference const & xCmdEnv); + bool compiledHelp, Reference const & xCmdEnv); void implCollectXhpFiles( const rtl::OUString& aDir, std::vector< rtl::OUString >& o_rXhpFileVector ); @@ -259,6 +260,57 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const return pBackend; } + +bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() +{ + bool bCompiled = true; + rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl(getURL()); + + ::osl::Directory helpFolder(aExpandedHelpURL); + if ( helpFolder.open() == ::osl::File::E_None) + { + //iterate over the contents of the help folder + //We assume that all folders withing the help folder contain language specific + //help files. If just one of them does not contain compiled help then this + //function returns false. + ::osl::DirectoryItem item; + ::osl::File::RC errorNext = ::osl::File::E_None; + while ((errorNext = helpFolder.getNextItem(item)) == ::osl::File::E_None) + { + //No find the language folders + ::osl::FileStatus stat(FileStatusMask_Type | FileStatusMask_FileName |FileStatusMask_FileURL); + if (item.getFileStatus(stat) == ::osl::File::E_None) + { + if (stat.getFileType() != ::osl::FileStatus::Directory) + continue; + + //look if there is the folder help.idxl in the language folder + OUString compUrl(stat.getFileURL() + OUSTR("/help.idxl")); + ::osl::Directory compiledFolder(compUrl); + if (compiledFolder.open() != ::osl::File::E_None) + { + bCompiled = false; + break; + } + } + else + { + //Error + OSL_ASSERT(0); + bCompiled = false; + break; + } + } + if (errorNext != ::osl::File::E_NOENT + && errorNext != ::osl::File::E_None) + { + //Error + OSL_ASSERT(0); + bCompiled = false; + } + } + return bCompiled; +} //______________________________________________________________________________ beans::Optional< beans::Ambiguous > BackendImpl::PackageImpl::isRegistered_( @@ -289,7 +341,8 @@ void BackendImpl::PackageImpl::processPackage_( BackendImpl* that = getMyBackend(); Reference< deployment::XPackage > xThisPackage( this ); - that->implProcessHelp( xThisPackage, doRegisterPackage, xCmdEnv); + that->implProcessHelp( xThisPackage, doRegisterPackage, + extensionContainsCompiledHelp(), xCmdEnv); } beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() @@ -316,213 +369,220 @@ static rtl::OUString aHelpStr( rtl::OUString::createFromAscii( "help" ) ); void BackendImpl::implProcessHelp -( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, +( Reference< deployment::XPackage > xPackage, bool doRegisterPackage, bool compiledHelp, Reference const & xCmdEnv) { OSL_ASSERT(xPackage.is()); if (doRegisterPackage) { HelpBackendDb::Data data; - const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); - data.dataUrl = sHelpFolder; - - Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); - rtl::OUString aHelpURL = xPackage->getURL(); - rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); - rtl::OUString aName = xPackage->getName(); - if( !xSFA->isFolder( aExpandedHelpURL ) ) + + if (compiledHelp) { - rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); - aErrStr += rtl::OUString::createFromAscii( "No help folder" ); - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + data.dataUrl = xPackage->getURL(); } - - Reference const & xContext = getComponentContext(); - Reference< script::XInvocation > xInvocation; - if( xContext.is() ) + else { - try + const OUString sHelpFolder = createFolder(OUString(), xCmdEnv); + data.dataUrl = sHelpFolder; + + Reference< ucb::XSimpleFileAccess > xSFA = getFileAccess(); + rtl::OUString aHelpURL = xPackage->getURL(); + rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl( aHelpURL ); + rtl::OUString aName = xPackage->getName(); + if( !xSFA->isFolder( aExpandedHelpURL ) ) { - xInvocation = Reference< script::XInvocation >( - xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( - "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + rtl::OUString aErrStr = getResourceString( RID_STR_HELPPROCESSING_GENERAL_ERROR ); + aErrStr += rtl::OUString::createFromAscii( "No help folder" ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); } - catch (Exception &) + + Reference const & xContext = getComponentContext(); + Reference< script::XInvocation > xInvocation; + if( xContext.is() ) { - // i98680: Survive missing lucene + try + { + xInvocation = Reference< script::XInvocation >( + xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( + "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); + } + catch (Exception &) + { + // i98680: Survive missing lucene + } } - } - // Scan languages - Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); - sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); - const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); - for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) - { - rtl::OUString aLangURL = pSeq[iLang]; - if( xSFA->isFolder( aLangURL ) ) + // Scan languages + Sequence< rtl::OUString > aLanguageFolderSeq = xSFA->getFolderContents( aExpandedHelpURL, true ); + sal_Int32 nLangCount = aLanguageFolderSeq.getLength(); + const rtl::OUString* pSeq = aLanguageFolderSeq.getConstArray(); + for( sal_Int32 iLang = 0 ; iLang < nLangCount ; ++iLang ) { - std::vector< rtl::OUString > aXhpFileVector; - - // calculate jar file URL - sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); - // for example "/en" - OUString langFolderURLSegment( - aLangURL.copy( - indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); - - //create the folder in the "temporary folder" - ::ucbhelper::Content langFolderContent; - const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); - const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); - ::dp_misc::create_folder( - &langFolderContent, - langFolderDest, xCmdEnv); - - rtl::OUString aJarFile( - makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + - OUSTR(".jar"))); - aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); - - rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( - aJarFile, rtl_UriCharClassPchar, - rtl_UriEncodeIgnoreEscapes, - RTL_TEXTENCODING_UTF8 ); - rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); - aDestBasePath += aEncodedJarFilePath; - aDestBasePath += rtl::OUString::createFromAscii( "/" ); - - sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; - - Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); - sal_Int32 nSubLangCount = aSubLangSeq.getLength(); - const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); - for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + rtl::OUString aLangURL = pSeq[iLang]; + if( xSFA->isFolder( aLangURL ) ) { - rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; - if( !xSFA->isFolder( aSubFolderURL ) ) - continue; + std::vector< rtl::OUString > aXhpFileVector; + + // calculate jar file URL + sal_Int32 indexStartSegment = aLangURL.lastIndexOf('/'); + // for example "/en" + OUString langFolderURLSegment( + aLangURL.copy( + indexStartSegment + 1, aLangURL.getLength() - indexStartSegment - 1)); + + //create the folder in the "temporary folder" + ::ucbhelper::Content langFolderContent; + const OUString langFolderDest = makeURL(sHelpFolder, langFolderURLSegment); + const OUString langFolderDestExpanded = ::dp_misc::expandUnoRcUrl(langFolderDest); + ::dp_misc::create_folder( + &langFolderContent, + langFolderDest, xCmdEnv); + + rtl::OUString aJarFile( + makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + + OUSTR(".jar"))); + aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); + + rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( + aJarFile, rtl_UriCharClassPchar, + rtl_UriEncodeIgnoreEscapes, + RTL_TEXTENCODING_UTF8 ); + rtl::OUString aDestBasePath = rtl::OUString::createFromAscii( "vnd.sun.star.pkg://" ); + aDestBasePath += aEncodedJarFilePath; + aDestBasePath += rtl::OUString::createFromAscii( "/" ); + + sal_Int32 nLenLangFolderURL = aLangURL.getLength() + 1; + + Sequence< rtl::OUString > aSubLangSeq = xSFA->getFolderContents( aLangURL, true ); + sal_Int32 nSubLangCount = aSubLangSeq.getLength(); + const rtl::OUString* pSubLangSeq = aSubLangSeq.getConstArray(); + for( sal_Int32 iSubLang = 0 ; iSubLang < nSubLangCount ; ++iSubLang ) + { + rtl::OUString aSubFolderURL = pSubLangSeq[iSubLang]; + if( !xSFA->isFolder( aSubFolderURL ) ) + continue; - implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); + implCollectXhpFiles( aSubFolderURL, aXhpFileVector ); - // Copy to package (later: move?) - rtl::OUString aDestPath = aDestBasePath; - rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); - aDestPath += aPureFolderName; - xSFA->copy( aSubFolderURL, aDestPath ); - } + // Copy to package (later: move?) + rtl::OUString aDestPath = aDestBasePath; + rtl::OUString aPureFolderName = aSubFolderURL.copy( nLenLangFolderURL ); + aDestPath += aPureFolderName; + xSFA->copy( aSubFolderURL, aDestPath ); + } - // Call compiler - sal_Int32 nXhpFileCount = aXhpFileVector.size(); - rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - { - rtl::OUString aXhpFile = aXhpFileVector[iXhp]; - rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); - pXhpFiles[iXhp] = aXhpRelFile; - } + // Call compiler + sal_Int32 nXhpFileCount = aXhpFileVector.size(); + rtl::OUString* pXhpFiles = new rtl::OUString[nXhpFileCount]; + for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) + { + rtl::OUString aXhpFile = aXhpFileVector[iXhp]; + rtl::OUString aXhpRelFile = aXhpFile.copy( nLenLangFolderURL ); + pXhpFiles[iXhp] = aXhpRelFile; + } - rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); - rtl::OUString aOfficeHelpPathFileURL; - ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); + rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); + rtl::OUString aOfficeHelpPathFileURL; + ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); - HelpProcessingErrorInfo aErrorInfo; - bool bSuccess = compileExtensionHelp( - aOfficeHelpPathFileURL, aHelpStr, aLangURL, - nXhpFileCount, pXhpFiles, - langFolderDestExpanded, aErrorInfo ); + HelpProcessingErrorInfo aErrorInfo; + bool bSuccess = compileExtensionHelp( + aOfficeHelpPathFileURL, aHelpStr, aLangURL, + nXhpFileCount, pXhpFiles, + langFolderDestExpanded, aErrorInfo ); - if( bSuccess && xInvocation.is() ) - { - Sequence aParamsSeq( 6 ); - - aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); - - rtl::OUString aLang; - sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); - if( nLastSlash != -1 ) - aLang = aLangURL.copy( nLastSlash + 1 ); - else - aLang = rtl::OUString::createFromAscii( "en" ); - aParamsSeq[1] = uno::makeAny( aLang ); - - aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); - aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); - - aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); - rtl::OUString aSystemPath; - osl::FileBase::getSystemPathFromFileURL( - langFolderDestExpanded, aSystemPath ); - aParamsSeq[5] = uno::makeAny( aSystemPath ); - - Sequence< sal_Int16 > aOutParamIndex; - Sequence< uno::Any > aOutParam; - uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), - aParamsSeq, aOutParamIndex, aOutParam ); - } - - if( !bSuccess ) - { - USHORT nErrStrId = 0; - switch( aErrorInfo.m_eErrorClass ) + if( bSuccess && xInvocation.is() ) { - case HELPPROCESSING_GENERAL_ERROR: - case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; - case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; - default: ; - }; - - rtl::OUString aErrStr; - if( nErrStrId != 0 ) + Sequence aParamsSeq( 6 ); + + aParamsSeq[0] = uno::makeAny( rtl::OUString::createFromAscii( "-lang" ) ); + + rtl::OUString aLang; + sal_Int32 nLastSlash = aLangURL.lastIndexOf( '/' ); + if( nLastSlash != -1 ) + aLang = aLangURL.copy( nLastSlash + 1 ); + else + aLang = rtl::OUString::createFromAscii( "en" ); + aParamsSeq[1] = uno::makeAny( aLang ); + + aParamsSeq[2] = uno::makeAny( rtl::OUString::createFromAscii( "-mod" ) ); + aParamsSeq[3] = uno::makeAny( rtl::OUString::createFromAscii( "help" ) ); + + aParamsSeq[4] = uno::makeAny( rtl::OUString::createFromAscii( "-zipdir" ) ); + rtl::OUString aSystemPath; + osl::FileBase::getSystemPathFromFileURL( + langFolderDestExpanded, aSystemPath ); + aParamsSeq[5] = uno::makeAny( aSystemPath ); + + Sequence< sal_Int16 > aOutParamIndex; + Sequence< uno::Any > aOutParam; + uno::Any aRet = xInvocation->invoke( rtl::OUString::createFromAscii( "createIndex" ), + aParamsSeq, aOutParamIndex, aOutParam ); + } + + if( !bSuccess ) { - aErrStr = getResourceString( nErrStrId ); - - // Remoce CR/LF - rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); - sal_Unicode nCR = 13, nLF = 10; - sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); - sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); - sal_Int32 nCopy; - if( nSearchCR != -1 || nSearchLF != -1 ) + USHORT nErrStrId = 0; + switch( aErrorInfo.m_eErrorClass ) { - if( nSearchCR == -1 ) - nCopy = nSearchLF; - else if( nSearchLF == -1 ) - nCopy = nSearchCR; - else - nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; - - aErrMsg = aErrMsg.copy( 0, nCopy ); - } - aErrStr += aErrMsg; - if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) + case HELPPROCESSING_GENERAL_ERROR: + case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; + case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; + default: ; + }; + + rtl::OUString aErrStr; + if( nErrStrId != 0 ) { - aErrStr += rtl::OUString::createFromAscii( " in " ); - - rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, - rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); - aErrStr += aDecodedFile; - if( aErrorInfo.m_nXMLParsingLine != -1 ) + aErrStr = getResourceString( nErrStrId ); + + // Remoce CR/LF + rtl::OUString aErrMsg( aErrorInfo.m_aErrorMsg ); + sal_Unicode nCR = 13, nLF = 10; + sal_Int32 nSearchCR = aErrMsg.indexOf( nCR ); + sal_Int32 nSearchLF = aErrMsg.indexOf( nLF ); + sal_Int32 nCopy; + if( nSearchCR != -1 || nSearchLF != -1 ) { - aErrStr += rtl::OUString::createFromAscii( ", line " ); - aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + if( nSearchCR == -1 ) + nCopy = nSearchLF; + else if( nSearchLF == -1 ) + nCopy = nSearchCR; + else + nCopy = ( nSearchCR < nSearchLF ) ? nSearchCR : nSearchLF; + + aErrMsg = aErrMsg.copy( 0, nCopy ); + } + aErrStr += aErrMsg; + if( nErrStrId == RID_STR_HELPPROCESSING_XMLPARSING_ERROR && aErrorInfo.m_aXMLParsingFile.getLength() ) + { + aErrStr += rtl::OUString::createFromAscii( " in " ); + + rtl::OUString aDecodedFile = rtl::Uri::decode( aErrorInfo.m_aXMLParsingFile, + rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); + aErrStr += aDecodedFile; + if( aErrorInfo.m_nXMLParsingLine != -1 ) + { + aErrStr += rtl::OUString::createFromAscii( ", line " ); + aErrStr += ::rtl::OUString::valueOf( aErrorInfo.m_nXMLParsingLine ); + } } } - } - OWeakObject* oWeakThis = static_cast(this); - throw deployment::DeploymentException( rtl::OUString(), oWeakThis, - makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + OWeakObject* oWeakThis = static_cast(this); + throw deployment::DeploymentException( rtl::OUString(), oWeakThis, + makeAny( uno::Exception( aErrStr, oWeakThis ) ) ); + } } } } - //Writing the data entry replaces writing the flag file. If we got to this //point the registration was successful. addDataToDb(xPackage->getURL(), data); - } + } //if (doRegisterPackage) else { deleteDataFromDb(xPackage->getURL()); -- cgit From a3e4f420ddbdf082284d79551d2333c95e09f857 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 20 Aug 2010 12:33:43 +0200 Subject: cws tl82: #i113440# string resource fixed --- sfx2/source/dialog/securitypage.src | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 sfx2/source/dialog/securitypage.src diff --git a/sfx2/source/dialog/securitypage.src b/sfx2/source/dialog/securitypage.src old mode 100644 new mode 100755 index fee60404d01c..ee334234c802 --- a/sfx2/source/dialog/securitypage.src +++ b/sfx2/source/dialog/securitypage.src @@ -79,9 +79,9 @@ TabPage TP_DOCINFOSECURITY Pos = MAP_APPFONT( 12, 48 ); Size = MAP_APPFONT( 236, 3 * RSC_CD_FIXEDTEXT_HEIGHT ); Text [ en-US ] = - "Note: After a password has been set, the document will only open "\ - "with the password. Should you lose the password, there will be "\ - "no way to recover the document. Please also note that this password "\ + "Note: After a password has been set, the document will only open " + "with the password. Should you lose the password, there will be " + "no way to recover the document. Please also note that this password " "is case-sensitive."; WordBreak = TRUE; }; -- cgit From be84c56ceffdf5e1bdade35611b15f8e76379818 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 23 Aug 2010 12:46:11 +0200 Subject: fwk154: #i114014# Fix problem with check box 'Remember Password' in login dialog --- uui/source/iahndl-authentication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 uui/source/iahndl-authentication.cxx diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx old mode 100755 new mode 100644 index 73fa61f31ff4..1e9a4e6837d3 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -270,7 +270,7 @@ handleAuthenticationRequest_( aInfo.SetCanRememberPassword( ePreferredRememberMode != eAlternateRememberMode); aInfo.SetIsRememberPassword( - eDefaultRememberMode != ucb::RememberAuthentication_NO); + ePreferredRememberMode != eDefaultRememberMode); aInfo.SetIsRememberPersistent( ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); -- cgit From d1102d84dad39c9b9009c59fa27e5d3bf30a4804 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Mon, 23 Aug 2010 13:43:42 +0200 Subject: fwk154: #i114014# Use correct compare statement --- uui/source/iahndl-authentication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 1e9a4e6837d3..95c2b45749ac 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -270,7 +270,7 @@ handleAuthenticationRequest_( aInfo.SetCanRememberPassword( ePreferredRememberMode != eAlternateRememberMode); aInfo.SetIsRememberPassword( - ePreferredRememberMode != eDefaultRememberMode); + ePreferredRememberMode == eDefaultRememberMode); aInfo.SetIsRememberPersistent( ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); -- cgit From f599db7be582daf55c0643a04198932e0470c44a Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 24 Aug 2010 17:53:12 +0200 Subject: fwk154: i114090: adapt listener code to reflect changes in config mgr, notification of change events --- ucb/source/core/ucb.cxx | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index c13ec9d367c8..4c4539080a13 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -647,28 +647,10 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& sal_Int32 nCount = Event.Changes.getLength(); if ( nCount ) { + uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess; + Event.Base >>= xHierNameAccess; - uno::Reference< lang::XMultiServiceFactory > xConfigProv( - m_xSMgr->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) ), - uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name - = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); - aProperty.Value <<= Event.Base; - aArguments[ 0 ] <<= aProperty; - - uno::Reference< uno::XInterface > xInterface( - xConfigProv->createInstanceWithArguments( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationAccess" ) ), - aArguments ) ); - - uno::Reference< container::XHierarchicalNameAccess > - xHierNameAccess( xInterface, uno::UNO_QUERY_THROW ); + OSL_ASSERT( xHierNameAccess.is() ); const util::ElementChange* pElementChanges = Event.Changes.getConstArray(); -- cgit From 0859f99410f579d393f847e0fa6552cde6d9a35f Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 25 Aug 2010 14:08:27 +0200 Subject: sb130: #i113096# fixed TODO in configmgr::Broadcaster::send (to ease debugging) --- configmgr/source/broadcaster.cxx | 63 ++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx index bb77039dcc8f..ab59d333d6d3 100644 --- a/configmgr/source/broadcaster.cxx +++ b/configmgr/source/broadcaster.cxx @@ -32,13 +32,17 @@ #include "com/sun/star/beans/XPropertyChangeListener.hpp" #include "com/sun/star/container/XContainerListener.hpp" #include "com/sun/star/lang/DisposedException.hpp" +#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/lang/XEventListener.hpp" +#include "com/sun/star/uno/Any.hxx" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/XInterface.hpp" #include "com/sun/star/util/XChangesListener.hpp" +#include "cppuhelper/exc_hlp.hxx" #include "osl/diagnose.hxx" +#include "rtl/string.h" +#include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" @@ -50,6 +54,13 @@ namespace { namespace css = com::sun::star; +void appendMessage( + rtl::OUStringBuffer & buffer, css::uno::Exception const & exception) +{ + buffer.appendAscii(RTL_CONSTASCII_STRINGPARAM("; ")); + buffer.append(exception.Message); +} + } void Broadcaster::addDisposeNotification( @@ -108,14 +119,16 @@ void Broadcaster::addChangesNotification( } void Broadcaster::send() { - bool exception = false; + css::uno::Any exception; + rtl::OUStringBuffer messages; for (DisposeNotifications::iterator i(disposeNotifications_.begin()); i != disposeNotifications_.end(); ++i) { try { i->listener->disposing(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -125,8 +138,9 @@ void Broadcaster::send() { try { i->listener->elementInserted(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -136,8 +150,9 @@ void Broadcaster::send() { try { i->listener->elementRemoved(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ContainerNotifications::iterator i( @@ -147,8 +162,9 @@ void Broadcaster::send() { try { i->listener->elementReplaced(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (PropertyChangeNotifications::iterator i( @@ -158,8 +174,9 @@ void Broadcaster::send() { try { i->listener->propertyChange(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (PropertiesChangeNotifications::iterator i( @@ -169,8 +186,9 @@ void Broadcaster::send() { try { i->listener->propertiesChange(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } for (ChangesNotifications::iterator i(changesNotifications_.begin()); @@ -178,16 +196,19 @@ void Broadcaster::send() { try { i->listener->changesOccurred(i->event); } catch (css::lang::DisposedException &) { - } catch (css::uno::Exception &) { - exception = true; + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); } } - if (exception) { //TODO - throw css::uno::RuntimeException( - rtl::OUString( + if (exception.hasValue()) { + throw css::lang::WrappedTargetRuntimeException( + (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "configmgr exceptions during listener notification")), - css::uno::Reference< css::uno::XInterface >()); + "configmgr exceptions during listener notification")) + + messages.makeStringAndClear()), + css::uno::Reference< css::uno::XInterface >(), + exception); } } -- cgit From 0da24e667613be2f480b57fce3519295ed0eea26 Mon Sep 17 00:00:00 2001 From: Juergen Schmidt Date: Tue, 24 Aug 2010 17:53:12 +0200 Subject: fwk154: i114090: adapt listener code to reflect changes in config mgr, notification of change events (transplanted from 7c0cad639e0b6d74f4be88f5877270f1a8b9fa53) --- ucb/source/core/ucb.cxx | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index c13ec9d367c8..4c4539080a13 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -647,28 +647,10 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& sal_Int32 nCount = Event.Changes.getLength(); if ( nCount ) { + uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess; + Event.Base >>= xHierNameAccess; - uno::Reference< lang::XMultiServiceFactory > xConfigProv( - m_xSMgr->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) ), - uno::UNO_QUERY_THROW ); - - uno::Sequence< uno::Any > aArguments( 1 ); - beans::PropertyValue aProperty; - aProperty.Name - = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); - aProperty.Value <<= Event.Base; - aArguments[ 0 ] <<= aProperty; - - uno::Reference< uno::XInterface > xInterface( - xConfigProv->createInstanceWithArguments( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationAccess" ) ), - aArguments ) ); - - uno::Reference< container::XHierarchicalNameAccess > - xHierNameAccess( xInterface, uno::UNO_QUERY_THROW ); + OSL_ASSERT( xHierNameAccess.is() ); const util::ElementChange* pElementChanges = Event.Changes.getConstArray(); -- cgit From 4c53df43b4cd3f3104a090e95d82fe695ff22a75 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Wed, 25 Aug 2010 08:25:36 +0200 Subject: fwk154#i114083# fixed some file properies for the Oracle Open Office executables --- desktop/util/verinfo.rc | 8 ++++---- desktop/win32/source/applauncher/ooo/verinfo.rc | 4 ++-- desktop/win32/source/applauncher/verinfo.rc | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 desktop/util/verinfo.rc mode change 100644 => 100755 desktop/win32/source/applauncher/ooo/verinfo.rc mode change 100644 => 100755 desktop/win32/source/applauncher/verinfo.rc diff --git a/desktop/util/verinfo.rc b/desktop/util/verinfo.rc old mode 100644 new mode 100755 index 038953f2aa79..7d589956ec83 --- a/desktop/util/verinfo.rc +++ b/desktop/util/verinfo.rc @@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo block "040704E4" { // German StringTable - value "CompanyName", "Oracle, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" { // International StringTable - value "CompanyName", "Oracle, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", "SOFFICE.EXE\0" value "InternalName", "SOFFICE\0" - value "LegalCopyright", S_CRIGHT " Oracle, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } diff --git a/desktop/win32/source/applauncher/ooo/verinfo.rc b/desktop/win32/source/applauncher/ooo/verinfo.rc old mode 100644 new mode 100755 index ce698ba80333..c13e723527fc --- a/desktop/win32/source/applauncher/ooo/verinfo.rc +++ b/desktop/win32/source/applauncher/ooo/verinfo.rc @@ -69,7 +69,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" @@ -81,7 +81,7 @@ VS_VERSION_INFO versioninfo value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } diff --git a/desktop/win32/source/applauncher/verinfo.rc b/desktop/win32/source/applauncher/verinfo.rc old mode 100644 new mode 100755 index 0db55c58c4b2..c0ff71494014 --- a/desktop/win32/source/applauncher/verinfo.rc +++ b/desktop/win32/source/applauncher/verinfo.rc @@ -68,25 +68,25 @@ VS_VERSION_INFO versioninfo block "040704E4" { // German StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #else block "040904E4" { // International StringTable - value "CompanyName", "Sun Microsystems, Inc.\0" + value "CompanyName", "Oracle\0" value "FileDescription", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\0" value "FileVersion", PPS(VER_LEVEL) "\0" value "ProductVersion", PPS(VER_LEVEL) "\0" value "OriginalFilename", PPS(RES_APP_NAME) ".exe\0" value "InternalName", PPS(RES_APP_NAME) "\0" - value "LegalCopyright", S_CRIGHT " Sun Microsystems, Inc.\0" + value "LegalCopyright", S_CRIGHT " Oracle and/or its affiliates. All rights reserved.\0" } #endif } -- cgit From 081f3c9e3fd4e3491994028e6b5eb19ff3ed7018 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 25 Aug 2010 13:29:38 +0200 Subject: fs33a: when all panels claim to be invisible, make the first one visible --- sfx2/source/dialog/taskpane.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index f25485a1401c..5d763f81744d 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -584,6 +584,7 @@ namespace sfx2 return; ::rtl::OUString sFirstVisiblePanelResource; + ::rtl::OUString sFirstPanelResource; const Sequence< ::rtl::OUString > aUIElements( aWindowStateConfig.getNodeNames() ); for ( const ::rtl::OUString* resource = aUIElements.getConstArray(); @@ -594,6 +595,8 @@ namespace sfx2 if ( !impl_isToolPanelResource( *resource ) ) continue; + sFirstPanelResource = *resource; + ::utl::OConfigurationNode aResourceNode( aWindowStateConfig.openNode( *resource ) ); ::svt::PToolPanel pCustomPanel( new CustomToolPanel( aResourceNode, m_xFrame ) ); @@ -620,6 +623,9 @@ namespace sfx2 sFirstVisiblePanelResource = *resource; } + if ( sFirstVisiblePanelResource.getLength() == 0 ) + sFirstVisiblePanelResource = sFirstPanelResource; + if ( sFirstVisiblePanelResource.getLength() ) { ::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) ); -- cgit From c280c618ed45e9105d00e8db76a324efc7e188d4 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 25 Aug 2010 14:39:15 +0200 Subject: cws tl82: #i114087# uno slot name fixed --- officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu old mode 100644 new mode 100755 index 7570fda066ca..4ed9be5a3d27 --- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu @@ -38,7 +38,7 @@ ~Text Mode - + ~Import Formula... -- cgit From d7fd47ed54f42d353c375d171350cfe81c307414 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 13:26:56 +0200 Subject: sb130: #i113096# previous change contained an error in configmgr::Components::removeExtensionXcuFile --- configmgr/source/components.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 733ca05bc147..e76460de5b64 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -290,6 +290,7 @@ void Components::removeExtensionXcuFile( // item->additions records all additions of set members in textual order, // the latter check works well when iterating through item->additions in // reverse order. + OSL_ASSERT(modifications != 0); rtl::Reference< Data::ExtensionXcu > item( data_.removeExtensionXcuAdditions(fileUri)); if (item.is()) { @@ -315,6 +316,7 @@ void Components::removeExtensionXcuFile( node->kind() == Node::KIND_SET); if (hasOnlyEmptySets(node)) { parent->getMembers().erase(i->back()); + addModification(*i); modifications->add(*i); } } -- cgit From abccae0c72bb7ec1b813653b256fe34ffb047279 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 13:28:53 +0200 Subject: sb130: #i113096# UniversalContentBroker::changesOccurred is now also called for removed items --- ucb/source/core/ucb.cxx | 127 ++++++++++++++++++++++++++++-------------------- ucb/source/core/ucb.hxx | 6 --- 2 files changed, 74 insertions(+), 59 deletions(-) diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 4c4539080a13..30f7e32f3828 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -182,6 +183,63 @@ void makeAndAppendXMLName( } } +bool createContentProviderData( + const rtl::OUString & rProvider, + const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess, + ContentProviderData & rInfo) +{ + // Obtain service name. + rtl::OUStringBuffer aKeyBuffer (rProvider); + aKeyBuffer.appendAscii( "/ServiceName" ); + + rtl::OUString aValue; + try + { + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + } + catch (container::NoSuchElementException &) + { + return false; + } + + rInfo.ServiceName = aValue; + + // Obtain URL Template. + aKeyBuffer.append(rProvider); + aKeyBuffer.appendAscii( "/URLTemplate" ); + + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + + rInfo.URLTemplate = aValue; + + // Obtain Arguments. + aKeyBuffer.append(rProvider); + aKeyBuffer.appendAscii( "/Arguments" ); + + if ( !( rxHierNameAccess->getByHierarchicalName( + aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) + { + OSL_ENSURE( false, + "UniversalContentBroker::getContentProviderData - " + "Error getting item value!" ); + } + + rInfo.Arguments = aValue; + return true; +} + } //========================================================================= @@ -664,9 +722,18 @@ void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& ContentProviderData aInfo; - createContentProviderData(aKey, xHierNameAccess, aInfo); - - aData.push_back(aInfo); + // Removal of UCPs from the configuration leads to changesOccurred + // notifications, too, but it is hard to tell for a given + // ElementChange whether it is an addition or a removal, so as a + // heuristic consider as removals those that cause a + // NoSuchElementException in createContentProviderData. + // + // For now, removal of UCPs from the configuration is simply ignored + // (and not reflected in the UCB's data structures): + if (createContentProviderData(aKey, xHierNameAccess, aInfo)) + { + aData.push_back(aInfo); + } } prepareAndRegister(aData); @@ -834,7 +901,10 @@ bool UniversalContentBroker::getContentProviderData( makeAndAppendXMLName( aElemBuffer, pElems[ n ] ); aElemBuffer.appendAscii( "']" ); - createContentProviderData(aElemBuffer.makeStringAndClear(), xHierNameAccess, aInfo); + OSL_VERIFY( + createContentProviderData( + aElemBuffer.makeStringAndClear(), xHierNameAccess, + aInfo)); rListToFill.push_back( aInfo ); } @@ -866,55 +936,6 @@ bool UniversalContentBroker::getContentProviderData( return true; } -void UniversalContentBroker::createContentProviderData( - const rtl::OUString & rProvider, - const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess, - ContentProviderData & rInfo) -{ - // Obtain service name. - rtl::OUStringBuffer aKeyBuffer (rProvider); - aKeyBuffer.appendAscii( "/ServiceName" ); - - rtl::OUString aValue; - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.ServiceName = aValue; - - // Obtain URL Template. - aKeyBuffer.append(rProvider); - aKeyBuffer.appendAscii( "/URLTemplate" ); - - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.URLTemplate = aValue; - - // Obtain Arguments. - aKeyBuffer.append(rProvider); - aKeyBuffer.appendAscii( "/Arguments" ); - - if ( !( rxHierNameAccess->getByHierarchicalName( - aKeyBuffer.makeStringAndClear() ) >>= aValue ) ) - { - OSL_ENSURE( false, - "UniversalContentBroker::getContentProviderData - " - "Error getting item value!" ); - } - - rInfo.Arguments = aValue; -} - //========================================================================= // // ProviderListEntry_Impl implementation. diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx index 0e44c5bc99b5..d2f6e4e4c41e 100644 --- a/ucb/source/core/ucb.hxx +++ b/ucb/source/core/ucb.hxx @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -204,11 +203,6 @@ private: void prepareAndRegister( const ucbhelper::ContentProviderDataList& rData); - void createContentProviderData( - const rtl::OUString& rProvider, - const com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >& rxHierNameAccess, - ucbhelper::ContentProviderData& rInfo); - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr; -- cgit From 4ea577d0efe22e5785c8ae72c86f517fd2cf9194 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 26 Aug 2010 17:11:05 +0200 Subject: sb130: #i113096# previous configmgr::Components::removeExtensionXcuFile changes were still not good --- configmgr/source/components.cxx | 24 +++++++++++++----------- configmgr/source/modifications.cxx | 21 +++++++++++++++++++++ configmgr/source/modifications.hxx | 2 ++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index e76460de5b64..33b0eca3f65f 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -120,26 +120,26 @@ rtl::OUString expand(rtl::OUString const & str) { return s; } -bool hasOnlyEmptySets(rtl::Reference< Node > const & node) { +bool canRemoveFromLayer(int layer, rtl::Reference< Node > const & node) { OSL_ASSERT(node.is()); + if (node->getLayer() > layer && node->getLayer() < Data::NO_LAYER) { + return false; + } switch (node->kind()) { - default: // Node::KIND_LOCALIZED_VALUE - OSL_ASSERT(false); - // fall through - case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY: - return true; case Node::KIND_GROUP: for (NodeMap::iterator i(node->getMembers().begin()); i != node->getMembers().end(); ++i) { - if (!hasOnlyEmptySets(i->second)) { + if (!canRemoveFromLayer(layer, i->second)) { return false; } } return true; case Node::KIND_SET: return node->getMembers().empty(); + default: // Node::KIND_PROPERTY, Node::KIND_LOCALIZED_VALUE + return true; } } @@ -282,7 +282,8 @@ void Components::removeExtensionXcuFile( // be removed. However, not enough information is recorded in the in-memory // data structures to do so. So, as a workaround, all those set elements // that were freshly added by the xcu and have afterwards been left - // unchanged are removed (and nothing else). The heuristic to determine + // unchanged or have only had their properties changed in the user layer are + // removed (and nothing else). The heuristic to determine // whether a node has been left unchanged is to check the layer ID (as // usual) and additionally to check that the node does not recursively // contain any non-empty sets (multiple extension xcu files are merged into @@ -302,7 +303,7 @@ void Components::removeExtensionXcuFile( rtl::Reference< Node > node; for (Path::const_iterator j(i->begin()); j != i->end(); ++j) { parent = node; - node = Data::findNode(item->layer, *map, *j); + node = Data::findNode(Data::NO_LAYER, *map, *j); if (!node.is()) { break; } @@ -314,14 +315,15 @@ void Components::removeExtensionXcuFile( OSL_ASSERT( node->kind() == Node::KIND_GROUP || node->kind() == Node::KIND_SET); - if (hasOnlyEmptySets(node)) { + if (canRemoveFromLayer(item->layer, node)) { parent->getMembers().erase(i->back()); - addModification(*i); + data_.modifications.remove(*i); modifications->add(*i); } } } } + writeModifications(); } } diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx index 2ad3b5ef8bd1..add18ceaa1ea 100644 --- a/configmgr/source/modifications.cxx +++ b/configmgr/source/modifications.cxx @@ -59,6 +59,27 @@ void Modifications::add(Path const & path) { p->children.clear(); } +void Modifications::remove(Path const & path) { + OSL_ASSERT(!path.empty()); + Node * p = &root_; + for (Path::const_iterator i(path.begin());;) { + Node::Children::iterator j(p->children.find(*i)); + if (j == p->children.end()) { + break; + } + if (++i == path.end()) { + p->children.erase(j); + if (p->children.empty()) { + Path parent(path); + parent.pop_back(); + remove(parent); + } + break; + } + p = &j->second; + } +} + Modifications::Node const & Modifications::getRoot() const { return root_; } diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx index e29a10150148..c28b1aadd192 100644 --- a/configmgr/source/modifications.hxx +++ b/configmgr/source/modifications.hxx @@ -54,6 +54,8 @@ public: void add(Path const & path); + void remove(Path const & path); + Node const & getRoot() const; private: -- cgit From 0cd40f9bffa9fa97bd44a7a2e43e40f11af1b2db Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 26 Aug 2010 21:50:11 +0200 Subject: impress200: #i114089# clear user any after they are applied to the shape --- editeng/inc/editeng/unoipset.hxx | 1 + editeng/source/uno/unoipset.cxx | 21 ++++++++++++--------- svx/source/unodraw/unoshape.cxx | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx index 3cd3053e4c3e..8a28df5cbe28 100644 --- a/editeng/inc/editeng/unoipset.hxx +++ b/editeng/inc/editeng/unoipset.hxx @@ -64,6 +64,7 @@ public: sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); } ::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const; void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID); + void ClearAllUsrAny(); com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const; const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;} diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 39ab3507c5d3..6ba232010390 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -71,15 +71,7 @@ SvxItemPropertySet::SvxItemPropertySet( const SfxItemPropertyMapEntry* pMap, Sfx //---------------------------------------------------------------------- SvxItemPropertySet::~SvxItemPropertySet() { -/* - if(pItemPool) - delete pItemPool; - pItemPool = NULL; -*/ - - if(pCombiList) - delete pCombiList; - pCombiList = NULL; + ClearAllUsrAny(); } //---------------------------------------------------------------------- @@ -111,6 +103,17 @@ void SvxItemPropertySet::AddUsrAnyForID(const uno::Any& rAny, sal_uInt16 nWID) pCombiList->Insert(pNew); } +//---------------------------------------------------------------------- + +void SvxItemPropertySet::ClearAllUsrAny() +{ + if(pCombiList) + delete pCombiList; + pCombiList = NULL; +} + +//---------------------------------------------------------------------- + sal_Bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) { sal_Bool bConvert = sal_True; // the default is that all metric items must be converted diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index d860f4973fd2..9c5affc38f9b 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -708,6 +708,7 @@ void SvxItemPropertySet_ObtainSettingsFromPropertySet(const SvxItemPropertySet& // next entry ++aSrcIt; } + const_cast< SvxItemPropertySet& >(rPropSet).ClearAllUsrAny(); } } -- cgit From 4b5214f0d0f0d95b94314a85b4cdd2156c596d65 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 12:58:30 +0200 Subject: chart50: #i113950# ODF: don't export text:id with bad value --- xmloff/source/chart/SchXMLExport.cxx | 38 ++++++---------- xmloff/source/chart/SchXMLTableContext.cxx | 70 +++++++++++++++++++++++++++++- xmloff/source/chart/SchXMLTools.cxx | 23 ++++++++++ xmloff/source/chart/SchXMLTools.hxx | 2 + 4 files changed, 108 insertions(+), 25 deletions(-) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index c4abc4172959..5af8f0f3e5ea 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -1688,20 +1688,16 @@ void SchXMLExportHelper_Impl::exportTable() { mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_STRING ); SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); - // write the original range name as id into the local table - // to allow a correct re-association when copying via clipboard + exportText( *aIt ); + if( nC < nComplexCount ) + lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport ); if( !bHasOwnData && aColumnDescriptions_RangeIter != aColumnDescriptions_RangeEnd ) { + // remind the original range to allow a correct re-association when copying via clipboard if ((*aColumnDescriptions_RangeIter).getLength()) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aColumnDescriptions_RangeIter); - } + SchXMLTools::exportRangeToSomewhere( mrExport, *aColumnDescriptions_RangeIter ); ++aColumnDescriptions_RangeIter; } - exportText( *aIt ); - if( nC < nComplexCount ) - lcl_exportComplexLabel( rComplexColumnDescriptions[nC++], mrExport ); } OSL_ASSERT( bHasOwnData || aColumnDescriptions_RangeIter == aColumnDescriptions_RangeEnd ); } // closing row and header-rows elements @@ -1725,17 +1721,15 @@ void SchXMLExportHelper_Impl::exportTable() SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); if( aRowDescriptionsIter != aData.aRowDescriptions.end()) { - // write the original range name as id into the local table - // to allow a correct re-association when copying via clipboard - if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aRowDescriptions_RangeIter++); - } exportText( *aRowDescriptionsIter ); ++aRowDescriptionsIter; if( nC < nComplexCount ) lcl_exportComplexLabel( rComplexRowDescriptions[nC++], mrExport ); + if( !bHasOwnData && aRowDescriptions_RangeIter != aRowDescriptions_RangeEnd ) + { + // remind the original range to allow a correct re-association when copying via clipboard + SchXMLTools::exportRangeToSomewhere( mrExport, *aRowDescriptions_RangeIter++ ); + } } } @@ -1748,19 +1742,15 @@ void SchXMLExportHelper_Impl::exportTable() mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE_TYPE, XML_FLOAT ); mrExport.AddAttribute( XML_NAMESPACE_OFFICE, XML_VALUE, msString ); SvXMLElementExport aCell( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_CELL, sal_True, sal_True ); - // write the original range name as id into the local table to - // allow a correct re-association when copying via clipboard + exportText( msString, false ); // do not convert tabs and lfs if( ( !bHasOwnData && aDataRangeIter != aDataRangeEndIter ) && - ( mbRowSourceColumns || (aColIt == aRowIt->begin())) ) + ( mbRowSourceColumns || (aColIt == aRowIt->begin()) ) ) { + // remind the original range to allow a correct re-association when copying via clipboard if ((*aDataRangeIter).getLength()) - { - mrExport.AddAttributeIdLegacy(XML_NAMESPACE_TEXT, - *aDataRangeIter); - } + SchXMLTools::exportRangeToSomewhere( mrExport, *aDataRangeIter ); ++aDataRangeIter; } - exportText( msString, false ); // do not convert tabs and lfs } } } diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index d82970858ebe..d3f0670f672d 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -34,6 +34,7 @@ #include "SchXMLImport.hxx" #include "SchXMLTools.hxx" #include "transporttypes.hxx" +#include "XMLStringBufferImportContext.hxx" #include #include #include "xmlnmspe.hxx" @@ -687,6 +688,35 @@ SvXMLImportContext* SchXMLTableRowContext::CreateChildContext( return pContext; } +//--------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------- + +class SchXMLRangeSomewhereContext : public SvXMLImportContext +{ +//#i113950# previously the range was exported to attribute text:id, +//but that attribute does not allow arbitrary strings anymore +//so we need to find an alternative to save that range info for copy/paste scenario ... +//-> use description at an empty group element for now + +private: + ::rtl::OUString& mrRangeString; + ::rtl::OUStringBuffer maRangeStringBuffer; + +public: + SchXMLRangeSomewhereContext( SvXMLImport& rImport, + const ::rtl::OUString& rLocalName, + ::rtl::OUString& rRangeString ); + virtual ~SchXMLRangeSomewhereContext(); + + virtual SvXMLImportContext* CreateChildContext( + USHORT nPrefix, + const ::rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList ); + virtual void EndElement(); +}; + +//--------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------- // ======================================== // classes for cells and their content @@ -778,11 +808,18 @@ SvXMLImportContext* SchXMLTableCellContext::CreateChildContext( pContext = new SchXMLTextListContext( GetImport(), rLocalName, *rCell.pComplexString ); mbReadText = sal_False;//don't apply text from } - // element - read text and range-id + // element - read text (and range from text:id old version) else if( nPrefix == XML_NAMESPACE_TEXT && IsXMLToken( rLocalName, XML_P ) ) { pContext = new SchXMLParagraphContext( GetImport(), rLocalName, maCellContent, &maRangeId ); } + // element - read range + else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_G ) ) + { + //#i113950# previously the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore + //so we need to find an alternative to save that range info for copy/paste scenario ... -> use description at an empty group element for now + pContext = new SchXMLRangeSomewhereContext( GetImport(), rLocalName, maRangeId ); + } else { pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -1148,3 +1185,34 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary( } } +//--------------------------------------------------------------------------------------------------- + +SchXMLRangeSomewhereContext::SchXMLRangeSomewhereContext( SvXMLImport& rImport, + const OUString& rLocalName, + OUString& rRangeString ) : + SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ), + mrRangeString( rRangeString ) +{ +} + +SchXMLRangeSomewhereContext::~SchXMLRangeSomewhereContext() +{ +} + +SvXMLImportContext* SchXMLRangeSomewhereContext::CreateChildContext( + USHORT nPrefix, + const OUString& rLocalName, + const uno::Reference< xml::sax::XAttributeList >& ) +{ + if( XML_NAMESPACE_SVG == nPrefix && IsXMLToken( rLocalName, XML_DESC ) ) + { + return new XMLStringBufferImportContext( + GetImport(), nPrefix, rLocalName, maRangeStringBuffer ); + } + return new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); +} + +void SchXMLRangeSomewhereContext::EndElement() +{ + mrRangeString = maRangeStringBuffer.makeStringAndClear(); +} diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 582e5aead326..b2a90e534771 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -600,6 +600,29 @@ void exportText( SvXMLExport& rExport, const OUString& rText, bool bConvertTabsL } } +void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue ) +{ + //with issue #i366# and CWS chart20 ranges for error bars were introduced + //to keep them during copy paste from calc to impress for example it + //was necessary to introduce a mapping between the used ranges within calc and the data written to the local table + //this is why we write this ranges here + + //#i113950# first the range was exported to attribute text:id, but that attribute does not allow arbitrary strings anymore within ODF 1.2 + //as an alternative the range info is now saved into the description at an empty group element (not very nice, but ODF conform) + + const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( nCurrentODFVersion == SvtSaveOptions::ODFVER_010 || nCurrentODFVersion == SvtSaveOptions::ODFVER_011 ) + return;//svg:desc is not allowed at draw:g in ODF1.0; but as the ranges for error bars are anyhow not allowed within ODF1.0 nor ODF1.1 we do not need the information + + SvXMLElementExport aEmptyShapeGroup( rExport, XML_NAMESPACE_DRAW, + ::xmloff::token::GetXMLToken( ::xmloff::token::XML_G ), + sal_True, sal_False ); + SvXMLElementExport aDescription( rExport, XML_NAMESPACE_SVG, + ::xmloff::token::GetXMLToken( ::xmloff::token::XML_DESC ), + sal_True, sal_False ); + rExport.GetDocHandler()->characters( rValue ); +} + Reference< chart2::XRegressionCurve > getRegressionCurve( const Reference< chart2::XDataSeries > & xDataSeries ) { diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx index bcc39ae3d114..d8841bf3861b 100644 --- a/xmloff/source/chart/SchXMLTools.hxx +++ b/xmloff/source/chart/SchXMLTools.hxx @@ -105,6 +105,8 @@ namespace SchXMLTools void exportText( SvXMLExport& rExport, const ::rtl::OUString& rText, bool bConvertTabsLFs ); + void exportRangeToSomewhere( SvXMLExport& rExport, const ::rtl::OUString& rValue ); + /** returns the properties of the equation of the first regression curve that is no mean-value line */ -- cgit From 926a7b29e05856d8ed567e3e4ff8640340d1ebfc Mon Sep 17 00:00:00 2001 From: obo Date: Fri, 27 Aug 2010 13:01:02 +0200 Subject: masterfix OOO330: #i10000# solve merge problem / WaE --- desktop/source/app/app.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cf19af655a1b..f5d6979bc4b1 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1558,6 +1558,7 @@ void Desktop::Main() std::auto_ptr pLanguageOptions; std::auto_ptr pPathOptions; + Reference< ::com::sun::star::task::XRestartManager > xRestartManager; sal_Bool bRestartRequested( sal_False ); sal_Bool bUseSystemFileDialog(sal_True); int nAcquireCount( 0 ); @@ -1761,7 +1762,6 @@ void Desktop::Main() impl_checkRecoveryState(bCrashed, bExistsRecoveryData, bExistsSessionData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "} impl_checkRecoveryState" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; { ::comphelper::ComponentContext aContext( xSMgr ); xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); @@ -1929,7 +1929,6 @@ void Desktop::Main() // call Application::Execute to process messages in vcl message loop RTL_LOGFILE_PRODUCT_TRACE( "PERFORMANCE - enter Application::Execute()" ); - Reference< ::com::sun::star::task::XRestartManager > xRestartManager; try { // The JavaContext contains an interaction handler which is used when @@ -1937,9 +1936,10 @@ void Desktop::Main() com::sun::star::uno::ContextLayer layer2( new svt::JavaContext( com::sun::star::uno::getCurrentContext() ) ); - ::comphelper::ComponentContext aContext( xSMgr ); - xRestartManager.set( aContext.getSingleton( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.OfficeRestartManager" ) ) ), UNO_QUERY ); - if ( !xRestartManager.is() || !xRestartManager->isRestartRequested( sal_True ) ) + // check whether the shutdown is caused by restart just before entering the Execute + bRestartRequested = bRestartRequested || ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); + + if ( !bRestartRequested ) { // if this run of the office is triggered by restart, some additional actions should be done DoRestartActionsIfNecessary( !pCmdLineArgs->IsInvisible() && !pCmdLineArgs->IsNoQuickstart() ); @@ -1957,13 +1957,11 @@ void Desktop::Main() OfficeIPCThread::SetDowning(); FatalError( MakeStartupErrorMessage(exAnyCfg.Message) ); } - - // check whether the shutdown is caused by restart - sal_Bool bRestartRequested = ( xRestartManager.is() && xRestartManager->isRestartRequested( sal_True ) ); - if ( bRestartRequested ) - SetRestartState(); } + if ( bRestartRequested ) + SetRestartState(); + if (xGlobalBroadcaster.is()) { css::document::EventObject aEvent; -- cgit From d19dc752fe6b9f88c7c6aa4686d8d8c6404cde26 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 27 Aug 2010 14:02:22 +0200 Subject: build breakers --- sfx2/source/statbar/stbitem.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 9b5fbd2d5d4e..e5de57d835c3 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -135,8 +135,8 @@ svt::StatusbarController* SAL_CALL SfxStatusBarControllerFactory( { rtl::OString aCmd(".uno:"); aCmd += pSlot->GetUnoName(); - return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule ); pStatusBar->SetHelpId( nSlotId, aCmd ); + return SfxStatusBarControl::CreateControl( nSlotId, nID, pStatusBar, pModule ); } } -- cgit From 466bacc3ad07d88c8d947e4f745d9e8f3cdbed89 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 27 Aug 2010 14:05:36 +0200 Subject: testtool: fix libsts to work with old testtool --- basic/inc/basic/ttstrhlp.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/basic/inc/basic/ttstrhlp.hxx b/basic/inc/basic/ttstrhlp.hxx index 1827d013c492..06f4939d61c0 100644 --- a/basic/inc/basic/ttstrhlp.hxx +++ b/basic/inc/basic/ttstrhlp.hxx @@ -31,6 +31,8 @@ #define CByteString( constAsciiStr ) ByteString( RTL_CONSTASCII_STRINGPARAM ( constAsciiStr ) ) #define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) ) +#define Str2Id( Str ) rtl::OUStringToOString( Str, RTL_TEXTENCODING_ASCII_US ) +#define Id2Str( Id ) String( rtl::OStringToOUString( Id, RTL_TEXTENCODING_ASCII_US ) ) #define StartKenn CUniString("%") #define EndKenn CUniString("%") @@ -42,7 +44,7 @@ #define TabKenn ( StartKenn.AppendAscii("Tab") ) #define MakeStringParam(Type,aText) ( Type.AppendAscii("=").Append( aText ).Append( EndKenn ) ) #define MakeStringNumber(Type,nNumber) MakeStringParam (Type, UniString::CreateFromInt32(nNumber)) -#define UIdString(aID) MakeStringParam(UIdKenn,aID.GetText()) +#define UIdString(aID) MakeStringParam(UIdKenn,String(rtl::OStringToOUString( aID, RTL_TEXTENCODING_ASCII_US ))) #define MethodString(nNumber) MakeStringNumber(MethodKenn,nNumber) #define TypeString(nNumber) MakeStringNumber(TypeKenn,nNumber) #define SlotString(nNumber) MakeStringNumber(SlotKenn,nNumber) -- cgit From 8412850383ef9569d42c4a8fd4493a7185799d37 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 15:40:24 +0200 Subject: chart50: #i114142# ODF: don't export invalid content to attribute chart:axis-label-position --- xmloff/inc/xmloff/xmltoken.hxx | 3 +++ xmloff/source/chart/PropertyMap.hxx | 2 ++ xmloff/source/core/xmltoken.cxx | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index f4843d54ace1..80238a075973 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3110,6 +3110,9 @@ namespace xmloff { namespace token { XML_DIAGONAL_BL_TR_WIDTHS, XML_DIAGONAL_TL_BR_WIDTHS, + XML_OUTSIDE_MINIMUM,//#i114142# + XML_OUTSIDE_MAXIMUM,//#i114142# + XML_TOKEN_END }; diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 0616040148b5..79a59ab6910f 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -223,6 +223,8 @@ SvXMLEnumMapEntry aXMLChartAxisLabelPositionEnumMap[] = { ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE, ::com::sun::star::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE }, { ::xmloff::token::XML_OUTSIDE_START, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START }, { ::xmloff::token::XML_OUTSIDE_END, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END }, + { ::xmloff::token::XML_OUTSIDE_MINIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142# + { ::xmloff::token::XML_OUTSIDE_MAXIMUM, ::com::sun::star::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142# { ::xmloff::token::XML_TOKEN_INVALID, 0 } }; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index a3d4a0c48d02..d65bafe583df 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3082,8 +3082,8 @@ namespace xmloff { namespace token { TOKEN( "axis-label-position", XML_AXIS_LABEL_POSITION ), TOKEN( "near-axis", XML_NEAR_AXIS ), TOKEN( "near-axis-other-side", XML_NEAR_AXIS_OTHER_SIDE ), - TOKEN( "outside-minimum", XML_OUTSIDE_START ), - TOKEN( "outside-maximum", XML_OUTSIDE_END ), + TOKEN( "outside-start", XML_OUTSIDE_START ), + TOKEN( "outside-end", XML_OUTSIDE_END ), TOKEN( "tick-mark-position", XML_TICK_MARK_POSITION ), TOKEN( "at-labels", XML_AT_LABELS ), TOKEN( "at-axis", XML_AT_AXIS ), @@ -3110,6 +3110,9 @@ namespace xmloff { namespace token { TOKEN( "diagonal-bl-tr-widths", XML_DIAGONAL_BL_TR_WIDTHS ), TOKEN( "diagonal-tl-br-widths", XML_DIAGONAL_TL_BR_WIDTHS ), + TOKEN( "outside-minimum", XML_OUTSIDE_MINIMUM ), + TOKEN( "outside-maximum", XML_OUTSIDE_MAXIMUM ), + #if OSL_DEBUG_LEVEL > 0 { 0, NULL, NULL, XML_TOKEN_END } #else -- cgit From 014547dafd3c0d455c37ba3c8df4a222a609c6c6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Aug 2010 15:51:44 +0200 Subject: #i111295# getFormattedValue: don't treat non-numeric columns with numeric formats --- connectivity/source/commontools/formattedcolumnvalue.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx index 3707b7fdb65d..d63c83524389 100644 --- a/connectivity/source/commontools/formattedcolumnvalue.cxx +++ b/connectivity/source/commontools/formattedcolumnvalue.cxx @@ -326,9 +326,16 @@ namespace dbtools ::rtl::OUString sStringValue; if ( m_pData->m_xColumn.is() ) { - sStringValue = DBTypeConversion::getValue( - m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType - ); + if ( m_pData->m_bNumericField ) + { + sStringValue = DBTypeConversion::getValue( + m_pData->m_xColumn, m_pData->m_xFormatter, m_pData->m_aNullDate, m_pData->m_nFormatKey, m_pData->m_nKeyType + ); + } + else + { + sStringValue = m_pData->m_xColumn->getString(); + } } return sStringValue; } -- cgit From d80d6e32933eddd5802e3a62113237d6a4d5c63d Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 27 Aug 2010 16:46:26 +0200 Subject: chart50: #i114149# ODF: export missing attribute dimension to element chart:error-indicator --- xmloff/source/chart/SchXMLExport.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 5af8f0f3e5ea..e6f6fc6d9340 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -3053,6 +3053,10 @@ void SchXMLExportHelper_Impl::exportSeries( { // add style name attribute AddAutoStyleAttribute( aPropertyStates ); + + const SvtSaveOptions::ODFDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() ); + if( nCurrentVersion >= SvtSaveOptions::ODFVER_012 ) + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DIMENSION, XML_Y );//#i114149# SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_ERROR_INDICATOR, sal_True, sal_True ); } else // autostyles -- cgit From 4a15cba3afa8bf8a81798c5c3fa124fce85e7f55 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 30 Aug 2010 14:08:45 +0200 Subject: dba33h: #i114161# --- sfx2/source/dialog/taskpane.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 5d763f81744d..30fe2460d512 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -253,10 +253,11 @@ namespace sfx2 pWindow->SetHelpId( HID_TASKPANE_WINDOW ); pWindow->SetOutputSizePixel( Size( 300, 450 ) ); - pWindow->Show(); dynamic_cast< SfxDockingWindow* >( pWindow )->Initialize( i_pInfo ); SetHideNotDelete( TRUE ); + + pWindow->Show(); } //------------------------------------------------------------------------------------------------------------------ -- cgit From 8baa98fb42161e9ee4ed3aababe87aade353e0fb Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 30 Aug 2010 16:38:02 +0200 Subject: sb123: #i114211# disabled xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization for now --- xmloff/qa/unoapi/knownissues.xcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xmloff/qa/unoapi/knownissues.xcl b/xmloff/qa/unoapi/knownissues.xcl index 55e277017e3f..a9fa072e8338 100644 --- a/xmloff/qa/unoapi/knownissues.xcl +++ b/xmloff/qa/unoapi/knownissues.xcl @@ -19,3 +19,6 @@ xmloff.Impress.XMLStylesExporter xmloff.Draw.XMLContentExporter::com::sun::star::document::XFilter xmloff.Draw.XMLMetaExporter::com::sun::star::document::XFilter xmloff.Impress.XMLMetaExporter::com::sun::star::document::XFilter + +### i114211 ### +xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization -- cgit From 073050f4527815a0825937bc0d398959dfb556ec Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 13:01:03 +0200 Subject: jl158: #i114008# pre-indexing of extension help --- xmlhelp/prj/d.lst | 1 + xmlhelp/util/makefile.mk | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst index 1cfa107f73b9..ec45189d3045 100644 --- a/xmlhelp/prj/d.lst +++ b/xmlhelp/prj/d.lst @@ -4,4 +4,5 @@ ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.* ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.* ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml +..\util\*.xsl %_DEST%\bin%_EXT%\*.* ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk index 10206670b5f8..66551f15bffc 100644 --- a/xmlhelp/util/makefile.mk +++ b/xmlhelp/util/makefile.mk @@ -74,5 +74,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------------------------------- +ZIP1TARGET=helpxsl +ZIP1FLAGS= -u -r +#ZIP1DIR=$(PRJ)$/source$/auxiliary +ZIP1LIST=main_transform*.xsl idxcaption.xsl idxcontent.xsl + + .INCLUDE: target.mk -- cgit From 7c006c81f4d7eb4c1dd371585ca09bfc3549a0d7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 13:39:49 +0200 Subject: dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the print preview and back, to SFX In particular, the following changes have been applied - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view factories for such named views - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view is exchanged with another view. In this case, it preserves the view's view data at the model - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from the print preview, has been removed completely. What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY. This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the view names would be speaking then, instead of the current "view" names. --- sfx2/inc/sfx2/docfac.hxx | 2 +- sfx2/inc/sfx2/viewfrm.hxx | 1 + sfx2/inc/sfx2/viewsh.hxx | 11 ++++++ sfx2/inc/viewfac.hxx | 14 ++++++- sfx2/source/doc/docfac.cxx | 4 +- sfx2/source/doc/sfxbasemodel.cxx | 4 +- sfx2/source/view/frmload.cxx | 2 +- sfx2/source/view/sfxbasecontroller.cxx | 51 ++++++++++++++++++++----- sfx2/source/view/viewfac.cxx | 29 ++++++++++++-- sfx2/source/view/viewfrm.cxx | 69 ++++++++++++++++++++++++++++++++++ 10 files changed, 168 insertions(+), 19 deletions(-) diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 7468394d2617..89062d7b7263 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -94,7 +94,7 @@ public: USHORT GetViewFactoryCount() const; SfxViewFactory& GetViewFactory(USHORT i = 0) const; - /// returns the view factory whose GetViewName delivers the requested logical name + /// returns the view factory whose GetAPIViewName or GetLegacyViewName delivers the requested logical name SfxViewFactory* GetViewFactoryByViewName( const String& i_rViewName ) const; // Filter diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index d376236bf830..a0f5eadd5148 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -253,6 +253,7 @@ public: private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); + SAL_DLLPRIVATE void SaveCurrentViewData_Impl(); /** loads the given existing document into the given frame diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 8465a238cd5b..34362500b690 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -134,6 +134,17 @@ public: \ } \ void Class::InitFactory() +#define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ + SfxViewFactory* Class::pFactory; \ + SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ + { return new Class(pFrame, pOldView); } \ + void Class::RegisterFactory( USHORT nPrio ) \ + { \ + pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,AsciiViewName);\ + InitFactory(); \ + } \ + void Class::InitFactory() + #define SFX_VIEW_REGISTRATION(DocClass) \ DocClass::Factory().RegisterViewFactory( Factory() ) diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index 6f9ae1d3cb37..0e6498b1f8a5 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -47,6 +47,8 @@ class SFX2_DLLPUBLIC SfxViewFactory public: SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const ResId& aDescrResId ); + SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ); ~SfxViewFactory(); SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); @@ -56,14 +58,22 @@ public: { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } - /// returns an API-compatible view name. For the moment, this is "view" with an appended ordinal/ID - String GetViewName() const; + /// returns a legacy view name. This is "view" with an appended ordinal/ID. + String GetLegacyViewName() const; + + /** returns a API-compatible view name. + + For details on which view names are specified, see the XModel2.getAvailableViewControllerNames + documentation. + */ + String GetAPIViewName() const; private: SfxViewCtor fnCreate; SfxViewInit fnInit; USHORT nOrd; ResId aDescription; + const String m_sViewName; }; #endif diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index bfd67210ec44..8f8a4a969740 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -467,7 +467,9 @@ SfxViewFactory* SfxObjectFactory::GetViewFactoryByViewName( const String& i_rVie ) { SfxViewFactory& rViewFac( GetViewFactory( nViewNo ) ); - if ( rViewFac.GetViewName() == i_rViewName ) + if ( ( rViewFac.GetAPIViewName() == i_rViewName ) + || ( rViewFac.GetLegacyViewName() == i_rViewName ) + ) return &rViewFac; } return NULL; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index fe4ffa50f67d..846cc669b9a7 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3812,7 +3812,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL SfxBaseModel::getAvailableViewCon Sequence< ::rtl::OUString > aViewNames( nViewFactoryCount ); for ( sal_Int32 nViewNo = 0; nViewNo < nViewFactoryCount; ++nViewNo ) - aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetViewName(); + aViewNames[nViewNo] = rDocumentFactory.GetViewFactory( nViewNo ).GetAPIViewName(); return aViewNames; } @@ -3826,7 +3826,7 @@ css::uno::Reference< css::frame::XController2 > SAL_CALL SfxBaseModel::createDef SfxModelGuard aGuard( *this ); const SfxObjectFactory& rDocumentFactory = GetObjectShell()->GetFactory(); - const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetViewName(); + const ::rtl::OUString sDefaultViewName = rDocumentFactory.GetViewFactory( 0 ).GetAPIViewName(); aGuard.clear(); diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index ed158ce009e3..df252b831803 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -650,7 +650,7 @@ sal_Bool SAL_CALL SfxFrameLoader_Impl::load( const Sequence< PropertyValue >& rA // ensure the ID of the to-be-created view is in the descriptor, if possible const sal_Int16 nViewId = impl_determineEffectiveViewId_nothrow( *xDoc, aDescriptor ); const sal_Int16 nViewNo = xDoc->GetFactory().GetViewNo_Impl( nViewId, 0 ); - const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetViewName() ); + const ::rtl::OUString sViewName( xDoc->GetFactory().GetViewFactory( nViewNo ).GetAPIViewName() ); // if the document is created hidden, prevent it from being deleted until it is shown or disposed impl_lockHiddenDocument( *xDoc, aDescriptor ); diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index f5c24b195af7..cda5fd0bdd7d 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -118,6 +118,7 @@ using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_SET_THROW; using ::com::sun::star::lang::DisposedException; using ::com::sun::star::awt::XWindow; using ::com::sun::star::frame::XController; @@ -579,7 +580,7 @@ Reference< XWindow > SAL_CALL SfxBaseController::getComponentWindow() throw (Run ::rtl::OUString sViewName; if ( nViewNo < rDocFac.GetViewFactoryCount() ) - sViewName = rDocFac.GetViewFactory( nViewNo ).GetViewName(); + sViewName = rDocFac.GetViewFactory( nViewNo ).GetAPIViewName(); return sViewName; } @@ -1421,20 +1422,52 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) // if so, forward it to the view/shell. if ( !bHasPluginMode && !bHasJumpMark ) { + // Note that this might not be the ideal place here. Restoring view data should, IMO, be the + // responsibility of the loader, not an implementation detail burried here deep within the controller's + // implementation. + // What I think should be done to replace the below code: + // - change SfxBaseController::restoreViewData to also accept a PropertyValue[] (it currently accepts + // a string only), and forward it to its ViewShell's ReadUserDataSequence + // - change the frame loader so that when a new document is loaded (as opposed to an existing + // document being loaded into a new frame), the model's view data is examine the very same + // way as below, and the proper view data is set via XController::restoreViewData + // - extend SfxViewFrame::SwitchToViewShell_Impl. Currently, it cares for the case where a non-PrintPreview + // view is exchanged, and sets the old view's data at the model. It should also care for the other + // way, were the PrintPreview view is left: in this case, the new view should also be initialized + // with the model's view data try { - Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY ); - Reference< XIndexAccess > xViewData; - if ( xViewDataSupplier.is() ) - xViewData = xViewDataSupplier->getViewData(); - if ( xViewData.is() && xViewData->getCount() > 0 ) + Reference< XViewDataSupplier > xViewDataSupplier( getModel(), UNO_QUERY_THROW ); + Reference< XIndexAccess > xViewData( xViewDataSupplier->getViewData(), UNO_SET_THROW ); + + // find the view data item whose ViewId matches the ID of the view we're just connecting to + const SfxObjectFactory& rDocFactory( rDoc.GetFactory() ); + const sal_Int32 nCount = xViewData->getCount(); + sal_Int32 nViewDataIndex = 0; + for ( sal_Int32 i=0; i aViewData; - if ( ( xViewData->getByIndex( 0 ) >>= aViewData ) && ( aViewData.getLength() ) ) + const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) ); + ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + if ( sViewId.getLength() == 0 ) + continue; + + const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); + if ( pViewFactory == NULL ) + continue; + + if ( pViewFactory->GetOrdinal() == pViewFrame->GetCurViewId() ) { - m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE ); + nViewDataIndex = i; + break; } } + if ( nViewDataIndex < nCount ) + { + Sequence< PropertyValue > aViewData; + OSL_VERIFY( xViewData->getByIndex( nViewDataIndex ) >>= aViewData ); + if ( aViewData.getLength() > 0 ) + m_pData->m_pViewShell->ReadUserDataSequence( aViewData, TRUE ); + } } catch( const Exception& ) { diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index b58bbc2840da..5ef64a2a8b0d 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -30,6 +30,7 @@ // INCLUDE --------------------------------------------------------------- #include +#include "sfxresid.hxx" #include #include "viewfac.hxx" @@ -49,7 +50,7 @@ void SfxViewFactory::InitFactory() (*fnInit)(); } -String SfxViewFactory::GetViewName() const +String SfxViewFactory::GetLegacyViewName() const { ::rtl::OUStringBuffer aViewName; aViewName.appendAscii( "view" ); @@ -57,6 +58,17 @@ String SfxViewFactory::GetViewName() const return aViewName.makeStringAndClear(); } +String SfxViewFactory::GetAPIViewName() const +{ + if ( m_sViewName.Len() > 0 ) + return m_sViewName; + + if ( GetOrdinal() == 0 ) + return String::CreateFromAscii( "Default" ); + + return GetLegacyViewName(); +} + // CTOR / DTOR ----------------------------------------------------------- SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, @@ -64,11 +76,22 @@ SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, fnCreate(fnC), fnInit(fnI), nOrd(nOrdinal), - aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()) + aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()), + m_sViewName() { aDescription.SetRT(aDescrResId.GetRT()); DBG_CTOR(SfxViewFactory, 0); -// SFX_APP()->RegisterViewFactory_Impl(*this); +} + +SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, + USHORT nOrdinal, const sal_Char* asciiViewName ): + fnCreate(fnC), + fnInit(fnI), + nOrd(nOrdinal), + aDescription( SfxResId( 0 ) ), + m_sViewName( String::CreateFromAscii( asciiViewName ) ) +{ + DBG_CTOR(SfxViewFactory, 0); } SfxViewFactory::~SfxViewFactory() diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index ed924623c700..f1e6e45c5217 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -75,6 +75,8 @@ #include #include #include +#include +#include #include #include @@ -106,6 +108,8 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using ::com::sun::star::awt::XWindow; using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::document::XViewDataSupplier; +using ::com::sun::star::container::XIndexContainer; namespace css = ::com::sun::star; #ifndef GCC @@ -2242,6 +2246,68 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- +void SfxViewFrame::SaveCurrentViewData_Impl() +{ + SfxViewShell* pCurrentShell = GetViewShell(); + ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" ); + + // determine the logical (API) view name + const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() ); + const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); + const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName(); + if ( sViewName.Len() == 0 ) + { + // can't say anything about the view, the respective application did not yet migrate its code to + // named view factories => bail out + return; + } + + // do *not* save view data when the view is a print preview + if ( sViewName.EqualsAscii( "PrintPreview" ) ) + return; + + // retrieve the view data from the view + Sequence< PropertyValue > aViewData; + pCurrentShell->WriteUserDataSequence( aViewData ); + + try + { + // retrieve view data (for *all* views) from the model + const Reference< XController > xController( pCurrentShell->GetController(), UNO_SET_THROW ); + const Reference< XViewDataSupplier > xViewDataSupplier( xController->getModel(), UNO_QUERY_THROW ); + const Reference< XIndexContainer > xViewData( xViewDataSupplier->getViewData(), UNO_QUERY_THROW ); + + // look up the one view data item which corresponds to our current view, and remove it + const sal_Int32 nCount = xViewData->getCount(); + for ( sal_Int32 i=0; igetByIndex(i) ); + ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + if ( sViewId.getLength() == 0 ) + continue; + + const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); + if ( pViewFactory == NULL ) + continue; + + if ( pViewFactory->GetOrdinal() == GetCurViewId() ) + { + xViewData->removeByIndex(i); + break; + } + } + + // then replace it with the most recent view data we just obtained + xViewData->insertByIndex( 0, makeAny( aViewData ) ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//-------------------------------------------------------------------- + sal_Bool SfxViewFrame::SwitchToViewShell_Impl ( sal_uInt16 nViewIdOrNo, /* > 0 @@ -2304,6 +2370,9 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl SfxObjectFactory& rDocFact = GetObjectShell()->GetFactory(); const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; + // save the view data of the old view, so it can be restored later on (when needed) + SaveCurrentViewData_Impl(); + // create and load new ViewShell SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( *GetObjectShell(), -- cgit From 03ee94167cc16990ee8809f3ebe30af27ba94570 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 14:59:07 +0200 Subject: dba33i: #i111146# migrated all SFX-based applications to use named views --- sfx2/inc/sfx2/viewsh.hxx | 11 ----------- sfx2/inc/viewfac.hxx | 5 ----- sfx2/source/doc/docfac.cxx | 15 +++++++++++++++ sfx2/source/view/viewfac.cxx | 14 -------------- 4 files changed, 15 insertions(+), 30 deletions(-) diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx index 34362500b690..ee8dfb1ca57c 100644 --- a/sfx2/inc/sfx2/viewsh.hxx +++ b/sfx2/inc/sfx2/viewsh.hxx @@ -123,17 +123,6 @@ public: \ static SfxViewFactory&Factory() { return *pFactory; } \ static void InitFactory() -#define SFX_IMPL_VIEWFACTORY(Class, rResId) \ - SfxViewFactory* Class::pFactory; \ - SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ - { return new Class(pFrame, pOldView); } \ - void Class::RegisterFactory( USHORT nPrio ) \ - { \ - pFactory = new SfxViewFactory(&CreateInstance,&InitFactory,nPrio,rResId);\ - InitFactory(); \ - } \ - void Class::InitFactory() - #define SFX_IMPL_NAMED_VIEWFACTORY(Class, AsciiViewName) \ SfxViewFactory* Class::pFactory; \ SfxViewShell* __EXPORT Class::CreateInstance(SfxViewFrame *pFrame, SfxViewShell *pOldView) \ diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx index 0e6498b1f8a5..b0f0abdba3b3 100644 --- a/sfx2/inc/viewfac.hxx +++ b/sfx2/inc/viewfac.hxx @@ -45,8 +45,6 @@ typedef void (*SfxViewInit)(); class SFX2_DLLPUBLIC SfxViewFactory { public: - SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, - USHORT nOrdinal, const ResId& aDescrResId ); SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const sal_Char* asciiViewName ); ~SfxViewFactory(); @@ -54,8 +52,6 @@ public: SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh); void InitFactory(); - String GetDescription() const - { return String( aDescription ); } USHORT GetOrdinal() const { return nOrd; } /// returns a legacy view name. This is "view" with an appended ordinal/ID. @@ -72,7 +68,6 @@ private: SfxViewCtor fnCreate; SfxViewInit fnInit; USHORT nOrd; - ResId aDescription; const String m_sViewName; }; diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx index 8f8a4a969740..4311559f94af 100644 --- a/sfx2/source/doc/docfac.cxx +++ b/sfx2/source/doc/docfac.cxx @@ -159,6 +159,21 @@ void SfxObjectFactory::RegisterViewFactory SfxViewFactory &rFactory ) { +#if OSL_DEBUG_LEVEL > 0 + { + const String sViewName( rFactory.GetAPIViewName() ); + for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i ) + { + if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) ) + continue; + ByteString sMessage( "SfxObjectFactory::RegisterViewFactory: duplicate view name '" ); + sMessage += ByteString( sViewName, RTL_TEXTENCODING_ASCII_US ); + sMessage += "'!"; + OSL_ENSURE( false, sMessage.GetBuffer() ); + break; + } + } +#endif sal_uInt16 nPos; for ( nPos = 0; nPos < pImpl->aViewFactoryArr.Count() && diff --git a/sfx2/source/view/viewfac.cxx b/sfx2/source/view/viewfac.cxx index 5ef64a2a8b0d..f9469e8a9f88 100644 --- a/sfx2/source/view/viewfac.cxx +++ b/sfx2/source/view/viewfac.cxx @@ -30,7 +30,6 @@ // INCLUDE --------------------------------------------------------------- #include -#include "sfxresid.hxx" #include #include "viewfac.hxx" @@ -71,24 +70,11 @@ String SfxViewFactory::GetAPIViewName() const // CTOR / DTOR ----------------------------------------------------------- -SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, - USHORT nOrdinal, const ResId& aDescrResId ): - fnCreate(fnC), - fnInit(fnI), - nOrd(nOrdinal), - aDescription(aDescrResId.GetId(), *aDescrResId.GetResMgr()), - m_sViewName() -{ - aDescription.SetRT(aDescrResId.GetRT()); - DBG_CTOR(SfxViewFactory, 0); -} - SfxViewFactory::SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI, USHORT nOrdinal, const sal_Char* asciiViewName ): fnCreate(fnC), fnInit(fnI), nOrd(nOrdinal), - aDescription( SfxResId( 0 ) ), m_sViewName( String::CreateFromAscii( asciiViewName ) ) { DBG_CTOR(SfxViewFactory, 0); -- cgit From 1f01f13ddb5738edb341a00e66ec289d20faf47f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 15:13:11 +0200 Subject: dba33i: #i111146# SaveCurrentViewData_Impl: be less generous, only store the old view's data in the model if the new view is a print preview --- sfx2/inc/sfx2/viewfrm.hxx | 2 +- sfx2/source/view/viewfrm.cxx | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index a0f5eadd5148..affa836486e6 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -253,7 +253,7 @@ public: private: SAL_DLLPRIVATE BOOL SwitchToViewShell_Impl( USHORT nNo, BOOL bIsIndex = FALSE ); SAL_DLLPRIVATE void PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell ); - SAL_DLLPRIVATE void SaveCurrentViewData_Impl(); + SAL_DLLPRIVATE void SaveCurrentViewData_Impl( const USHORT i_nNewViewId ); /** loads the given existing document into the given frame diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f1e6e45c5217..744a8e83568d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2246,24 +2246,28 @@ SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, c //-------------------------------------------------------------------- -void SfxViewFrame::SaveCurrentViewData_Impl() +void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId ) { SfxViewShell* pCurrentShell = GetViewShell(); ENSURE_OR_RETURN_VOID( pCurrentShell != NULL, "SfxViewFrame::SaveCurrentViewData_Impl: no current view shell -> no current view data!" ); // determine the logical (API) view name const SfxObjectFactory& rDocFactory( pCurrentShell->GetObjectShell()->GetFactory() ); - const sal_uInt16 nViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); - const String sViewName = rDocFactory.GetViewFactory( nViewNo ).GetAPIViewName(); - if ( sViewName.Len() == 0 ) + const sal_uInt16 nCurViewNo = rDocFactory.GetViewNo_Impl( GetCurViewId(), 0 ); + const String sCurrentViewName = rDocFactory.GetViewFactory( nCurViewNo ).GetAPIViewName(); + const sal_uInt16 nNewViewNo = rDocFactory.GetViewNo_Impl( i_nNewViewId, 0 ); + const String sNewViewName = rDocFactory.GetViewFactory( nNewViewNo ).GetAPIViewName(); + if ( ( sCurrentViewName.Len() == 0 ) || ( sNewViewName.Len() == 0 ) ) { // can't say anything about the view, the respective application did not yet migrate its code to // named view factories => bail out + OSL_ENSURE( false, "SfxViewFrame::SaveCurrentViewData_Impl: views without API names? Shouldn't happen anymore?" ); return; } + OSL_ENSURE( !sNewViewName.Equals( sCurrentViewName ), "SfxViewFrame::SaveCurrentViewData_Impl: suspicious: new and old view name are identical!" ); - // do *not* save view data when the view is a print preview - if ( sViewName.EqualsAscii( "PrintPreview" ) ) + // save the view data only when we're moving from a non-print-preview to the print-preview view + if ( !sNewViewName.EqualsAscii( "PrintPreview" ) ) return; // retrieve the view data from the view @@ -2371,7 +2375,7 @@ sal_Bool SfxViewFrame::SwitchToViewShell_Impl const USHORT nViewId = ( bIsIndex || !nViewIdOrNo ) ? rDocFact.GetViewFactory( nViewIdOrNo ).GetOrdinal() : nViewIdOrNo; // save the view data of the old view, so it can be restored later on (when needed) - SaveCurrentViewData_Impl(); + SaveCurrentViewData_Impl( nViewId ); // create and load new ViewShell SfxViewShell* pNewSh = LoadViewIntoFrame_Impl( -- cgit From a30673bb9d8324810f2e33d1e4e42966771ed08f Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 15:49:06 +0200 Subject: jl158: #i114088# required file missing --- xmlhelp/util/delzip | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 xmlhelp/util/delzip diff --git a/xmlhelp/util/delzip b/xmlhelp/util/delzip new file mode 100644 index 000000000000..e69de29bb2d1 -- cgit From 79431b1f2ac04cc55eeaaed0931bb1bd770356af Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 17:15:05 +0200 Subject: jl158: #i114008# move transformation files --- xmlhelp/util/embed.xsl | 83 ++++ xmlhelp/util/idxcaption.xsl | 34 ++ xmlhelp/util/idxcontent.xsl | 104 +++++ xmlhelp/util/main_transform.xsl | 972 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1193 insertions(+) create mode 100644 xmlhelp/util/embed.xsl create mode 100644 xmlhelp/util/idxcaption.xsl create mode 100644 xmlhelp/util/idxcontent.xsl create mode 100644 xmlhelp/util/main_transform.xsl diff --git a/xmlhelp/util/embed.xsl b/xmlhelp/util/embed.xsl new file mode 100644 index 000000000000..3a4e3ef80f61 --- /dev/null +++ b/xmlhelp/util/embed.xsl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:apply-templates/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/idxcaption.xsl b/xmlhelp/util/idxcaption.xsl new file mode 100644 index 000000000000..7570fa5c7870 --- /dev/null +++ b/xmlhelp/util/idxcaption.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/idxcontent.xsl b/xmlhelp/util/idxcontent.xsl new file mode 100644 index 000000000000..aa371d7f9255 --- /dev/null +++ b/xmlhelp/util/idxcontent.xsl @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl new file mode 100644 index 000000000000..d9b6c3229696 --- /dev/null +++ b/xmlhelp/util/main_transform.xsl @@ -0,0 +1,972 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="$title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

                            + + + + +
                          + + +
                          +
                          + + + + + + +
                            + + + + +
                          +
                          + +
                          +
                          +
                          +
                          + + + +
                        • +
                          + + +
                        • +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          + + + + +
                          + +
                          +
                          +
                          + + + + + + + + + +
                          + +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

                          +
                          + + + + + + + + + + + +
                          +

                          +
                          + + + + + + + + + + + + + + + + + +
                          +
                          +
                          +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                          + + + + + +
                          {$alt}
                          +
                          +
                          +
                          + + + + + + <h> + + + + + + + + + </h> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

                          + +

                          +
                          + +

                          + +

                          +
                          + +

                          D'oh! You found a bug ( not found).

                          +
                          +
                          +
                          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {$alt} + + + + + + + + + + + + + + + + +
                          +
                          + + + + +
                          +
                          + + + + +
                          +
                          + + + + +
                          +
                          + + + + +
                          +
                          +
                          + +
                          +
                          + + +
                          + + + + + + + + + + + +
                          +
                          + + + + + + + + + + + + + + [ not found]. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit From ada49490ba4972243e4b1873f990f11b8bfb5afd Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Wed, 1 Sep 2010 17:41:13 +0200 Subject: jl158: #i114008# deliver moved .zip --- xmlhelp/prj/d.lst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst index ec45189d3045..67fe323757bb 100644 --- a/xmlhelp/prj/d.lst +++ b/xmlhelp/prj/d.lst @@ -6,3 +6,5 @@ ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml ..\util\*.xsl %_DEST%\bin%_EXT%\*.* ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib +..\%__SRC%\bin\helpxsl.zip %_DEST%\pck%_EXT%\helpxsl.zip + -- cgit From 23eb90b58cd29c102d4e6f6e940933b04d9a87a7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Sep 2010 21:56:16 +0200 Subject: dba33i: #i112694# care for mouse handlers which tamper with the tree: survive this --- svx/source/dialog/checklbx.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx index c54634017392..80096ce70f32 100644 --- a/svx/source/dialog/checklbx.cxx +++ b/svx/source/dialog/checklbx.cxx @@ -212,7 +212,7 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.IsLeft() ) { - Point aPnt = rMEvt.GetPosPixel(); + const Point aPnt = rMEvt.GetPosPixel(); SvLBoxEntry* pEntry = GetEntry( aPnt ); if ( pEntry ) @@ -230,6 +230,13 @@ void SvxCheckListBox::MouseButtonDown( const MouseEvent& rMEvt ) { ToggleCheckButton( pEntry ); SvTreeListBox::MouseButtonDown( rMEvt ); + + // check if the entry below the mouse changed during the base method call. This is possible if, + // for instance, a handler invoked by the base class tampers with the list entries. + const SvLBoxEntry* pNewEntry = GetEntry( aPnt ); + if ( pNewEntry != pEntry ) + return; + if ( bCheck != ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) ) CheckButtonHdl(); return; -- cgit From 3e84753f90632b3cbbed8c1f283f539047e92c74 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 2 Sep 2010 12:18:55 +0200 Subject: vgbugs11: #i106852# more general solution --- sysui/desktop/cleanversion/makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysui/desktop/cleanversion/makefile.mk b/sysui/desktop/cleanversion/makefile.mk index d89b192b4995..40651af2d17b 100644 --- a/sysui/desktop/cleanversion/makefile.mk +++ b/sysui/desktop/cleanversion/makefile.mk @@ -43,7 +43,7 @@ ALLTAR: $(MISC)$/cleanup.flag # version changed - bin previous trees $(MISC)$/cleanup.flag : ..$/productversion.mk - rm -rf `ls -d ../../unxsols4.pro/misc/* | sed '/\/logs$/d'` && $(TOUCH) $@ + rm -rf `ls -d $(MISC)$/* | sed '/\/logs$/d'` && $(TOUCH) $@ .ENDIF # "$(MISC)"!="" -- cgit From ab46e29e1a993724a6000e82fd05514c2d34d115 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Sep 2010 12:25:23 +0200 Subject: dba33i: #i113684# proper termination condition when reading large strings --- connectivity/source/drivers/odbcbase/OTools.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx index 43de55e3505c..d598de8bc12d 100644 --- a/connectivity/source/drivers/odbcbase/OTools.cxx +++ b/connectivity/source/drivers/odbcbase/OTools.cxx @@ -578,7 +578,7 @@ Sequence OTools::getBytesValue(OConnection* _pConnection, // StarView zu lang ist oder der Treiber kann die Laenge der // Daten nicht im voraus bestimmen - also als MemoryStream // speichern. - while ((pcbValue == SQL_NO_TOTAL ) || pcbValue > nMaxLen) + while ((pcbValue == SQL_NO_TOTAL ) || nLen > nMaxLen) { // Bei Strings wird der Puffer nie ganz ausgenutzt // (das letzte Byte ist immer ein NULL-Byte, das -- cgit From bfac8e3f220d826d3443d7a367794a3df778d549 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Sep 2010 12:25:31 +0200 Subject: dba33i: fix GCC warning --- sfx2/source/view/viewfrm.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 744a8e83568d..0e71a49e30de 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2285,8 +2285,8 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const USHORT i_nNewViewId ) const sal_Int32 nCount = xViewData->getCount(); for ( sal_Int32 i=0; igetByIndex(i) ); - ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); + const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) ); + ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); if ( sViewId.getLength() == 0 ) continue; -- cgit From 0445833f87a174bcd6d638c975c9f7fc914f24c1 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 2 Sep 2010 14:48:49 +0200 Subject: cws tl82: #i114272# password dialog messages and min password length changed --- uui/source/masterpasscrtdlg.cxx | 2 +- uui/source/masterpasscrtdlg.src | 2 +- uui/source/passworderrs.src | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 uui/source/masterpasscrtdlg.cxx mode change 100644 => 100755 uui/source/masterpasscrtdlg.src mode change 100644 => 100755 uui/source/passworderrs.src diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx old mode 100644 new mode 100755 index af2ef194f22e..1622be0b38ab --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -93,7 +93,7 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog aHelpBtn ( this, ResId( BTN_MASTERPASSCRT_HELP, *pResMgr ) ), pResourceMgr ( pResMgr ), - nMinLen ( 5 ) + nMinLen ( 1 ) { FreeResource(); diff --git a/uui/source/masterpasscrtdlg.src b/uui/source/masterpasscrtdlg.src old mode 100644 new mode 100755 index 870cc8a2456f..439026d3f6e1 --- a/uui/source/masterpasscrtdlg.src +++ b/uui/source/masterpasscrtdlg.src @@ -86,7 +86,7 @@ ModalDialog DLG_UUI_MASTERPASSWORD_CRT Pos = MAP_APPFONT ( COL_0 , ROW_6 ) ; Size = MAP_APPFONT ( CTRL_WIDTH , 8*RSC_CD_FIXEDTEXT_HEIGHT ) ; WordBreak = TRUE ; - Text [ en-US ] = "Caution: Make sure you remember the Master Password you have set. If you forget your Master Password, you will be unable to access any of the information protected by it. Passwords are case-sensitive and at least five characters long."; + Text [ en-US ] = "Caution: If you forget the master password, you will be unable to access any of the information protected by it. Passwords are case-sensitive."; }; FixedLine FL_CAUTIONTEXT { diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src old mode 100644 new mode 100755 index 91b244ae543e..1ff0f7a70b46 --- a/uui/source/passworderrs.src +++ b/uui/source/passworderrs.src @@ -43,7 +43,7 @@ String STR_ERROR_PASSWORD_TO_MODIFY_WRONG String STR_ERROR_MASTERPASSWORD_WRONG { - Text [ en-US ] = "The wrong Master Password has been entered. %PRODUCTNAME could not access web login information protected by Master Password.\n\nNote: Passwords are case-sensitive and at least five characters long."; + Text [ en-US ] = "Caution: If you forget the master password, you will be unable to access any of the information protected by it. Passwords are case-sensitive."; }; String STR_ERROR_PASSWORDS_NOT_IDENTICAL -- cgit From 324f9a50a4cf7fb0cdbf7ec674263bb54f7d7d6c Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 2 Sep 2010 18:37:30 +0200 Subject: impress198: #i114276# fixed problem with the second handle position parameter of the enhancedcustoms --- xmloff/source/draw/ximpcustomshape.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 98255edf68d0..6f9710392e2a 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1247,7 +1247,6 @@ void XMLEnhancedCustomShapeContext::EndElement() { switch( EASGet( pValues->Name ) ) { - case EAS_Position : case EAS_RangeYMinimum : case EAS_RangeYMaximum : case EAS_RangeXMinimum : @@ -1259,6 +1258,8 @@ void XMLEnhancedCustomShapeContext::EndElement() pValues->Value.getValue()), pH ); } break; + + case EAS_Position : case EAS_Polar : { CheckAndResolveEquationParameter( (*((com::sun::star::drawing::EnhancedCustomShapeParameterPair*) -- cgit From 6d1adcc602a92f31d5341cafa3cbfbc647b24733 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 6 Sep 2010 09:19:49 +0200 Subject: cws tl82: #i114292# button order changed --- uui/source/logindlg.src | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 uui/source/logindlg.src diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src old mode 100644 new mode 100755 index bf6a97c3b0ff..736e0f9ae1df --- a/uui/source/logindlg.src +++ b/uui/source/logindlg.src @@ -175,20 +175,20 @@ ModalDialog DLG_UUI_LOGIN Size = MAP_APPFONT( 177 , 8 ) ; }; - OKButton BTN_LOGIN_OK + HelpButton BTN_LOGIN_HELP { Pos = MAP_APPFONT( 6 , 227 ) ; Size = MAP_APPFONT( 50 , 14 ) ; - DefButton = TRUE ; }; - CancelButton BTN_LOGIN_CANCEL + OKButton BTN_LOGIN_OK { Pos = MAP_APPFONT( 66 , 227 ) ; Size = MAP_APPFONT( 50 , 14 ) ; + DefButton = TRUE ; }; - HelpButton BTN_LOGIN_HELP + CancelButton BTN_LOGIN_CANCEL { Pos = MAP_APPFONT( 121 , 227 ) ; Size = MAP_APPFONT( 50 , 14 ) ; -- cgit From e70c93b5e54fab6a4eeb979fb9188a310b32c28e Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 6 Sep 2010 10:02:33 +0200 Subject: cws tl82: #i114160# SimplePasswordRequest and respective dialog --- uui/source/iahndl-authentication.cxx | 46 +++++++++---- uui/source/ids.hrc | 3 + uui/source/passworddlg.cxx | 126 +++++++++++++++++++++++++++-------- uui/source/passworddlg.hrc | 18 +++-- uui/source/passworddlg.hxx | 10 ++- uui/source/passworddlg.src | 76 +++++++++++++++------ uui/source/passworderrs.src | 5 ++ 7 files changed, 216 insertions(+), 68 deletions(-) mode change 100644 => 100755 uui/source/ids.hrc mode change 100644 => 100755 uui/source/passworddlg.cxx mode change 100644 => 100755 uui/source/passworddlg.hrc mode change 100644 => 100755 uui/source/passworddlg.hxx mode change 100644 => 100755 uui/source/passworddlg.src diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 6d65eb67055e..d3ebed5fc630 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -519,7 +519,8 @@ executePasswordDialog( task::PasswordRequestMode nMode, ::rtl::OUString aDocName, bool bMSCryptoMode, - bool bIsPasswordToModify ) + bool bIsPasswordToModify, + bool bIsSimplePasswordRequest ) SAL_THROW((uno::RuntimeException)) { try @@ -530,21 +531,36 @@ executePasswordDialog( ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) { - const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length + if (bIsSimplePasswordRequest) + { + std::auto_ptr< PasswordDialog > pDialog( + new PasswordDialog( pParent, nMode, xManager.get(), aDocName, + bIsPasswordToModify, bIsSimplePasswordRequest ) ); + pDialog->SetMinLen(0); + + rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); + rInfo.SetPassword( pDialog->GetPassword() ); + } + else + { + const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length - VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); - AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify ); - std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); + VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); + AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify ); + std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); - rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); - rInfo.SetPassword( pDialog->GetPasswordToOpen() ); - rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); - rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); + rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); + rInfo.SetPassword( pDialog->GetPasswordToOpen() ); + rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); + rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); + } } - else + else // enter password or reenter password { std::auto_ptr< PasswordDialog > pDialog( - new PasswordDialog( pParent, nMode, xManager.get(), aDocName, bIsPasswordToModify ) ); + new PasswordDialog( pParent, nMode, xManager.get(), aDocName, + bIsPasswordToModify, bIsSimplePasswordRequest ) ); + pDialog->SetMinLen(0); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); rInfo.SetPassword( bIsPasswordToModify ? String() : pDialog->GetPassword() ); @@ -567,7 +583,8 @@ handlePasswordRequest_( rContinuations, ::rtl::OUString aDocumentName, bool bMSCryptoMode, - bool bIsPasswordToModify ) + bool bIsPasswordToModify, + bool bIsSimplePasswordRequest = false ) SAL_THROW((uno::RuntimeException)) { uno::Reference< task::XInteractionRetry > xRetry; @@ -582,7 +599,7 @@ handlePasswordRequest_( LoginErrorInfo aInfo; executePasswordDialog( pParent, aInfo, nMode, - aDocumentName, bMSCryptoMode, bIsPasswordToModify ); + aDocumentName, bMSCryptoMode, bIsPasswordToModify, bIsSimplePasswordRequest ); switch (aInfo.GetResult()) { @@ -742,7 +759,8 @@ UUIInteractionHelper::handlePasswordRequest( rRequest->getContinuations(), rtl::OUString(), false /* bool bMSCryptoMode */, - false /* bool bIsPasswordToModify */); + false /* bool bIsPasswordToModify */, + true /* bool bIsSimplePasswordRequest */ ); return true; } diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc old mode 100644 new mode 100755 index 9be81479ef59..f9c9e2fd2d15 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -56,6 +56,7 @@ #define RID_UUI_ERRHDL (RID_UUI_START + 20) #define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) #define DLG_UUI_PASSWORD (RID_UUI_START + 22) +#define STR_ERROR_SIMPLE_PASSWORD_WRONG (RID_UUI_START + 23) #define STR_ERROR_PASSWORD_TO_OPEN_WRONG (RID_UUI_START + 24) #define STR_ERROR_PASSWORD_TO_MODIFY_WRONG (RID_UUI_START + 25) #define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26) @@ -93,6 +94,8 @@ #define STR_RENAME_OR_REPLACE (RID_UUI_START + 58) #define STR_NAME_CLASH_RENAME_ONLY (RID_UUI_START + 59) #define STR_SAME_NAME_USED (RID_UUI_START + 60) +#define STR_ENTER_SIMPLE_PASSWORD (RID_UUI_START + 61) +#define STR_CONFIRM_SIMPLE_PASSWORD (RID_UUI_START + 62) #define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) #define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx old mode 100644 new mode 100755 index c89184f54bc1..348d2f833e15 --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -25,67 +25,119 @@ * ************************************************************************/ +#include "passworddlg.hxx" +#include "passworddlg.hrc" +#include "ids.hrc" + #include #include -#ifndef UUI_IDS_HRC -#include -#endif -#ifndef UUI_PASSWORDDLG_HRC -#include -#endif -#include -// PasswordDialog--------------------------------------------------------- +using namespace ::com::sun::star; + // ----------------------------------------------------------------------- -IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG ) +static void lcl_Move( Window &rWin, long nOffset ) { - EndDialog( RET_OK ); - return 1; + Point aTmp( rWin.GetPosPixel() ); + aTmp.Y() += nOffset; + rWin.SetPosPixel( aTmp ); } // ----------------------------------------------------------------------- PasswordDialog::PasswordDialog( Window* _pParent, - ::com::sun::star::task::PasswordRequestMode nDlgMode, + task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, rtl::OUString& aDocURL, - bool bOpenToModify ) + bool bOpenToModify, + bool bIsSimplePasswordRequest ) :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) ) ,aFTPassword( this, ResId( FT_PASSWORD, *pResMgr )) ,aEDPassword( this, ResId( ED_PASSWORD, *pResMgr )) + ,aFTConfirmPassword( this, ResId( FT_CONFIRM_PASSWORD, *pResMgr )) + ,aEDConfirmPassword( this, ResId( ED_CONFIRM_PASSWORD, *pResMgr )) ,aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr )) ,aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr )) ,aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr )) ,aFixedLine1( this, ResId( FL_FIXED_LINE_1, *pResMgr )) + ,nMinLen(1) + ,aPasswdMismatch( ResId( STR_PASSWORD_MISMATCH, *pResMgr )) ,nDialogMode( nDlgMode ) ,pResourceMgr ( pResMgr ) { - if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER ) + if( nDialogMode == task::PasswordRequestMode_PASSWORD_REENTER ) { - USHORT nErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG; + const USHORT nOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG; + const USHORT nErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : nOpenToModifyErrStrId; String aErrorMsg( ResId( nErrStrId, *pResourceMgr )); - ErrorBox aErrorBox( _pParent, WB_OK, aErrorMsg ); + ErrorBox aErrorBox( this, WB_OK, aErrorMsg ); aErrorBox.Execute(); } + // default settings for enter password or reenter passwd... + String aTitle( ResId( STR_TITLE_ENTER_PASSWORD, *pResourceMgr ) ); + aFTConfirmPassword.Hide(); + aEDConfirmPassword.Hide(); + aFTConfirmPassword.Enable( FALSE ); + aEDConfirmPassword.Enable( FALSE ); + + // settings for create password + if (nDialogMode == task::PasswordRequestMode_PASSWORD_CREATE) + { + aTitle = String( ResId( STR_TITLE_CREATE_PASSWORD, *pResourceMgr ) ); + + aFTConfirmPassword.SetText( String( ResId( STR_CONFIRM_SIMPLE_PASSWORD, *pResourceMgr ) ) ); + + aFTConfirmPassword.Show(); + aEDConfirmPassword.Show(); + aFTConfirmPassword.Enable( TRUE ); + aEDConfirmPassword.Enable( TRUE ); + } + else + { + // shrink dialog by size of hidden controls and move rest up accordingly + + long nDelta = aFixedLine1.GetPosPixel().Y() - aFTConfirmPassword.GetPosPixel().Y(); + + lcl_Move( aFixedLine1, -nDelta ); + lcl_Move( aOKBtn, -nDelta ); + lcl_Move( aCancelBtn, -nDelta ); + lcl_Move( aHelpBtn, -nDelta ); + + Size aNewDlgSize = GetSizePixel(); + aNewDlgSize.Height() -= nDelta; + SetSizePixel( aNewDlgSize ); + } + + SetText( aTitle ); + USHORT nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN; aFTPassword.SetText( String( ResId( nStrId, *pResourceMgr ) ) ); + aFTPassword.SetText( aFTPassword.GetText() + aDocURL ); + if (bIsSimplePasswordRequest) + { + DBG_ASSERT( aDocURL.getLength() == 0, "A simple password request should not have a document URL! Use document password request instead." ); + aFTPassword.SetText( String( ResId( STR_ENTER_SIMPLE_PASSWORD, *pResourceMgr ) ) ); + } FreeResource(); - aFTPassword.SetText( aFTPassword.GetText() + aDocURL ); - aOKBtn.SetClickHdl( LINK( this, PasswordDialog, OKHdl_Impl ) ); - long nLabelWidth = aFTPassword.GetSizePixel().Width(); - long nLabelHeight = aFTPassword.GetSizePixel().Height(); - long nTextWidth = aFTPassword.GetCtrlTextWidth( aFTPassword.GetText() ); - long nTextHeight = aFTPassword.GetTextHeight(); + + // + // move controls down by extra height needed for aFTPassword + // (usually only needed if a URL was provided) + // + + long nLabelWidth = aFTPassword.GetSizePixel().Width(); + long nLabelHeight = aFTPassword.GetSizePixel().Height(); + long nTextWidth = aFTPassword.GetCtrlTextWidth( aFTPassword.GetText() ); + long nTextHeight = aFTPassword.GetTextHeight(); Rectangle aLabelRect( aFTPassword.GetPosPixel(), aFTPassword.GetSizePixel() ); Rectangle aRect = aFTPassword.GetTextRect( aLabelRect, aFTPassword.GetText() ); @@ -105,13 +157,31 @@ PasswordDialog::PasswordDialog( aNewLabelSize.Height() = nNewLabelHeight; aFTPassword.SetPosSizePixel( aFTPassword.GetPosPixel(), aNewLabelSize ); - Window* pControls[] = { &aEDPassword, &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn }; - const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] ); - for ( int i = 0; i < nCCount; ++i ) + lcl_Move( aEDPassword, nDelta ); + lcl_Move( aFTConfirmPassword, nDelta ); + lcl_Move( aEDConfirmPassword, nDelta ); + lcl_Move( aFixedLine1, nDelta ); + lcl_Move( aOKBtn, nDelta ); + lcl_Move( aCancelBtn, nDelta ); + lcl_Move( aHelpBtn, nDelta ); +} + + +IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG ) +{ + bool bEDPasswdValid = aEDPassword.GetText().Len() >= nMinLen; + bool bPasswdMismatch = aEDConfirmPassword.GetText() != aEDPassword.GetText(); + bool bValid = (!aEDConfirmPassword.IsVisible() && bEDPasswdValid) || + (aEDConfirmPassword.IsVisible() && bEDPasswdValid && !bPasswdMismatch); + + if (aEDConfirmPassword.IsVisible() && bPasswdMismatch) { - Point aNewPos =(*pControls[i]).GetPosPixel(); - aNewPos.Y() += nDelta; - pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() ); + ErrorBox aErrorBox( this, WB_OK, aPasswdMismatch ); + aErrorBox.Execute(); } + else if (bValid) + EndDialog( RET_OK ); + return 1; } + diff --git a/uui/source/passworddlg.hrc b/uui/source/passworddlg.hrc old mode 100644 new mode 100755 index ad7517b7a62b..e9a8bb5b5b04 --- a/uui/source/passworddlg.hrc +++ b/uui/source/passworddlg.hrc @@ -29,12 +29,18 @@ #define PASSWORDDLG_HRC // local identifiers -#define BTN_PASSWORD_OK 1 -#define ED_PASSWORD 2 -#define FT_PASSWORD 3 -#define FL_FIXED_LINE_1 4 -#define BTN_PASSWORD_HELP 5 -#define BTN_PASSWORD_CANCEL 6 +#define BTN_PASSWORD_OK 1 +#define ED_PASSWORD 2 +#define FT_PASSWORD 3 +#define FT_CONFIRM_PASSWORD 4 +#define ED_CONFIRM_PASSWORD 5 +#define FL_FIXED_LINE_1 6 +#define BTN_PASSWORD_HELP 7 +#define BTN_PASSWORD_CANCEL 8 + +#define STR_TITLE_CREATE_PASSWORD 9 +#define STR_TITLE_ENTER_PASSWORD 10 +#define STR_PASSWORD_MISMATCH 11 #endif // PASSWORDDLG_HRC diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx old mode 100644 new mode 100755 index fe5fe7f2ef84..b94dbab82444 --- a/uui/source/passworddlg.hxx +++ b/uui/source/passworddlg.hxx @@ -37,21 +37,28 @@ #include //============================================================================ + class PasswordDialog : public ModalDialog { FixedText aFTPassword; Edit aEDPassword; + FixedText aFTConfirmPassword; + Edit aEDConfirmPassword; OKButton aOKBtn; CancelButton aCancelBtn; HelpButton aHelpBtn; FixedLine aFixedLine1; + USHORT nMinLen; + String aPasswdMismatch; DECL_LINK( OKHdl_Impl, OKButton * ); public: - PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL, bool bOpenToModify = false ); + PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL, + bool bOpenToModify = false, bool bIsSimplePasswordRequest = false ); + void SetMinLen( USHORT nMin ) { nMinLen = nMin; } String GetPassword() const { return aEDPassword.GetText(); } private: @@ -60,3 +67,4 @@ private: }; #endif // PASSWORDDLG_HXX + diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src old mode 100644 new mode 100755 index 33767057e1bd..52f8fbfac134 --- a/uui/source/passworddlg.src +++ b/uui/source/passworddlg.src @@ -41,48 +41,61 @@ ModalDialog DLG_UUI_PASSWORD Moveable = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT( 145, 91 ); - Text [ en-US ] = "Enter password"; + Size = MAP_APPFONT( 165, 95 ); FixedText FT_PASSWORD { - Pos = MAP_APPFONT( 3, 4 ); - Size = MAP_APPFONT( 139, 28 ); + Pos = MAP_APPFONT( 3, 6 ); + Size = MAP_APPFONT( 159, 8 ); WordBreak = TRUE; }; Edit ED_PASSWORD { - Pos = MAP_APPFONT( 3, 51 ); - Size = MAP_APPFONT( 139, 13 ); + Pos = MAP_APPFONT( 3, 17 ); + Size = MAP_APPFONT( 159, 12 ); Border = TRUE ; PassWord = TRUE ; }; - FixedLine FL_FIXED_LINE_1 + FixedText FT_CONFIRM_PASSWORD { - Pos = MAP_APPFONT( 0, 66 ); - Size = MAP_APPFONT( 145, 6 ); + Pos = MAP_APPFONT( 3, 34 ); + Size = MAP_APPFONT( 159, 8 ); + WordBreak = TRUE; }; - OKButton BTN_PASSWORD_OK + Edit ED_CONFIRM_PASSWORD { - Pos = MAP_APPFONT( 27, 72 ); - Size = MAP_APPFONT( 37, 15 ); - DefButton = TRUE ; - DefButton = TRUE; + Pos = MAP_APPFONT( 3, 45 ); + Size = MAP_APPFONT( 159, 12 ); + Border = TRUE ; + PassWord = TRUE ; }; - CancelButton BTN_PASSWORD_CANCEL + FixedLine FL_FIXED_LINE_1 { - Pos = MAP_APPFONT( 66, 72 ); - Size = MAP_APPFONT( 37, 15 ); + Pos = MAP_APPFONT( 0, 63 ); + Size = MAP_APPFONT( 165, 8 ); }; HelpButton BTN_PASSWORD_HELP { - Pos = MAP_APPFONT( 105, 72 ); - Size = MAP_APPFONT( 37, 15 ); + Pos = MAP_APPFONT( 3, 76 ); + Size = MAP_APPFONT( 50, 14 ); + }; + + OKButton BTN_PASSWORD_OK + { + Pos = MAP_APPFONT( 59, 76 ); + Size = MAP_APPFONT( 50, 14 ); + DefButton = TRUE ; + }; + + CancelButton BTN_PASSWORD_CANCEL + { + Pos = MAP_APPFONT( 112, 76 ); + Size = MAP_APPFONT( 50, 14 ); }; String STR_ENTER_PASSWORD_TO_OPEN @@ -94,5 +107,30 @@ ModalDialog DLG_UUI_PASSWORD { Text [ en-US ] = "Enter password to modify file: \n"; }; + + String STR_ENTER_SIMPLE_PASSWORD + { + Text [ en-US ] = "Enter password: "; + }; + + String STR_CONFIRM_SIMPLE_PASSWORD + { + Text [ en-US ] = "Confirm password: "; + }; + + String STR_TITLE_CREATE_PASSWORD + { + Text [ en-US ] = "Set Password"; + }; + + String STR_TITLE_ENTER_PASSWORD + { + Text [ en-US ] = "Enter Password"; + }; + + String STR_PASSWORD_MISMATCH + { + Text [ en-US ] = "The confirmation password did not match the password. Set the password again by entering the same password in both boxes." ; + }; }; diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src index 1ff0f7a70b46..73741d35df2e 100755 --- a/uui/source/passworderrs.src +++ b/uui/source/passworderrs.src @@ -46,6 +46,11 @@ String STR_ERROR_MASTERPASSWORD_WRONG Text [ en-US ] = "Caution: If you forget the master password, you will be unable to access any of the information protected by it. Passwords are case-sensitive."; }; +String STR_ERROR_SIMPLE_PASSWORD_WRONG +{ + Text [ en-US ] = "The password is incorrect."; +}; + String STR_ERROR_PASSWORDS_NOT_IDENTICAL { Text [ en-US ] = "The password confirmation does not match."; -- cgit From 5efdee14aa33ffa892c79b60c9d061e100b9b0ba Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 7 Sep 2010 10:46:02 +0200 Subject: cws tl82: #i114272# error message changed --- uui/source/passworderrs.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src index 73741d35df2e..3d4307ad4f80 100755 --- a/uui/source/passworderrs.src +++ b/uui/source/passworderrs.src @@ -43,7 +43,7 @@ String STR_ERROR_PASSWORD_TO_MODIFY_WRONG String STR_ERROR_MASTERPASSWORD_WRONG { - Text [ en-US ] = "Caution: If you forget the master password, you will be unable to access any of the information protected by it. Passwords are case-sensitive."; + Text [ en-US ] = "The master password is incorrect."; }; String STR_ERROR_SIMPLE_PASSWORD_WRONG -- cgit From 663798e24e8bfd1d0194002a675a24d8eda271c2 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 7 Sep 2010 17:50:32 +0200 Subject: #i113922# added code to transform the LineWidth on MetaFile creation with the current transformation --- drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index dc954de7bb2a..0d2be85f9872 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1206,7 +1206,12 @@ namespace drawinglayer mpOutputDevice->SetLineColor(Color(aHairlineColor)); mpOutputDevice->SetFillColor(); aHairLinePolyPolygon.transform(maCurrentTransformation); - LineInfo aLineInfo(LINE_SOLID, basegfx::fround(rLine.getWidth())); + + // #i113922# LineWidth needs to be transformed, too + const basegfx::B2DVector aDiscreteUnit(maCurrentTransformation * basegfx::B2DVector(rLine.getWidth(), 0.0)); + const double fDiscreteLineWidth(aDiscreteUnit.getLength()); + + LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth)); aLineInfo.SetLineJoin(rLine.getLineJoin()); for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++) -- cgit From 90a93cdf131381df4fe985d6535be76a52310a1c Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 9 Sep 2010 10:48:03 +0200 Subject: hb22: #b6982587# treat null LD_LIBRARY_PATH like unset one --- desktop/scripts/soffice.sh | 2 +- desktop/scripts/unopkg.sh | 2 +- svx/source/gengal/gengal.sh | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index 0215f88d1ff0..cd191e43ef2b 100644 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -96,7 +96,7 @@ if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` if [ -n "$my_path" ] ; then - LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} + LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH fi fi diff --git a/desktop/scripts/unopkg.sh b/desktop/scripts/unopkg.sh index 0fe319735c06..1f09b87eb1ef 100644 --- a/desktop/scripts/unopkg.sh +++ b/desktop/scripts/unopkg.sh @@ -57,7 +57,7 @@ if [ -x "$sd_prog/../basis-link/ure-link/bin/javaldx" ] ; then my_path=`"$sd_prog/../basis-link/ure-link/bin/javaldx" $BOOTSTRAPVARS \ "-env:INIFILENAME=vnd.sun.star.pathname:$sd_prog/redirectrc"` if [ -n "$my_path" ] ; then - LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH} + LD_LIBRARY_PATH=$my_path${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH fi fi diff --git a/svx/source/gengal/gengal.sh b/svx/source/gengal/gengal.sh index 98e2cc1c845a..a760b8e085d0 100644 --- a/svx/source/gengal/gengal.sh +++ b/svx/source/gengal/gengal.sh @@ -67,17 +67,17 @@ case $sd_platform in ;; Darwin) - DYLD_LIBRARY_PATH=${sd_prog}${DYLD_LIBRARY_PATH+:${DYLD_LIBRARY_PATH}} + DYLD_LIBRARY_PATH=${sd_prog}${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}} export DYLD_LIBRARY_PATH ;; HP-UX) - SHLIB_PATH=${sd_prog}:/usr/openwin/lib${SHLIB_PATH+:${SHLIB_PATH}} + SHLIB_PATH=${sd_prog}:/usr/openwin/lib${SHLIB_PATH:+:${SHLIB_PATH}} export SHLIB_PATH ;; *) - LD_LIBRARY_PATH=${sd_prog}${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}} + LD_LIBRARY_PATH=${sd_prog}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export LD_LIBRARY_PATH ;; esac -- cgit From 7a54dffcfbdb0d2e004ad070c35f511cee6642b5 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:09:38 +0200 Subject: sb129: #i113189# move XmlReader from configmgr to URE --- configmgr/prj/build.lst | 2 +- configmgr/source/README | 3 - configmgr/source/components.cxx | 4 +- configmgr/source/makefile.mk | 7 +- configmgr/source/pad.cxx | 91 ---- configmgr/source/pad.hxx | 61 --- configmgr/source/parsemanager.cxx | 31 +- configmgr/source/parsemanager.hxx | 13 +- configmgr/source/parser.hxx | 14 +- configmgr/source/span.hxx | 64 --- configmgr/source/valueparser.cxx | 68 +-- configmgr/source/valueparser.hxx | 14 +- configmgr/source/writemodfile.cxx | 35 +- configmgr/source/xcdparser.cxx | 44 +- configmgr/source/xcdparser.hxx | 13 +- configmgr/source/xcsparser.cxx | 167 +++--- configmgr/source/xcsparser.hxx | 27 +- configmgr/source/xcuparser.cxx | 205 ++++---- configmgr/source/xcuparser.hxx | 38 +- configmgr/source/xmldata.cxx | 112 ++-- configmgr/source/xmldata.hxx | 14 +- configmgr/source/xmlreader.cxx | 1054 ------------------------------------- configmgr/source/xmlreader.hxx | 186 ------- 23 files changed, 416 insertions(+), 1851 deletions(-) delete mode 100644 configmgr/source/pad.cxx delete mode 100644 configmgr/source/pad.hxx delete mode 100644 configmgr/source/span.hxx delete mode 100644 configmgr/source/xmlreader.cxx delete mode 100644 configmgr/source/xmlreader.hxx diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst index 9fcccbc73b4c..bbd0d7f34a9a 100644 --- a/configmgr/prj/build.lst +++ b/configmgr/prj/build.lst @@ -1,4 +1,4 @@ -cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport NULL +cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL cg configmgr\inc nmake - all cg_inc NULL cg configmgr\source nmake - all cg_source cg_inc NULL cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL diff --git a/configmgr/source/README b/configmgr/source/README index b731043d34ed..e662dd2fd577 100644 --- a/configmgr/source/README +++ b/configmgr/source/README @@ -51,16 +51,13 @@ propertynode.cxx setnode.cxx Internal representations of data nodes. -pad.cxx parsemanager.cxx parser.hxx -span.hxx valueparser.cxx xcdparser.cxx xcsparser.cxx xcuparser.cxx xmldata.cxx -xmlreader.cxx XML file reading. modifications.cxx diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 04e6317c959d..918c80f0a2a6 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -655,8 +655,8 @@ void Components::parseModificationLayer() { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); // Migrate old user layer data (can be removed once migration is no - // longer relevant; also see hack for xsi namespace in XmlReader - // constructor): + // longer relevant; also see hack for xsi namespace in + // xmlreader::XmlReader constructor): parseFiles( Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")), &parseXcuFile, diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk index 777fed3323d8..37235a726ce4 100644 --- a/configmgr/source/makefile.mk +++ b/configmgr/source/makefile.mk @@ -52,7 +52,6 @@ SLOFILES = \ $(SLO)/modifications.obj \ $(SLO)/node.obj \ $(SLO)/nodemap.obj \ - $(SLO)/pad.obj \ $(SLO)/parsemanager.obj \ $(SLO)/partial.obj \ $(SLO)/propertynode.obj \ @@ -66,8 +65,7 @@ SLOFILES = \ $(SLO)/xcdparser.obj \ $(SLO)/xcsparser.obj \ $(SLO)/xcuparser.obj \ - $(SLO)/xmldata.obj \ - $(SLO)/xmlreader.obj + $(SLO)/xmldata.obj SHL1IMPLIB = i$(SHL1TARGET) SHL1OBJS = $(SLOFILES) @@ -76,7 +74,8 @@ SHL1STDLIBS = \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALHELPERLIB) \ - $(SALLIB) + $(SALLIB) \ + $(XMLREADERLIB) SHL1TARGET = configmgr.uno SHL1USE_EXPORTS = name DEF1NAME = $(SHL1TARGET) diff --git a/configmgr/source/pad.cxx b/configmgr/source/pad.cxx deleted file mode 100644 index c8c7218b6da6..000000000000 --- a/configmgr/source/pad.cxx +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#include "precompiled_configmgr.hxx" -#include "sal/config.h" - -#include "osl/diagnose.h" -#include "rtl/string.h" -#include "sal/types.h" - -#include "pad.hxx" -#include "span.hxx" - -namespace configmgr { - -void Pad::add(char const * begin, sal_Int32 length) { - OSL_ASSERT( - begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0)); - if (length != 0) { - flushSpan(); - if (buffer_.getLength() == 0) { - span_ = Span(begin, length); - } else { - buffer_.append(begin, length); - } - } -} - -void Pad::addEphemeral(char const * begin, sal_Int32 length) { - OSL_ASSERT( - begin != 0 && length >= 0 && !(span_.is() && buffer_.getLength() != 0)); - if (length != 0) { - flushSpan(); - buffer_.append(begin, length); - } -} - -void Pad::clear() { - OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0)); - span_.clear(); - buffer_.setLength(0); -} - -bool Pad::is() const { - OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0)); - return span_.is() || buffer_.getLength() != 0; -} - -Span Pad::get() const { - OSL_ASSERT(!(span_.is() && buffer_.getLength() != 0)); - if (span_.is()) { - return span_; - } else if (buffer_.getLength() == 0) { - return Span(RTL_CONSTASCII_STRINGPARAM("")); - } else { - return Span(buffer_.getStr(), buffer_.getLength()); - } -} - -void Pad::flushSpan() { - if (span_.is()) { - buffer_.append(span_.begin, span_.length); - span_.clear(); - } -} - -} diff --git a/configmgr/source/pad.hxx b/configmgr/source/pad.hxx deleted file mode 100644 index 66a51f480023..000000000000 --- a/configmgr/source/pad.hxx +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_PAD_HXX -#define INCLUDED_CONFIGMGR_SOURCE_PAD_HXX - -#include "sal/config.h" - -#include "rtl/strbuf.hxx" -#include "sal/types.h" - -#include "span.hxx" - -namespace configmgr { - -class Pad { -public: - void add(char const * begin, sal_Int32 length); - - void addEphemeral(char const * begin, sal_Int32 length); - - void clear(); - - bool is() const; - - Span get() const; - -private: - void flushSpan(); - - Span span_; - rtl::OStringBuffer buffer_; -}; - -} - -#endif diff --git a/configmgr/source/parsemanager.cxx b/configmgr/source/parsemanager.cxx index 69a5515b977c..c17eddd2976f 100644 --- a/configmgr/source/parsemanager.cxx +++ b/configmgr/source/parsemanager.cxx @@ -32,10 +32,11 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "osl/diagnose.h" #include "sal/types.h" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" #include "parsemanager.hxx" #include "parser.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -52,28 +53,42 @@ ParseManager::ParseManager( reader_(url), parser_(parser) { OSL_ASSERT(parser.is()); + int id; + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"))); + OSL_ASSERT(id == NAMESPACE_OOR); + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"))); + OSL_ASSERT(id == NAMESPACE_XS); + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM( + "http://www.w3.org/2001/XMLSchema-instance"))); + OSL_ASSERT(id == NAMESPACE_XSI); } bool ParseManager::parse() { for (;;) { switch (itemData_.is() - ? XmlReader::RESULT_BEGIN + ? xmlreader::XmlReader::RESULT_BEGIN : reader_.nextItem( - parser_->getTextMode(), &itemData_, &itemNamespace_)) + parser_->getTextMode(), &itemData_, &itemNamespaceId_)) { - case XmlReader::RESULT_BEGIN: - if (!parser_->startElement(reader_, itemNamespace_, itemData_)) + case xmlreader::XmlReader::RESULT_BEGIN: + if (!parser_->startElement(reader_, itemNamespaceId_, itemData_)) { return false; } break; - case XmlReader::RESULT_END: + case xmlreader::XmlReader::RESULT_END: parser_->endElement(reader_); break; - case XmlReader::RESULT_TEXT: + case xmlreader::XmlReader::RESULT_TEXT: parser_->characters(itemData_); break; - case XmlReader::RESULT_DONE: + case xmlreader::XmlReader::RESULT_DONE: return true; } itemData_.clear(); diff --git a/configmgr/source/parsemanager.hxx b/configmgr/source/parsemanager.hxx index 18292859ab98..19d16c74621a 100644 --- a/configmgr/source/parsemanager.hxx +++ b/configmgr/source/parsemanager.hxx @@ -35,9 +35,8 @@ #include "rtl/ref.hxx" #include "sal/types.h" #include "salhelper/simplereferenceobject.hxx" - -#include "span.hxx" -#include "xmlreader.hxx" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" namespace rtl { class OUString; } @@ -55,13 +54,15 @@ public: bool parse(); + enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 }; + private: virtual ~ParseManager(); - XmlReader reader_; + xmlreader::XmlReader reader_; rtl::Reference< Parser > parser_; - Span itemData_; - XmlReader::Namespace itemNamespace_; + xmlreader::Span itemData_; + int itemNamespaceId_; }; } diff --git a/configmgr/source/parser.hxx b/configmgr/source/parser.hxx index da29941953b5..f782e0dbc151 100644 --- a/configmgr/source/parser.hxx +++ b/configmgr/source/parser.hxx @@ -33,23 +33,23 @@ #include #include "salhelper/simplereferenceobject.hxx" +#include "xmlreader/xmlreader.hxx" -#include "xmlreader.hxx" +namespace xmlreader { struct Span; } namespace configmgr { -struct Span; - class Parser: public salhelper::SimpleReferenceObject { public: - virtual XmlReader::Text getTextMode() = 0; + virtual xmlreader::XmlReader::Text getTextMode() = 0; virtual bool startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name) = 0; + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) + = 0; - virtual void endElement(XmlReader const & reader) = 0; + virtual void endElement(xmlreader::XmlReader const & reader) = 0; - virtual void characters(Span const & text) = 0; + virtual void characters(xmlreader::Span const & text) = 0; protected: Parser() {} diff --git a/configmgr/source/span.hxx b/configmgr/source/span.hxx deleted file mode 100644 index 689618613700..000000000000 --- a/configmgr/source/span.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX -#define INCLUDED_CONFIGMGR_SOURCE_SPAN_HXX - -#include "sal/config.h" - -#include "rtl/string.h" -#include "sal/types.h" - -namespace configmgr { - -struct Span { - char const * begin; - sal_Int32 length; - - inline Span(): begin(0), length(0) {} - // init length to avoid compiler warnings - - inline Span(char const * theBegin, sal_Int32 theLength): - begin(theBegin), length(theLength) {} - - inline void clear() throw() { begin = 0; } - - inline bool is() const { return begin != 0; } - - inline bool equals(Span const & text) const { - return rtl_str_compare_WithLength( - begin, length, text.begin, text.length) == 0; - } - - inline bool equals(char const * textBegin, sal_Int32 textLength) const { - return equals(Span(textBegin, textLength)); - } -}; - -} - -#endif diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx index 4adf452c409b..0be173f74919 100644 --- a/configmgr/source/valueparser.cxx +++ b/configmgr/source/valueparser.cxx @@ -40,16 +40,17 @@ #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" #include "localizedvaluenode.hxx" #include "node.hxx" #include "nodemap.hxx" +#include "parsemanager.hxx" #include "propertynode.hxx" -#include "span.hxx" #include "type.hxx" #include "valueparser.hxx" #include "xmldata.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -74,7 +75,7 @@ bool parseHexDigit(char c, int * value) { return false; } -bool parseValue(Span const & text, sal_Bool * value) { +bool parseValue(xmlreader::Span const & text, sal_Bool * value) { OSL_ASSERT(text.is() && value != 0); if (text.equals(RTL_CONSTASCII_STRINGPARAM("true")) || text.equals(RTL_CONSTASCII_STRINGPARAM("1"))) @@ -91,7 +92,7 @@ bool parseValue(Span const & text, sal_Bool * value) { return false; } -bool parseValue(Span const & text, sal_Int16 * value) { +bool parseValue(xmlreader::Span const & text, sal_Int16 * value) { OSL_ASSERT(text.is() && value != 0); // For backwards compatibility, support hexadecimal values: sal_Int32 n = @@ -110,7 +111,7 @@ bool parseValue(Span const & text, sal_Int16 * value) { return false; } -bool parseValue(Span const & text, sal_Int32 * value) { +bool parseValue(xmlreader::Span const & text, sal_Int32 * value) { OSL_ASSERT(text.is() && value != 0); // For backwards compatibility, support hexadecimal values: *value = @@ -125,7 +126,7 @@ bool parseValue(Span const & text, sal_Int32 * value) { return true; } -bool parseValue(Span const & text, sal_Int64 * value) { +bool parseValue(xmlreader::Span const & text, sal_Int64 * value) { OSL_ASSERT(text.is() && value != 0); // For backwards compatibility, support hexadecimal values: *value = @@ -140,20 +141,22 @@ bool parseValue(Span const & text, sal_Int64 * value) { return true; } -bool parseValue(Span const & text, double * value) { +bool parseValue(xmlreader::Span const & text, double * value) { OSL_ASSERT(text.is() && value != 0); *value = rtl::OString(text.begin, text.length).toDouble(); //TODO: check valid lexical representation return true; } -bool parseValue(Span const & text, rtl::OUString * value) { +bool parseValue(xmlreader::Span const & text, rtl::OUString * value) { OSL_ASSERT(text.is() && value != 0); - *value = xmldata::convertFromUtf8(text); + *value = text.convertFromUtf8(); return true; } -bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) { +bool parseValue( + xmlreader::Span const & text, css::uno::Sequence< sal_Int8 > * value) +{ OSL_ASSERT(text.is() && value != 0); if ((text.length & 1) != 0) { return false; @@ -173,7 +176,9 @@ bool parseValue(Span const & text, css::uno::Sequence< sal_Int8 > * value) { return true; } -template< typename T > css::uno::Any parseSingleValue(Span const & text) { +template< typename T > css::uno::Any parseSingleValue( + xmlreader::Span const & text) +{ T val; if (!parseValue(text, &val)) { throw css::uno::RuntimeException( @@ -184,21 +189,23 @@ template< typename T > css::uno::Any parseSingleValue(Span const & text) { } template< typename T > css::uno::Any parseListValue( - rtl::OString const & separator, Span const & text) + rtl::OString const & separator, xmlreader::Span const & text) { comphelper::SequenceAsVector< T > seq; - Span sep; + xmlreader::Span sep; if (separator.getLength() == 0) { - sep = Span(RTL_CONSTASCII_STRINGPARAM(" ")); + sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" ")); } else { - sep = Span(separator.getStr(), separator.getLength()); + sep = xmlreader::Span(separator.getStr(), separator.getLength()); } if (text.length != 0) { - for (Span t(text);;) { + for (xmlreader::Span t(text);;) { sal_Int32 i = rtl_str_indexOfStr_WithLength( t.begin, t.length, sep.begin, sep.length); T val; - if (!parseValue(Span(t.begin, i == -1 ? t.length : i), &val)) { + if (!parseValue( + xmlreader::Span(t.begin, i == -1 ? t.length : i), &val)) + { throw css::uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid value")), css::uno::Reference< css::uno::XInterface >()); @@ -215,7 +222,7 @@ template< typename T > css::uno::Any parseListValue( } css::uno::Any parseValue( - rtl::OString const & separator, Span const & text, Type type) + rtl::OString const & separator, xmlreader::Span const & text, Type type) { switch (type) { case TYPE_ANY: @@ -266,7 +273,7 @@ ValueParser::ValueParser(int layer): layer_(layer) {} ValueParser::~ValueParser() {} -XmlReader::Text ValueParser::getTextMode() const { +xmlreader::XmlReader::Text ValueParser::getTextMode() const { if (node_.is()) { switch (state_) { case STATE_TEXT: @@ -278,23 +285,24 @@ XmlReader::Text ValueParser::getTextMode() const { return (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST || separator_.getLength() != 0) - ? XmlReader::TEXT_RAW : XmlReader::TEXT_NORMALIZED; + ? xmlreader::XmlReader::TEXT_RAW + : xmlreader::XmlReader::TEXT_NORMALIZED; default: break; } } - return XmlReader::TEXT_NONE; + return xmlreader::XmlReader::TEXT_NONE; } bool ValueParser::startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name) + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) { if (!node_.is()) { return false; } switch (state_) { case STATE_TEXT: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("it")) && isListType(type_) && separator_.getLength() == 0) { @@ -306,18 +314,18 @@ bool ValueParser::startElement( } // fall through case STATE_IT: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) && (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST)) { sal_Int32 scalar = -1; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("scalar"))) { if (!parseValue(reader.getAttributeValue(true), &scalar)) { @@ -352,7 +360,7 @@ bool ValueParser::startElement( } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } @@ -439,7 +447,7 @@ bool ValueParser::endElement() { return true; } -void ValueParser::characters(Span const & text) { +void ValueParser::characters(xmlreader::Span const & text) { if (node_.is()) { OSL_ASSERT(state_ == STATE_TEXT || state_ == STATE_IT); pad_.add(text.begin, text.length); diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx index 4e899f4632dd..c5e1d0a0a45f 100644 --- a/configmgr/source/valueparser.hxx +++ b/configmgr/source/valueparser.hxx @@ -36,19 +36,19 @@ #include "rtl/ref.hxx" #include "rtl/string.hxx" #include "rtl/ustring.hxx" +#include "xmlreader/pad.hxx" +#include "xmlreader/xmlreader.hxx" -#include "pad.hxx" #include "type.hxx" -#include "xmlreader.hxx" namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } +namespace xmlreader { struct Span; } namespace configmgr { class Node; -struct Span; class ValueParser: private boost::noncopyable { public: @@ -56,14 +56,14 @@ public: ~ValueParser(); - XmlReader::Text getTextMode() const; + xmlreader::XmlReader::Text getTextMode() const; bool startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name); + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); bool endElement(); - void characters(Span const & text); + void characters(xmlreader::Span const & text); void start( rtl::Reference< Node > const & property, @@ -83,7 +83,7 @@ private: rtl::Reference< Node > node_; rtl::OUString localizedName_; State state_; - Pad pad_; + xmlreader::Pad pad_; std::vector< com::sun::star::uno::Any > items_; }; diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx index c2573ab67439..5616833abf3d 100644 --- a/configmgr/source/writemodfile.cxx +++ b/configmgr/source/writemodfile.cxx @@ -45,6 +45,7 @@ #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "xmlreader/span.hxx" #include "data.hxx" #include "groupnode.hxx" @@ -54,7 +55,6 @@ #include "node.hxx" #include "nodemap.hxx" #include "propertynode.hxx" -#include "span.hxx" #include "type.hxx" #include "writemodfile.hxx" @@ -341,22 +341,23 @@ void writeNode( rtl::Reference< Node > const & parent, rtl::OUString const & name, rtl::Reference< Node > const & node) { - static Span const typeNames[] = { - Span(), Span(), Span(), // TYPE_ERROR, TYPE_NIL, TYPE_ANY - Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:short")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:int")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:long")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:double")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:string")), - Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")), - Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) }; + static xmlreader::Span const typeNames[] = { + xmlreader::Span(), xmlreader::Span(), xmlreader::Span(), + // TYPE_ERROR, TYPE_NIL, TYPE_ANY + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:hexBinary-list")) }; switch (node->kind()) { case Node::KIND_PROPERTY: { diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx index 498254b35644..b8092866cb4e 100644 --- a/configmgr/source/xcdparser.cxx +++ b/configmgr/source/xcdparser.cxx @@ -37,13 +37,14 @@ #include "rtl/string.h" #include "rtl/ustring.h" #include "rtl/ustring.hxx" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" -#include "span.hxx" +#include "parsemanager.hxx" #include "xcdparser.hxx" #include "xcsparser.hxx" #include "xcuparser.hxx" #include "xmldata.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -59,22 +60,22 @@ XcdParser::XcdParser(int layer, Dependencies const & dependencies, Data & data): XcdParser::~XcdParser() {} -XmlReader::Text XcdParser::getTextMode() { +xmlreader::XmlReader::Text XcdParser::getTextMode() { return nestedParser_.is() - ? nestedParser_->getTextMode() : XmlReader::TEXT_NONE; + ? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE; } bool XcdParser::startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name) + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) { if (nestedParser_.is()) { OSL_ASSERT(nesting_ != LONG_MAX); ++nesting_; - return nestedParser_->startElement(reader, ns, name); + return nestedParser_->startElement(reader, nsId, name); } switch (state_) { case STATE_START: - if (ns == XmlReader::NAMESPACE_OOR && + if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("data"))) { state_ = STATE_DEPENDENCIES; @@ -82,18 +83,19 @@ bool XcdParser::startElement( } break; case STATE_DEPENDENCIES: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("dependency"))) { if (dependency_.getLength() == 0) { - Span attrFile; + xmlreader::Span attrFile; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_NONE && //TODO: _OOR + if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE && + //TODO: _OOR attrLn.equals(RTL_CONSTASCII_STRINGPARAM("file"))) { attrFile = reader.getAttributeValue(false); @@ -107,7 +109,7 @@ bool XcdParser::startElement( reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - dependency_ = xmldata::convertFromUtf8(attrFile); + dependency_ = attrFile.convertFromUtf8(); if (dependency_.getLength() == 0) { throw css::uno::RuntimeException( (rtl::OUString( @@ -127,19 +129,19 @@ bool XcdParser::startElement( state_ = STATE_COMPONENTS; // fall through case STATE_COMPONENTS: - if (ns == XmlReader::NAMESPACE_OOR && + if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) { nestedParser_ = new XcsParser(layer_, data_); nesting_ = 1; - return nestedParser_->startElement(reader, ns, name); + return nestedParser_->startElement(reader, nsId, name); } - if (ns == XmlReader::NAMESPACE_OOR && + if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) { nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0); nesting_ = 1; - return nestedParser_->startElement(reader, ns, name); + return nestedParser_->startElement(reader, nsId, name); } break; default: // STATE_DEPENDENCY @@ -148,12 +150,12 @@ bool XcdParser::startElement( } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } -void XcdParser::endElement(XmlReader const & reader) { +void XcdParser::endElement(xmlreader::XmlReader const & reader) { if (nestedParser_.is()) { nestedParser_->endElement(reader); if (--nesting_ == 0) { @@ -174,7 +176,7 @@ void XcdParser::endElement(XmlReader const & reader) { } } -void XcdParser::characters(Span const & text) { +void XcdParser::characters(xmlreader::Span const & text) { if (nestedParser_.is()) { nestedParser_->characters(text); } diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx index 2ad8ecea7f93..a807e011b244 100644 --- a/configmgr/source/xcdparser.hxx +++ b/configmgr/source/xcdparser.hxx @@ -34,14 +34,15 @@ #include "rtl/ref.hxx" #include "rtl/ustring.hxx" +#include "xmlreader/xmlreader.hxx" #include "parser.hxx" -#include "xmlreader.hxx" + +namespace xmlreader { struct Span; } namespace configmgr { struct Data; -struct Span; class XcdParser: public Parser { public: @@ -52,14 +53,14 @@ public: private: virtual ~XcdParser(); - virtual XmlReader::Text getTextMode(); + virtual xmlreader::XmlReader::Text getTextMode(); virtual bool startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name); + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); - virtual void endElement(XmlReader const & reader); + virtual void endElement(xmlreader::XmlReader const & reader); - virtual void characters(Span const & text); + virtual void characters(xmlreader::Span const & text); enum State { STATE_START, STATE_DEPENDENCIES, STATE_DEPENDENCY, STATE_COMPONENTS }; diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 79e122759fc8..1c9cd53d7b9a 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -41,18 +41,19 @@ #include "rtl/string.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" #include "data.hxx" #include "localizedpropertynode.hxx" #include "groupnode.hxx" #include "node.hxx" #include "nodemap.hxx" +#include "parsemanager.hxx" #include "propertynode.hxx" #include "setnode.hxx" -#include "span.hxx" #include "xcsparser.hxx" #include "xmldata.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -125,18 +126,18 @@ XcsParser::XcsParser(int layer, Data & data): XcsParser::~XcsParser() {} -XmlReader::Text XcsParser::getTextMode() { +xmlreader::XmlReader::Text XcsParser::getTextMode() { return valueParser_.getTextMode(); } bool XcsParser::startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name) + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) { - if (valueParser_.startElement(reader, ns, name)) { + if (valueParser_.startElement(reader, nsId, name)) { return true; } if (state_ == STATE_START) { - if (ns == XmlReader::NAMESPACE_OOR && + if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) { handleComponentSchema(reader); state_ = STATE_COMPONENT_SCHEMA; @@ -148,7 +149,7 @@ bool XcsParser::startElement( // prop constraints; accepting all four at illegal places (and with // illegal content): if (ignoring_ > 0 || - (ns == XmlReader::NAMESPACE_NONE && + (nsId == xmlreader::XmlReader::NAMESPACE_NONE && (name.equals(RTL_CONSTASCII_STRINGPARAM("info")) || name.equals(RTL_CONSTASCII_STRINGPARAM("import")) || name.equals(RTL_CONSTASCII_STRINGPARAM("uses")) || @@ -160,7 +161,7 @@ bool XcsParser::startElement( } switch (state_) { case STATE_COMPONENT_SCHEMA: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("templates"))) { state_ = STATE_TEMPLATES; @@ -168,7 +169,7 @@ bool XcsParser::startElement( } // fall through case STATE_TEMPLATES_DONE: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("component"))) { state_ = STATE_COMPONENT; @@ -183,13 +184,13 @@ bool XcsParser::startElement( break; case STATE_TEMPLATES: if (elements_.empty()) { - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) { handleGroup(reader, true); return true; } - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("set"))) { handleSet(reader, true); @@ -203,7 +204,7 @@ bool XcsParser::startElement( switch (elements_.top().node->kind()) { case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) { handlePropValue(reader, elements_.top().node); @@ -211,25 +212,25 @@ bool XcsParser::startElement( } break; case Node::KIND_GROUP: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) { handleProp(reader); return true; } - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref"))) { handleNodeRef(reader); return true; } - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) { handleGroup(reader, false); return true; } - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("set"))) { handleSet(reader, false); @@ -237,7 +238,7 @@ bool XcsParser::startElement( } break; case Node::KIND_SET: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("item"))) { handleSetItem( @@ -260,12 +261,12 @@ bool XcsParser::startElement( } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } -void XcsParser::endElement(XmlReader const & reader) { +void XcsParser::endElement(xmlreader::XmlReader const & reader) { if (valueParser_.endElement()) { return; } @@ -338,23 +339,23 @@ void XcsParser::endElement(XmlReader const & reader) { } } -void XcsParser::characters(Span const & text) { +void XcsParser::characters(xmlreader::Span const & text) { valueParser_.characters(text); } -void XcsParser::handleComponentSchema(XmlReader & reader) { +void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) { //TODO: oor:version, xml:lang attributes rtl::OStringBuffer buf; buf.append('.'); bool hasPackage = false; bool hasName = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package"))) { if (hasPackage) { @@ -367,9 +368,9 @@ void XcsParser::handleComponentSchema(XmlReader & reader) { css::uno::Reference< css::uno::XInterface >()); } hasPackage = true; - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); buf.insert(0, s.begin, s.length); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { if (hasName) { @@ -381,7 +382,7 @@ void XcsParser::handleComponentSchema(XmlReader & reader) { css::uno::Reference< css::uno::XInterface >()); } hasName = true; - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); buf.append(s.begin, s.length); } } @@ -401,38 +402,36 @@ void XcsParser::handleComponentSchema(XmlReader & reader) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - componentName_ = xmldata::convertFromUtf8( - Span(buf.getStr(), buf.getLength())); + componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()). + convertFromUtf8(); } -void XcsParser::handleNodeRef(XmlReader & reader) { +void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) { bool hasName = false; rtl::OUString name; rtl::OUString component(componentName_); bool hasNodeType = false; rtl::OUString nodeType; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) { - component = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) { hasNodeType = true; - nodeType = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); + nodeType = reader.getAttributeValue(false).convertFromUtf8(); } } if (!hasName) { @@ -461,33 +460,33 @@ void XcsParser::handleNodeRef(XmlReader & reader) { elements_.push(Element(node, name)); } -void XcsParser::handleProp(XmlReader & reader) { +void XcsParser::handleProp(xmlreader::XmlReader & reader) { bool hasName = false; rtl::OUString name; valueParser_.type_ = TYPE_ERROR; bool localized = false; bool nillable = true; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) { valueParser_.type_ = xmldata::parseType( reader, reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized"))) { localized = xmldata::parseBoolean(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nillable"))) { nillable = xmldata::parseBoolean(reader.getAttributeValue(true)); @@ -521,16 +520,16 @@ void XcsParser::handleProp(XmlReader & reader) { } void XcsParser::handlePropValue( - XmlReader & reader, rtl::Reference< Node > const & property) + xmlreader::XmlReader & reader, rtl::Reference< Node > const & property) { - Span attrSeparator; + xmlreader::Span attrSeparator; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) { attrSeparator = reader.getAttributeValue(false); @@ -549,22 +548,22 @@ void XcsParser::handlePropValue( valueParser_.start(property); } -void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) { +void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) { bool hasName = false; rtl::OUString name; bool extensible = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("extensible"))) { extensible = xmldata::parseBoolean(reader.getAttributeValue(true)); @@ -588,34 +587,32 @@ void XcsParser::handleGroup(XmlReader & reader, bool isTemplate) { name)); } -void XcsParser::handleSet(XmlReader & reader, bool isTemplate) { +void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) { bool hasName = false; rtl::OUString name; rtl::OUString component(componentName_); bool hasNodeType = false; rtl::OUString nodeType; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) { - component = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) { hasNodeType = true; - nodeType = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); + nodeType = reader.getAttributeValue(false).convertFromUtf8(); } } if (!hasName) { @@ -638,27 +635,25 @@ void XcsParser::handleSet(XmlReader & reader, bool isTemplate) { name)); } -void XcsParser::handleSetItem(XmlReader & reader, SetNode * set) { +void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) { rtl::OUString component(componentName_); bool hasNodeType = false; rtl::OUString nodeType; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) { - component = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) { hasNodeType = true; - nodeType = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); + nodeType = reader.getAttributeValue(false).convertFromUtf8(); } } set->getAdditionalTemplateNames().push_back( diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx index 196add9a826a..1fac315c0783 100644 --- a/configmgr/source/xcsparser.hxx +++ b/configmgr/source/xcsparser.hxx @@ -34,17 +34,18 @@ #include "rtl/ref.hxx" #include "rtl/ustring.hxx" +#include "xmlreader/xmlreader.hxx" #include "node.hxx" #include "parser.hxx" #include "valueparser.hxx" -#include "xmlreader.hxx" + +namespace xmlreader { struct Span; } namespace configmgr { class SetNode; struct Data; -struct Span; class XcsParser: public Parser { public: @@ -53,29 +54,29 @@ public: private: virtual ~XcsParser(); - virtual XmlReader::Text getTextMode(); + virtual xmlreader::XmlReader::Text getTextMode(); virtual bool startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name); + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); - virtual void endElement(XmlReader const & reader); + virtual void endElement(xmlreader::XmlReader const & reader); - virtual void characters(Span const & text); + virtual void characters(xmlreader::Span const & text); - void handleComponentSchema(XmlReader & reader); + void handleComponentSchema(xmlreader::XmlReader & reader); - void handleNodeRef(XmlReader & reader); + void handleNodeRef(xmlreader::XmlReader & reader); - void handleProp(XmlReader & reader); + void handleProp(xmlreader::XmlReader & reader); void handlePropValue( - XmlReader & reader, rtl::Reference< Node > const & property); + xmlreader::XmlReader & reader, rtl::Reference< Node > const & property); - void handleGroup(XmlReader & reader, bool isTemplate); + void handleGroup(xmlreader::XmlReader & reader, bool isTemplate); - void handleSet(XmlReader & reader, bool isTemplate); + void handleSet(xmlreader::XmlReader & reader, bool isTemplate); - void handleSetItem(XmlReader & reader, SetNode * set); + void handleSetItem(xmlreader::XmlReader & reader, SetNode * set); enum State { STATE_START, STATE_COMPONENT_SCHEMA, STATE_TEMPLATES, diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index cd1e6e55d085..8a39a3a231ec 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -41,6 +41,8 @@ #include "rtl/string.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" #include "data.hxx" #include "localizedpropertynode.hxx" @@ -49,14 +51,13 @@ #include "modifications.hxx" #include "node.hxx" #include "nodemap.hxx" +#include "parsemanager.hxx" #include "partial.hxx" #include "path.hxx" #include "propertynode.hxx" #include "setnode.hxx" -#include "span.hxx" #include "xcuparser.hxx" #include "xmldata.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -78,22 +79,22 @@ XcuParser::XcuParser( XcuParser::~XcuParser() {} -XmlReader::Text XcuParser::getTextMode() { +xmlreader::XmlReader::Text XcuParser::getTextMode() { return valueParser_.getTextMode(); } bool XcuParser::startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name) + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) { - if (valueParser_.startElement(reader, ns, name)) { + if (valueParser_.startElement(reader, nsId, name)) { return true; } if (state_.empty()) { - if (ns == XmlReader::NAMESPACE_OOR && + if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) { handleComponentData(reader); - } else if (ns == XmlReader::NAMESPACE_OOR && + } else if (nsId == ParseManager::NAMESPACE_OOR && name.equals(RTL_CONSTASCII_STRINGPARAM("items"))) { state_.push(State(rtl::Reference< Node >(), false)); @@ -101,7 +102,7 @@ bool XcuParser::startElement( throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("bad root element <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); @@ -109,7 +110,7 @@ bool XcuParser::startElement( } else if (state_.top().ignore) { state_.push(State(false)); } else if (!state_.top().node.is()) { - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("item"))) { handleItem(reader); @@ -117,7 +118,7 @@ bool XcuParser::startElement( throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("bad items node member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); @@ -125,7 +126,7 @@ bool XcuParser::startElement( } else { switch (state_.top().node->kind()) { case Node::KIND_PROPERTY: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) { handlePropValue( @@ -136,14 +137,14 @@ bool XcuParser::startElement( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "bad property node member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } break; case Node::KIND_LOCALIZED_PROPERTY: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) { handleLocpropValue( @@ -155,7 +156,7 @@ bool XcuParser::startElement( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "bad localized property node member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); @@ -164,18 +165,18 @@ bool XcuParser::startElement( case Node::KIND_LOCALIZED_VALUE: throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); case Node::KIND_GROUP: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) { handleGroupProp( reader, dynamic_cast< GroupNode * >(state_.top().node.get())); - } else if (ns == XmlReader::NAMESPACE_NONE && + } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("node"))) { handleGroupNode(reader, state_.top().node); @@ -184,19 +185,19 @@ bool XcuParser::startElement( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "bad group node member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } break; case Node::KIND_SET: - if (ns == XmlReader::NAMESPACE_NONE && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("node"))) { handleSetNode( reader, dynamic_cast< SetNode * >(state_.top().node.get())); - } else if (ns == XmlReader::NAMESPACE_NONE && + } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) { OSL_TRACE( @@ -208,7 +209,7 @@ bool XcuParser::startElement( throw css::uno::RuntimeException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) + - xmldata::convertFromUtf8(name) + + name.convertFromUtf8() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); @@ -219,7 +220,7 @@ bool XcuParser::startElement( return true; } -void XcuParser::endElement(XmlReader const &) { +void XcuParser::endElement(xmlreader::XmlReader const &) { if (valueParser_.endElement()) { return; } @@ -244,11 +245,11 @@ void XcuParser::endElement(XmlReader const &) { } } -void XcuParser::characters(Span const & text) { +void XcuParser::characters(xmlreader::Span const & text) { valueParser_.characters(text); } -XcuParser::Operation XcuParser::parseOperation(Span const & text) { +XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) { OSL_ASSERT(text.is()); if (text.equals(RTL_CONSTASCII_STRINGPARAM("modify"))) { return OPERATION_MODIFY; @@ -264,11 +265,11 @@ XcuParser::Operation XcuParser::parseOperation(Span const & text) { } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid op ")) + - xmldata::convertFromUtf8(text)), + text.convertFromUtf8()), css::uno::Reference< css::uno::XInterface >()); } -void XcuParser::handleComponentData(XmlReader & reader) { +void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { rtl::OStringBuffer buf; buf.append('.'); bool hasPackage = false; @@ -276,12 +277,12 @@ void XcuParser::handleComponentData(XmlReader & reader) { Operation op = OPERATION_MODIFY; bool finalized = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("package"))) { if (hasPackage) { @@ -294,9 +295,9 @@ void XcuParser::handleComponentData(XmlReader & reader) { css::uno::Reference< css::uno::XInterface >()); } hasPackage = true; - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); buf.insert(0, s.begin, s.length); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { if (hasName) { @@ -308,13 +309,13 @@ void XcuParser::handleComponentData(XmlReader & reader) { css::uno::Reference< css::uno::XInterface >()); } hasName = true; - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); buf.append(s.begin, s.length); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) { op = parseOperation(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); @@ -336,8 +337,8 @@ void XcuParser::handleComponentData(XmlReader & reader) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - componentName_ = xmldata::convertFromUtf8( - Span(buf.getStr(), buf.getLength())); + componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()). + convertFromUtf8(); if (trackPath_) { OSL_ASSERT(path_.empty()); path_.push_back(componentName_); @@ -379,15 +380,15 @@ void XcuParser::handleComponentData(XmlReader & reader) { state_.push(State(node, finalizedLayer < valueParser_.getLayer())); } -void XcuParser::handleItem(XmlReader & reader) { - Span attrPath; +void XcuParser::handleItem(xmlreader::XmlReader & reader) { + xmlreader::Span attrPath; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("path"))) { attrPath = reader.getAttributeValue(false); @@ -400,7 +401,7 @@ void XcuParser::handleItem(XmlReader & reader) { reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - rtl::OUString path(xmldata::convertFromUtf8(attrPath)); + rtl::OUString path(attrPath.convertFromUtf8()); int finalizedLayer; rtl::Reference< Node > node( data_.resolvePathRepresentation( @@ -445,21 +446,23 @@ void XcuParser::handleItem(XmlReader & reader) { state_.push(State(node, finalizedLayer < valueParser_.getLayer())); } -void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { +void XcuParser::handlePropValue( + xmlreader::XmlReader & reader, PropertyNode * prop) + { bool nil = false; rtl::OString separator; rtl::OUString external; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_XSI && + if (attrNsId == ParseManager::NAMESPACE_XSI && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) { nil = xmldata::parseBoolean(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) { Type type = xmldata::parseType( @@ -472,10 +475,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { css::uno::Reference< css::uno::XInterface >()); } valueParser_.type_ = type; - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) { - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); if (s.length == 0) { throw css::uno::RuntimeException( (rtl::OUString( @@ -485,10 +488,10 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { css::uno::Reference< css::uno::XInterface >()); } separator = rtl::OString(s.begin, s.length); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external"))) { - external = xmldata::convertFromUtf8(reader.getAttributeValue(true)); + external = reader.getAttributeValue(true).convertFromUtf8(); if (external.getLength() == 0) { throw css::uno::RuntimeException( (rtl::OUString( @@ -528,27 +531,27 @@ void XcuParser::handlePropValue(XmlReader & reader, PropertyNode * prop) { } void XcuParser::handleLocpropValue( - XmlReader & reader, LocalizedPropertyNode * locprop) + xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop) { rtl::OUString name; bool nil = false; rtl::OString separator; Operation op = OPERATION_FUSE; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_XML && + if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang"))) { - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_XSI && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_XSI && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) { nil = xmldata::parseBoolean(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) { Type type = xmldata::parseType( @@ -561,10 +564,10 @@ void XcuParser::handleLocpropValue( css::uno::Reference< css::uno::XInterface >()); } valueParser_.type_ = type; - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) { - Span s(reader.getAttributeValue(false)); + xmlreader::Span s(reader.getAttributeValue(false)); if (s.length == 0) { throw css::uno::RuntimeException( (rtl::OUString( @@ -574,7 +577,7 @@ void XcuParser::handleLocpropValue( css::uno::Reference< css::uno::XInterface >()); } separator = rtl::OString(s.begin, s.length); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) { op = parseOperation(reader.getAttributeValue(true)); @@ -650,32 +653,34 @@ void XcuParser::handleLocpropValue( } } -void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) { +void XcuParser::handleGroupProp( + xmlreader::XmlReader & reader, GroupNode * group) +{ bool hasName = false; rtl::OUString name; Type type = TYPE_ERROR; Operation op = OPERATION_MODIFY; bool finalized = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) { type = xmldata::parseType(reader, reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) { op = parseOperation(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); @@ -725,8 +730,8 @@ void XcuParser::handleGroupProp(XmlReader & reader, GroupNode * group) { } void XcuParser::handleUnknownGroupProp( - XmlReader const & reader, GroupNode * group, rtl::OUString const & name, - Type type, Operation operation, bool finalized) + xmlreader::XmlReader const & reader, GroupNode * group, + rtl::OUString const & name, Type type, Operation operation, bool finalized) { switch (operation) { case OPERATION_REPLACE: @@ -766,7 +771,7 @@ void XcuParser::handleUnknownGroupProp( } void XcuParser::handlePlainGroupProp( - XmlReader const & reader, GroupNode * group, + xmlreader::XmlReader const & reader, GroupNode * group, NodeMap::iterator const & propertyIndex, rtl::OUString const & name, Type type, Operation operation, bool finalized) { @@ -820,7 +825,7 @@ void XcuParser::handlePlainGroupProp( } void XcuParser::handleLocalizedGroupProp( - XmlReader const & reader, LocalizedPropertyNode * property, + xmlreader::XmlReader const & reader, LocalizedPropertyNode * property, rtl::OUString const & name, Type type, Operation operation, bool finalized) { if (property->getLayer() > valueParser_.getLayer()) { @@ -878,28 +883,28 @@ void XcuParser::handleLocalizedGroupProp( } void XcuParser::handleGroupNode( - XmlReader & reader, rtl::Reference< Node > const & group) + xmlreader::XmlReader & reader, rtl::Reference< Node > const & group) { bool hasName = false; rtl::OUString name; Operation op = OPERATION_MODIFY; bool finalized = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) { op = parseOperation(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); @@ -949,7 +954,7 @@ void XcuParser::handleGroupNode( state_.top().locked || finalizedLayer < valueParser_.getLayer())); } -void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { +void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { bool hasName = false; rtl::OUString name; rtl::OUString component(componentName_); @@ -959,36 +964,34 @@ void XcuParser::handleSetNode(XmlReader & reader, SetNode * set) { bool finalized = false; bool mandatory = false; for (;;) { - XmlReader::Namespace attrNs; - Span attrLn; - if (!reader.nextAttribute(&attrNs, &attrLn)) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNs == XmlReader::NAMESPACE_OOR && + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) { hasName = true; - name = xmldata::convertFromUtf8(reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) { - component = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) { hasNodeType = true; - nodeType = xmldata::convertFromUtf8( - reader.getAttributeValue(false)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + nodeType = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) { op = parseOperation(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); - } else if (attrNs == XmlReader::NAMESPACE_OOR && + } else if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals(RTL_CONSTASCII_STRINGPARAM("mandatory"))) { mandatory = xmldata::parseBoolean(reader.getAttributeValue(true)); diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx index 64108451b4ef..802ed1cd8e50 100644 --- a/configmgr/source/xcuparser.hxx +++ b/configmgr/source/xcuparser.hxx @@ -34,6 +34,7 @@ #include "rtl/ref.hxx" #include "rtl/ustring.hxx" +#include "xmlreader/xmlreader.hxx" #include "node.hxx" #include "nodemap.hxx" @@ -42,7 +43,8 @@ #include "type.hxx" #include "valueparser.hxx" #include "xmldata.hxx" -#include "xmlreader.hxx" + +namespace xmlreader { struct Span; } namespace configmgr { @@ -53,7 +55,6 @@ class Partial; class PropertyNode; class SetNode; struct Data; -struct Span; class XcuParser: public Parser { public: @@ -64,49 +65,50 @@ public: private: virtual ~XcuParser(); - virtual XmlReader::Text getTextMode(); + virtual xmlreader::XmlReader::Text getTextMode(); virtual bool startElement( - XmlReader & reader, XmlReader::Namespace ns, Span const & name); + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); - virtual void endElement(XmlReader const & reader); + virtual void endElement(xmlreader::XmlReader const & reader); - virtual void characters(Span const & span); + virtual void characters(xmlreader::Span const & span); enum Operation { OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE }; - static Operation parseOperation(Span const & text); + static Operation parseOperation(xmlreader::Span const & text); - void handleComponentData(XmlReader & reader); + void handleComponentData(xmlreader::XmlReader & reader); - void handleItem(XmlReader & reader); + void handleItem(xmlreader::XmlReader & reader); - void handlePropValue(XmlReader & reader, PropertyNode * prop); + void handlePropValue(xmlreader::XmlReader & reader, PropertyNode * prop); void handleLocpropValue( - XmlReader & reader, LocalizedPropertyNode * locprop); + xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop); - void handleGroupProp(XmlReader & reader, GroupNode * group); + void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group); void handleUnknownGroupProp( - XmlReader const & reader, GroupNode * group, rtl::OUString const & name, - Type type, Operation operation, bool finalized); + xmlreader::XmlReader const & reader, GroupNode * group, + rtl::OUString const & name, Type type, Operation operation, + bool finalized); void handlePlainGroupProp( - XmlReader const & reader, GroupNode * group, + xmlreader::XmlReader const & reader, GroupNode * group, NodeMap::iterator const & propertyIndex, rtl::OUString const & name, Type type, Operation operation, bool finalized); void handleLocalizedGroupProp( - XmlReader const & reader, LocalizedPropertyNode * property, + xmlreader::XmlReader const & reader, LocalizedPropertyNode * property, rtl::OUString const & name, Type type, Operation operation, bool finalized); void handleGroupNode( - XmlReader & reader, rtl::Reference< Node > const & group); + xmlreader::XmlReader & reader, rtl::Reference< Node > const & group); - void handleSetNode(XmlReader & reader, SetNode * set); + void handleSetNode(xmlreader::XmlReader & reader, SetNode * set); void recordModification(); diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx index 07ad4d17a345..7d3d9ead3d2c 100644 --- a/configmgr/source/xmldata.cxx +++ b/configmgr/source/xmldata.cxx @@ -40,12 +40,12 @@ #include "rtl/ref.hxx" #include "rtl/strbuf.hxx" #include "rtl/string.h" -#include "rtl/textcvt.h" -#include "rtl/textenc.h" #include "rtl/ustrbuf.hxx" #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" #include "data.hxx" #include "groupnode.hxx" @@ -57,9 +57,7 @@ #include "parser.hxx" #include "propertynode.hxx" #include "setnode.hxx" -#include "span.hxx" #include "type.hxx" -#include "xmlreader.hxx" namespace configmgr { @@ -71,90 +69,88 @@ namespace css = com::sun::star; } -rtl::OUString convertFromUtf8(Span const & text) { - OSL_ASSERT(text.is()); - rtl_uString * s = 0; - if (!rtl_convertStringToUString( - &s, text.begin, text.length, RTL_TEXTENCODING_UTF8, - (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR | - RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR | - RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) - { - throw css::uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("cannot convert from UTF-8")), - css::uno::Reference< css::uno::XInterface >()); - } - return rtl::OUString(s, SAL_NO_ACQUIRE); -} - -Type parseType(XmlReader const & reader, Span const & text) { +Type parseType( + xmlreader::XmlReader const & reader, xmlreader::Span const & text) +{ OSL_ASSERT(text.is()); sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':'); if (i >= 0) { - switch (reader.getNamespace(Span(text.begin, i))) { - case XmlReader::NAMESPACE_OOR: - if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("any"))) + switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) { + case ParseManager::NAMESPACE_OOR: + if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("any"))) { return TYPE_ANY; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("boolean-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("boolean-list"))) { return TYPE_BOOLEAN_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("short-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("short-list"))) { return TYPE_SHORT_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("int-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("int-list"))) { return TYPE_INT_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("long-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("long-list"))) { return TYPE_LONG_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("double-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("double-list"))) { return TYPE_DOUBLE_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("string-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("string-list"))) { return TYPE_STRING_LIST; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("hexBinary-list"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("hexBinary-list"))) { return TYPE_HEXBINARY_LIST; } break; - case XmlReader::NAMESPACE_XS: - if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("boolean"))) + case ParseManager::NAMESPACE_XS: + if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("boolean"))) { return TYPE_BOOLEAN; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("short"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("short"))) { return TYPE_SHORT; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("int"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("int"))) { return TYPE_INT; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("long"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("long"))) { return TYPE_LONG; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("double"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("double"))) { return TYPE_DOUBLE; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("string"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("string"))) { return TYPE_STRING; - } else if (Span(text.begin + i + 1, text.length - (i + 1)).equals( - RTL_CONSTASCII_STRINGPARAM("hexBinary"))) + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("hexBinary"))) { return TYPE_HEXBINARY; } @@ -165,11 +161,11 @@ Type parseType(XmlReader const & reader, Span const & text) { } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid type ")) + - convertFromUtf8(text)), + text.convertFromUtf8()), css::uno::Reference< css::uno::XInterface >()); } -bool parseBoolean(Span const & text) { +bool parseBoolean(xmlreader::Span const & text) { OSL_ASSERT(text.is()); if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) { return true; @@ -179,7 +175,7 @@ bool parseBoolean(Span const & text) { } throw css::uno::RuntimeException( (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("invalid boolean ")) + - convertFromUtf8(text)), + text.convertFromUtf8()), css::uno::Reference< css::uno::XInterface >()); } diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx index 15a0a36336ad..e60e1082cabb 100644 --- a/configmgr/source/xmldata.hxx +++ b/configmgr/source/xmldata.hxx @@ -33,19 +33,19 @@ #include "type.hxx" namespace rtl { class OUString; } +namespace xmlreader { + class XmlReader; + struct Span; +} namespace configmgr { -class XmlReader; -struct Span; - namespace xmldata { -rtl::OUString convertFromUtf8(Span const & text); - -Type parseType(XmlReader const & reader, Span const & text); +Type parseType( + xmlreader::XmlReader const & reader, xmlreader::Span const & text); -bool parseBoolean(Span const & text); +bool parseBoolean(xmlreader::Span const & text); rtl::OUString parseTemplateReference( rtl::OUString const & component, bool hasNodeType, diff --git a/configmgr/source/xmlreader.cxx b/configmgr/source/xmlreader.cxx deleted file mode 100644 index ac6a08d18604..000000000000 --- a/configmgr/source/xmlreader.cxx +++ /dev/null @@ -1,1054 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#include "precompiled_configmgr.hxx" -#include "sal/config.h" - -#include - -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/uno/Reference.hxx" -#include "com/sun/star/uno/RuntimeException.hpp" -#include "com/sun/star/uno/XInterface.hpp" -#include "osl/diagnose.h" -#include "osl/file.h" -#include "rtl/string.h" -#include "rtl/ustring.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" - -#include "pad.hxx" -#include "span.hxx" -#include "xmlreader.hxx" - -namespace configmgr { - -namespace { - -namespace css = com::sun::star; - -bool isSpace(char c) { - switch (c) { - case '\x09': - case '\x0A': - case '\x0D': - case ' ': - return true; - default: - return false; - } -} - -} - -XmlReader::XmlReader(rtl::OUString const & fileUrl) - SAL_THROW(( - css::container::NoSuchElementException, css::uno::RuntimeException)): - fileUrl_(fileUrl) -{ - switch (osl_openFile(fileUrl_.pData, &fileHandle_, osl_File_OpenFlag_Read)) - { - case osl_File_E_None: - break; - case osl_File_E_NOENT: - throw css::container::NoSuchElementException( - fileUrl_, css::uno::Reference< css::uno::XInterface >()); - default: - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot open ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - oslFileError e = osl_getFileSize(fileHandle_, &fileSize_); - if (e == osl_File_E_None) { - e = osl_mapFile( - fileHandle_, &fileAddress_, fileSize_, 0, - osl_File_MapFlag_WillNeed); - } - if (e != osl_File_E_None) { - e = osl_closeFile(fileHandle_); - if (e != osl_File_E_None) { - OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e)); - } - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("cannot mmap ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - namespaces_.push_back( - NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xml")), NAMESPACE_XML)); - namespaces_.push_back( - NamespaceData(Span(RTL_CONSTASCII_STRINGPARAM("xsi")), NAMESPACE_XSI)); - // old user layer .xcu files used the xsi namespace prefix without - // declaring a corresponding namespace binding, see issue 77174; reading - // those files during migration would fail without this hack that can be - // removed once migration is no longer relevant (see - // Components::parseModificationLayer) - pos_ = static_cast< char * >(fileAddress_); - end_ = pos_ + fileSize_; - state_ = STATE_CONTENT; -} - -XmlReader::~XmlReader() { - oslFileError e = osl_unmapFile(fileAddress_, fileSize_); - if (e != osl_File_E_None) { - OSL_TRACE("osl_unmapFile failed with %ld", static_cast< long >(e)); - } - e = osl_closeFile(fileHandle_); - if (e != osl_File_E_None) { - OSL_TRACE("osl_closeFile failed with %ld", static_cast< long >(e)); - } -} - -XmlReader::Result XmlReader::nextItem( - Text reportText, Span * data, Namespace * ns) -{ - switch (state_) { - case STATE_CONTENT: - switch (reportText) { - case TEXT_NONE: - return handleSkippedText(data, ns); - case TEXT_RAW: - return handleRawText(data); - case TEXT_NORMALIZED: - return handleNormalizedText(data); - } - case STATE_START_TAG: - return handleStartTag(ns, data); - case STATE_END_TAG: - return handleEndTag(); - case STATE_EMPTY_ELEMENT_TAG: - handleElementEnd(); - return RESULT_END; - default: // STATE_DONE - return RESULT_DONE; - } -} - -bool XmlReader::nextAttribute(Namespace * ns, Span * localName) { - OSL_ASSERT(ns != 0 && localName != 0); - if (firstAttribute_) { - currentAttribute_ = attributes_.begin(); - firstAttribute_ = false; - } else { - ++currentAttribute_; - } - if (currentAttribute_ == attributes_.end()) { - return false; - } - if (currentAttribute_->nameColon == 0) { - *ns = NAMESPACE_NONE; - *localName = Span( - currentAttribute_->nameBegin, - currentAttribute_->nameEnd - currentAttribute_->nameBegin); - } else { - *ns = getNamespace( - Span( - currentAttribute_->nameBegin, - currentAttribute_->nameColon - currentAttribute_->nameBegin)); - *localName = Span( - currentAttribute_->nameColon + 1, - currentAttribute_->nameEnd - (currentAttribute_->nameColon + 1)); - } - return true; -} - -Span XmlReader::getAttributeValue(bool fullyNormalize) { - return handleAttributeValue( - currentAttribute_->valueBegin, currentAttribute_->valueEnd, - fullyNormalize); -} - -XmlReader::Namespace XmlReader::getNamespace(Span const & prefix) const { - for (NamespaceList::const_reverse_iterator i(namespaces_.rbegin()); - i != namespaces_.rend(); ++i) - { - if (prefix.equals(i->prefix)) { - return i->ns; - } - } - return NAMESPACE_OTHER; -} - -rtl::OUString XmlReader::getUrl() const { - return fileUrl_; -} - -void XmlReader::normalizeLineEnds(Span const & text) { - char const * p = text.begin; - sal_Int32 n = text.length; - for (;;) { - sal_Int32 i = rtl_str_indexOfChar_WithLength(p, n, '\x0D'); - if (i < 0) { - break; - } - pad_.add(p, i); - p += i + 1; - n -= i + 1; - if (n == 0 || *p != '\x0A') { - pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A")); - } - } - pad_.add(p, n); -} - -void XmlReader::skipSpace() { - while (isSpace(peek())) { - ++pos_; - } -} - -bool XmlReader::skipComment() { - if (rtl_str_shortenedCompare_WithLength( - pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--"), - RTL_CONSTASCII_LENGTH("--")) != - 0) - { - return false; - } - pos_ += RTL_CONSTASCII_LENGTH("--"); - sal_Int32 i = rtl_str_indexOfStr_WithLength( - pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("--")); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within comment) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - pos_ += i + RTL_CONSTASCII_LENGTH("--"); - if (read() != '>') { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "illegal \"--\" within comment in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - return true; -} - -void XmlReader::skipProcessingInstruction() { - sal_Int32 i = rtl_str_indexOfStr_WithLength( - pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("?>")); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad '()); - } - pos_ += i + RTL_CONSTASCII_LENGTH("?>"); -} - -void XmlReader::skipDocumentTypeDeclaration() { - // Neither is it checked that the doctypedecl is at the correct position in - // the document, nor that it is well-formed: - for (;;) { - char c = read(); - switch (c) { - case '\0': // i.e., EOF - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within DTD) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - case '"': - case '\'': - { - sal_Int32 i = rtl_str_indexOfChar_WithLength( - pos_, end_ - pos_, c); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within DTD) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - pos_ += i + 1; - } - break; - case '>': - return; - case '[': - for (;;) { - c = read(); - switch (c) { - case '\0': // i.e., EOF - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within DTD) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - case '"': - case '\'': - { - sal_Int32 i = rtl_str_indexOfChar_WithLength( - pos_, end_ - pos_, c); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within DTD) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - pos_ += i + 1; - } - break; - case '<': - switch (read()) { - case '\0': // i.e., EOF - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within DTD) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - case '!': - skipComment(); - break; - case '?': - skipProcessingInstruction(); - break; - default: - break; - } - break; - case ']': - skipSpace(); - if (read() != '>') { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "missing \">\" of DTD in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - return; - default: - break; - } - } - default: - break; - } - } -} - -Span XmlReader::scanCdataSection() { - if (rtl_str_shortenedCompare_WithLength( - pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("[CDATA["), - RTL_CONSTASCII_LENGTH("[CDATA[")) != - 0) - { - return Span(); - } - pos_ += RTL_CONSTASCII_LENGTH("[CDATA["); - char const * begin = pos_; - sal_Int32 i = rtl_str_indexOfStr_WithLength( - pos_, end_ - pos_, RTL_CONSTASCII_STRINGPARAM("]]>")); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "premature end (within CDATA section) of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - pos_ += i + RTL_CONSTASCII_LENGTH("]]>"); - return Span(begin, i); -} - -bool XmlReader::scanName(char const ** nameColon) { - OSL_ASSERT(nameColon != 0 && *nameColon == 0); - for (char const * begin = pos_;; ++pos_) { - switch (peek()) { - case '\0': // i.e., EOF - case '\x09': - case '\x0A': - case '\x0D': - case ' ': - case '/': - case '=': - case '>': - return pos_ != begin; - case ':': - *nameColon = pos_; - break; - default: - break; - } - } -} - -XmlReader::Namespace XmlReader::scanNamespaceIri( - char const * begin, char const * end) -{ - OSL_ASSERT(begin != 0 && begin <= end); - Span iri(handleAttributeValue(begin, end, false)); - struct Iri { - char const * begin; - sal_Int32 length; - XmlReader::Namespace ns; - }; - static Iri const iris[] = { - { RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"), - XmlReader::NAMESPACE_OOR }, - { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"), - XmlReader::NAMESPACE_XS }, - { RTL_CONSTASCII_STRINGPARAM( - "http://www.w3.org/2001/XMLSchema-instance"), - XmlReader::NAMESPACE_XSI }, - { RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/XML/1998/namespace"), - XmlReader::NAMESPACE_XML } }; - for (std::size_t i = 0; i < sizeof iris / sizeof iris[0]; ++i) { - if (rtl_str_compare_WithLength( - iri.begin, iri.length, iris[i].begin, iris[i].length) == - 0) - { - return iris[i].ns; - } - } - return XmlReader::NAMESPACE_OTHER; -} - -char const * XmlReader::handleReference(char const * position, char const * end) -{ - OSL_ASSERT(position != 0 && *position == '&' && position < end); - ++position; - if (*position == '#') { - ++position; - sal_Int32 val = 0; - char const * p; - if (*position == 'x') { - ++position; - p = position; - for (;; ++position) { - char c = *position; - if (c >= '0' && c <= '9') { - val = 16 * val + (c - '0'); - } else if (c >= 'A' && c <= 'F') { - val = 16 * val + (c - 'A') + 10; - } else if (c >= 'a' && c <= 'f') { - val = 16 * val + (c - 'a') + 10; - } else { - break; - } - if (val > 0x10FFFF) { // avoid overflow - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "'&#x...' too large in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - } - } else { - p = position; - for (;; ++position) { - char c = *position; - if (c >= '0' && c <= '9') { - val = 10 * val + (c - '0'); - } else { - break; - } - if (val > 0x10FFFF) { // avoid overflow - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "'&#...' too large in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - } - } - if (position == p || *position++ != ';') { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("'&#...' missing ';' in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - OSL_ASSERT(val >= 0 && val <= 0x10FFFF); - if ((val < 0x20 && val != 0x9 && val != 0xA && val != 0xD) || - (val >= 0xD800 && val <= 0xDFFF) || val == 0xFFFE || val == 0xFFFF) - { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "character reference denoting invalid character in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char buf[4]; - sal_Int32 len; - if (val < 0x80) { - buf[0] = static_cast< char >(val); - len = 1; - } else if (val < 0x800) { - buf[0] = static_cast< char >((val >> 6) | 0xC0); - buf[1] = static_cast< char >((val & 0x3F) | 0x80); - len = 2; - } else if (val < 0x10000) { - buf[0] = static_cast< char >((val >> 12) | 0xE0); - buf[1] = static_cast< char >(((val >> 6) & 0x3F) | 0x80); - buf[2] = static_cast< char >((val & 0x3F) | 0x80); - len = 3; - } else { - buf[0] = static_cast< char >((val >> 18) | 0xF0); - buf[1] = static_cast< char >(((val >> 12) & 0x3F) | 0x80); - buf[2] = static_cast< char >(((val >> 6) & 0x3F) | 0x80); - buf[3] = static_cast< char >((val & 0x3F) | 0x80); - len = 4; - } - pad_.addEphemeral(buf, len); - return position; - } else { - struct EntityRef { - char const * inBegin; - sal_Int32 inLength; - char const * outBegin; - sal_Int32 outLength; - }; - static EntityRef const refs[] = { - { RTL_CONSTASCII_STRINGPARAM("amp;"), - RTL_CONSTASCII_STRINGPARAM("&") }, - { RTL_CONSTASCII_STRINGPARAM("lt;"), - RTL_CONSTASCII_STRINGPARAM("<") }, - { RTL_CONSTASCII_STRINGPARAM("gt;"), - RTL_CONSTASCII_STRINGPARAM(">") }, - { RTL_CONSTASCII_STRINGPARAM("apos;"), - RTL_CONSTASCII_STRINGPARAM("'") }, - { RTL_CONSTASCII_STRINGPARAM("quot;"), - RTL_CONSTASCII_STRINGPARAM("\"") } }; - for (std::size_t i = 0; i < sizeof refs / sizeof refs[0]; ++i) { - if (rtl_str_shortenedCompare_WithLength( - position, end - position, refs[i].inBegin, refs[i].inLength, - refs[i].inLength) == - 0) - { - position += refs[i].inLength; - pad_.add(refs[i].outBegin, refs[i].outLength); - return position; - } - } - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("unknown entity reference in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } -} - -Span XmlReader::handleAttributeValue( - char const * begin, char const * end, bool fullyNormalize) -{ - pad_.clear(); - if (fullyNormalize) { - while (begin != end && isSpace(*begin)) { - ++begin; - } - while (end != begin && isSpace(end[-1])) { - --end; - } - char const * p = begin; - enum Space { SPACE_NONE, SPACE_SPAN, SPACE_BREAK }; - // a single true space character can go into the current span, - // everything else breaks the span - Space space = SPACE_NONE; - while (p != end) { - switch (*p) { - case '\x09': - case '\x0A': - case '\x0D': - switch (space) { - case SPACE_NONE: - pad_.add(begin, p - begin); - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - space = SPACE_BREAK; - break; - case SPACE_SPAN: - pad_.add(begin, p - begin); - space = SPACE_BREAK; - break; - case SPACE_BREAK: - break; - } - begin = ++p; - break; - case ' ': - switch (space) { - case SPACE_NONE: - ++p; - space = SPACE_SPAN; - break; - case SPACE_SPAN: - pad_.add(begin, p - begin); - begin = ++p; - space = SPACE_BREAK; - break; - case SPACE_BREAK: - begin = ++p; - break; - } - break; - case '&': - pad_.add(begin, p - begin); - p = handleReference(p, end); - begin = p; - space = SPACE_NONE; - break; - default: - ++p; - space = SPACE_NONE; - break; - } - } - pad_.add(begin, p - begin); - } else { - char const * p = begin; - while (p != end) { - switch (*p) { - case '\x09': - case '\x0A': - pad_.add(begin, p - begin); - begin = ++p; - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - break; - case '\x0D': - pad_.add(begin, p - begin); - ++p; - if (peek() == '\x0A') { - ++p; - } - begin = p; - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - break; - case '&': - pad_.add(begin, p - begin); - p = handleReference(p, end); - begin = p; - break; - default: - ++p; - break; - } - } - pad_.add(begin, p - begin); - } - return pad_.get(); -} - -XmlReader::Result XmlReader::handleStartTag(Namespace * ns, Span * localName) { - OSL_ASSERT(ns != 0 && localName); - char const * nameBegin = pos_; - char const * nameColon = 0; - if (!scanName(&nameColon)) { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad tag name in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * nameEnd = pos_; - NamespaceList::size_type inheritedNamespaces = namespaces_.size(); - bool hasDefaultNs = false; - Namespace defaultNs = NAMESPACE_NONE; - attributes_.clear(); - for (;;) { - char const * p = pos_; - skipSpace(); - if (peek() == '/' || peek() == '>') { - break; - } - if (pos_ == p) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "missing whitespace before attribute in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * attrNameBegin = pos_; - char const * attrNameColon = 0; - if (!scanName(&attrNameColon)) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("bad attribute name in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * attrNameEnd = pos_; - skipSpace(); - if (read() != '=') { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '=' in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - skipSpace(); - char del = read(); - if (del != '\'' && del != '"') { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("bad attribute value in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * valueBegin = pos_; - sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, del); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unterminated attribute value in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * valueEnd = pos_ + i; - pos_ += i + 1; - if (attrNameColon == 0 && - Span(attrNameBegin, attrNameEnd - attrNameBegin).equals( - RTL_CONSTASCII_STRINGPARAM("xmlns"))) - { - hasDefaultNs = true; - defaultNs = scanNamespaceIri(valueBegin, valueEnd); - } else if (attrNameColon != 0 && - Span(attrNameBegin, attrNameColon - attrNameBegin).equals( - RTL_CONSTASCII_STRINGPARAM("xmlns"))) - { - namespaces_.push_back( - NamespaceData( - Span(attrNameColon + 1, attrNameEnd - (attrNameColon + 1)), - scanNamespaceIri(valueBegin, valueEnd))); - } else { - attributes_.push_back( - AttributeData( - attrNameBegin, attrNameEnd, attrNameColon, valueBegin, - valueEnd)); - } - } - if (!hasDefaultNs && !elements_.empty()) { - defaultNs = elements_.top().defaultNamespace; - } - firstAttribute_ = true; - if (peek() == '/') { - state_ = STATE_EMPTY_ELEMENT_TAG; - ++pos_; - } else { - state_ = STATE_CONTENT; - } - if (peek() != '>') { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - ++pos_; - elements_.push( - ElementData( - Span(nameBegin, nameEnd - nameBegin), inheritedNamespaces, - defaultNs)); - if (nameColon == 0) { - *ns = defaultNs; - *localName = Span(nameBegin, nameEnd - nameBegin); - } else { - *ns = getNamespace(Span(nameBegin, nameColon - nameBegin)); - *localName = Span(nameColon + 1, nameEnd - (nameColon + 1)); - } - return RESULT_BEGIN; -} - -XmlReader::Result XmlReader::handleEndTag() { - if (elements_.empty()) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("spurious end tag in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - char const * nameBegin = pos_; - char const * nameColon = 0; - if (!scanName(&nameColon) || - !elements_.top().name.equals(nameBegin, pos_ - nameBegin)) - { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - handleElementEnd(); - skipSpace(); - if (peek() != '>') { - throw css::uno::RuntimeException( - (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("missing '>' in ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - ++pos_; - return RESULT_END; -} - -void XmlReader::handleElementEnd() { - OSL_ASSERT(!elements_.empty()); - namespaces_.resize(elements_.top().inheritedNamespaces); - elements_.pop(); - state_ = elements_.empty() ? STATE_DONE : STATE_CONTENT; -} - -XmlReader::Result XmlReader::handleSkippedText(Span * data, Namespace * ns) { - for (;;) { - sal_Int32 i = rtl_str_indexOfChar_WithLength(pos_, end_ - pos_, '<'); - if (i < 0) { - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("premature end of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - } - pos_ += i + 1; - switch (peek()) { - case '!': - ++pos_; - if (!skipComment() && !scanCdataSection().is()) { - skipDocumentTypeDeclaration(); - } - break; - case '/': - ++pos_; - return handleEndTag(); - case '?': - ++pos_; - skipProcessingInstruction(); - break; - default: - return handleStartTag(ns, data); - } - } -} - -XmlReader::Result XmlReader::handleRawText(Span * text) { - pad_.clear(); - for (char const * begin = pos_;;) { - switch (peek()) { - case '\0': // i.e., EOF - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("premature end of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - case '\x0D': - pad_.add(begin, pos_ - begin); - ++pos_; - if (peek() != '\x0A') { - pad_.add(RTL_CONSTASCII_STRINGPARAM("\x0A")); - } - begin = pos_; - break; - case '&': - pad_.add(begin, pos_ - begin); - pos_ = handleReference(pos_, end_); - begin = pos_; - break; - case '<': - pad_.add(begin, pos_ - begin); - ++pos_; - switch (peek()) { - case '!': - ++pos_; - if (!skipComment()) { - Span cdata(scanCdataSection()); - if (cdata.is()) { - normalizeLineEnds(cdata); - } else { - skipDocumentTypeDeclaration(); - } - } - begin = pos_; - break; - case '/': - *text = pad_.get(); - ++pos_; - state_ = STATE_END_TAG; - return RESULT_TEXT; - case '?': - ++pos_; - skipProcessingInstruction(); - begin = pos_; - break; - default: - *text = pad_.get(); - state_ = STATE_START_TAG; - return RESULT_TEXT; - } - break; - default: - ++pos_; - break; - } - } -} - -XmlReader::Result XmlReader::handleNormalizedText(Span * text) { - pad_.clear(); - char const * flowBegin = pos_; - char const * flowEnd = pos_; - enum Space { SPACE_START, SPACE_NONE, SPACE_SPAN, SPACE_BREAK }; - // a single true space character can go into the current flow, - // everything else breaks the flow - Space space = SPACE_START; - for (;;) { - switch (peek()) { - case '\0': // i.e., EOF - throw css::uno::RuntimeException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("premature end of ")) + - fileUrl_), - css::uno::Reference< css::uno::XInterface >()); - case '\x09': - case '\x0A': - case '\x0D': - switch (space) { - case SPACE_START: - case SPACE_BREAK: - break; - case SPACE_NONE: - case SPACE_SPAN: - space = SPACE_BREAK; - break; - } - ++pos_; - break; - case ' ': - switch (space) { - case SPACE_START: - case SPACE_BREAK: - break; - case SPACE_NONE: - space = SPACE_SPAN; - break; - case SPACE_SPAN: - space = SPACE_BREAK; - break; - } - ++pos_; - break; - case '&': - switch (space) { - case SPACE_START: - break; - case SPACE_NONE: - case SPACE_SPAN: - pad_.add(flowBegin, pos_ - flowBegin); - break; - case SPACE_BREAK: - pad_.add(flowBegin, flowEnd - flowBegin); - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - break; - } - pos_ = handleReference(pos_, end_); - flowBegin = pos_; - flowEnd = pos_; - space = SPACE_NONE; - break; - case '<': - ++pos_; - switch (peek()) { - case '!': - ++pos_; - if (skipComment()) { - space = SPACE_BREAK; - } else { - Span cdata(scanCdataSection()); - if (cdata.is()) { - // CDATA is not normalized (similar to character - // references; it keeps the code simple), but it might - // arguably be better to normalize it: - switch (space) { - case SPACE_START: - break; - case SPACE_NONE: - case SPACE_SPAN: - pad_.add(flowBegin, pos_ - flowBegin); - break; - case SPACE_BREAK: - pad_.add(flowBegin, flowEnd - flowBegin); - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - break; - } - normalizeLineEnds(cdata); - flowBegin = pos_; - flowEnd = pos_; - space = SPACE_NONE; - } else { - skipDocumentTypeDeclaration(); - } - } - break; - case '/': - ++pos_; - pad_.add(flowBegin, flowEnd - flowBegin); - *text = pad_.get(); - state_ = STATE_END_TAG; - return RESULT_TEXT; - case '?': - ++pos_; - skipProcessingInstruction(); - space = SPACE_BREAK; - break; - default: - pad_.add(flowBegin, flowEnd - flowBegin); - *text = pad_.get(); - state_ = STATE_START_TAG; - return RESULT_TEXT; - } - break; - default: - switch (space) { - case SPACE_START: - flowBegin = pos_; - break; - case SPACE_NONE: - case SPACE_SPAN: - break; - case SPACE_BREAK: - pad_.add(flowBegin, flowEnd - flowBegin); - pad_.add(RTL_CONSTASCII_STRINGPARAM(" ")); - flowBegin = pos_; - break; - } - flowEnd = ++pos_; - space = SPACE_NONE; - break; - } - } -} - -} diff --git a/configmgr/source/xmlreader.hxx b/configmgr/source/xmlreader.hxx deleted file mode 100644 index 83ccac148cd4..000000000000 --- a/configmgr/source/xmlreader.hxx +++ /dev/null @@ -1,186 +0,0 @@ -/************************************************************************* -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* -* for a copy of the LGPLv3 License. -* -************************************************************************/ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX -#define INCLUDED_CONFIGMGR_SOURCE_XMLREADER_HXX - -#include "sal/config.h" - -#include -#include - -#include "boost/noncopyable.hpp" -#include "com/sun/star/container/NoSuchElementException.hpp" -#include "com/sun/star/uno/RuntimeException.hpp" -#include "osl/file.h" -#include "rtl/ustring.hxx" -#include "sal/types.h" - -#include "pad.hxx" -#include "span.hxx" - -namespace configmgr { - -class XmlReader: private boost::noncopyable { -public: - explicit XmlReader(rtl::OUString const & fileUrl) - SAL_THROW(( - com::sun::star::container::NoSuchElementException, - com::sun::star::uno::RuntimeException)); - - ~XmlReader(); - - enum Namespace { - NAMESPACE_NONE, NAMESPACE_XML, NAMESPACE_OOR, NAMESPACE_XS, - NAMESPACE_XSI, NAMESPACE_OTHER }; - - enum Text { TEXT_NONE, TEXT_RAW, TEXT_NORMALIZED }; - - enum Result { RESULT_BEGIN, RESULT_END, RESULT_TEXT, RESULT_DONE }; - - // RESULT_BEGIN: data = localName, ns = ns - // RESULT_END: data, ns unused - // RESULT_TEXT: data = text, ns unused - Result nextItem(Text reportText, Span * data, Namespace * ns); - - bool nextAttribute(Namespace * ns, Span * localName); - - // the span returned by getAttributeValue is only valid until the next call - // to nextItem or getAttributeValue - Span getAttributeValue(bool fullyNormalize); - - Namespace getNamespace(Span const & prefix) const; - - rtl::OUString getUrl() const; - -private: - inline char read() { return pos_ == end_ ? '\0' : *pos_++; } - - inline char peek() { return pos_ == end_ ? '\0' : *pos_; } - - void normalizeLineEnds(Span const & text); - - void skipSpace(); - - bool skipComment(); - - void skipProcessingInstruction(); - - void skipDocumentTypeDeclaration(); - - Span scanCdataSection(); - - bool scanName(char const ** nameColon); - - Namespace scanNamespaceIri(char const * begin, char const * end); - - char const * handleReference(char const * position, char const * end); - - Span handleAttributeValue( - char const * begin, char const * end, bool fullyNormalize); - - Result handleStartTag(Namespace * ns, Span * localName); - - Result handleEndTag(); - - void handleElementEnd(); - - Result handleSkippedText(Span * data, Namespace * ns); - - Result handleRawText(Span * text); - - Result handleNormalizedText(Span * text); - - struct NamespaceData { - Span prefix; - Namespace ns; - - NamespaceData() {} - - NamespaceData(Span const & thePrefix, Namespace theNs): - prefix(thePrefix), ns(theNs) {} - }; - - typedef std::vector< NamespaceData > NamespaceList; - - struct ElementData { - Span name; - NamespaceList::size_type inheritedNamespaces; - Namespace defaultNamespace; - - ElementData( - Span const & theName, - NamespaceList::size_type theInheritedNamespaces, - Namespace theDefaultNamespace): - name(theName), inheritedNamespaces(theInheritedNamespaces), - defaultNamespace(theDefaultNamespace) - {} - }; - - typedef std::stack< ElementData > ElementStack; - - struct AttributeData { - char const * nameBegin; - char const * nameEnd; - char const * nameColon; - char const * valueBegin; - char const * valueEnd; - - AttributeData( - char const * theNameBegin, char const * theNameEnd, - char const * theNameColon, char const * theValueBegin, - char const * theValueEnd): - nameBegin(theNameBegin), nameEnd(theNameEnd), - nameColon(theNameColon), valueBegin(theValueBegin), - valueEnd(theValueEnd) - {} - }; - - typedef std::vector< AttributeData > Attributes; - - enum State { - STATE_CONTENT, STATE_START_TAG, STATE_END_TAG, STATE_EMPTY_ELEMENT_TAG, - STATE_DONE }; - - rtl::OUString fileUrl_; - oslFileHandle fileHandle_; - sal_uInt64 fileSize_; - void * fileAddress_; - NamespaceList namespaces_; - ElementStack elements_; - char const * pos_; - char const * end_; - State state_; - Attributes attributes_; - Attributes::iterator currentAttribute_; - bool firstAttribute_; - Pad pad_; -}; - -} - -#endif -- cgit From 9551bf5a1ee5c9275a26f8ec4021e0b7f5665176 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- avmedia/prj/d.lst | 5 + avmedia/source/framework/soundhandler.cxx | 38 ----- avmedia/source/gstreamer/avmediagst.component | 34 ++++ avmedia/source/gstreamer/exports.dxp | 1 - avmedia/source/gstreamer/gstuno.cxx | 29 ---- avmedia/source/gstreamer/makefile.mk | 8 + avmedia/source/java/MediaUno.java | 9 -- avmedia/source/java/avmedia.jar.component | 34 ++++ avmedia/source/java/makefile.mk | 8 + .../source/quicktime/avmediaQuickTime.component | 34 ++++ avmedia/source/quicktime/makefile.mk | 8 + avmedia/source/quicktime/quicktimeuno.cxx | 29 ---- avmedia/source/win/avmediawin.component | 34 ++++ avmedia/source/win/exports.dxp | 1 - avmedia/source/win/makefile.mk | 8 + avmedia/source/win/winuno.cxx | 27 ---- avmedia/source/xine/exports.dxp | 1 - avmedia/source/xine/xineuno.cxx | 29 ---- avmedia/util/avmedia.component | 34 ++++ avmedia/util/makefile.mk | 8 + basic/prj/d.lst | 1 + basic/util/makefile.mk | 6 + basic/util/sb.component | 39 +++++ configmgr/prj/d.lst | 1 + configmgr/source/configmgr.component | 45 ++++++ configmgr/source/makefile.mk | 8 + configmgr/source/services.cxx | 48 ------ connectivity/prj/d.lst | 17 ++ .../commontools/FDatabaseMetaDataResultSet.cxx | 5 - connectivity/source/cpool/Zregistration.cxx | 29 ---- connectivity/source/cpool/dbpool2.component | 34 ++++ connectivity/source/cpool/exports.dxp | 1 - connectivity/source/cpool/makefile.mk | 6 + connectivity/source/dbtools/dbtools.component | 37 +++++ connectivity/source/dbtools/exports.dxp | 1 - connectivity/source/dbtools/makefile.mk | 8 + connectivity/source/drivers/adabas/Bservices.cxx | 52 ------ .../source/drivers/adabas/adabas.component | 35 ++++ connectivity/source/drivers/adabas/adabas.mxp.map | 1 - connectivity/source/drivers/adabas/exports.dxp | 1 - connectivity/source/drivers/adabas/makefile.mk | 8 + connectivity/source/drivers/ado/Aservices.cxx | 52 ------ connectivity/source/drivers/ado/ado.component | 35 ++++ connectivity/source/drivers/ado/exports.dxp | 1 - connectivity/source/drivers/ado/makefile.mk | 8 + connectivity/source/drivers/calc/Cservices.cxx | 52 ------ connectivity/source/drivers/calc/calc.component | 35 ++++ connectivity/source/drivers/calc/exports.dxp | 1 - connectivity/source/drivers/calc/makefile.mk | 8 + connectivity/source/drivers/dbase/Dservices.cxx | 52 ------ connectivity/source/drivers/dbase/dbase.component | 35 ++++ connectivity/source/drivers/dbase/dbase.mxp.map | 1 - connectivity/source/drivers/dbase/exports.dxp | 1 - connectivity/source/drivers/dbase/makefile.mk | 8 + connectivity/source/drivers/evoab/LServices.cxx | 52 ------ connectivity/source/drivers/evoab/exports.dxp | 1 - connectivity/source/drivers/evoab2/NServices.cxx | 51 ------ connectivity/source/drivers/evoab2/evoab.component | 34 ++++ connectivity/source/drivers/evoab2/makefile.mk | 8 + connectivity/source/drivers/flat/Eservices.cxx | 52 ------ connectivity/source/drivers/flat/exports.dxp | 1 - connectivity/source/drivers/flat/flat.component | 35 ++++ connectivity/source/drivers/flat/flat.mxp.map | 1 - connectivity/source/drivers/flat/makefile.mk | 8 + connectivity/source/drivers/hsqldb/Hservices.cxx | 52 ------ connectivity/source/drivers/hsqldb/exports.dxp | 1 - .../source/drivers/hsqldb/hsqldb.component | 35 ++++ connectivity/source/drivers/hsqldb/hsqldb.map | 1 - connectivity/source/drivers/hsqldb/makefile.mk | 8 + connectivity/source/drivers/jdbc/exports.dxp | 1 - connectivity/source/drivers/jdbc/jdbc.component | 34 ++++ connectivity/source/drivers/jdbc/jdbc.mxp.map | 1 - connectivity/source/drivers/jdbc/jservices.cxx | 51 ------ connectivity/source/drivers/jdbc/makefile.mk | 8 + connectivity/source/drivers/kab/KServices.cxx | 52 ------ connectivity/source/drivers/kab/exports.dxp | 1 - connectivity/source/drivers/kab/kab1.component | 34 ++++ connectivity/source/drivers/kab/makefile.mk | 8 + .../source/drivers/macab/MacabServices.cxx | 52 ------ connectivity/source/drivers/macab/exports.dxp | 1 - connectivity/source/drivers/macab/macab1.component | 34 ++++ connectivity/source/drivers/macab/makefile.mk | 8 + connectivity/source/drivers/mozab/MServices.cxx | 57 ------- .../drivers/mozab/bootstrap/MMozillaBootstrap.cxx | 45 ------ .../source/drivers/mozab/bootstrap/makefile.mk | 9 +- .../drivers/mozab/bootstrap/mozbootstrap.component | 34 ++++ connectivity/source/drivers/mozab/exports.dxp | 1 - connectivity/source/drivers/mozab/makefile.mk | 8 + connectivity/source/drivers/mozab/mozab.component | 37 +++++ connectivity/source/drivers/mysql/Yservices.cxx | 52 ------ connectivity/source/drivers/mysql/exports.dxp | 1 - connectivity/source/drivers/mysql/makefile.mk | 8 + connectivity/source/drivers/mysql/mysql.component | 35 ++++ connectivity/source/drivers/odbc/makefile.mk | 8 + connectivity/source/drivers/odbc/odbc.component | 34 ++++ connectivity/source/drivers/odbc/oservices.cxx | 52 ------ connectivity/source/manager/exports.dxp | 1 - connectivity/source/manager/makefile.mk | 6 + connectivity/source/manager/mregistration.cxx | 33 ---- connectivity/source/manager/sdbc.mxp.map | 1 - connectivity/source/manager/sdbc2.component | 34 ++++ desktop/prj/d.lst | 7 + desktop/source/app/exports.dxp | 1 - desktop/source/deployment/deployment.component | 64 ++++++++ desktop/source/deployment/dp_services.cxx | 21 --- .../source/deployment/gui/deploymentgui.component | 40 +++++ desktop/source/deployment/gui/dp_gui_service.cxx | 8 - desktop/source/deployment/gui/makefile.mk | 8 + desktop/source/deployment/makefile.mk | 8 + desktop/source/migration/services/cexports.cxx | 7 - desktop/source/migration/services/cexportsoo3.cxx | 7 - desktop/source/migration/services/makefile.mk | 17 +- .../migration/services/migrationoo2.component | 37 +++++ .../migration/services/migrationoo3.component | 34 ++++ desktop/source/migration/services/migrationoo3.map | 8 - desktop/source/offacc/acceptor.cxx | 17 -- desktop/source/offacc/makefile.mk | 8 + desktop/source/offacc/offacc.component | 34 ++++ .../com/sun/star/registration/Registration.java | 4 - .../com/sun/star/registration/makefile.mk | 7 + .../registration/productregistration.jar.component | 34 ++++ desktop/source/so_comp/services.cxx | 26 --- desktop/source/splash/makefile.mk | 8 + desktop/source/splash/services_spl.cxx | 26 --- desktop/source/splash/spl.component | 37 +++++ editeng/util/editeng.dxp | 1 - embeddedobj/prj/d.lst | 2 + embeddedobj/source/commonembedding/register.cxx | 42 ----- embeddedobj/source/msole/emboleobj.component | 35 ++++ .../source/msole/emboleobj.windows.component | 39 +++++ embeddedobj/source/msole/exports.dxp | 1 - embeddedobj/source/msole/makefile.mk | 11 ++ embeddedobj/util/embobj.component | 43 +++++ embeddedobj/util/exports.dxp | 1 - embeddedobj/util/makefile.mk | 8 + eventattacher/prj/d.lst | 1 + eventattacher/source/eventattacher.cxx | 28 ---- eventattacher/source/evtatt.component | 34 ++++ eventattacher/source/makefile.mk | 8 + fileaccess/prj/d.lst | 1 + fileaccess/source/FileAccess.cxx | 26 --- fileaccess/source/fileacc.component | 34 ++++ fileaccess/source/makefile.mk | 8 + formula/prj/d.lst | 1 + formula/source/core/api/services.cxx | 6 - formula/util/for.component | 34 ++++ formula/util/makefile.mk | 8 + fpicker/prj/d.lst | 10 +- fpicker/source/aqua/FPentry.cxx | 26 --- fpicker/source/aqua/fps-aqua-ucd.txt | 13 -- fpicker/source/aqua/fps_aqua.component | 37 +++++ fpicker/source/aqua/makefile.mk | 8 + fpicker/source/generic/fpicker.component | 37 +++++ fpicker/source/generic/fpicker.cxx | 7 - fpicker/source/generic/makefile.mk | 8 + fpicker/source/office/fps_office.component | 37 +++++ fpicker/source/office/fps_office.cxx | 7 - fpicker/source/office/makefile.mk | 8 + fpicker/source/unx/gnome/FPentry.cxx | 26 --- fpicker/source/unx/gnome/fps-gnome-ucd.txt | 13 -- fpicker/source/unx/gnome/fps_gnome.component | 37 +++++ fpicker/source/unx/gnome/makefile.mk | 8 + fpicker/source/unx/kde4/KDE4FPEntry.cxx | 21 --- fpicker/source/unx/kde4/fps-kde4-ucd.txt | 6 - fpicker/source/unx/kde4/fps_kde4.component | 34 ++++ fpicker/source/unx/kde4/makefile.mk | 8 + fpicker/source/win32/filepicker/FPentry.cxx | 25 --- fpicker/source/win32/folderpicker/Fopentry.cxx | 25 --- fpicker/util/exports.dxp | 1 - fpicker/util/fop.component | 34 ++++ fpicker/util/fps.component | 34 ++++ fpicker/util/makefile.mk | 13 ++ framework/inc/macros/debug/registration.hxx | 21 --- framework/inc/macros/registration.hxx | 96 +---------- framework/prj/d.lst | 3 + .../source/register/register3rdcomponents.cxx | 10 -- framework/source/register/registerlogindialog.cxx | 7 - framework/source/register/registerservices.cxx | 64 -------- framework/source/register/registertemp.cxx | 29 ---- framework/util/fwk.component | 142 ++++++++++++++++ framework/util/fwl.component | 100 ++++++++++++ framework/util/fwm.component | 43 +++++ framework/util/makefile.mk | 20 +++ linguistic/prj/d.lst | 1 + linguistic/source/convdiclist.cxx | 25 --- linguistic/source/dlistimp.cxx | 25 --- linguistic/source/gciterator.cxx | 24 --- linguistic/source/grammarchecker.cxx | 21 --- linguistic/source/lng.component | 46 ++++++ linguistic/source/lngopt.cxx | 23 --- linguistic/source/lngreg.cxx | 58 ------- linguistic/source/lngsvcmgr.cxx | 25 --- linguistic/source/makefile.mk | 13 +- .../script/framework/security/SecurityDialog.java | 5 - scripting/java/ScriptFramework.component | 34 ++++ .../java/ScriptProviderForBeanShell.component | 37 +++++ scripting/java/ScriptProviderForJava.component | 37 +++++ .../java/ScriptProviderForJavaScript.component | 37 +++++ .../beanshell/ScriptProviderForBeanShell.java | 35 ---- .../provider/java/ScriptProviderForJava.java | 35 ---- .../javascript/ScriptProviderForJavaScript.java | 34 ---- scripting/java/makefile.mk | 34 ++++ scripting/prj/d.lst | 12 ++ scripting/source/basprov/basprov.component | 37 +++++ scripting/source/basprov/basprov.cxx | 7 - scripting/source/basprov/makefile.mk | 8 + scripting/source/dlgprov/dlgprov.component | 36 +++++ scripting/source/dlgprov/dlgprov.cxx | 7 - scripting/source/dlgprov/makefile.mk | 8 + scripting/source/protocolhandler/exports.dxp | 1 - scripting/source/protocolhandler/makefile.mk | 8 + .../protocolhandler/protocolhandler.component | 34 ++++ scripting/source/protocolhandler/scripthandler.cxx | 21 --- scripting/source/provider/MasterScriptProvider.cxx | 36 ----- scripting/source/provider/exports.dxp | 1 - scripting/source/pyprov/mailmerge.component | 37 +++++ scripting/source/pyprov/makefile.mk | 14 ++ scripting/source/pyprov/pythonscript.component | 35 ++++ .../source/runtimemgr/ScriptRuntimeManager.cxx | 62 ------- scripting/source/runtimemgr/exports.dxp | 1 - scripting/source/storage/exports.dxp | 1 - scripting/source/stringresource/makefile.mk | 8 + .../source/stringresource/stringresource.component | 40 +++++ scripting/source/stringresource/stringresource.cxx | 7 - scripting/source/vbaevents/makefile.mk | 8 + scripting/source/vbaevents/service.cxx | 10 -- scripting/source/vbaevents/vbaevents.component | 37 +++++ scripting/util/exports.dxp | 1 - scripting/util/makefile.mk | 8 + scripting/util/scriptframe.component | 49 ++++++ sfx2/inc/sfx2/sfxuno.hxx | 47 ------ sfx2/prj/d.lst | 1 + sfx2/source/appl/appuno.cxx | 160 ------------------ sfx2/source/doc/SfxDocumentMetaData.cxx | 7 - sfx2/util/makefile.mk | 8 + sfx2/util/sfx.component | 75 +++++++++ shell/prj/d.lst | 11 +- shell/source/backends/desktopbe/desktopbackend.cxx | 6 - shell/source/backends/desktopbe/desktopbe1-ucd.txt | 6 - .../source/backends/desktopbe/desktopbe1.component | 34 ++++ shell/source/backends/desktopbe/makefile.mk | 10 +- shell/source/backends/gconfbe/gconfbackend.cxx | 6 - shell/source/backends/gconfbe/gconfbe1-ucd.txt | 6 - shell/source/backends/gconfbe/gconfbe1.component | 34 ++++ shell/source/backends/gconfbe/makefile.mk | 11 +- shell/source/backends/kde4be/kde4backend.cxx | 6 - shell/source/backends/kde4be/kde4be1-ucd.txt | 6 - shell/source/backends/kde4be/kde4be1.component | 34 ++++ shell/source/backends/kde4be/makefile.mk | 10 +- shell/source/backends/kdebe/kdebackend.cxx | 6 - shell/source/backends/kdebe/kdebe1-ucd.txt | 6 - shell/source/backends/kdebe/kdebe1.component | 34 ++++ shell/source/backends/kdebe/makefile.mk | 10 +- shell/source/backends/localebe/localebe1.component | 34 ++++ shell/source/backends/localebe/localebecdef.cxx | 7 - shell/source/backends/localebe/makefile.mk | 8 + shell/source/backends/macbe/macbe1.component | 34 ++++ shell/source/backends/macbe/macbecdef.cxx | 7 - shell/source/backends/macbe/makefile.mk | 8 + shell/source/backends/wininetbe/makefile.mk | 8 + .../source/backends/wininetbe/wininetbe1.component | 34 ++++ shell/source/backends/wininetbe/wininetbecdef.cxx | 7 - shell/source/cmdmail/cmdmail.component | 34 ++++ shell/source/cmdmail/cmdmailentry.cxx | 24 --- shell/source/cmdmail/exports.dxp | 1 - shell/source/cmdmail/makefile.mk | 7 + shell/source/unix/exec/makefile.mk | 8 + shell/source/unix/exec/shellexecentry.cxx | 23 --- shell/source/unix/exec/syssh.component | 34 ++++ shell/source/win32/SysShentry.cxx | 26 --- shell/source/win32/exports.dxp | 1 - shell/source/win32/makefile.mk | 8 + shell/source/win32/simplemail/exports.dxp | 1 - shell/source/win32/simplemail/makefile.mk | 8 + shell/source/win32/simplemail/smplmail.component | 34 ++++ shell/source/win32/simplemail/smplmailentry.cxx | 26 --- shell/source/win32/syssh.component | 34 ++++ svx/prj/d.lst | 3 + svx/source/core/coreservices.cxx | 38 ----- .../unodialogs/textconversiondlgs/makefile.mk | 8 + .../unodialogs/textconversiondlgs/services.cxx | 7 - .../textconversiondlgs.component | 34 ++++ svx/source/unodraw/unoctabl.cxx | 54 ------- svx/util/gal.dxp | 1 - svx/util/makefile.mk | 14 ++ svx/util/svx.component | 76 +++++++++ svx/util/svx.dxp | 1 - svx/util/svxcore.component | 49 ++++++ sysui/util/exports.dxp | 1 - ucb/prj/d.lst | 15 +- ucb/source/cacher/cached1.component | 43 +++++ ucb/source/cacher/cacheserv.cxx | 77 --------- ucb/source/cacher/makefile.mk | 8 + ucb/source/core/exports2.dxp | 1 - ucb/source/core/makefile.mk | 8 + ucb/source/core/ucb1.component | 46 ++++++ ucb/source/core/ucbserv.cxx | 87 ---------- ucb/source/sorter/makefile.mk | 8 + ucb/source/sorter/sortmain.cxx | 55 ------- ucb/source/sorter/srtrs1.component | 34 ++++ ucb/source/ucp/expand/makefile.mk | 8 + ucb/source/ucp/expand/ucpexpand.cxx | 8 - ucb/source/ucp/expand/ucpexpand1.component | 35 ++++ ucb/source/ucp/ext/makefile.mk | 8 + ucb/source/ucp/ext/ucpext.component | 35 ++++ ucb/source/ucp/ext/ucpext_services.cxx | 6 - ucb/source/ucp/file/exports2.dxp | 1 - ucb/source/ucp/file/makefile.mk | 8 + ucb/source/ucp/file/prov.cxx | 54 ------- ucb/source/ucp/file/ucpfile1.component | 34 ++++ ucb/source/ucp/ftp/ftpservices.cxx | 54 ------- ucb/source/ucp/ftp/makefile.mk | 8 + ucb/source/ucp/ftp/ucpftp1.component | 34 ++++ ucb/source/ucp/gio/gio_provider.cxx | 35 ---- ucb/source/ucp/gio/makefile.mk | 10 +- ucb/source/ucp/gio/ucpgio-ucd.txt | 6 - ucb/source/ucp/gio/ucpgio.component | 34 ++++ ucb/source/ucp/gvfs/gvfs_provider.cxx | 45 ------ ucb/source/ucp/gvfs/makefile.mk | 9 +- ucb/source/ucp/gvfs/ucpgvfs-ucd.txt | 6 - ucb/source/ucp/gvfs/ucpgvfs.component | 34 ++++ ucb/source/ucp/hierarchy/hierarchyservices.cxx | 63 -------- ucb/source/ucp/hierarchy/makefile.mk | 8 + ucb/source/ucp/hierarchy/ucphier1.component | 38 +++++ ucb/source/ucp/odma/odma_services.cxx | 39 ----- ucb/source/ucp/package/makefile.mk | 8 + ucb/source/ucp/package/pkgservices.cxx | 59 ------- ucb/source/ucp/package/ucppkg1.component | 34 ++++ ucb/source/ucp/tdoc/makefile.mk | 8 + ucb/source/ucp/tdoc/tdoc_services.cxx | 62 ------- ucb/source/ucp/tdoc/ucptdoc1.component | 37 +++++ ucb/source/ucp/webdav/makefile.mk | 8 + ucb/source/ucp/webdav/ucpdav1.component | 34 ++++ ucb/source/ucp/webdav/webdavservices.cxx | 54 ------- uui/prj/d.lst | 1 + uui/source/services.cxx | 80 --------- uui/util/makefile.mk | 8 + uui/util/uui.component | 44 +++++ vbahelper/prj/d.lst | 1 + vbahelper/source/msforms/service.cxx | 10 -- vbahelper/util/makefile.mk | 8 + vbahelper/util/msforms.component | 37 +++++ xmlhelp/prj/d.lst | 3 + .../source/com/sun/star/help/HelpComponent.java | 25 +-- xmlhelp/source/com/sun/star/help/HelpSearch.java | 19 +-- .../com/sun/star/help/LuceneHelpWrapper.component | 37 +++++ xmlhelp/source/com/sun/star/help/makefile.mk | 8 + xmlhelp/source/cxxhelp/provider/services.cxx | 55 ------- xmlhelp/source/treeview/makefile.mk | 8 + xmlhelp/source/treeview/tvfactory.cxx | 57 ------- xmlhelp/source/treeview/tvhlp1.component | 35 ++++ xmlhelp/util/makefile.mk | 8 + xmlhelp/util/ucpchelp1.component | 35 ++++ xmloff/prj/d.lst | 2 + xmloff/source/core/facreg.cxx | 111 ------------- xmloff/source/transform/XMLFilterRegistration.cxx | 33 ---- xmloff/source/transform/makefile.mk | 8 + xmloff/source/transform/xof.component | 118 ++++++++++++++ xmloff/util/makefile.mk | 8 + xmloff/util/xo.component | 178 +++++++++++++++++++++ xmlscript/prj/d.lst | 1 + xmlscript/source/misc/unoservices.cxx | 9 -- xmlscript/util/makefile.mk | 8 + xmlscript/util/xcr.component | 46 ++++++ 364 files changed, 4831 insertions(+), 3785 deletions(-) create mode 100644 avmedia/source/gstreamer/avmediagst.component create mode 100644 avmedia/source/java/avmedia.jar.component create mode 100644 avmedia/source/quicktime/avmediaQuickTime.component create mode 100644 avmedia/source/win/avmediawin.component create mode 100644 avmedia/util/avmedia.component create mode 100644 basic/util/sb.component create mode 100644 configmgr/source/configmgr.component create mode 100644 connectivity/source/cpool/dbpool2.component create mode 100644 connectivity/source/dbtools/dbtools.component create mode 100644 connectivity/source/drivers/adabas/adabas.component create mode 100644 connectivity/source/drivers/ado/ado.component create mode 100644 connectivity/source/drivers/calc/calc.component create mode 100644 connectivity/source/drivers/dbase/dbase.component create mode 100644 connectivity/source/drivers/evoab2/evoab.component create mode 100644 connectivity/source/drivers/flat/flat.component create mode 100644 connectivity/source/drivers/hsqldb/hsqldb.component create mode 100644 connectivity/source/drivers/jdbc/jdbc.component create mode 100644 connectivity/source/drivers/kab/kab1.component create mode 100644 connectivity/source/drivers/macab/macab1.component create mode 100644 connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component create mode 100644 connectivity/source/drivers/mozab/mozab.component create mode 100644 connectivity/source/drivers/mysql/mysql.component create mode 100644 connectivity/source/drivers/odbc/odbc.component create mode 100644 connectivity/source/manager/sdbc2.component create mode 100644 desktop/source/deployment/deployment.component create mode 100644 desktop/source/deployment/gui/deploymentgui.component mode change 100755 => 100644 desktop/source/deployment/gui/dp_gui_service.cxx mode change 100755 => 100644 desktop/source/migration/services/cexportsoo3.cxx create mode 100644 desktop/source/migration/services/migrationoo2.component create mode 100644 desktop/source/migration/services/migrationoo3.component delete mode 100755 desktop/source/migration/services/migrationoo3.map create mode 100644 desktop/source/offacc/offacc.component create mode 100644 desktop/source/registration/com/sun/star/registration/productregistration.jar.component create mode 100644 desktop/source/splash/spl.component create mode 100644 embeddedobj/source/msole/emboleobj.component create mode 100644 embeddedobj/source/msole/emboleobj.windows.component create mode 100644 embeddedobj/util/embobj.component create mode 100644 eventattacher/source/evtatt.component create mode 100644 fileaccess/source/fileacc.component create mode 100644 formula/util/for.component delete mode 100644 fpicker/source/aqua/fps-aqua-ucd.txt create mode 100644 fpicker/source/aqua/fps_aqua.component create mode 100644 fpicker/source/generic/fpicker.component create mode 100644 fpicker/source/office/fps_office.component delete mode 100644 fpicker/source/unx/gnome/fps-gnome-ucd.txt create mode 100644 fpicker/source/unx/gnome/fps_gnome.component delete mode 100644 fpicker/source/unx/kde4/fps-kde4-ucd.txt create mode 100644 fpicker/source/unx/kde4/fps_kde4.component create mode 100644 fpicker/util/fop.component create mode 100644 fpicker/util/fps.component create mode 100644 framework/util/fwk.component create mode 100644 framework/util/fwl.component create mode 100644 framework/util/fwm.component create mode 100644 linguistic/source/lng.component create mode 100644 scripting/java/ScriptFramework.component create mode 100644 scripting/java/ScriptProviderForBeanShell.component create mode 100644 scripting/java/ScriptProviderForJava.component create mode 100644 scripting/java/ScriptProviderForJavaScript.component create mode 100644 scripting/source/basprov/basprov.component create mode 100644 scripting/source/dlgprov/dlgprov.component create mode 100644 scripting/source/protocolhandler/protocolhandler.component create mode 100644 scripting/source/pyprov/mailmerge.component create mode 100644 scripting/source/pyprov/pythonscript.component create mode 100644 scripting/source/stringresource/stringresource.component mode change 100644 => 100755 scripting/source/vbaevents/makefile.mk create mode 100644 scripting/source/vbaevents/vbaevents.component create mode 100644 scripting/util/scriptframe.component mode change 100755 => 100644 sfx2/source/appl/appuno.cxx create mode 100644 sfx2/util/sfx.component delete mode 100644 shell/source/backends/desktopbe/desktopbe1-ucd.txt create mode 100644 shell/source/backends/desktopbe/desktopbe1.component delete mode 100644 shell/source/backends/gconfbe/gconfbe1-ucd.txt create mode 100644 shell/source/backends/gconfbe/gconfbe1.component delete mode 100644 shell/source/backends/kde4be/kde4be1-ucd.txt create mode 100644 shell/source/backends/kde4be/kde4be1.component delete mode 100644 shell/source/backends/kdebe/kdebe1-ucd.txt create mode 100644 shell/source/backends/kdebe/kdebe1.component create mode 100644 shell/source/backends/localebe/localebe1.component create mode 100644 shell/source/backends/macbe/macbe1.component create mode 100644 shell/source/backends/wininetbe/wininetbe1.component create mode 100644 shell/source/cmdmail/cmdmail.component create mode 100644 shell/source/unix/exec/syssh.component create mode 100644 shell/source/win32/simplemail/smplmail.component create mode 100644 shell/source/win32/syssh.component create mode 100644 svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component create mode 100644 svx/util/svx.component create mode 100644 svx/util/svxcore.component create mode 100644 ucb/source/cacher/cached1.component create mode 100644 ucb/source/core/ucb1.component create mode 100644 ucb/source/sorter/srtrs1.component create mode 100644 ucb/source/ucp/expand/ucpexpand1.component create mode 100644 ucb/source/ucp/ext/ucpext.component create mode 100644 ucb/source/ucp/file/ucpfile1.component create mode 100644 ucb/source/ucp/ftp/ucpftp1.component delete mode 100644 ucb/source/ucp/gio/ucpgio-ucd.txt create mode 100644 ucb/source/ucp/gio/ucpgio.component delete mode 100644 ucb/source/ucp/gvfs/ucpgvfs-ucd.txt create mode 100644 ucb/source/ucp/gvfs/ucpgvfs.component create mode 100644 ucb/source/ucp/hierarchy/ucphier1.component create mode 100644 ucb/source/ucp/package/ucppkg1.component create mode 100644 ucb/source/ucp/tdoc/ucptdoc1.component create mode 100644 ucb/source/ucp/webdav/ucpdav1.component create mode 100644 uui/util/uui.component create mode 100644 vbahelper/util/msforms.component create mode 100644 xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component create mode 100644 xmlhelp/source/treeview/tvhlp1.component create mode 100644 xmlhelp/util/ucpchelp1.component create mode 100644 xmloff/source/transform/xof.component create mode 100644 xmloff/util/xo.component create mode 100644 xmlscript/util/xcr.component diff --git a/avmedia/prj/d.lst b/avmedia/prj/d.lst index c82db252aab8..eb140ed45770 100644 --- a/avmedia/prj/d.lst +++ b/avmedia/prj/d.lst @@ -16,3 +16,8 @@ mkdir: %_DEST%\inc%_EXT%\avmedia ..\inc\avmedia\mediatoolbox.hxx %_DEST%\inc%_EXT%\avmedia\mediatoolbox.hxx ..\%__SRC%\class\avmedia.jar %_DEST%\bin%_EXT%\avmedia.jar +..\%__SRC%\misc\avmedia.component %_DEST%\xml%_EXT%\avmedia.component +..\%__SRC%\misc\avmedia.jar.component %_DEST%\xml%_EXT%\avmedia.jar.component +..\%__SRC%\misc\avmediaQuickTime.component %_DEST%\xml%_EXT%\avmediaQuickTime.component +..\%__SRC%\misc\avmediagst.component %_DEST%\xml%_EXT%\avmediagst.component +..\%__SRC%\misc\avmediawin.component %_DEST%\xml%_EXT%\avmediawin.component diff --git a/avmedia/source/framework/soundhandler.cxx b/avmedia/source/framework/soundhandler.cxx index d24ae795fd76..a1fed18a0f68 100644 --- a/avmedia/source/framework/soundhandler.cxx +++ b/avmedia/source/framework/soundhandler.cxx @@ -497,44 +497,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - rtl::OUString sKeyName = DECLARE_ASCII( "/" ); - sKeyName += avmedia::SoundHandler::impl_getStaticImplementationName(); - sKeyName += DECLARE_ASCII( "/UNO/SERVICES" ); - css::uno::Reference< css::registry::XRegistryKey > xNewKey( - static_cast< css::registry::XRegistryKey* >( pRegistryKey )->createKey(sKeyName)); - - if ( xNewKey.is() == sal_True ) - { - css::uno::Sequence< ::rtl::OUString > seqServiceNames = avmedia::SoundHandler::impl_getStaticSupportedServiceNames(); - const ::rtl::OUString* pArray = seqServiceNames.getArray(); - sal_Int32 nLength = seqServiceNames.getLength(); - for ( sal_Int32 nCounter = 0; nCounter < nLength; ++nCounter ) - xNewKey->createKey( pArray[nCounter] ); - } - - bRet = sal_True; - } - catch( css::registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/avmedia/source/gstreamer/avmediagst.component b/avmedia/source/gstreamer/avmediagst.component new file mode 100644 index 000000000000..75d39d275f5c --- /dev/null +++ b/avmedia/source/gstreamer/avmediagst.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/avmedia/source/gstreamer/exports.dxp b/avmedia/source/gstreamer/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/avmedia/source/gstreamer/exports.dxp +++ b/avmedia/source/gstreamer/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/avmedia/source/gstreamer/gstuno.cxx b/avmedia/source/gstreamer/gstuno.cxx index adcda63fcd9c..26d13ffc938b 100644 --- a/avmedia/source/gstreamer/gstuno.cxx +++ b/avmedia/source/gstreamer/gstuno.cxx @@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xNewKey1( - static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - ::rtl::OUString::createFromAscii( - "/" AVMEDIA_GSTREAMER_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/" - AVMEDIA_GSTREAMER_MANAGER_SERVICENAME ) ) ); - - bRet = sal_True; - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/avmedia/source/gstreamer/makefile.mk b/avmedia/source/gstreamer/makefile.mk index 2f22c7333778..c648fcc77f89 100644 --- a/avmedia/source/gstreamer/makefile.mk +++ b/avmedia/source/gstreamer/makefile.mk @@ -69,3 +69,11 @@ DEF1EXPORTFILE=exports.dxp .ENDIF .INCLUDE : target.mk + +ALLTAR : $(MISC)/avmediagst.component + +$(MISC)/avmediagst.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + avmediagst.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt avmediagst.component diff --git a/avmedia/source/java/MediaUno.java b/avmedia/source/java/MediaUno.java index ca7a164586d8..3e4387840741 100644 --- a/avmedia/source/java/MediaUno.java +++ b/avmedia/source/java/MediaUno.java @@ -64,13 +64,4 @@ public class MediaUno return null; } - - // ------------------------------------------------------------------------- - - public static boolean __writeRegistryServiceInfo( - com.sun.star.registry.XRegistryKey regKey ) - { - return com.sun.star.comp.loader.FactoryHelper.writeRegistryServiceInfo( - s_implName, s_serviceName, regKey ); - } } diff --git a/avmedia/source/java/avmedia.jar.component b/avmedia/source/java/avmedia.jar.component new file mode 100644 index 000000000000..d7cc160bd7d0 --- /dev/null +++ b/avmedia/source/java/avmedia.jar.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/avmedia/source/java/makefile.mk b/avmedia/source/java/makefile.mk index 37c53a721164..1fe771c117f2 100644 --- a/avmedia/source/java/makefile.mk +++ b/avmedia/source/java/makefile.mk @@ -59,3 +59,11 @@ CUSTOMMANIFESTFILE = manifest # --- Targets ------------------------------------------------------ .INCLUDE: target.mk + +ALLTAR : $(MISC)/avmedia.jar.component + +$(MISC)/avmedia.jar.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)avmedia.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component diff --git a/avmedia/source/quicktime/avmediaQuickTime.component b/avmedia/source/quicktime/avmediaQuickTime.component new file mode 100644 index 000000000000..aa0251d74c9d --- /dev/null +++ b/avmedia/source/quicktime/avmediaQuickTime.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/avmedia/source/quicktime/makefile.mk b/avmedia/source/quicktime/makefile.mk index f3c9f244f357..358fce491847 100644 --- a/avmedia/source/quicktime/makefile.mk +++ b/avmedia/source/quicktime/makefile.mk @@ -83,3 +83,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map dummy: @echo " Nothing to build for GUIBASE=$(GUIBASE)" .ENDIF + +ALLTAR : $(MISC)/avmediaQuickTime.component + +$(MISC)/avmediaQuickTime.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt avmediaQuickTime.component diff --git a/avmedia/source/quicktime/quicktimeuno.cxx b/avmedia/source/quicktime/quicktimeuno.cxx index b2dee4d77838..9ecd77f4b9e0 100644 --- a/avmedia/source/quicktime/quicktimeuno.cxx +++ b/avmedia/source/quicktime/quicktimeuno.cxx @@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xNewKey1( - static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - ::rtl::OUString::createFromAscii( - "/" AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/" - AVMEDIA_QUICKTIME_MANAGER_SERVICENAME ) ) ); - - bRet = sal_True; - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/avmedia/source/win/avmediawin.component b/avmedia/source/win/avmediawin.component new file mode 100644 index 000000000000..c80c19bff0d9 --- /dev/null +++ b/avmedia/source/win/avmediawin.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/avmedia/source/win/exports.dxp b/avmedia/source/win/exports.dxp index db9c0a52f288..926e49f5f1a5 100644 --- a/avmedia/source/win/exports.dxp +++ b/avmedia/source/win/exports.dxp @@ -1,4 +1,3 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/avmedia/source/win/makefile.mk b/avmedia/source/win/makefile.mk index b70841e8bdf7..37db25b6a8b7 100644 --- a/avmedia/source/win/makefile.mk +++ b/avmedia/source/win/makefile.mk @@ -80,3 +80,11 @@ SHL1STDLIBS += dxguid.lib .ENDIF .INCLUDE : target.mk + +ALLTAR : $(MISC)/avmediawin.component + +$(MISC)/avmediawin.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + avmediawin.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt avmediawin.component diff --git a/avmedia/source/win/winuno.cxx b/avmedia/source/win/winuno.cxx index 645871290413..8b71f10b3f29 100644 --- a/avmedia/source/win/winuno.cxx +++ b/avmedia/source/win/winuno.cxx @@ -48,33 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xNewKey1( - static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - ::rtl::OUString::createFromAscii( "/com.sun.star.comp.avmedia.Manager_DirectX/UNO/SERVICES/com.sun.star.media.Manager_DirectX" ) ) ); - - bRet = sal_True; - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/avmedia/source/xine/exports.dxp b/avmedia/source/xine/exports.dxp index db9c0a52f288..926e49f5f1a5 100644 --- a/avmedia/source/xine/exports.dxp +++ b/avmedia/source/xine/exports.dxp @@ -1,4 +1,3 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/avmedia/source/xine/xineuno.cxx b/avmedia/source/xine/xineuno.cxx index 4dc4f3f7e1dd..2efe57b2472c 100644 --- a/avmedia/source/xine/xineuno.cxx +++ b/avmedia/source/xine/xineuno.cxx @@ -48,35 +48,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -// ----------------------- -// - component_writeInfo - -// ----------------------- - -extern "C" sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xNewKey1( - static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - ::rtl::OUString::createFromAscii( - "/" AVMEDIA_XINE_MANAGER_IMPLEMENTATIONNAME "/UNO/SERVICES/" - AVMEDIA_XINE_MANAGER_SERVICENAME ) ) ); - - bRet = sal_True; - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/avmedia/util/avmedia.component b/avmedia/util/avmedia.component new file mode 100644 index 000000000000..fa01dc03eb9c --- /dev/null +++ b/avmedia/util/avmedia.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/avmedia/util/makefile.mk b/avmedia/util/makefile.mk index b0d0a6816cf8..a0712204bec1 100644 --- a/avmedia/util/makefile.mk +++ b/avmedia/util/makefile.mk @@ -77,3 +77,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo LibMain>>$@ @echo CT>>$@ .ENDIF + +ALLTAR : $(MISC)/avmedia.component + +$(MISC)/avmedia.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + avmedia.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt avmedia.component diff --git a/basic/prj/d.lst b/basic/prj/d.lst index d2a083ebcb1e..d8d0fce41994 100644 --- a/basic/prj/d.lst +++ b/basic/prj/d.lst @@ -57,3 +57,4 @@ mkdir: %_DEST%\inc%_EXT%\basic ..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx ..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx +..\%__SRC%\misc\sb.component %_DEST%\xml%_EXT%\sb.component diff --git a/basic/util/makefile.mk b/basic/util/makefile.mk index 629586f0441c..31a4dcca8f8b 100644 --- a/basic/util/makefile.mk +++ b/basic/util/makefile.mk @@ -143,4 +143,10 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk $(SRS)$/basic.srs: $(TYPE) $(SRS)$/classes.srs + $(SRS)$/runtime.srs + $(SRS)$/sbx.srs > $@ +ALLTAR : $(MISC)/sb.component +$(MISC)/sb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sb.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sb.component diff --git a/basic/util/sb.component b/basic/util/sb.component new file mode 100644 index 000000000000..4687bd1e7d0b --- /dev/null +++ b/basic/util/sb.component @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst index 17ccdbe86a08..34b6cf3e0010 100644 --- a/configmgr/prj/d.lst +++ b/configmgr/prj/d.lst @@ -1,3 +1,4 @@ ..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin%_EXT%\configmgr.uno.dll ..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib%_EXT%\configmgr.uno.dylib ..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib%_EXT%\configmgr.uno.so +..\%__SRC%\misc\configmgr.component %_DEST%\xml%_EXT%\configmgr.component diff --git a/configmgr/source/configmgr.component b/configmgr/source/configmgr.component new file mode 100644 index 000000000000..6ed51257005d --- /dev/null +++ b/configmgr/source/configmgr.component @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk index 37235a726ce4..94747d9dd803 100644 --- a/configmgr/source/makefile.mk +++ b/configmgr/source/makefile.mk @@ -81,3 +81,11 @@ SHL1USE_EXPORTS = name DEF1NAME = $(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/configmgr.component + +$(MISC)/configmgr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + configmgr.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt configmgr.component diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx index f8c3289664ef..b1ef8d2169bb 100644 --- a/configmgr/source/services.cxx +++ b/configmgr/source/services.cxx @@ -28,7 +28,6 @@ #include "precompiled_configmgr.hxx" #include "sal/config.h" -#include "com/sun/star/registry/XRegistryKey.hpp" #include "com/sun/star/uno/Exception.hpp" #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/XComponentContext.hpp" @@ -36,9 +35,6 @@ #include "cppuhelper/implementationentry.hxx" #include "osl/diagnose.h" #include "uno/lbnames.h" -#include "rtl/textenc.h" -#include "rtl/ustring.h" -#include "rtl/ustring.hxx" #include "sal/types.h" #include "configurationprovider.hxx" @@ -89,47 +85,3 @@ component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - if (!component_writeInfoHelper(pServiceManager, pRegistryKey, services)) { - return false; - } - try { - css::uno::Reference< css::registry::XRegistryKey >( - (css::uno::Reference< css::registry::XRegistryKey >( - static_cast< css::registry::XRegistryKey * >(pRegistryKey))-> - createKey( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "/com.sun.star.comp.configuration.DefaultProvider/UNO/" - "SINGLETONS/" - "com.sun.star.configuration.theDefaultProvider")))), - css::uno::UNO_SET_THROW)-> - setStringValue( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.DefaultProvider"))); - css::uno::Reference< css::registry::XRegistryKey >( - (css::uno::Reference< css::registry::XRegistryKey >( - static_cast< css::registry::XRegistryKey * >(pRegistryKey))-> - createKey( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "/com.sun.star.comp.configuration.Update/UNO/" - "SINGLETONS/com.sun.star.configuration.Update")))), - css::uno::UNO_SET_THROW)-> - setStringValue( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.Update_Service"))); - } catch (css::uno::Exception & e) { - (void) e; - OSL_TRACE( - "configmgr component_writeInfo exception: %s", - rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); - return false; - } - return true; -} diff --git a/connectivity/prj/d.lst b/connectivity/prj/d.lst index e116ee5740ac..01d82ba9177e 100644 --- a/connectivity/prj/d.lst +++ b/connectivity/prj/d.lst @@ -31,3 +31,20 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\DataAccess ..\%__SRC%\misc\registry\data\org\openoffice\Office\DataAccess\*.xcu %_DEST%\xml%_EXT%\registry\spool\DataAccess\*.xcu ..\%COMMON_OUTDIR%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip ..\%__SRC%\bin\fcfg_drivers_*.zip %_DEST%\pck%_EXT%\fcfg_drivers_*.zip +..\%__SRC%\misc\adabas.component %_DEST%\xml%_EXT%\adabas.component +..\%__SRC%\misc\ado.component %_DEST%\xml%_EXT%\ado.component +..\%__SRC%\misc\calc.component %_DEST%\xml%_EXT%\calc.component +..\%__SRC%\misc\dbase.component %_DEST%\xml%_EXT%\dbase.component +..\%__SRC%\misc\dbpool2.component %_DEST%\xml%_EXT%\dbpool2.component +..\%__SRC%\misc\dbtools.component %_DEST%\xml%_EXT%\dbtools.component +..\%__SRC%\misc\evoab.component %_DEST%\xml%_EXT%\evoab.component +..\%__SRC%\misc\flat.component %_DEST%\xml%_EXT%\flat.component +..\%__SRC%\misc\hsqldb.component %_DEST%\xml%_EXT%\hsqldb.component +..\%__SRC%\misc\jdbc.component %_DEST%\xml%_EXT%\jdbc.component +..\%__SRC%\misc\kab1.component %_DEST%\xml%_EXT%\kab1.component +..\%__SRC%\misc\macab1.component %_DEST%\xml%_EXT%\macab1.component +..\%__SRC%\misc\mozab.component %_DEST%\xml%_EXT%\mozab.component +..\%__SRC%\misc\mozbootstrap.component %_DEST%\xml%_EXT%\mozbootstrap.component +..\%__SRC%\misc\mysql.component %_DEST%\xml%_EXT%\mysql.component +..\%__SRC%\misc\odbc.component %_DEST%\xml%_EXT%\odbc.component +..\%__SRC%\misc\sdbc2.component %_DEST%\xml%_EXT%\sdbc2.component diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx index 52e76f834ab5..1e3f80546d74 100644 --- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx +++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx @@ -899,11 +899,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* serviceManager, com::sun::star::registry::XRegistryKey* registryKey) -{ - return cppu::component_writeInfoHelper(serviceManager, registryKey, entries); -} //--------------------------------------------------------------------------------------- SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* implName, ::com::sun::star::lang::XMultiServiceFactory* serviceManager, void* registryKey) { diff --git a/connectivity/source/cpool/Zregistration.cxx b/connectivity/source/cpool/Zregistration.cxx index 0786d9ea5f9a..be638aebf620 100644 --- a/connectivity/source/cpool/Zregistration.cxx +++ b/connectivity/source/cpool/Zregistration.cxx @@ -49,35 +49,6 @@ extern "C" *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey) -{ - ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/"); - sMainKeyName += OPoolCollection::getImplementationName_Static(); - sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES"); - - try - { - Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName); - if (!xMainKey.is()) - return sal_False; - - Sequence< ::rtl::OUString > sServices = OPoolCollection::getSupportedServiceNames_Static(); - const ::rtl::OUString* pServices = sServices.getConstArray(); - for (sal_Int32 i=0; icreateKey(*pServices); - } - catch(InvalidRegistryException&) - { - return sal_False; - } - catch(InvalidValueException&) - { - return sal_False; - } - return sal_True; -} - //--------------------------------------------------------------------------------------- void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/) { diff --git a/connectivity/source/cpool/dbpool2.component b/connectivity/source/cpool/dbpool2.component new file mode 100644 index 000000000000..2fa8a144959c --- /dev/null +++ b/connectivity/source/cpool/dbpool2.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/cpool/exports.dxp b/connectivity/source/cpool/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/cpool/exports.dxp +++ b/connectivity/source/cpool/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk index 1f6e49c6cbd7..9908a6d242cb 100644 --- a/connectivity/source/cpool/makefile.mk +++ b/connectivity/source/cpool/makefile.mk @@ -78,4 +78,10 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : target.mk +ALLTAR : $(MISC)/dbpool2.component +$(MISC)/dbpool2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbpool2.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbpool2.component diff --git a/connectivity/source/dbtools/dbtools.component b/connectivity/source/dbtools/dbtools.component new file mode 100644 index 000000000000..08be953bb9d4 --- /dev/null +++ b/connectivity/source/dbtools/dbtools.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/connectivity/source/dbtools/exports.dxp b/connectivity/source/dbtools/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/dbtools/exports.dxp +++ b/connectivity/source/dbtools/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/dbtools/makefile.mk b/connectivity/source/dbtools/makefile.mk index af4ac13e54cc..a73dae3d047d 100644 --- a/connectivity/source/dbtools/makefile.mk +++ b/connectivity/source/dbtools/makefile.mk @@ -95,3 +95,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo _TI >$@ @echo _real >>$@ + +ALLTAR : $(MISC)/dbtools.component + +$(MISC)/dbtools.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbtools.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbtools.component diff --git a/connectivity/source/drivers/adabas/Bservices.cxx b/connectivity/source/drivers/adabas/Bservices.cxx index be1d716e8cd0..d895fb72b391 100644 --- a/connectivity/source/drivers/adabas/Bservices.cxx +++ b/connectivity/source/drivers/adabas/Bservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "adabas/BDriver.hxx" #include -#include using namespace connectivity::adabas; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriver::getImplementationName_Static(), - ODriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/adabas/adabas.component b/connectivity/source/drivers/adabas/adabas.component new file mode 100644 index 000000000000..3c359c3d0217 --- /dev/null +++ b/connectivity/source/drivers/adabas/adabas.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/adabas/adabas.mxp.map b/connectivity/source/drivers/adabas/adabas.mxp.map index 2ce9f111412b..f64c44c13fce 100644 --- a/connectivity/source/drivers/adabas/adabas.mxp.map +++ b/connectivity/source/drivers/adabas/adabas.mxp.map @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory __mh_dylib_header ___builtin_delete diff --git a/connectivity/source/drivers/adabas/exports.dxp b/connectivity/source/drivers/adabas/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/adabas/exports.dxp +++ b/connectivity/source/drivers/adabas/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk index 9268f02a3b42..ffc3960391fd 100644 --- a/connectivity/source/drivers/adabas/makefile.mk +++ b/connectivity/source/drivers/adabas/makefile.mk @@ -104,3 +104,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/adabas.component + +$(MISC)/adabas.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + adabas.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt adabas.component diff --git a/connectivity/source/drivers/ado/Aservices.cxx b/connectivity/source/drivers/ado/Aservices.cxx index 05ebd274be84..71d90f289a7d 100644 --- a/connectivity/source/drivers/ado/Aservices.cxx +++ b/connectivity/source/drivers/ado/Aservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "ado/ADriver.hxx" #include -#include using namespace connectivity::ado; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "ADO::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -121,31 +94,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine"; } -//--------------------------------------------------------------------------------------- -extern "C" sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriver::getImplementationName_Static(), - ODriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "ADO::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/ado/ado.component b/connectivity/source/drivers/ado/ado.component new file mode 100644 index 000000000000..1962a6b710a7 --- /dev/null +++ b/connectivity/source/drivers/ado/ado.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/ado/exports.dxp b/connectivity/source/drivers/ado/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/ado/exports.dxp +++ b/connectivity/source/drivers/ado/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/ado/makefile.mk b/connectivity/source/drivers/ado/makefile.mk index 33e470648219..2b3c91a2010c 100644 --- a/connectivity/source/drivers/ado/makefile.mk +++ b/connectivity/source/drivers/ado/makefile.mk @@ -112,3 +112,11 @@ dummy: # --- Targets ---------------------------------- .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/ado.component + +$(MISC)/ado.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ado.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ado.component diff --git a/connectivity/source/drivers/calc/Cservices.cxx b/connectivity/source/drivers/calc/Cservices.cxx index b172d9d4cf88..5f0338b55aae 100644 --- a/connectivity/source/drivers/calc/Cservices.cxx +++ b/connectivity/source/drivers/calc/Cservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "calc/CDriver.hxx" #include -#include using namespace connectivity::calc; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriver::getImplementationName_Static(), - ODriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/calc/calc.component b/connectivity/source/drivers/calc/calc.component new file mode 100644 index 000000000000..be949f70de14 --- /dev/null +++ b/connectivity/source/drivers/calc/calc.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/calc/exports.dxp b/connectivity/source/drivers/calc/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/calc/exports.dxp +++ b/connectivity/source/drivers/calc/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk index 8e193524aa45..a7393b3c8e82 100644 --- a/connectivity/source/drivers/calc/makefile.mk +++ b/connectivity/source/drivers/calc/makefile.mk @@ -94,3 +94,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/calc.component + +$(MISC)/calc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + calc.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt calc.component diff --git a/connectivity/source/drivers/dbase/Dservices.cxx b/connectivity/source/drivers/dbase/Dservices.cxx index 831329a1feba..74019abe364d 100644 --- a/connectivity/source/drivers/dbase/Dservices.cxx +++ b/connectivity/source/drivers/dbase/Dservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "dbase/DDriver.hxx" #include -#include using namespace connectivity::dbase; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriver::getImplementationName_Static(), - ODriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/dbase/dbase.component b/connectivity/source/drivers/dbase/dbase.component new file mode 100644 index 000000000000..7f913f083680 --- /dev/null +++ b/connectivity/source/drivers/dbase/dbase.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/dbase/dbase.mxp.map b/connectivity/source/drivers/dbase/dbase.mxp.map index c5b4377b04c3..87eccc45b66a 100644 --- a/connectivity/source/drivers/dbase/dbase.mxp.map +++ b/connectivity/source/drivers/dbase/dbase.mxp.map @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory __mh_dylib_header ___builtin_delete diff --git a/connectivity/source/drivers/dbase/exports.dxp b/connectivity/source/drivers/dbase/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/dbase/exports.dxp +++ b/connectivity/source/drivers/dbase/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk index f855cf1f4554..62b7ae96f8fa 100644 --- a/connectivity/source/drivers/dbase/makefile.mk +++ b/connectivity/source/drivers/dbase/makefile.mk @@ -127,3 +127,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/dbase.component + +$(MISC)/dbase.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dbase.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dbase.component diff --git a/connectivity/source/drivers/evoab/LServices.cxx b/connectivity/source/drivers/evoab/LServices.cxx index 4ae9d4b9113b..29a19e9168eb 100644 --- a/connectivity/source/drivers/evoab/LServices.cxx +++ b/connectivity/source/drivers/evoab/LServices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "LDriver.hxx" #include -#include using namespace connectivity::evoab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - OEvoabDriver::getImplementationName_Static(), - OEvoabDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/evoab/exports.dxp b/connectivity/source/drivers/evoab/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/evoab/exports.dxp +++ b/connectivity/source/drivers/evoab/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/evoab2/NServices.cxx b/connectivity/source/drivers/evoab2/NServices.cxx index c11eed9d6c61..555837d15a28 100644 --- a/connectivity/source/drivers/evoab2/NServices.cxx +++ b/connectivity/source/drivers/evoab2/NServices.cxx @@ -35,7 +35,6 @@ using namespace connectivity::evoab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "EVOAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +96,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - OEvoabDriver::getImplementationName_Static(), - OEvoabDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/evoab2/evoab.component b/connectivity/source/drivers/evoab2/evoab.component new file mode 100644 index 000000000000..a99719388d13 --- /dev/null +++ b/connectivity/source/drivers/evoab2/evoab.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk index e8a1cf96cddf..3f5b62903b7a 100644 --- a/connectivity/source/drivers/evoab2/makefile.mk +++ b/connectivity/source/drivers/evoab2/makefile.mk @@ -110,3 +110,11 @@ DEF1NAME= $(SHL1TARGET) # --- Targets ---------------------------------- .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/evoab.component + +$(MISC)/evoab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + evoab.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt evoab.component diff --git a/connectivity/source/drivers/flat/Eservices.cxx b/connectivity/source/drivers/flat/Eservices.cxx index a0445c1ca70f..30553af24cfc 100644 --- a/connectivity/source/drivers/flat/Eservices.cxx +++ b/connectivity/source/drivers/flat/Eservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "flat/EDriver.hxx" #include -#include using namespace connectivity::flat; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "FILE::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriver::getImplementationName_Static(), - ODriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "FILE::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/flat/exports.dxp b/connectivity/source/drivers/flat/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/flat/exports.dxp +++ b/connectivity/source/drivers/flat/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/flat/flat.component b/connectivity/source/drivers/flat/flat.component new file mode 100644 index 000000000000..fe8b79ee73b8 --- /dev/null +++ b/connectivity/source/drivers/flat/flat.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/flat/flat.mxp.map b/connectivity/source/drivers/flat/flat.mxp.map index 54a8532f7840..2737c61b5a57 100644 --- a/connectivity/source/drivers/flat/flat.mxp.map +++ b/connectivity/source/drivers/flat/flat.mxp.map @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory __mh_dylib_header ___builtin_delete diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk index 2d1f99f759c7..23920f91c21d 100644 --- a/connectivity/source/drivers/flat/makefile.mk +++ b/connectivity/source/drivers/flat/makefile.mk @@ -105,3 +105,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/flat.component + +$(MISC)/flat.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + flat.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt flat.component diff --git a/connectivity/source/drivers/hsqldb/Hservices.cxx b/connectivity/source/drivers/hsqldb/Hservices.cxx index a3e783a3e9a7..ea0d452f1d05 100644 --- a/connectivity/source/drivers/hsqldb/Hservices.cxx +++ b/connectivity/source/drivers/hsqldb/Hservices.cxx @@ -30,13 +30,11 @@ #include "hsqldb/HDriver.hxx" #include -#include using namespace connectivity::hsqldb; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -123,31 +96,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriverDelegator::getImplementationName_Static(), - ODriverDelegator::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/hsqldb/exports.dxp b/connectivity/source/drivers/hsqldb/exports.dxp index 7ff56f4f9977..3efc73741d24 100644 --- a/connectivity/source/drivers/hsqldb/exports.dxp +++ b/connectivity/source/drivers/hsqldb/exports.dxp @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII diff --git a/connectivity/source/drivers/hsqldb/hsqldb.component b/connectivity/source/drivers/hsqldb/hsqldb.component new file mode 100644 index 000000000000..eb8ae477e749 --- /dev/null +++ b/connectivity/source/drivers/hsqldb/hsqldb.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/hsqldb/hsqldb.map b/connectivity/source/drivers/hsqldb/hsqldb.map index b4fc53b320ef..b611aba02d5b 100644 --- a/connectivity/source/drivers/hsqldb/hsqldb.map +++ b/connectivity/source/drivers/hsqldb/hsqldb.map @@ -1,7 +1,6 @@ UDK_3_0_0 { global: component_getImplementationEnvironment; - component_writeInfo; component_getFactory; Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream; Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII; diff --git a/connectivity/source/drivers/hsqldb/makefile.mk b/connectivity/source/drivers/hsqldb/makefile.mk index e1a953055c04..5be6fa08cd7b 100644 --- a/connectivity/source/drivers/hsqldb/makefile.mk +++ b/connectivity/source/drivers/hsqldb/makefile.mk @@ -115,3 +115,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/hsqldb.component + +$(MISC)/hsqldb.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + hsqldb.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt hsqldb.component diff --git a/connectivity/source/drivers/jdbc/exports.dxp b/connectivity/source/drivers/jdbc/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/jdbc/exports.dxp +++ b/connectivity/source/drivers/jdbc/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/jdbc/jdbc.component b/connectivity/source/drivers/jdbc/jdbc.component new file mode 100644 index 000000000000..5d7db4690ba5 --- /dev/null +++ b/connectivity/source/drivers/jdbc/jdbc.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/jdbc/jdbc.mxp.map b/connectivity/source/drivers/jdbc/jdbc.mxp.map index a4457e2478af..e02823e8c41b 100644 --- a/connectivity/source/drivers/jdbc/jdbc.mxp.map +++ b/connectivity/source/drivers/jdbc/jdbc.mxp.map @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory __mh_dylib_header ___builtin_delete diff --git a/connectivity/source/drivers/jdbc/jservices.cxx b/connectivity/source/drivers/jdbc/jservices.cxx index cadbbdcbcd49..85a8d37b9346 100644 --- a/connectivity/source/drivers/jdbc/jservices.cxx +++ b/connectivity/source/drivers/jdbc/jservices.cxx @@ -34,7 +34,6 @@ using namespace connectivity; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -47,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pModCount ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "SBA::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -121,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - java_sql_Driver::getImplementationName_Static(), - java_sql_Driver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "SBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk index 46619952163b..510daeac4a9f 100644 --- a/connectivity/source/drivers/jdbc/makefile.mk +++ b/connectivity/source/drivers/jdbc/makefile.mk @@ -110,3 +110,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/jdbc.component + +$(MISC)/jdbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + jdbc.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt jdbc.component diff --git a/connectivity/source/drivers/kab/KServices.cxx b/connectivity/source/drivers/kab/KServices.cxx index 5a0f4c3f9917..6b7a1a39a667 100644 --- a/connectivity/source/drivers/kab/KServices.cxx +++ b/connectivity/source/drivers/kab/KServices.cxx @@ -30,13 +30,11 @@ #include "KDriver.hxx" #include -#include using namespace connectivity::kab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// The following C Api must be provided! -// It consists in three functions that must be exported by the module -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "KAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void*, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - KabDriver::getImplementationName_Static(), - KabDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "KAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/kab/exports.dxp b/connectivity/source/drivers/kab/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/kab/exports.dxp +++ b/connectivity/source/drivers/kab/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/kab/kab1.component b/connectivity/source/drivers/kab/kab1.component new file mode 100644 index 000000000000..77227501d36c --- /dev/null +++ b/connectivity/source/drivers/kab/kab1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk index 219bdd6cd020..c085cddb2d3b 100644 --- a/connectivity/source/drivers/kab/makefile.mk +++ b/connectivity/source/drivers/kab/makefile.mk @@ -138,3 +138,11 @@ dummy: .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/kab1.component + +$(MISC)/kab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + kab1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt kab1.component diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx index b3c303324302..9d2e2faa0ca1 100755 --- a/connectivity/source/drivers/macab/MacabServices.cxx +++ b/connectivity/source/drivers/macab/MacabServices.cxx @@ -30,13 +30,11 @@ #include "MacabDriver.hxx" #include -#include using namespace connectivity::macab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// The following C Api must be provided! -// It consists in three functions that must be exported by the module -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "MACAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void*, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - MacabDriver::getImplementationName_Static(), - MacabDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "MACAB::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/macab/exports.dxp b/connectivity/source/drivers/macab/exports.dxp index 9630d7e06768..f0e1c69934bc 100755 --- a/connectivity/source/drivers/macab/exports.dxp +++ b/connectivity/source/drivers/macab/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/macab/macab1.component b/connectivity/source/drivers/macab/macab1.component new file mode 100644 index 000000000000..0a120c041883 --- /dev/null +++ b/connectivity/source/drivers/macab/macab1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk index 35532b15ec2d..0565d3171329 100755 --- a/connectivity/source/drivers/macab/makefile.mk +++ b/connectivity/source/drivers/macab/makefile.mk @@ -127,3 +127,11 @@ dummy: .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/macab1.component + +$(MISC)/macab1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + macab1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt macab1.component diff --git a/connectivity/source/drivers/mozab/MServices.cxx b/connectivity/source/drivers/mozab/MServices.cxx index 4e595dad57ed..d6a280985969 100644 --- a/connectivity/source/drivers/mozab/MServices.cxx +++ b/connectivity/source/drivers/mozab/MServices.cxx @@ -39,7 +39,6 @@ using namespace connectivity::mozab; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::mozilla::XMozillaBootstrap; @@ -53,31 +52,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM("/")); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -127,37 +101,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - - REGISTER_PROVIDER( - MozabDriver::getImplementationName_Static(), - MozabDriver::getSupportedServiceNames_Static(), xKey); - - Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")); - REGISTER_PROVIDER( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")), - aSNS, xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} typedef void* (SAL_CALL * OMozillaBootstrap_CreateInstanceFunction)(const Reference< XMultiServiceFactory >& _rxFactory ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createMozillaBootstrap(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception ) { diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx index 3a7c169d467d..aeef289bae20 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx @@ -238,7 +238,6 @@ Sequence< ::rtl::OUString > SAL_CALL MozillaBootstrap::getSupportedServiceNames( #include using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -251,50 +250,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const ::rtl::OUString& aServiceImplName, - const Sequence< ::rtl::OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - ::rtl::OUString aMainKeyName; - aMainKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/")); - aMainKeyName += aServiceImplName; - aMainKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "MOZAB::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.mozilla.MozillaBootstrap")); - REGISTER_PROVIDER( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.mozilla.MozillaBootstrap")), - aSNS, xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "Mozab::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { MozillaBootstrap * pBootstrap = reinterpret_cast(OMozillaBootstrap_CreateInstance(rServiceManager)); diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk index 6a4172da205d..b44436e488ce 100644 --- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk +++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk @@ -78,6 +78,14 @@ SHL1STDLIBS=\ $(SALLIB) \ $(COMPHELPERLIB) +ALLTAR : $(MISC)/mozbootstrap.component + +$(MISC)/mozbootstrap.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mozbootstrap.component + .ELSE SLOFILES += \ $(SLO)$/MNSInit.obj \ @@ -90,4 +98,3 @@ SLOFILES += \ # --- Targets ---------------------------------- .INCLUDE : target.mk - diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component new file mode 100644 index 000000000000..5da158924a06 --- /dev/null +++ b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/mozab/exports.dxp b/connectivity/source/drivers/mozab/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/mozab/exports.dxp +++ b/connectivity/source/drivers/mozab/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk index b1e12fde6f8a..852560f1c9a7 100644 --- a/connectivity/source/drivers/mozab/makefile.mk +++ b/connectivity/source/drivers/mozab/makefile.mk @@ -184,3 +184,11 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk @echo _TI >$@ @echo _real >>$@ + +ALLTAR : $(MISC)/mozab.component + +$(MISC)/mozab.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mozab.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mozab.component diff --git a/connectivity/source/drivers/mozab/mozab.component b/connectivity/source/drivers/mozab/mozab.component new file mode 100644 index 000000000000..70f5da3bfe72 --- /dev/null +++ b/connectivity/source/drivers/mozab/mozab.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/connectivity/source/drivers/mysql/Yservices.cxx b/connectivity/source/drivers/mysql/Yservices.cxx index 0927f191e6e6..b892e2f51066 100644 --- a/connectivity/source/drivers/mysql/Yservices.cxx +++ b/connectivity/source/drivers/mysql/Yservices.cxx @@ -29,13 +29,11 @@ #include "precompiled_connectivity.hxx" #include "mysql/YDriver.hxx" #include -#include using namespace connectivity::mysql; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -48,31 +46,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pT ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "ADABAS::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -122,31 +95,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODriverDelegator::getImplementationName_Static(), - ODriverDelegator::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/drivers/mysql/exports.dxp b/connectivity/source/drivers/mysql/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/drivers/mysql/exports.dxp +++ b/connectivity/source/drivers/mysql/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk index fbb68321cb01..453f4b652f21 100644 --- a/connectivity/source/drivers/mysql/makefile.mk +++ b/connectivity/source/drivers/mysql/makefile.mk @@ -82,3 +82,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/mysql.component + +$(MISC)/mysql.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mysql.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mysql.component diff --git a/connectivity/source/drivers/mysql/mysql.component b/connectivity/source/drivers/mysql/mysql.component new file mode 100644 index 000000000000..ced2297fa07f --- /dev/null +++ b/connectivity/source/drivers/mysql/mysql.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk index 508cbfb6df63..426c75bf0142 100644 --- a/connectivity/source/drivers/odbc/makefile.mk +++ b/connectivity/source/drivers/odbc/makefile.mk @@ -76,3 +76,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- Targets ---------------------------------- .INCLUDE : $(PRJ)$/target.pmk + +ALLTAR : $(MISC)/odbc.component + +$(MISC)/odbc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + odbc.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt odbc.component diff --git a/connectivity/source/drivers/odbc/odbc.component b/connectivity/source/drivers/odbc/odbc.component new file mode 100644 index 000000000000..d4e6bc127da2 --- /dev/null +++ b/connectivity/source/drivers/odbc/odbc.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/connectivity/source/drivers/odbc/oservices.cxx b/connectivity/source/drivers/odbc/oservices.cxx index 21bc448a5708..1347a00ea4d4 100644 --- a/connectivity/source/drivers/odbc/oservices.cxx +++ b/connectivity/source/drivers/odbc/oservices.cxx @@ -30,13 +30,11 @@ #include "ORealDriver.hxx" #include "odbc/ODriver.hxx" #include -#include using namespace connectivity::odbc; using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; -using ::com::sun::star::registry::XRegistryKey; using ::com::sun::star::lang::XSingleServiceFactory; using ::com::sun::star::lang::XMultiServiceFactory; @@ -49,31 +47,6 @@ typedef Reference< XSingleServiceFactory > (SAL_CALL *createFactoryFunc) rtl_ModuleCount* _pTemp ); -//*************************************************************************************** -// -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. -// - -//--------------------------------------------------------------------------------------- -void REGISTER_PROVIDER( - const OUString& aServiceImplName, - const Sequence< OUString>& Services, - const Reference< ::com::sun::star::registry::XRegistryKey > & xKey) -{ - OUString aMainKeyName; - aMainKeyName = OUString::createFromAscii("/"); - aMainKeyName += aServiceImplName; - aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); - - Reference< ::com::sun::star::registry::XRegistryKey > xNewKey( xKey->createKey(aMainKeyName) ); - OSL_ENSURE(xNewKey.is(), "ODBC::component_writeInfo : could not create a registry key !"); - - for (sal_Int32 i=0; icreateKey(Services[i]); -} - - //--------------------------------------------------------------------------------------- struct ProviderRequest { @@ -123,31 +96,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - Reference< ::com::sun::star::registry::XRegistryKey > xKey(reinterpret_cast< ::com::sun::star::registry::XRegistryKey*>(pRegistryKey)); - - REGISTER_PROVIDER( - ODBCDriver::getImplementationName_Static(), - ODBCDriver::getSupportedServiceNames_Static(), xKey); - - return sal_True; - } - catch (::com::sun::star::registry::InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "ODBC::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/connectivity/source/manager/exports.dxp b/connectivity/source/manager/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/connectivity/source/manager/exports.dxp +++ b/connectivity/source/manager/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk index 52ec191ec836..4880407952f6 100644 --- a/connectivity/source/manager/makefile.mk +++ b/connectivity/source/manager/makefile.mk @@ -76,4 +76,10 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : target.mk +ALLTAR : $(MISC)/sdbc2.component +$(MISC)/sdbc2.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sdbc2.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sdbc2.component diff --git a/connectivity/source/manager/mregistration.cxx b/connectivity/source/manager/mregistration.cxx index f3bdf74c9574..16b88c071493 100644 --- a/connectivity/source/manager/mregistration.cxx +++ b/connectivity/source/manager/mregistration.cxx @@ -36,7 +36,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; //========================================================================== //= registration @@ -50,38 +49,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* /*_pServiceManager*/, com::sun::star::registry::XRegistryKey* _pRegistryKey) -{ - - - sal_Bool bReturn = sal_False; - - try - { - ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/"); - sMainKeyName += ::drivermanager::OSDBCDriverManager::getImplementationName_static(); - sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES"); - Reference< XRegistryKey > xMainKey = _pRegistryKey->createKey(sMainKeyName); - if (xMainKey.is()) - { - Sequence< ::rtl::OUString > sServices(::drivermanager::OSDBCDriverManager::getSupportedServiceNames_static()); - const ::rtl::OUString* pBegin = sServices.getConstArray(); - const ::rtl::OUString* pEnd = pBegin + sServices.getLength(); - for (;pBegin != pEnd ; ++pBegin) - xMainKey->createKey(*pBegin); - bReturn = sal_True; - } - } - catch(InvalidRegistryException&) - { - } - catch(InvalidValueException&) - { - } - return bReturn; -} - //--------------------------------------------------------------------------------------- SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/) { diff --git a/connectivity/source/manager/sdbc.mxp.map b/connectivity/source/manager/sdbc.mxp.map index 14e33ebafb65..431725adbbec 100644 --- a/connectivity/source/manager/sdbc.mxp.map +++ b/connectivity/source/manager/sdbc.mxp.map @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory __mh_dylib_header ___builtin_delete diff --git a/connectivity/source/manager/sdbc2.component b/connectivity/source/manager/sdbc2.component new file mode 100644 index 000000000000..6cce2b1d9fde --- /dev/null +++ b/connectivity/source/manager/sdbc2.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index 92a4853c2bed..e288e18c1f1c 100644 --- a/desktop/prj/d.lst +++ b/desktop/prj/d.lst @@ -143,3 +143,10 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar ..\%__SRC%\misc\registry\spool\org\openoffice\Office\Jobs\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs +..\%__SRC%\misc\migrationoo3.component %_DEST%\xml%_EXT%\migrationoo3.component +..\%__SRC%\misc\productregistration.jar.component %_DEST%\xml%_EXT%\productregistration.jar.component +..\%__SRC%\misc\deployment.component %_DEST%\xml%_EXT%\deployment.component +..\%__SRC%\misc\deploymentgui.component %_DEST%\xml%_EXT%\deploymentgui.component +..\%__SRC%\misc\migrationoo2.component %_DEST%\xml%_EXT%\migrationoo2.component +..\%__SRC%\misc\offacc.component %_DEST%\xml%_EXT%\offacc.component +..\%__SRC%\misc\spl.component %_DEST%\xml%_EXT%\spl.component diff --git a/desktop/source/app/exports.dxp b/desktop/source/app/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/desktop/source/app/exports.dxp +++ b/desktop/source/app/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/desktop/source/deployment/deployment.component b/desktop/source/deployment/deployment.component new file mode 100644 index 000000000000..11385c7aa8d9 --- /dev/null +++ b/desktop/source/deployment/deployment.component @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx index f7ebf66355ba..f3dc75ae39c5 100644 --- a/desktop/source/deployment/dp_services.cxx +++ b/desktop/source/deployment/dp_services.cxx @@ -92,27 +92,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) -{ - return component_writeInfoHelper( - pServiceManager, pRegistryKey, - dp_registry::backend::configuration::serviceDecl, - dp_registry::backend::component::serviceDecl, - dp_registry::backend::help::serviceDecl, - dp_registry::backend::script::serviceDecl, - dp_registry::backend::sfwk::serviceDecl, - dp_registry::backend::executable::serviceDecl, - dp_manager::factory::serviceDecl, - dp_log::serviceDecl, - dp_info::serviceDecl, - dp_manager::serviceDecl) && - dp_manager::factory::singleton_entries( pRegistryKey ) && - dp_info::singleton_entries( pRegistryKey ) && - dp_manager::singleton_entries( pRegistryKey); -} - void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/desktop/source/deployment/gui/deploymentgui.component b/desktop/source/deployment/gui/deploymentgui.component new file mode 100644 index 000000000000..d613f482e791 --- /dev/null +++ b/desktop/source/deployment/gui/deploymentgui.component @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx old mode 100755 new mode 100644 index 29bedf1b229f..567eb9756386 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -356,14 +356,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) -{ - return component_writeInfoHelper( - pServiceManager, pRegistryKey, dp_gui::serviceDecl, dp_gui::licenseDecl, dp_gui::updateDecl ); -} - void * SAL_CALL component_getFactory( sal_Char const * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/desktop/source/deployment/gui/makefile.mk b/desktop/source/deployment/gui/makefile.mk index 52092a077a4b..fe3921bf506b 100644 --- a/desktop/source/deployment/gui/makefile.mk +++ b/desktop/source/deployment/gui/makefile.mk @@ -107,3 +107,11 @@ RESLIB1IMAGES= $(PRJ)$/res .INCLUDE : target.mk + +ALLTAR : $(MISC)/deploymentgui.component + +$(MISC)/deploymentgui.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt deploymentgui.component diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk index 6d83a5c1004b..991ba7026d72 100644 --- a/desktop/source/deployment/makefile.mk +++ b/desktop/source/deployment/makefile.mk @@ -110,3 +110,11 @@ RESLIB1SRSFILES += $(SRS)$/deployment_misc.srs .INCLUDE : target.mk + +ALLTAR : $(MISC)/deployment.component + +$(MISC)/deployment.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + deployment.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt deployment.component diff --git a/desktop/source/migration/services/cexports.cxx b/desktop/source/migration/services/cexports.cxx index cf9a9ab30b0c..d869993f39c3 100644 --- a/desktop/source/migration/services/cexports.cxx +++ b/desktop/source/migration/services/cexports.cxx @@ -63,13 +63,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, entries ); -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/desktop/source/migration/services/cexportsoo3.cxx b/desktop/source/migration/services/cexportsoo3.cxx old mode 100755 new mode 100644 index 695b6b810808..589701d534d5 --- a/desktop/source/migration/services/cexportsoo3.cxx +++ b/desktop/source/migration/services/cexportsoo3.cxx @@ -51,13 +51,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, entries ); -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk index 2f3eb9308ebd..38f97084b36e 100644 --- a/desktop/source/migration/services/makefile.mk +++ b/desktop/source/migration/services/makefile.mk @@ -87,7 +87,7 @@ DEF1NAME=$(SHL1TARGET) COMP2TYPELIST = migrationoo3 SHL2TARGET=migrationoo3.uno -SHL2VERSIONMAP = migrationoo3.map +SHL2VERSIONMAP = $(SOLARENV)/src/component.map SHL2OBJS= \ $(SLO)$/cexportsoo3.obj \ @@ -117,3 +117,18 @@ DEF2NAME=$(SHL2TARGET) .INCLUDE : target.mk +ALLTAR : $(MISC)/migrationoo3.component + +$(MISC)/migrationoo3.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt migrationoo3.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt migrationoo3.component + +ALLTAR : $(MISC)/migrationoo2.component + +$(MISC)/migrationoo2.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt migrationoo2.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt migrationoo2.component diff --git a/desktop/source/migration/services/migrationoo2.component b/desktop/source/migration/services/migrationoo2.component new file mode 100644 index 000000000000..2b21ab123b9e --- /dev/null +++ b/desktop/source/migration/services/migrationoo2.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/desktop/source/migration/services/migrationoo3.component b/desktop/source/migration/services/migrationoo3.component new file mode 100644 index 000000000000..380c389ab7b9 --- /dev/null +++ b/desktop/source/migration/services/migrationoo3.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/desktop/source/migration/services/migrationoo3.map b/desktop/source/migration/services/migrationoo3.map deleted file mode 100755 index ac2c3750bfe0..000000000000 --- a/desktop/source/migration/services/migrationoo3.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/desktop/source/offacc/acceptor.cxx b/desktop/source/offacc/acceptor.cxx index 4e100fd99665..430737106a59 100644 --- a/desktop/source/offacc/acceptor.cxx +++ b/desktop/source/offacc/acceptor.cxx @@ -317,23 +317,6 @@ component_getImplementationEnvironment(const sal_Char **ppEnvironmentTypeName, u *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -sal_Bool SAL_CALL -component_writeInfo(void *pServiceManager, void *pRegistryKey) -{ - Reference< XMultiServiceFactory > xMan(reinterpret_cast< XMultiServiceFactory* >(pServiceManager)); - Reference< XRegistryKey > xKey(reinterpret_cast< XRegistryKey* >(pRegistryKey)); - - // register service - ::rtl::OUString aTempStr; - ::rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += Acceptor::impl_getImplementationName(); - aImpl += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - Reference< XRegistryKey > xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(Acceptor::impl_getSupportedServiceNames()[0]); - - return sal_True; -} - void * SAL_CALL component_getFactory(const sal_Char *pImplementationName, void *pServiceManager, void *) { diff --git a/desktop/source/offacc/makefile.mk b/desktop/source/offacc/makefile.mk index c2d53930b580..809c28414bef 100644 --- a/desktop/source/offacc/makefile.mk +++ b/desktop/source/offacc/makefile.mk @@ -60,3 +60,11 @@ SHL1STDLIBS= \ .INCLUDE : target.mk + +ALLTAR : $(MISC)/offacc.component + +$(MISC)/offacc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + offacc.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt offacc.component diff --git a/desktop/source/offacc/offacc.component b/desktop/source/offacc/offacc.component new file mode 100644 index 000000000000..6f0d4a97a2d2 --- /dev/null +++ b/desktop/source/offacc/offacc.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/desktop/source/registration/com/sun/star/registration/Registration.java b/desktop/source/registration/com/sun/star/registration/Registration.java index 7fc24b80398f..e5c98dd51ab8 100644 --- a/desktop/source/registration/com/sun/star/registration/Registration.java +++ b/desktop/source/registration/com/sun/star/registration/Registration.java @@ -63,10 +63,6 @@ public class Registration { return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return FactoryHelper.writeRegistryServiceInfo(Registration.class.getName(), _serviceName, regKey); - } - static final String _serviceName = "com.sun.star.comp.framework.DoRegistrationJob"; static public class _Registration implements XJob { diff --git a/desktop/source/registration/com/sun/star/registration/makefile.mk b/desktop/source/registration/com/sun/star/registration/makefile.mk index 9784166eb91b..859802256256 100644 --- a/desktop/source/registration/com/sun/star/registration/makefile.mk +++ b/desktop/source/registration/com/sun/star/registration/makefile.mk @@ -53,3 +53,10 @@ CUSTOMMANIFESTFILE = manifest .INCLUDE : target.mk +ALLTAR : $(MISC)/productregistration.jar.component + +$(MISC)/productregistration.jar.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt productregistration.jar.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)productregistration.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt productregistration.jar.component diff --git a/desktop/source/registration/com/sun/star/registration/productregistration.jar.component b/desktop/source/registration/com/sun/star/registration/productregistration.jar.component new file mode 100644 index 000000000000..c022a98ae010 --- /dev/null +++ b/desktop/source/registration/com/sun/star/registration/productregistration.jar.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/desktop/source/so_comp/services.cxx b/desktop/source/so_comp/services.cxx index d1a2b3139e91..e28d762fc69b 100644 --- a/desktop/source/so_comp/services.cxx +++ b/desktop/source/so_comp/services.cxx @@ -100,32 +100,6 @@ component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -sal_Bool SAL_CALL -component_writeInfo( - void* pServiceManager, - void* pRegistryKey) -{ - Reference xMan( - reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; - Reference xKey( - reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ; - - // iterate over service names and register them... - OUString aImpl; - const char* pServiceName = NULL; - const char* pImplName = NULL; - for (int i = 0; (pServices[i]!=NULL)&&(pImplementations[i]!=NULL); i++) { - pServiceName= pServices[i]; - pImplName = pImplementations[i]; - aImpl = OUString::createFromAscii("/") - + OUString::createFromAscii(pImplName) - + OUString::createFromAscii("/UNO/SERVICES"); - Reference xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(OUString::createFromAscii(pServiceName)); - } - return sal_True; -} - void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/desktop/source/splash/makefile.mk b/desktop/source/splash/makefile.mk index 89609687438c..02483aae83dd 100644 --- a/desktop/source/splash/makefile.mk +++ b/desktop/source/splash/makefile.mk @@ -87,3 +87,11 @@ DO_PHONY=.PHONY $(INCCOM)$/introbmpnames.hxx $(DO_PHONY): echo const char INTRO_BITMAP_STRINGLIST[]=$(EMQ)"$(INTRO_BITMAPS:f:t",")$(EMQ)"$(EMQ); > $@ echo LASTTIME_INTRO_BITMAPS=$(INTRO_BITMAPS:f) > $(MISC)$/intro_bmp_names.mk + +ALLTAR : $(MISC)/spl.component + +$(MISC)/spl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + spl.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt spl.component diff --git a/desktop/source/splash/services_spl.cxx b/desktop/source/splash/services_spl.cxx index 349ec2ec0a78..4b1130c71cdf 100755 --- a/desktop/source/splash/services_spl.cxx +++ b/desktop/source/splash/services_spl.cxx @@ -97,32 +97,6 @@ component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -sal_Bool SAL_CALL -component_writeInfo( - void* pServiceManager, - void* pRegistryKey) -{ - Reference xMan( - reinterpret_cast< XMultiServiceFactory* >( pServiceManager ) ) ; - Reference xKey( - reinterpret_cast< XRegistryKey* >( pRegistryKey ) ) ; - - // iterate over service names and register them... - OUString aImpl; - const char* pServiceName = NULL; - const char* pImplName = NULL; - for (int i = 0; (pServices[i]!=NULL)&&(pImplementations[i]!=NULL); i++) { - pServiceName= pServices[i]; - pImplName = pImplementations[i]; - aImpl = OUString::createFromAscii("/") - + OUString::createFromAscii(pImplName) - + OUString::createFromAscii("/UNO/SERVICES"); - Reference xNewKey = xKey->createKey(aImpl); - xNewKey->createKey(OUString::createFromAscii(pServiceName)); - } - return sal_True; -} - void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, diff --git a/desktop/source/splash/spl.component b/desktop/source/splash/spl.component new file mode 100644 index 000000000000..2caecf5c0e4b --- /dev/null +++ b/desktop/source/splash/spl.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/editeng/util/editeng.dxp b/editeng/util/editeng.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/editeng/util/editeng.dxp +++ b/editeng/util/editeng.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/embeddedobj/prj/d.lst b/embeddedobj/prj/d.lst index 69721747166a..e85b439a1e34 100644 --- a/embeddedobj/prj/d.lst +++ b/embeddedobj/prj/d.lst @@ -4,3 +4,5 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\dtd\*.dtd %_DEST%\bin%_EXT%\*.* +..\%__SRC%\misc\embobj.component %_DEST%\xml%_EXT%\embobj.component +..\%__SRC%\misc\emboleobj.component %_DEST%\xml%_EXT%\emboleobj.component diff --git a/embeddedobj/source/commonembedding/register.cxx b/embeddedobj/source/commonembedding/register.cxx index bd2a64b299f1..8dbbd9ee4980 100644 --- a/embeddedobj/source/commonembedding/register.cxx +++ b/embeddedobj/source/commonembedding/register.cxx @@ -87,47 +87,5 @@ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServic return pRet; } -sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - sal_Int32 nInd = 0; - uno::Reference< registry::XRegistryKey > xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) ); - - uno::Reference< registry::XRegistryKey > xNewKey; - - xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - OOoEmbeddedObjectFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - uno::Sequence< ::rtl::OUString > rServices = OOoEmbeddedObjectFactory::impl_staticGetSupportedServiceNames(); - for( nInd = 0; nInd < rServices.getLength(); nInd++ ) - xNewKey->createKey( rServices.getConstArray()[nInd] ); - - xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - rServices = OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames(); - for( nInd = 0; nInd < rServices.getLength(); nInd++ ) - xNewKey->createKey( rServices.getConstArray()[nInd] ); - - xNewKey = xKey->createKey( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + - UNOEmbeddedObjectCreator::impl_staticGetImplementationName() + - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); - rServices = UNOEmbeddedObjectCreator::impl_staticGetSupportedServiceNames(); - for( nInd = 0; nInd < rServices.getLength(); nInd++ ) - xNewKey->createKey( rServices.getConstArray()[nInd] ); - - return sal_True; - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} - } // extern "C" diff --git a/embeddedobj/source/msole/emboleobj.component b/embeddedobj/source/msole/emboleobj.component new file mode 100644 index 000000000000..96f8ed0d8d57 --- /dev/null +++ b/embeddedobj/source/msole/emboleobj.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/embeddedobj/source/msole/emboleobj.windows.component b/embeddedobj/source/msole/emboleobj.windows.component new file mode 100644 index 000000000000..644a1d4f19a1 --- /dev/null +++ b/embeddedobj/source/msole/emboleobj.windows.component @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/embeddedobj/source/msole/exports.dxp b/embeddedobj/source/msole/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/embeddedobj/source/msole/exports.dxp +++ b/embeddedobj/source/msole/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/embeddedobj/source/msole/makefile.mk b/embeddedobj/source/msole/makefile.mk index 07b08bce6984..f40e231bc2dd 100644 --- a/embeddedobj/source/msole/makefile.mk +++ b/embeddedobj/source/msole/makefile.mk @@ -130,3 +130,14 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk +ALLTAR : $(MISC)/emboleobj.component + +.IF "$(OS)" == "WNT" +my_platform = .windows +.END + +$(MISC)/emboleobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + emboleobj.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt emboleobj$(my_platform).component diff --git a/embeddedobj/util/embobj.component b/embeddedobj/util/embobj.component new file mode 100644 index 000000000000..e46945dcb7e0 --- /dev/null +++ b/embeddedobj/util/embobj.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + diff --git a/embeddedobj/util/exports.dxp b/embeddedobj/util/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/embeddedobj/util/exports.dxp +++ b/embeddedobj/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/embeddedobj/util/makefile.mk b/embeddedobj/util/makefile.mk index 763d64c164c4..eb2416bd4dd5 100644 --- a/embeddedobj/util/makefile.mk +++ b/embeddedobj/util/makefile.mk @@ -87,3 +87,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo CLEAR_THE_FILE > $@ @echo __CT >>$@ + +ALLTAR : $(MISC)/embobj.component + +$(MISC)/embobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + embobj.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt embobj.component diff --git a/eventattacher/prj/d.lst b/eventattacher/prj/d.lst index 5f9f228eda10..202a0a06aec8 100644 --- a/eventattacher/prj/d.lst +++ b/eventattacher/prj/d.lst @@ -1,3 +1,4 @@ ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT% ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT% +..\%__SRC%\misc\evtatt.component %_DEST%\xml%_EXT%\evtatt.component diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx index 9ff96cbf1087..effa7cb202ae 100644 --- a/eventattacher/source/eventattacher.cxx +++ b/eventattacher/source/eventattacher.cxx @@ -842,34 +842,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * , void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - // DefaultRegistry - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM( "/" IMPLNAME "/UNO/SERVICES") ))); - - Sequence< OUString > aSNL - ( ::comp_EventAttacher::EventAttacherImpl::getSupportedServiceNames_Static() ); - const OUString * pArray = aSNL.getConstArray(); - for ( sal_Int32 nPos = aSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) { diff --git a/eventattacher/source/evtatt.component b/eventattacher/source/evtatt.component new file mode 100644 index 000000000000..3e48d58893fb --- /dev/null +++ b/eventattacher/source/evtatt.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/eventattacher/source/makefile.mk b/eventattacher/source/makefile.mk index 632a1fa41ad5..360dcdabd7d7 100644 --- a/eventattacher/source/makefile.mk +++ b/eventattacher/source/makefile.mk @@ -61,3 +61,11 @@ SHL1LIBS= $(SLB)$/$(TARGET).lib # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/evtatt.component + +$(MISC)/evtatt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + evtatt.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt evtatt.component diff --git a/fileaccess/prj/d.lst b/fileaccess/prj/d.lst index 695487c56035..c9b2bdd18f06 100644 --- a/fileaccess/prj/d.lst +++ b/fileaccess/prj/d.lst @@ -3,3 +3,4 @@ ..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT% ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\* ..\source\fileacc.xml %_DEST%\xml%_EXT%\fileacc.xml +..\%__SRC%\misc\fileacc.component %_DEST%\xml%_EXT%\fileacc.component diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx index a7b08778dbdd..ca11639fef33 100644 --- a/fileaccess/source/FileAccess.cxx +++ b/fileaccess/source/FileAccess.cxx @@ -914,32 +914,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > xNewKey( - reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - rtl::OUString::createFromAscii("/" IMPLEMENTATION_NAME "/UNO/SERVICES" ) ) ); - - const Sequence< rtl::OUString > & rSNL = io_FileAccess::FileAccess_getSupportedServiceNames(); - const rtl::OUString * pArray = rSNL.getConstArray(); - for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) - xNewKey->createKey( pArray[nPos] ); - - return sal_True; - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_False; -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { diff --git a/fileaccess/source/fileacc.component b/fileaccess/source/fileacc.component new file mode 100644 index 000000000000..3f14d4053216 --- /dev/null +++ b/fileaccess/source/fileacc.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/fileaccess/source/makefile.mk b/fileaccess/source/makefile.mk index 2b7826534618..8c8a91b0f675 100644 --- a/fileaccess/source/makefile.mk +++ b/fileaccess/source/makefile.mk @@ -66,3 +66,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib .INCLUDE : target.mk + +ALLTAR : $(MISC)/fileacc.component + +$(MISC)/fileacc.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fileacc.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fileacc.component diff --git a/formula/prj/d.lst b/formula/prj/d.lst index 3ad1e394844f..d2afebacf4d9 100644 --- a/formula/prj/d.lst +++ b/formula/prj/d.lst @@ -35,3 +35,4 @@ mkdir: %_DEST%\inc%_EXT%\formula +..\%__SRC%\misc\for.component %_DEST%\xml%_EXT%\for.component diff --git a/formula/source/core/api/services.cxx b/formula/source/core/api/services.cxx index 0b45a0e4d02a..d1811dcfa303 100644 --- a/formula/source/core/api/services.cxx +++ b/formula/source/core/api/services.cxx @@ -66,10 +66,4 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return cppu::component_writeInfoHelper( - serviceManager, registryKey, entries); -} } // extern "C" diff --git a/formula/util/for.component b/formula/util/for.component new file mode 100644 index 000000000000..99a1adfbf978 --- /dev/null +++ b/formula/util/for.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/formula/util/makefile.mk b/formula/util/makefile.mk index 7ae30b007d00..3c6f91f6073d 100644 --- a/formula/util/makefile.mk +++ b/formula/util/makefile.mk @@ -136,3 +136,11 @@ RESLIB2SRSFILES=$(RES2FILELIST) .INCLUDE : target.mk + +ALLTAR : $(MISC)/for.component + +$(MISC)/for.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + for.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt for.component diff --git a/fpicker/prj/d.lst b/fpicker/prj/d.lst index 7c4e0bf6024a..4fff0467fc87 100644 --- a/fpicker/prj/d.lst +++ b/fpicker/prj/d.lst @@ -9,6 +9,10 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid ..\source\win32\filepicker\*.xml %_DEST%\xml%_EXT%\*.xml ..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml -..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt -..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt -..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt +..\%__SRC%\misc\fop.component %_DEST%\xml%_EXT%\fop.component +..\%__SRC%\misc\fpicker.component %_DEST%\xml%_EXT%\fpicker.component +..\%__SRC%\misc\fps.component %_DEST%\xml%_EXT%\fps.component +..\%__SRC%\misc\fps_aqua.component %_DEST%\xml%_EXT%\fps_aqua.component +..\%__SRC%\misc\fps_gnome.component %_DEST%\xml%_EXT%\fps_gnome.component +..\%__SRC%\misc\fps_kde4.component %_DEST%\xml%_EXT%\fps_kde4.component +..\%__SRC%\misc\fps_office.component %_DEST%\xml%_EXT%\fps_office.component diff --git a/fpicker/source/aqua/FPentry.cxx b/fpicker/source/aqua/FPentry.cxx index 127d1f5d60bb..5d5dc16c5d32 100644 --- a/fpicker/source/aqua/FPentry.cxx +++ b/fpicker/source/aqua/FPentry.cxx @@ -95,32 +95,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/fpicker/source/aqua/fps-aqua-ucd.txt b/fpicker/source/aqua/fps-aqua-ucd.txt deleted file mode 100644 index d71e8f4a574f..000000000000 --- a/fpicker/source/aqua/fps-aqua-ucd.txt +++ /dev/null @@ -1,13 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalAquaFilePicker -ComponentName=fps_aqua.uno.dylib -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.AquaFilePicker - -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalAquaFolderPicker -ComponentName=fps_aqua.uno.dylib -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.AquaFolderPicker diff --git a/fpicker/source/aqua/fps_aqua.component b/fpicker/source/aqua/fps_aqua.component new file mode 100644 index 000000000000..a04443e37ffd --- /dev/null +++ b/fpicker/source/aqua/fps_aqua.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/fpicker/source/aqua/makefile.mk b/fpicker/source/aqua/makefile.mk index 10990e22d5e1..ff0473c8a71e 100644 --- a/fpicker/source/aqua/makefile.mk +++ b/fpicker/source/aqua/makefile.mk @@ -83,3 +83,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_aqua.component + +$(MISC)/fps_aqua.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_aqua.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_aqua.component diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component new file mode 100644 index 000000000000..7d44d006d960 --- /dev/null +++ b/fpicker/source/generic/fpicker.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx index 4589b3319163..7d6417099ae0 100644 --- a/fpicker/source/generic/fpicker.cxx +++ b/fpicker/source/generic/fpicker.cxx @@ -216,13 +216,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_writeInfoHelper ( - pServiceManager, pRegistryKey, g_entries); -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey) { diff --git a/fpicker/source/generic/makefile.mk b/fpicker/source/generic/makefile.mk index bfbfb65f3da6..0b2ad77baac6 100644 --- a/fpicker/source/generic/makefile.mk +++ b/fpicker/source/generic/makefile.mk @@ -60,3 +60,11 @@ DEF1NAME= $(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fpicker.component + +$(MISC)/fpicker.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fpicker.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fpicker.component diff --git a/fpicker/source/office/fps_office.component b/fpicker/source/office/fps_office.component new file mode 100644 index 000000000000..3e49f68a49db --- /dev/null +++ b/fpicker/source/office/fps_office.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/fpicker/source/office/fps_office.cxx b/fpicker/source/office/fps_office.cxx index 52659e1f76f5..3d06873338de 100644 --- a/fpicker/source/office/fps_office.cxx +++ b/fpicker/source/office/fps_office.cxx @@ -63,13 +63,6 @@ component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_writeInfoHelper ( - pServiceManager, pRegistryKey, g_entries); -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey) { diff --git a/fpicker/source/office/makefile.mk b/fpicker/source/office/makefile.mk index adc3c30f9a3d..7481fd867ca7 100644 --- a/fpicker/source/office/makefile.mk +++ b/fpicker/source/office/makefile.mk @@ -86,3 +86,11 @@ RESLIB1SRSFILES=\ # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_office.component + +$(MISC)/fps_office.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_office.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_office.component diff --git a/fpicker/source/unx/gnome/FPentry.cxx b/fpicker/source/unx/gnome/FPentry.cxx index 7561d1f4e95f..ccca3dabf72c 100644 --- a/fpicker/source/unx/gnome/FPentry.cxx +++ b/fpicker/source/unx/gnome/FPentry.cxx @@ -99,32 +99,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - pXNewKey->createKey( OUString::createFromAscii( FOLDER_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* /*pRegistryKey*/ ) { diff --git a/fpicker/source/unx/gnome/fps-gnome-ucd.txt b/fpicker/source/unx/gnome/fps-gnome-ucd.txt deleted file mode 100644 index 4a84215dc960..000000000000 --- a/fpicker/source/unx/gnome/fps-gnome-ucd.txt +++ /dev/null @@ -1,13 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalGtkFilePicker -ComponentName=fps_gnome.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.GtkFilePicker - -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.SalGtkFolderPicker -ComponentName=fps_gnome.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.GtkFolderPicker diff --git a/fpicker/source/unx/gnome/fps_gnome.component b/fpicker/source/unx/gnome/fps_gnome.component new file mode 100644 index 000000000000..72bca42f8acf --- /dev/null +++ b/fpicker/source/unx/gnome/fps_gnome.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/fpicker/source/unx/gnome/makefile.mk b/fpicker/source/unx/gnome/makefile.mk index 04c6e650ff6f..82b2413dd4af 100644 --- a/fpicker/source/unx/gnome/makefile.mk +++ b/fpicker/source/unx/gnome/makefile.mk @@ -96,3 +96,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/fps_gnome.component + +$(MISC)/fps_gnome.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_gnome.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_gnome.component diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx index 3d74c1a09dca..174b1fc440a6 100644 --- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx +++ b/fpicker/source/unx/kde4/KDE4FPEntry.cxx @@ -55,27 +55,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) - { - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; - } - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* ) { void* pRet = 0; diff --git a/fpicker/source/unx/kde4/fps-kde4-ucd.txt b/fpicker/source/unx/kde4/fps-kde4-ucd.txt deleted file mode 100644 index 8ecc4e0a0a52..000000000000 --- a/fpicker/source/unx/kde4/fps-kde4-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.ui.dialogs.KDE4FilePicker -ComponentName=fps_kde4.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ui.dialogs.KDE4FilePicker diff --git a/fpicker/source/unx/kde4/fps_kde4.component b/fpicker/source/unx/kde4/fps_kde4.component new file mode 100644 index 000000000000..d627212b75e8 --- /dev/null +++ b/fpicker/source/unx/kde4/fps_kde4.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/fpicker/source/unx/kde4/makefile.mk b/fpicker/source/unx/kde4/makefile.mk index e245e6618465..7ccf6df6a0ce 100644 --- a/fpicker/source/unx/kde4/makefile.mk +++ b/fpicker/source/unx/kde4/makefile.mk @@ -80,3 +80,11 @@ DEF1VERSIONMAP=exports.map $(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx $(MOC4) $< -o $@ + +ALLTAR : $(MISC)/fps_kde4.component + +$(MISC)/fps_kde4.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps_kde4.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps_kde4.component diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index e93c3bec18ba..79a2cf3b2865 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -104,31 +104,6 @@ void SAL_CALL component_getImplementationEnvironment( // //------------------------------------------------ -sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); - bRetVal = sal_False; - } - } - - return bRetVal; -} - -//------------------------------------------------ -// -//------------------------------------------------ - void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* ) { diff --git a/fpicker/source/win32/folderpicker/Fopentry.cxx b/fpicker/source/win32/folderpicker/Fopentry.cxx index 717359ba511a..3c861cc67ce3 100644 --- a/fpicker/source/win32/folderpicker/Fopentry.cxx +++ b/fpicker/source/win32/folderpicker/Fopentry.cxx @@ -87,31 +87,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//----------------------------------------------------------------------- -// -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( FOLDER_PICKER_REGKEY_NAME ) ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - bRetVal = sal_False; - } - } - - return bRetVal; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/fpicker/util/exports.dxp b/fpicker/util/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/fpicker/util/exports.dxp +++ b/fpicker/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/fpicker/util/fop.component b/fpicker/util/fop.component new file mode 100644 index 000000000000..a31c096dd42a --- /dev/null +++ b/fpicker/util/fop.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/fpicker/util/fps.component b/fpicker/util/fps.component new file mode 100644 index 000000000000..cc18d211028c --- /dev/null +++ b/fpicker/util/fps.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/fpicker/util/makefile.mk b/fpicker/util/makefile.mk index c249e4259e91..60bd3333cb71 100644 --- a/fpicker/util/makefile.mk +++ b/fpicker/util/makefile.mk @@ -100,3 +100,16 @@ DEF2EXPORTFILE= exports.dxp .INCLUDE : target.mk +ALLTAR : $(MISC)/fop.component $(MISC)/fps.component + +$(MISC)/fop.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fop.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fop.component + +$(MISC)/fps.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fps.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fps.component diff --git a/framework/inc/macros/debug/registration.hxx b/framework/inc/macros/debug/registration.hxx index e8ea5a0bafe6..afb359348349 100644 --- a/framework/inc/macros/debug/registration.hxx +++ b/framework/inc/macros/debug/registration.hxx @@ -53,26 +53,6 @@ "registration.log" #endif - /*_____________________________________________________________________________________________________________ - LOG_REGISTRATION_WRITEINFO( SINFOTEXT ) - - Write informations for component_writeInfo() in log file. - _____________________________________________________________________________________________________________*/ - - #define LOG_REGISTRATION_WRITEINFO( SINFOTEXT ) \ - { \ - ::rtl::OStringBuffer sOut( 1024 ); \ - sOut.append( "component_writeInfo():" ); \ - sOut.append( SINFOTEXT ); \ - WRITE_LOGFILE( LOGFILE_REGISTRATION, sOut.makeStringAndClear() ) \ - } - - /*_____________________________________________________________________________________________________________ - LOG_REGISTRATION_WRITEINFO( SINFOTEXT ) - - Write informations for component_getFactory() in log file. - _____________________________________________________________________________________________________________*/ - #define LOG_REGISTRATION_GETFACTORY( SINFOTEXT ) \ { \ ::rtl::OStringBuffer sOut( 1024 ); \ @@ -88,7 +68,6 @@ _____________________________________________________________________________________________________________*/ #undef LOGFILE_REGISTRATION - #define LOG_REGISTRATION_WRITEINFO( SINFOTEXT ) #define LOG_REGISTRATION_GETFACTORY( SINFOTEXT ) #endif // #ifdef ENABLE_REGISTRATIONDEBUG diff --git a/framework/inc/macros/registration.hxx b/framework/inc/macros/registration.hxx index 3db6761abc15..11f7c297c645 100644 --- a/framework/inc/macros/registration.hxx +++ b/framework/inc/macros/registration.hxx @@ -37,10 +37,8 @@ //_________________________________________________________________________________________________________________ // interface includes //_________________________________________________________________________________________________________________ -#include #include #include -#include //_________________________________________________________________________________________________________________ // other includes @@ -57,65 +55,12 @@ macros for registration of services Please use follow public macros only! - 1) COMPONENTINFO( CLASS ) => use it as parameter for COMPONENT_WRITEINFO( INFOS ) - 2) IFFACTORY( CLASS ) => use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES ) - 3) COMPONENTGETIMPLEMENTATIONENVIRONMENT => use it to define exported function component_getImplementationEnvironment() - 4) COMPONENTWRITEINFO( INFOS ) => use it to define exported function component_writeInfo() - 5) COMPONENTGETFACTORY( IFFACTORIES ) => use it to define exported function component_getFactory() + IFFACTORY( CLASS ) => use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES ) + COMPONENTGETIMPLEMENTATIONENVIRONMENT => use it to define exported function component_getImplementationEnvironment() + COMPONENTGETFACTORY( IFFACTORIES ) => use it to define exported function component_getFactory() _________________________________________________________________________________________________________________*/ -//***************************************************************************************************************** -// public -// use it as parameter for COMPONENT_WRITEINFO( INFOS ) -//***************************************************************************************************************** - -#define COMPONENTINFO( CLASS ) \ - try \ - { \ - /* Set default result of follow operations !!! */ \ - bReturn = sal_False; \ - /* Do the follow only, if given key is valid ! */ \ - if ( xKey.is() == sal_True ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\t\t\txKey is valid ...\n" ) \ - /* Build new keyname */ \ - sKeyName = DECLARE_ASCII( "/" ); \ - sKeyName += CLASS::impl_getStaticImplementationName(); \ - sKeyName += DECLARE_ASCII( "/UNO/SERVICES" ); \ - LOG_REGISTRATION_WRITEINFO( "\t\t\tcreate key \"" ) \ - LOG_REGISTRATION_WRITEINFO( U2B( sKeyName ) ) \ - LOG_REGISTRATION_WRITEINFO( "\" ...\n" ) \ - /* Create new key with new name. */ \ - xNewKey = xKey->createKey( sKeyName ); \ - /* If this new key valid ... */ \ - if ( xNewKey.is() == sal_True ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\t\t\t\ttsuccessful ...\n" ) \ - /* Get information about supported services. */ \ - seqServiceNames = CLASS::impl_getStaticSupportedServiceNames() ; \ - pArray = seqServiceNames.getArray() ; \ - nLength = seqServiceNames.getLength() ; \ - nCounter = 0 ; \ - /* Then set this information on this key. */ \ - for ( nCounter = 0; nCounter < nLength; ++nCounter ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\t\t\t\twrite key \"" ) \ - LOG_REGISTRATION_WRITEINFO( U2B( pArray[nCounter] ) ) \ - LOG_REGISTRATION_WRITEINFO( "\" to registry ...\n" ) \ - xNewKey->createKey( pArray[nCounter] ); \ - } \ - /* Result of this operations = OK. */ \ - bReturn = sal_True ; \ - } \ - } \ - } \ - catch( ::com::sun::star::registry::InvalidRegistryException& ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\n\nERROR:\nInvalidRegistryException detected\n\n" ) \ - bReturn = sal_False ; \ - } - //***************************************************************************************************************** // public // use it as parameter for COMPONENT_GETFACTORY( IFFACTORIES ) @@ -142,41 +87,6 @@ ________________________________________________________________________________ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; \ } -//***************************************************************************************************************** -// public -// define registration of service -//***************************************************************************************************************** -#define COMPONENTWRITEINFO( INFOS ) \ - extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/ , \ - void* pRegistryKey ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\t[start]\n" ) \ - /* Set default return value for this operation - if it failed. */ \ - sal_Bool bReturn = sal_False ; \ - if ( pRegistryKey != NULL ) \ - { \ - LOG_REGISTRATION_WRITEINFO( "\t\tpRegistryKey is valid ...\n" ) \ - /* Define variables for following helper macros! */ \ - /* bReturn will set automaticly. */ \ - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey ; \ - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xNewKey ; \ - ::com::sun::star::uno::Sequence< ::rtl::OUString > seqServiceNames ; \ - const ::rtl::OUString* pArray ; \ - sal_Int32 nLength ; \ - sal_Int32 nCounter ; \ - ::rtl::OUString sKeyName ; \ - xKey = reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ); \ - /* This parameter will expand to */ \ - /* "COMPONENT_INFO(a) */ \ - /* ... */ \ - /* COMPONENT_INFO(z)" */ \ - INFOS \ - } \ - LOG_REGISTRATION_WRITEINFO( "\t[end]\n" ) \ - /* Return with result of this operation. */ \ - return bReturn ; \ - } - //***************************************************************************************************************** // public // define method to instanciate new services diff --git a/framework/prj/d.lst b/framework/prj/d.lst index 7f260f07cf65..f066b172458b 100644 --- a/framework/prj/d.lst +++ b/framework/prj/d.lst @@ -49,3 +49,6 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\StartModule\statusbar ..\source\unotypes\fw?.xml %_DEST%\xml%_EXT%\*.xml +..\%__SRC%\misc\fwk.component %_DEST%\xml%_EXT%\fwk.component +..\%__SRC%\misc\fwl.component %_DEST%\xml%_EXT%\fwl.component +..\%__SRC%\misc\fwm.component %_DEST%\xml%_EXT%\fwm.component diff --git a/framework/source/register/register3rdcomponents.cxx b/framework/source/register/register3rdcomponents.cxx index 0d93c775ff7e..86ef8c16d1ea 100644 --- a/framework/source/register/register3rdcomponents.cxx +++ b/framework/source/register/register3rdcomponents.cxx @@ -47,10 +47,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT - COMPONENTWRITEINFO ( COMPONENTINFO( Service1 ) - COMPONENTINFO( Service2 ) - ) - COMPONENTGETFACTORY ( IFFACTORIE( Service1 ) else IFFACTORIE( Service2 ) @@ -63,12 +59,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT -COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::HelpOnStartup ) - COMPONENTINFO( ::framework::TabWinFactory ) - COMPONENTINFO( ::framework::SystemExec ) - COMPONENTINFO( ::framework::ShellJob ) - ) - COMPONENTGETFACTORY ( IFFACTORY( ::framework::HelpOnStartup ) else IFFACTORY( ::framework::TabWinFactory ) else IFFACTORY( ::framework::SystemExec ) else diff --git a/framework/source/register/registerlogindialog.cxx b/framework/source/register/registerlogindialog.cxx index 55e13252570f..0a7e08c8c93a 100644 --- a/framework/source/register/registerlogindialog.cxx +++ b/framework/source/register/registerlogindialog.cxx @@ -48,10 +48,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT - COMPONENTWRITEINFO ( COMPONENTINFO( Service1 ) - COMPONENTINFO( Service2 ) - ) - COMPONENTGETFACTORY ( IFFACTORIE( Service1 ) else IFFACTORIE( Service2 ) @@ -64,8 +60,5 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT -COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::LoginDialog ) - ) - COMPONENTGETFACTORY ( IFFACTORY( ::framework::LoginDialog ) ) diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx index 6e3fa878bbb1..4f078d9ab50d 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -47,10 +47,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT - COMPONENTWRITEINFO ( COMPONENTINFO( Service1 ) - COMPONENTINFO( Service2 ) - ) - COMPONENTGETFACTORY ( IFFACTORIE( Service1 ) else IFFACTORIE( Service2 ) @@ -117,66 +113,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT -COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer ) - COMPONENTINFO( ::framework::Desktop ) - COMPONENTINFO( ::framework::Frame ) - //COMPONENTINFO( ::framework::Oxt_Handler ) - COMPONENTINFO( ::framework::JobExecutor ) - //COMPONENTINFO( ::framework::DispatchRecorderSupplier ) - //COMPONENTINFO( ::framework::DispatchRecorder ) - //COMPONENTINFO( ::framework::MailToDispatcher ) - //COMPONENTINFO( ::framework::ServiceHandler ) - COMPONENTINFO( ::framework::JobDispatch ) - COMPONENTINFO( ::framework::BackingComp ) - //COMPONENTINFO( ::framework::DispatchHelper ) - COMPONENTINFO( ::framework::LayoutManager ) - //COMPONENTINFO( ::framework::License ) - COMPONENTINFO( ::framework::UIElementFactoryManager ) - COMPONENTINFO( ::framework::PopupMenuControllerFactory ) - //COMPONENTINFO( ::framework::FontMenuController ) - //COMPONENTINFO( ::framework::FontSizeMenuController ) - COMPONENTINFO( ::framework::ObjectMenuController ) - //COMPONENTINFO( ::framework::HeaderMenuController ) - //COMPONENTINFO( ::framework::FooterMenuController ) - COMPONENTINFO( ::framework::ControlMenuController ) - //COMPONENTINFO( ::framework::MacrosMenuController ) - COMPONENTINFO( ::framework::UICommandDescription ) - COMPONENTINFO( ::framework::ModuleManager ) - COMPONENTINFO( ::framework::UIConfigurationManager ) - COMPONENTINFO( ::framework::ModuleUIConfigurationManagerSupplier ) - COMPONENTINFO( ::framework::ModuleUIConfigurationManager ) - COMPONENTINFO( ::framework::MenuBarFactory ) - COMPONENTINFO( ::framework::GlobalAcceleratorConfiguration ) - COMPONENTINFO( ::framework::ModuleAcceleratorConfiguration ) - COMPONENTINFO( ::framework::DocumentAcceleratorConfiguration ) - COMPONENTINFO( ::framework::ToolBoxFactory ) - COMPONENTINFO( ::framework::AddonsToolBoxFactory ) - COMPONENTINFO( ::framework::WindowStateConfiguration ) - COMPONENTINFO( ::framework::ToolbarControllerFactory ) - //COMPONENTINFO( ::framework::ToolbarsMenuController ) - COMPONENTINFO( ::framework::AutoRecovery ) - COMPONENTINFO( ::framework::StatusIndicatorFactory ) - COMPONENTINFO( ::framework::RecentFilesMenuController ) - COMPONENTINFO( ::framework::StatusBarFactory ) - COMPONENTINFO( ::framework::UICategoryDescription ) - COMPONENTINFO( ::framework::StatusbarControllerFactory ) - COMPONENTINFO( ::framework::SessionListener ) - //COMPONENTINFO( ::framework::LogoImageStatusbarController ) - //COMPONENTINFO( ::framework::LogoTextStatusbarController ) - //COMPONENTINFO( ::framework::NewMenuController ) - COMPONENTINFO( ::framework::TaskCreatorService ) - //COMPONENTINFO( ::framework::SimpleTextStatusbarController ) - //COMPONENTINFO( ::framework::UriAbbreviation ) - //COMPONENTINFO( ::framework::PopupMenuDispatcher ) - COMPONENTINFO( ::framework::ImageManager ) - COMPONENTINFO( ::framework::LangSelectionStatusbarController ) - //COMPONENTINFO( ::framework::LanguageSelectionMenuController ) - //COMPONENTINFO( ::framework::TabWindowService ) - COMPONENTINFO( ::framework::WindowContentFactoryManager ) - COMPONENTINFO( ::framework::SubstitutePathVariables ) - COMPONENTINFO( ::framework::PathSettings ) - ) - COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer ) else IFFACTORY( ::framework::Desktop ) else IFFACTORY( ::framework::Frame ) else diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx index 7382380ef525..111b3550559d 100644 --- a/framework/source/register/registertemp.cxx +++ b/framework/source/register/registertemp.cxx @@ -47,10 +47,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT - COMPONENTWRITEINFO ( COMPONENTINFO( Service1 ) - COMPONENTINFO( Service2 ) - ) - COMPONENTGETFACTORY ( IFFACTORIE( Service1 ) else IFFACTORIE( Service2 ) @@ -82,31 +78,6 @@ COMPONENTGETIMPLEMENTATIONENVIRONMENT -COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper ) - COMPONENTINFO( ::framework::MailToDispatcher ) - COMPONENTINFO( ::framework::NewMenuController ) - COMPONENTINFO( ::framework::ToolbarsMenuController ) - COMPONENTINFO( ::framework::MacrosMenuController ) - COMPONENTINFO( ::framework::FontSizeMenuController ) - COMPONENTINFO( ::framework::HeaderMenuController ) - COMPONENTINFO( ::framework::FooterMenuController ) - COMPONENTINFO( ::framework::FontMenuController ) - COMPONENTINFO( ::framework::ServiceHandler ) - COMPONENTINFO( ::framework::LogoImageStatusbarController ) - COMPONENTINFO( ::framework::LogoTextStatusbarController ) - COMPONENTINFO( ::framework::SimpleTextStatusbarController ) - COMPONENTINFO( ::framework::UriAbbreviation ) - COMPONENTINFO( ::framework::LanguageSelectionMenuController ) - COMPONENTINFO( ::framework::PopupMenuDispatcher ) - COMPONENTINFO( ::framework::DispatchHelper ) - COMPONENTINFO( ::framework::TabWindowService ) - COMPONENTINFO( ::framework::DispatchRecorder ) - COMPONENTINFO( ::framework::DispatchRecorderSupplier ) - COMPONENTINFO( ::framework::Oxt_Handler ) - COMPONENTINFO( ::framework::License ) - COMPONENTINFO( ::framework::PopupMenuController ) - ) - COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper ) IFFACTORY( ::framework::MailToDispatcher ) else IFFACTORY( ::framework::ServiceHandler ) else diff --git a/framework/util/fwk.component b/framework/util/fwk.component new file mode 100644 index 000000000000..e6ceb91e8090 --- /dev/null +++ b/framework/util/fwk.component @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/util/fwl.component b/framework/util/fwl.component new file mode 100644 index 000000000000..aa124d1cdc4b --- /dev/null +++ b/framework/util/fwl.component @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/util/fwm.component b/framework/util/fwm.component new file mode 100644 index 000000000000..624249ff4382 --- /dev/null +++ b/framework/util/fwm.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 91532cda76e2..a66643994f64 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -423,3 +423,23 @@ $(MISC)$/$(SHL2TARGET).flt: makefile.mk @echo _TI2>>$@ @echo LIBMAIN>>$@ @echo LibMain>>$@ + +ALLTAR : $(MISC)/fwk.component $(MISC)/fwl.component $(MISC)/fwm.component + +$(MISC)/fwk.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fwk.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL4TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fwk.component + +$(MISC)/fwl.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fwl.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fwl.component + +$(MISC)/fwm.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + fwm.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL5TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt fwm.component diff --git a/linguistic/prj/d.lst b/linguistic/prj/d.lst index 01a755e53cc6..0e0534feafd8 100644 --- a/linguistic/prj/d.lst +++ b/linguistic/prj/d.lst @@ -8,3 +8,4 @@ mkdir: %_DEST%\inc%_EXT%\linguistic ..\inc\*.hxx %_DEST%\inc%_EXT%\linguistic\*.hxx +..\%__SRC%\misc\lng.component %_DEST%\xml%_EXT%\lng.component diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 2916b2ee6eec..c842893d66f1 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -692,31 +692,6 @@ uno::Reference< uno::XInterface > SAL_CALL ConvDicList_CreateInstance( return StaticConvDicList::get(); } - -sal_Bool SAL_CALL ConvDicList_writeInfo( - void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += ConvDicList::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< OUString > aServices = - ConvDicList::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - - void * SAL_CALL ConvDicList_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, void * ) diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 817dbeb311ca..0e1a045bb98e 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -796,31 +796,6 @@ uno::Sequence< rtl::OUString > DicList::getSupportedServiceNames_Static() throw( return aSNS; } - -sal_Bool SAL_CALL DicList_writeInfo( - void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += DicList::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< rtl::OUString > aServices = - DicList::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - - void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, XMultiServiceFactory * pServiceManager, void * ) { diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 6485e6e841b7..afcf1503bbe9 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -1333,27 +1333,3 @@ void * SAL_CALL GrammarCheckingIterator_getFactory( } return pRet; } - - -sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo( - void * /*pServiceManager*/, - registry::XRegistryKey * pRegistryKey ) -{ - try - { - OUString aImpl( '/' ); - aImpl += GrammarCheckingIterator_getImplementationName().getStr(); - aImpl += A2OU( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = GrammarCheckingIterator_getSupportedServiceNames(); - for( sal_Int32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch (uno::Exception &) - { - return sal_False; - } -} - diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 21e1b7a58a3c..57041b7c1e4a 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -276,27 +276,6 @@ OUString SAL_CALL GrammarChecker::getImplementationName( ) throw(uno::RuntimeEx return getImplementationName_Static(); } -sal_Bool SAL_CALL GrammarChecker_writeInfo( void * /*pServiceManager*/, registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += GrammarChecker::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = GrammarChecker::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); ++i ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch(uno::Exception &) - { - return sal_False; - } -} - uno::Reference< uno::XInterface > SAL_CALL GrammarChecker_CreateInstance( const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) throw(uno::Exception) diff --git a/linguistic/source/lng.component b/linguistic/source/lng.component new file mode 100644 index 000000000000..f4f3ca603a88 --- /dev/null +++ b/linguistic/source/lng.component @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 77a1fcbd57b0..9cefa6179316 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -665,29 +665,6 @@ uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static() return aSNS; } - -sal_Bool SAL_CALL LinguProps_writeInfo( void * /*pServiceManager*/, - XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += LinguProps::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - Reference< XRegistryKey > xNewKey = - pRegistryKey->createKey(aImpl ); - uno::Sequence< OUString > aServices = LinguProps::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i]); - - return sal_True; - } - catch(Exception &) - { - return sal_False; - } -} - void * SAL_CALL LinguProps_getFactory( const sal_Char * pImplName, XMultiServiceFactory *pServiceManager, void * ) { diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx index 6ab3db60d268..0f6add07b466 100644 --- a/linguistic/source/lngreg.cxx +++ b/linguistic/source/lngreg.cxx @@ -38,42 +38,6 @@ using namespace com::sun::star::lang; using namespace com::sun::star::registry; -//////////////////////////////////////// -// declaration of external RegEntry-functions defined by the service objects -// - -extern sal_Bool SAL_CALL LngSvcMgr_writeInfo -( - void * /*pServiceManager*/, - XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL DicList_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL LinguProps_writeInfo -( - void * /*pServiceManager*/, - XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL ConvDicList_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -extern sal_Bool SAL_CALL GrammarCheckingIterator_writeInfo -( - void * /*pServiceManager*/, XRegistryKey * pRegistryKey -); - -//extern sal_Bool SAL_CALL GrammarChecker_writeInfo -//( -// void * /*pServiceManager*/, XRegistryKey * pRegistryKey -//); - extern void * SAL_CALL LngSvcMgr_getFactory ( const sal_Char * pImplName, @@ -129,28 +93,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo -( - void * pServiceManager, - XRegistryKey * pRegistryKey -) -{ - sal_Bool bRet = LngSvcMgr_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = LinguProps_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = DicList_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = ConvDicList_writeInfo( pServiceManager, pRegistryKey ); - if(bRet) - bRet = GrammarCheckingIterator_writeInfo( pServiceManager, pRegistryKey ); -/* - if(bRet) - bRet = GrammarChecker_writeInfo( pServiceManager, pRegistryKey ); -*/ - return bRet; -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 90e433f50f07..e7db388a826a 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1990,31 +1990,6 @@ uno::Reference< uno::XInterface > SAL_CALL LngSvcMgr_CreateInstance( return xService; } - - -sal_Bool SAL_CALL LngSvcMgr_writeInfo( - void * /*pServiceManager*/, - registry::XRegistryKey * pRegistryKey ) -{ - try - { - String aImpl( '/' ); - aImpl += LngSvcMgr::getImplementationName_Static().getStr(); - aImpl.AppendAscii( "/UNO/SERVICES" ); - uno::Reference< registry::XRegistryKey > xNewKey = - pRegistryKey->createKey( aImpl ); - uno::Sequence< OUString > aServices = LngSvcMgr::getSupportedServiceNames_Static(); - for( INT32 i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; - } - catch(uno::Exception &) - { - return sal_False; - } -} - void * SAL_CALL LngSvcMgr_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index 3f68afb30575..9bbd456ce89d 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -91,9 +91,8 @@ DEF1DES =Linguistic main DLL .IF "$(GUI)"=="WNT" -DEF1EXPORT1 = component_writeInfo -DEF1EXPORT2 = component_getFactory -DEF1EXPORT3 = component_getImplementationEnvironment +DEF1EXPORT1 = component_getFactory +DEF1EXPORT2 = component_getImplementationEnvironment .ENDIF # --- Targets ------------------------------------------------------ @@ -109,3 +108,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo component >> $@ @echo __CT >> $@ + +ALLTAR : $(MISC)/lng.component + +$(MISC)/lng.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + lng.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt lng.component diff --git a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java index c90e58881835..242c800b48db 100644 --- a/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java +++ b/scripting/java/Framework/com/sun/star/script/framework/security/SecurityDialog.java @@ -215,11 +215,6 @@ XInitialization { return xSingleServiceFactory; } - public static boolean __writeRegistryServiceInfo( XRegistryKey regKey ) { - return FactoryHelper.writeRegistryServiceInfo( - SecurityDialog.class.getName(), SecurityDialog.__serviceName, regKey ); - } - // XServiceInfo public String getImplementationName( ) { return getClass().getName(); diff --git a/scripting/java/ScriptFramework.component b/scripting/java/ScriptFramework.component new file mode 100644 index 000000000000..d6f9a8f62bf4 --- /dev/null +++ b/scripting/java/ScriptFramework.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/scripting/java/ScriptProviderForBeanShell.component b/scripting/java/ScriptProviderForBeanShell.component new file mode 100644 index 000000000000..fe040d71d90d --- /dev/null +++ b/scripting/java/ScriptProviderForBeanShell.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/java/ScriptProviderForJava.component b/scripting/java/ScriptProviderForJava.component new file mode 100644 index 000000000000..4ea6ea8a1086 --- /dev/null +++ b/scripting/java/ScriptProviderForJava.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/java/ScriptProviderForJavaScript.component b/scripting/java/ScriptProviderForJavaScript.component new file mode 100644 index 000000000000..e9725d865983 --- /dev/null +++ b/scripting/java/ScriptProviderForJavaScript.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java index d3a0fdf3bc82..95c727881427 100755 --- a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java +++ b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptProviderForBeanShell.java @@ -123,41 +123,6 @@ public class ScriptProviderForBeanShell return xSingleServiceFactory; } - - - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

                          - * - * @param regKey the registryKey - * @return returns true if the operation succeeded - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo( XRegistryKey regKey ) - { - String impl = "com.sun.star.script.framework.provider.beanshell." + - "ScriptProviderForBeanShell$_ScriptProviderForBeanShell"; - - String service1 = "com.sun.star.script.provider." + - "ScriptProvider"; - String service2 = "com.sun.star.script.provider." + - "LanguageScriptProvider"; - String service3 = "com.sun.star.script.provider." + - "ScriptProviderForBeanShell"; - String service4 = "com.sun.star.script.browse." + - "BrowseNode"; - - if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) ) - { - return true; - } - return false; - } - } class ScriptImpl implements XScript diff --git a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java index f4160531c9db..707ea05624d9 100755 --- a/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java +++ b/scripting/java/com/sun/star/script/framework/provider/java/ScriptProviderForJava.java @@ -134,41 +134,6 @@ public class ScriptProviderForJava return xSingleServiceFactory; } - - - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

                          - * - * @param regKey the registryKey - * @return returns true if the operation succeeded - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo( XRegistryKey regKey ) - { - String impl = "com.sun.star.script.framework.provider.java." + - "ScriptProviderForJava$_ScriptProviderForJava"; - - String service1 = "com.sun.star.script.provider." + - "ScriptProvider"; - String service2 = "com.sun.star.script.provider." + - "LanguageScriptProvider"; - String service3 = "com.sun.star.script.provider." + - "ScriptProviderForJava"; - String service4 = "com.sun.star.script.browse." + - "BrowseNode"; - - if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) ) - { - return true; - } - return false; - } - } class ScriptImpl implements XScript diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java index c053b4166063..9f04d9105374 100755 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptProviderForJavaScript.java @@ -124,40 +124,6 @@ public class ScriptProviderForJavaScript return xSingleServiceFactory; } - - - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

                          - * - * @param regKey the registryKey - * @return returns true if the operation succeeded - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo( XRegistryKey regKey ) - { - String impl = "com.sun.star.script.framework.provider.javascript." + - "ScriptProviderForJavaScript$_ScriptProviderForJavaScript"; - - String service1 = "com.sun.star.script.provider." + - "ScriptProvider"; - String service2 = "com.sun.star.script.provider." + - "LanguageScriptProvider"; - String service3 = "com.sun.star.script.provider." + - "ScriptProviderForJavaScript"; - String service4 = "com.sun.star.script.browse." + - "BrowseNode"; - - if ( FactoryHelper.writeRegistryServiceInfo(impl, service1, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service2, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service3, regKey) && - FactoryHelper.writeRegistryServiceInfo(impl, service4, regKey) ) - { - return true; - } - return false; - } } class ScriptImpl implements XScript { diff --git a/scripting/java/makefile.mk b/scripting/java/makefile.mk index 6a5a81bf978c..dc8ee1abdc46 100755 --- a/scripting/java/makefile.mk +++ b/scripting/java/makefile.mk @@ -36,3 +36,37 @@ TARGET=scriptruntimeforjava ALLTAR : ANTBUILD .ENDIF .ENDIF + +ALLTAR : \ + $(MISC)/ScriptFramework.component \ + $(MISC)/ScriptProviderForBeanShell.component \ + $(MISC)/ScriptProviderForJava.component \ + $(MISC)/ScriptProviderForJavaScript.component + +$(MISC)/ScriptFramework.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt ScriptFramework.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)ScriptFramework.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ScriptFramework.component + +$(MISC)/ScriptProviderForBeanShell.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt \ + ScriptProviderForBeanShell.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForBeanShell.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt \ + ScriptProviderForBeanShell.component + +$(MISC)/ScriptProviderForJava.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt ScriptProviderForJava.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForJava.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ScriptProviderForJava.component + +$(MISC)/ScriptProviderForJavaScript.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt \ + ScriptProviderForJavaScript.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)ScriptProviderForJavaScript.jar' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt \ + ScriptProviderForJavaScript.component diff --git a/scripting/prj/d.lst b/scripting/prj/d.lst index ef216fe84f8a..4b9d435af7a0 100644 --- a/scripting/prj/d.lst +++ b/scripting/prj/d.lst @@ -15,3 +15,15 @@ mkdir: %_DEST%\bin%_EXT%\pyuno ..\source\storage\storage.xml %_DEST%\xml%_EXT%\storage.xml ..\%__SRC%\lib\lib*static*.dylib %_DEST%\lib%_EXT%\lib*static*.dylib +..\%__SRC%\misc\mailmerge.component %_DEST%\xml%_EXT%\mailmerge.component +..\%__SRC%\misc\pythonscript.component %_DEST%\xml%_EXT%\pythonscript.component +..\%__SRC%\misc\ScriptFramework.component %_DEST%\xml%_EXT%\ScriptFramework.component +..\%__SRC%\misc\ScriptProviderForBeanShell.component %_DEST%\xml%_EXT%\ScriptProviderForBeanShell.component +..\%__SRC%\misc\ScriptProviderForJava.component %_DEST%\xml%_EXT%\ScriptProviderForJava.component +..\%__SRC%\misc\ScriptProviderForJavaScript.component %_DEST%\xml%_EXT%\ScriptProviderForJavaScript.component +..\%__SRC%\misc\basprov.component %_DEST%\xml%_EXT%\basprov.component +..\%__SRC%\misc\dlgprov.component %_DEST%\xml%_EXT%\dlgprov.component +..\%__SRC%\misc\protocolhandler.component %_DEST%\xml%_EXT%\protocolhandler.component +..\%__SRC%\misc\scriptframe.component %_DEST%\xml%_EXT%\scriptframe.component +..\%__SRC%\misc\stringresource.component %_DEST%\xml%_EXT%\stringresource.component +..\%__SRC%\misc\vbaevents.component %_DEST%\xml%_EXT%\vbaevents.component diff --git a/scripting/source/basprov/basprov.component b/scripting/source/basprov/basprov.component new file mode 100644 index 000000000000..528ab6544e1e --- /dev/null +++ b/scripting/source/basprov/basprov.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx index abd61f6c1285..72d53793a69a 100644 --- a/scripting/source/basprov/basprov.cxx +++ b/scripting/source/basprov/basprov.cxx @@ -589,13 +589,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, ::basprov::s_component_entries ); - } - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/scripting/source/basprov/makefile.mk b/scripting/source/basprov/makefile.mk index 5001e5db288e..c98f961e6bd3 100644 --- a/scripting/source/basprov/makefile.mk +++ b/scripting/source/basprov/makefile.mk @@ -71,3 +71,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/basprov.component + +$(MISC)/basprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + basprov.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt basprov.component diff --git a/scripting/source/dlgprov/dlgprov.component b/scripting/source/dlgprov/dlgprov.component new file mode 100644 index 000000000000..f7ceed336cf6 --- /dev/null +++ b/scripting/source/dlgprov/dlgprov.component @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx index 0fc0778c71d9..ffa128381d39 100644 --- a/scripting/source/dlgprov/dlgprov.cxx +++ b/scripting/source/dlgprov/dlgprov.cxx @@ -853,13 +853,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, ::dlgprov::s_component_entries ); - } - void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/scripting/source/dlgprov/makefile.mk b/scripting/source/dlgprov/makefile.mk index 6c8ec298c760..111dca58edc2 100644 --- a/scripting/source/dlgprov/makefile.mk +++ b/scripting/source/dlgprov/makefile.mk @@ -80,3 +80,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@ echo $@ + +ALLTAR : $(MISC)/dlgprov.component + +$(MISC)/dlgprov.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + dlgprov.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt dlgprov.component diff --git a/scripting/source/protocolhandler/exports.dxp b/scripting/source/protocolhandler/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/scripting/source/protocolhandler/exports.dxp +++ b/scripting/source/protocolhandler/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/scripting/source/protocolhandler/makefile.mk b/scripting/source/protocolhandler/makefile.mk index c782c1a188f5..ec69c00b209d 100644 --- a/scripting/source/protocolhandler/makefile.mk +++ b/scripting/source/protocolhandler/makefile.mk @@ -61,3 +61,11 @@ DEF1EXPORTFILE= exports.dxp # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/protocolhandler.component + +$(MISC)/protocolhandler.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt protocolhandler.component diff --git a/scripting/source/protocolhandler/protocolhandler.component b/scripting/source/protocolhandler/protocolhandler.component new file mode 100644 index 000000000000..db177a896ca4 --- /dev/null +++ b/scripting/source/protocolhandler/protocolhandler.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 1e6adb6e7804..4e81426d7d53 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -537,27 +537,6 @@ extern "C" *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } - sal_Bool SAL_CALL component_writeInfo( void * pServiceManager , - void * pRegistryKey ) - { - (void)pServiceManager; - - Reference< css::registry::XRegistryKey > xKey( - reinterpret_cast< css::registry::XRegistryKey* >( pRegistryKey ) ) ; - - ::rtl::OUString aStr = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); - aStr += - ::scripting_protocolhandler::ScriptProtocolHandler::impl_getStaticImplementationName(); - - aStr += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) ); - Reference< css::registry::XRegistryKey > xNewKey = xKey->createKey( aStr ); - xNewKey->createKey( - ::rtl::OUString::createFromAscii( ::scripting_protocolhandler::MYSERVICENAME ) - ); - - return sal_True; - } - void* SAL_CALL component_getFactory( const sal_Char * pImplementationName , void * pServiceManager , void * pRegistryKey ) diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index dbade7172e6e..94ea78f80c73 100755 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -981,42 +981,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - /** - * This function creates an implementation section in the registry and another subkey - * - * for each supported service. - * @param pServiceManager the service manager - * @param pRegistryKey the registry key - */ - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) - { - if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, - ::scripting_runtimemgr::s_entries )) - { - try - { - // MasterScriptProviderFactory Mangager singleton - registry::XRegistryKey * pKey = - reinterpret_cast< registry::XRegistryKey * >(pRegistryKey); - - Reference< registry::XRegistryKey >xKey = pKey->createKey( - OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory/UNO/SINGLETONS/com.sun.star.script.provider.theMasterScriptProviderFactory")); - xKey->setStringValue( OUSTR("com.sun.star.script.provider.MasterScriptProviderFactory") ); - // BrowseNodeFactory Mangager singleton - xKey = pKey->createKey( - OUSTR("com.sun.star.script.browse.BrowseNodeFactory/UNO/SINGLETONS/com.sun.star.script.browse.theBrowseNodeFactory")); - xKey->setStringValue( OUSTR("com.sun.star.script.browse.BrowseNodeFactory") ); - return sal_True; - } - catch (Exception &) - { - } - } - return sal_False; - } - /** * This function is called to get service factories for an implementation. * diff --git a/scripting/source/provider/exports.dxp b/scripting/source/provider/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/scripting/source/provider/exports.dxp +++ b/scripting/source/provider/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/scripting/source/pyprov/mailmerge.component b/scripting/source/pyprov/mailmerge.component new file mode 100644 index 000000000000..dd6a65e9a1ce --- /dev/null +++ b/scripting/source/pyprov/mailmerge.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/source/pyprov/makefile.mk b/scripting/source/pyprov/makefile.mk index 3c0278595181..42c161adbbc8 100644 --- a/scripting/source/pyprov/makefile.mk +++ b/scripting/source/pyprov/makefile.mk @@ -47,3 +47,17 @@ $(DLLDEST)$/%.py: %.py cp $? $@ .INCLUDE : target.mk + +ALLTAR : $(MISC)/mailmerge.component $(MISC)/pythonscript.component + +$(MISC)/mailmerge.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + mailmerge.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_PYTHON)mailmerge' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt mailmerge.component + +$(MISC)/pythonscript.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt pythonscript.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_PYTHON)pythonscript' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt pythonscript.component diff --git a/scripting/source/pyprov/pythonscript.component b/scripting/source/pyprov/pythonscript.component new file mode 100644 index 000000000000..08f895097203 --- /dev/null +++ b/scripting/source/pyprov/pythonscript.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx index 48f21367e762..4780d58acc88 100755 --- a/scripting/source/runtimemgr/ScriptRuntimeManager.cxx +++ b/scripting/source/runtimemgr/ScriptRuntimeManager.cxx @@ -485,68 +485,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - /** - * This function creates an implementation section in the registry and another subkey - * - * for each supported service. - * @param pServiceManager the service manager - * @param pRegistryKey the registry key - */ - sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) - { - if (::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, - ::scripting_runtimemgr::s_entries )) - { - try - { - // register RuntimeManager singleton - - registry::XRegistryKey * pKey = - reinterpret_cast< registry::XRegistryKey * >(pRegistryKey); - - Reference< registry::XRegistryKey > xKey( - pKey->createKey( - - OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeManager"))); - xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeManager") ); - - // ScriptStorage Mangaer singleton - - xKey = pKey->createKey( - OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager/UNO/SINGLETONS/drafts.com.sun.star.script.framework.storage.theScriptStorageManager")); - xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.storage.ScriptStorageManager") ); - // Singleton entries are not handled by the setup process - // below is the only alternative at the momement which - // is to programmatically do this. - - // "Java" Runtime singleton entry - - xKey = pKey->createKey( - OUSTR("com.sun.star.scripting.runtime.java.ScriptRuntimeForJava$_ScriptRuntimeForJava/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJava")); - xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJava") ); - - // "JavaScript" Runtime singleton entry - - xKey = pKey->createKey( - OUSTR("com.sun.star.scripting.runtime.javascript.ScriptRuntimeForJavaScript$_ScriptRuntimeForJavaScript/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForJavaScript")); - xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForJavaScript") ); - - // "BeanShell" Runtime singleton entry - - xKey = pKey->createKey( - OUSTR("com.sun.star.scripting.runtime.beanshell.ScriptRuntimeForBeanShell$_ScriptRuntimeForBeanShell/UNO/SINGLETONS/drafts.com.sun.star.script.framework.runtime.theScriptRuntimeForBeanShell")); - xKey->setStringValue( OUSTR("drafts.com.sun.star.script.framework.runtime.ScriptRuntimeForBeanShell") ); - - return sal_True; - } - catch (Exception & exc) - { - } - } - return sal_False; - } - /** * This function is called to get service factories for an implementation. * diff --git a/scripting/source/runtimemgr/exports.dxp b/scripting/source/runtimemgr/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/scripting/source/runtimemgr/exports.dxp +++ b/scripting/source/runtimemgr/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/scripting/source/storage/exports.dxp b/scripting/source/storage/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/scripting/source/storage/exports.dxp +++ b/scripting/source/storage/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/scripting/source/stringresource/makefile.mk b/scripting/source/stringresource/makefile.mk index dfc2d1979190..71f8ee39e748 100644 --- a/scripting/source/stringresource/makefile.mk +++ b/scripting/source/stringresource/makefile.mk @@ -60,3 +60,11 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib # --- Targets ------------------------------------------------------ .INCLUDE : target.mk + +ALLTAR : $(MISC)/stringresource.component + +$(MISC)/stringresource.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt stringresource.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt stringresource.component diff --git a/scripting/source/stringresource/stringresource.component b/scripting/source/stringresource/stringresource.component new file mode 100644 index 000000000000..6d64d9553945 --- /dev/null +++ b/scripting/source/stringresource/stringresource.component @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 58b6c21b522f..0c0e9dd454ca 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -3080,13 +3080,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, ::stringresource::s_component_entries ); - } - void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/scripting/source/vbaevents/makefile.mk b/scripting/source/vbaevents/makefile.mk old mode 100644 new mode 100755 index 1946c61d1e0b..287bbe2b052b --- a/scripting/source/vbaevents/makefile.mk +++ b/scripting/source/vbaevents/makefile.mk @@ -91,3 +91,11 @@ $(MISC)$/$(TARGET).don : $(SOLARBINDIR)$/oovbaapi.rdb +$(CPPUMAKER) -O$(INCCOM)$/$(TARGET) -BUCR $(SOLARBINDIR)$/oovbaapi.rdb -X$(SOLARBINDIR)$/types.rdb && echo > $@ echo $@ + +ALLTAR : $(MISC)/vbaevents.component + +$(MISC)/vbaevents.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + vbaevents.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt vbaevents.component diff --git a/scripting/source/vbaevents/service.cxx b/scripting/source/vbaevents/service.cxx index 9f38acb7e2a6..a6d4b287cfd6 100755 --- a/scripting/source/vbaevents/service.cxx +++ b/scripting/source/vbaevents/service.cxx @@ -110,16 +110,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - OSL_TRACE("In component_writeInfo"); - if ( ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, s_component_entries ) ) - return sal_True; - return sal_False; - } - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/scripting/source/vbaevents/vbaevents.component b/scripting/source/vbaevents/vbaevents.component new file mode 100644 index 000000000000..e8cbf3d88ff7 --- /dev/null +++ b/scripting/source/vbaevents/vbaevents.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/scripting/util/exports.dxp b/scripting/util/exports.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/scripting/util/exports.dxp +++ b/scripting/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/scripting/util/makefile.mk b/scripting/util/makefile.mk index f18970f164f8..04435caab11f 100644 --- a/scripting/util/makefile.mk +++ b/scripting/util/makefile.mk @@ -65,3 +65,11 @@ DEF1EXPORTFILE= exports.dxp .INCLUDE : target.mk + +ALLTAR : $(MISC)/scriptframe.component + +$(MISC)/scriptframe.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt scriptframe.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt scriptframe.component diff --git a/scripting/util/scriptframe.component b/scripting/util/scriptframe.component new file mode 100644 index 000000000000..5b3fe8c396d5 --- /dev/null +++ b/scripting/util/scriptframe.component @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/sfx2/inc/sfx2/sfxuno.hxx b/sfx2/inc/sfx2/sfxuno.hxx index fb331889a573..f9702063713a 100644 --- a/sfx2/inc/sfx2/sfxuno.hxx +++ b/sfx2/inc/sfx2/sfxuno.hxx @@ -73,7 +73,6 @@ #define UNOPROPERTYVALUE ::com::sun::star::beans::PropertyValue #define UNOREFERENCE ::com::sun::star::uno::Reference #define UNORUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException -#define UNOINVALIDREGISTRYEXCEPTION ::com::sun::star::registry::InvalidRegistryException #define UNOSEQUENCE ::com::sun::star::uno::Sequence #define UNOTYPE ::com::sun::star::uno::Type #define UNOURL ::com::sun::star::util::URL @@ -590,52 +589,6 @@ sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, ::rtl::OUString& rPasswd ); return xReturn ; \ } -//************************************************************************************************************************ -// definition for "extern c component_writeInfo()" -//************************************************************************************************************************ -#define COMPONENT_INFO(CLASS) \ - \ - try \ - { \ - /* Set default result of follow operations !!! */ \ - bReturn = sal_False ; \ - \ - /* Do the follow only, if given key is valid ! */ \ - if ( xKey.is () ) \ - { \ - /* Build new keyname */ \ - sKeyName = UNOOUSTRING::createFromAscii( "/" ) ; \ - sKeyName += CLASS::impl_getStaticImplementationName() ; \ - sKeyName += UNOOUSTRING::createFromAscii( "/UNO/SERVICES" ); \ - \ - /* Create new key with new name. */ \ - xNewKey = xKey->createKey( sKeyName ); \ - \ - /* If this new key valid ... */ \ - if ( xNewKey.is () ) \ - { \ - /* Get information about supported services. */ \ - seqServiceNames = CLASS::impl_getStaticSupportedServiceNames() ; \ - pArray = seqServiceNames.getArray() ; \ - nLength = seqServiceNames.getLength() ; \ - nCounter = 0 ; \ - \ - /* Then set this information on this key. */ \ - for ( nCounter = 0; nCounter < nLength; ++nCounter ) \ - { \ - xNewKey->createKey( pArray [nCounter] ); \ - } \ - \ - /* Result of this operations = OK. */ \ - bReturn = sal_True ; \ - } \ - } \ - } \ - catch( UNOINVALIDREGISTRYEXCEPTION& ) \ - { \ - bReturn = sal_False ; \ - } \ - //************************************************************************************************************************ // definition for "extern c component_getFactory()" //************************************************************************************************************************ diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst index 0748aa19cd65..0768000425eb 100644 --- a/sfx2/prj/d.lst +++ b/sfx2/prj/d.lst @@ -44,3 +44,4 @@ mkdir: %_DEST%\inc%_EXT%\sfx2 ..\inc\mailmodelapi.hxx %_DEST%\inc%_EXT%\sfx2\mailmodelapi.hxx ..\inc\docinsert.hxx %_DEST%\inc%_EXT%\sfx2\docinsert.hxx +..\%__SRC%\misc\sfx.component %_DEST%\xml%_EXT%\sfx.component diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx old mode 100755 new mode 100644 index 6f9d3b258745..b0aae115aa9b --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -2124,166 +2124,6 @@ SFX2_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -SFX2_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* , - void* pRegistryKey ) -{ - ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ; - - // register actual implementations and their services - ::rtl::OUString aImpl; - ::rtl::OUString aTempStr; - ::rtl::OUString aKeyStr; - Reference< XRegistryKey > xNewKey; - Reference< XRegistryKey > xLoaderKey; - - // PluginObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::PluginObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") ); - - #if 0 - // AppletObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::AppletObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") ); - #endif - - // IFrameObject - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::IFrameObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.SpecialEmbeddedObject") ); - - // global app event broadcaster - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxGlobalEvents_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.GlobalEventBroadcaster") ); - - // global app dispatcher - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxAppDispatchProvider::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") ); - - // standalone document info - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxStandaloneDocumentInfoObject::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.StandaloneDocumentInfo") ); - - // frame loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence < ::rtl::OUString > aServices = SfxFrameLoader_Impl::impl_getStaticSupportedServiceNames(); - sal_Int32 nCount = aServices.getLength(); - for ( sal_Int16 i=0; icreateKey( aServices.getConstArray()[i] ); - - // macro loader - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxMacroLoader::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ProtocolHandler") ); - - // - sfx document templates - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxDocTplService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.DocumentTemplates") ); - - // quickstart wrapper service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ShutdownIcon::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.office.Quickstart") ); - - // application script library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationScriptLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationScriptLibraryContainer") ); - - // application dialog library container service - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += SfxApplicationDialogLibraryContainer::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.script.ApplicationDialogLibraryContainer") ); - - // converter of fs folders to packages - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += OPackageStructureCreator::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - Sequence< ::rtl::OUString > rServices = OPackageStructureCreator::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // subfilter to parse a stream in OASIS format generated by the filter - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += ::sfx2::OwnSubFilterService::impl_getStaticImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - rServices = ::sfx2::OwnSubFilterService::impl_getStaticSupportedServiceNames(); - for( sal_Int32 ind = 0; ind < rServices.getLength(); ind++ ) - xNewKey->createKey( rServices.getConstArray()[ind] ); - - // document meta data - aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - aImpl += comp_SfxDocumentMetaData::_getImplementationName(); - - aTempStr = aImpl; - aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - xNewKey = xKey->createKey( aTempStr ); - xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.document.DocumentProperties") ); - - return sal_True; -} - SFX2_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , void* pServiceManager , diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 14474dd2904d..f18e903eb6e4 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -2380,12 +2380,5 @@ extern "C" void * SAL_CALL component_getFactory( return ::cppu::component_getFactoryHelper( implName, serviceManager, registryKey, entries); } - -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return ::cppu::component_writeInfoHelper(serviceManager, registryKey, - entries); -} #endif diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk index 2d93e7692d86..f520e2097e7e 100644 --- a/sfx2/util/makefile.mk +++ b/sfx2/util/makefile.mk @@ -162,3 +162,11 @@ SHL3NOCHECK=TRUE .INCLUDE : target.mk + +ALLTAR : $(MISC)/sfx.component + +$(MISC)/sfx.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sfx.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sfx.component diff --git a/sfx2/util/sfx.component b/sfx2/util/sfx.component new file mode 100644 index 000000000000..1c28afd4177f --- /dev/null +++ b/sfx2/util/sfx.component @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/prj/d.lst b/shell/prj/d.lst index ea8be0bbaf04..3ef183dbdf42 100644 --- a/shell/prj/d.lst +++ b/shell/prj/d.lst @@ -10,6 +10,7 @@ ..\%__SRC%\bin\x64\propertyhdl.dll %_DEST%\bin%_EXT%\propertyhdl_x64.dll ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib ..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\misc\cmdmail.component %_DEST%\xml%_EXT%\cmdmail.component ..\%__SRC%\bin\open-url %_DEST%\bin%_EXT%\open-url ..\%__SRC%\bin\cde-open-url %_DEST%\bin%_EXT%\cde-open-url @@ -21,5 +22,13 @@ ..\%__SRC%\misc\*.xml %_DEST%\xml%_EXT%\*.xml -..\%__SRC%\misc\*-ucd.txt %_DEST%\bin%_EXT%\*-ucd.txt +..\%__SRC%\misc\desktopbe1.component %_DEST%\xml%_EXT%\desktopbe1.component +..\%__SRC%\misc\gconfbe1.component %_DEST%\xml%_EXT%\gconfbe1.component +..\%__SRC%\misc\kde4be1.component %_DEST%\xml%_EXT%\kde4be1.component +..\%__SRC%\misc\kdebe1.component %_DEST%\xml%_EXT%\kdebe1.component ..\inc\kde_headers.h %_DEST%\inc%_EXT%\shell\kde_headers.h +..\%__SRC%\misc\localebe1.component %_DEST%\xml%_EXT%\localebe1.component +..\%__SRC%\misc\macbe1.component %_DEST%\xml%_EXT%\macbe1.component +..\%__SRC%\misc\smplmail.component %_DEST%\xml%_EXT%\smplmail.component +..\%__SRC%\misc\syssh.component %_DEST%\xml%_EXT%\syssh.component +..\%__SRC%\misc\wininetbe1.component %_DEST%\xml%_EXT%\wininetbe1.component diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index 21371755b479..e628e8e1b830 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -282,9 +282,3 @@ component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return component_writeInfoHelper(pServiceManager, pRegistryKey, services); -} diff --git a/shell/source/backends/desktopbe/desktopbe1-ucd.txt b/shell/source/backends/desktopbe/desktopbe1-ucd.txt deleted file mode 100644 index fd874a82ead5..000000000000 --- a/shell/source/backends/desktopbe/desktopbe1-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.configuration.backend.DesktopBackend -ComponentName=desktopbe1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.configuration.backend.DesktopBackend diff --git a/shell/source/backends/desktopbe/desktopbe1.component b/shell/source/backends/desktopbe/desktopbe1.component new file mode 100644 index 000000000000..9ef142107698 --- /dev/null +++ b/shell/source/backends/desktopbe/desktopbe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/desktopbe/makefile.mk b/shell/source/backends/desktopbe/makefile.mk index 29260821d551..66ad8cf99e1e 100644 --- a/shell/source/backends/desktopbe/makefile.mk +++ b/shell/source/backends/desktopbe/makefile.mk @@ -48,6 +48,12 @@ SHL1TARGET = desktopbe1.uno SHL1USE_EXPORTS = name DEF1NAME = $(SHL1TARGET) -UNIXTEXT = $(MISC)/desktopbe1-ucd.txt - .INCLUDE: target.mk + +ALLTAR : $(MISC)/desktopbe1.component + +$(MISC)/desktopbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + desktopbe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt desktopbe1.component diff --git a/shell/source/backends/gconfbe/gconfbackend.cxx b/shell/source/backends/gconfbe/gconfbackend.cxx index 122d1cad02b3..fb3fdb114305 100644 --- a/shell/source/backends/gconfbe/gconfbackend.cxx +++ b/shell/source/backends/gconfbe/gconfbackend.cxx @@ -231,9 +231,3 @@ component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return component_writeInfoHelper(pServiceManager, pRegistryKey, services); -} diff --git a/shell/source/backends/gconfbe/gconfbe1-ucd.txt b/shell/source/backends/gconfbe/gconfbe1-ucd.txt deleted file mode 100644 index daa5444ff0c5..000000000000 --- a/shell/source/backends/gconfbe/gconfbe1-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.configuration.backend.GconfBackend -ComponentName=gconfbe1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.configuration.backend.GconfBackend diff --git a/shell/source/backends/gconfbe/gconfbe1.component b/shell/source/backends/gconfbe/gconfbe1.component new file mode 100644 index 000000000000..7638e05b544a --- /dev/null +++ b/shell/source/backends/gconfbe/gconfbe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/gconfbe/makefile.mk b/shell/source/backends/gconfbe/makefile.mk index a8d9b23aa9df..9e77a0867ab0 100644 --- a/shell/source/backends/gconfbe/makefile.mk +++ b/shell/source/backends/gconfbe/makefile.mk @@ -39,7 +39,6 @@ VISIBILITY_HIDDEN=TRUE # no "lib" prefix DLLPRE = -UCDSRCEXT = txt .IF "$(ENABLE_LOCKDOWN)" == "YES" CFLAGS+=-DENABLE_LOCKDOWN @@ -89,8 +88,10 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk -ALLTAR : $(MISC)/$(TARGET)1-ucd.txt - -$(MISC)/$(TARGET)1-ucd.txt : $$(@:b).$(UCDSRCEXT) - cat $< | tr -d "\015" > $@ +ALLTAR : $(MISC)/gconfbe1.component +$(MISC)/gconfbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + gconfbe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt gconfbe1.component diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx index 44ddb49bd025..2bf3d144a5dc 100644 --- a/shell/source/backends/kde4be/kde4backend.cxx +++ b/shell/source/backends/kde4be/kde4backend.cxx @@ -250,9 +250,3 @@ component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return component_writeInfoHelper(pServiceManager, pRegistryKey, services); -} diff --git a/shell/source/backends/kde4be/kde4be1-ucd.txt b/shell/source/backends/kde4be/kde4be1-ucd.txt deleted file mode 100644 index 9671199b26e3..000000000000 --- a/shell/source/backends/kde4be/kde4be1-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend -ComponentName=kde4be1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.configuration.backend.KDE4Backend diff --git a/shell/source/backends/kde4be/kde4be1.component b/shell/source/backends/kde4be/kde4be1.component new file mode 100644 index 000000000000..8ea7ae121088 --- /dev/null +++ b/shell/source/backends/kde4be/kde4be1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/kde4be/makefile.mk b/shell/source/backends/kde4be/makefile.mk index 1f9093a95aee..477e47ca6100 100644 --- a/shell/source/backends/kde4be/makefile.mk +++ b/shell/source/backends/kde4be/makefile.mk @@ -44,8 +44,6 @@ VISIBILITY_HIDDEN=TRUE CFLAGSCXX+=-Wno-shadow .ENDIF -UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt - # no "lib" prefix DLLPRE = @@ -79,3 +77,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets --- .INCLUDE : target.mk + +ALLTAR : $(MISC)/kde4be1.component + +$(MISC)/kde4be1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + kde4be1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt kde4be1.component diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx index 53a00cf35987..ad38a6cfc854 100644 --- a/shell/source/backends/kdebe/kdebackend.cxx +++ b/shell/source/backends/kdebe/kdebackend.cxx @@ -250,9 +250,3 @@ component_getImplementationEnvironment( { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey) -{ - return component_writeInfoHelper(pServiceManager, pRegistryKey, services); -} diff --git a/shell/source/backends/kdebe/kdebe1-ucd.txt b/shell/source/backends/kdebe/kdebe1-ucd.txt deleted file mode 100644 index adf7e17431f8..000000000000 --- a/shell/source/backends/kdebe/kdebe1-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.configuration.backend.KDEBackend -ComponentName=kdebe1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.configuration.backend.KDEBackend diff --git a/shell/source/backends/kdebe/kdebe1.component b/shell/source/backends/kdebe/kdebe1.component new file mode 100644 index 000000000000..393fbc80d538 --- /dev/null +++ b/shell/source/backends/kdebe/kdebe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/kdebe/makefile.mk b/shell/source/backends/kdebe/makefile.mk index 31bf77b47b54..b1b12ad3c6f3 100644 --- a/shell/source/backends/kdebe/makefile.mk +++ b/shell/source/backends/kdebe/makefile.mk @@ -44,8 +44,6 @@ VISIBILITY_HIDDEN=TRUE CFLAGSCXX+=-Wno-shadow .ENDIF -UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt - # no "lib" prefix DLLPRE = @@ -79,3 +77,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets --- .INCLUDE : target.mk + +ALLTAR : $(MISC)/kdebe1.component + +$(MISC)/kdebe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + kdebe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt kdebe1.component diff --git a/shell/source/backends/localebe/localebe1.component b/shell/source/backends/localebe/localebe1.component new file mode 100644 index 000000000000..7236a6198281 --- /dev/null +++ b/shell/source/backends/localebe/localebe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/localebe/localebecdef.cxx b/shell/source/backends/localebe/localebecdef.cxx index 576501e4da9f..0ec9c0665125 100644 --- a/shell/source/backends/localebe/localebecdef.cxx +++ b/shell/source/backends/localebe/localebecdef.cxx @@ -72,13 +72,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { - return cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, kImplementations_entries); -} - -//------------------------------------------------------------------------------ - extern "C" void *component_getFactory( const sal_Char *aImplementationName, void *aServiceManager, void *aRegistryKey) { diff --git a/shell/source/backends/localebe/makefile.mk b/shell/source/backends/localebe/makefile.mk index bd12bcdb28ce..1efe3ed5e498 100644 --- a/shell/source/backends/localebe/makefile.mk +++ b/shell/source/backends/localebe/makefile.mk @@ -70,3 +70,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/localebe1.component + +$(MISC)/localebe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + localebe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt localebe1.component diff --git a/shell/source/backends/macbe/macbe1.component b/shell/source/backends/macbe/macbe1.component new file mode 100644 index 000000000000..10bac2e2b6a0 --- /dev/null +++ b/shell/source/backends/macbe/macbe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/macbe/macbecdef.cxx b/shell/source/backends/macbe/macbecdef.cxx index 18cf2806c16b..ab49bbb779f3 100644 --- a/shell/source/backends/macbe/macbecdef.cxx +++ b/shell/source/backends/macbe/macbecdef.cxx @@ -73,13 +73,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { - return cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, kImplementations_entries); -} - -//------------------------------------------------------------------------------ - extern "C" void *component_getFactory( const sal_Char *aImplementationName, void *aServiceManager, void *aRegistryKey) { diff --git a/shell/source/backends/macbe/makefile.mk b/shell/source/backends/macbe/makefile.mk index c3a58ec9f5c6..dd20834b2635 100644 --- a/shell/source/backends/macbe/makefile.mk +++ b/shell/source/backends/macbe/makefile.mk @@ -76,3 +76,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk .ENDIF # "$(OS)" != "MACOSX" + +ALLTAR : $(MISC)/macbe1.component + +$(MISC)/macbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + macbe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt macbe1.component diff --git a/shell/source/backends/wininetbe/makefile.mk b/shell/source/backends/wininetbe/makefile.mk index 9f79fa706fbf..7d8a6be14b21 100644 --- a/shell/source/backends/wininetbe/makefile.mk +++ b/shell/source/backends/wininetbe/makefile.mk @@ -66,3 +66,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/wininetbe1.component + +$(MISC)/wininetbe1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + wininetbe1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt wininetbe1.component diff --git a/shell/source/backends/wininetbe/wininetbe1.component b/shell/source/backends/wininetbe/wininetbe1.component new file mode 100644 index 000000000000..d8930280fb2a --- /dev/null +++ b/shell/source/backends/wininetbe/wininetbe1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx b/shell/source/backends/wininetbe/wininetbecdef.cxx index 862600009e30..ed6cdceb4a3e 100644 --- a/shell/source/backends/wininetbe/wininetbecdef.cxx +++ b/shell/source/backends/wininetbe/wininetbecdef.cxx @@ -73,13 +73,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( //------------------------------------------------------------------------------ -extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void *pRegistryKey) { - return cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, kImplementations_entries); -} - -//------------------------------------------------------------------------------ - extern "C" void *component_getFactory( const sal_Char *aImplementationName, void *aServiceManager, void *aRegistryKey) { diff --git a/shell/source/cmdmail/cmdmail.component b/shell/source/cmdmail/cmdmail.component new file mode 100644 index 000000000000..7e56741d16c1 --- /dev/null +++ b/shell/source/cmdmail/cmdmail.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/cmdmail/cmdmailentry.cxx b/shell/source/cmdmail/cmdmailentry.cxx index aacef87396c4..740f87cd76f1 100755 --- a/shell/source/cmdmail/cmdmailentry.cxx +++ b/shell/source/cmdmail/cmdmailentry.cxx @@ -54,7 +54,6 @@ using com::sun::star::system::XSimpleMailClientSupplier; #define COMP_SERVICE_NAME "com.sun.star.system.SimpleCommandMail" #define COMP_IMPL_NAME "com.sun.star.comp.system.SimpleCommandMail" -#define COMP_REGKEY_NAME "/com.sun.star.comp.system.SimpleCommandMail/UNO/SERVICES/com.sun.star.system.SimpleCommandMail" //----------------------------------------------------------------------- // @@ -85,29 +84,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//----------------------------------------------------------------------- -// -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( COMP_REGKEY_NAME ) ) ); - return sal_True; - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - //---------------------------------------------------------------------- // component_getFactory //---------------------------------------------------------------------- diff --git a/shell/source/cmdmail/exports.dxp b/shell/source/cmdmail/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/shell/source/cmdmail/exports.dxp +++ b/shell/source/cmdmail/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/shell/source/cmdmail/makefile.mk b/shell/source/cmdmail/makefile.mk index 5781afe8f5dd..e4d5ec48b925 100644 --- a/shell/source/cmdmail/makefile.mk +++ b/shell/source/cmdmail/makefile.mk @@ -62,3 +62,10 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE : target.mk +ALLTAR : $(MISC)/cmdmail.component + +$(MISC)/cmdmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + cmdmail.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt cmdmail.component diff --git a/shell/source/unix/exec/makefile.mk b/shell/source/unix/exec/makefile.mk index 4bf77436f668..1a26d377b142 100644 --- a/shell/source/unix/exec/makefile.mk +++ b/shell/source/unix/exec/makefile.mk @@ -88,3 +88,11 @@ run_test : $(BIN)$/$(TESTAPP1).sh $(BIN)$/$(TESTAPP1).sh : $$(@:f) $(COPY) $< $@ -chmod +x $@ + +ALLTAR : $(MISC)/syssh.component + +$(MISC)/syssh.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + syssh.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt syssh.component diff --git a/shell/source/unix/exec/shellexecentry.cxx b/shell/source/unix/exec/shellexecentry.cxx index da5e5613f955..d1eff582ea59 100644 --- a/shell/source/unix/exec/shellexecentry.cxx +++ b/shell/source/unix/exec/shellexecentry.cxx @@ -83,29 +83,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//----------------------------------------------------------------------- -// component_writeInfo -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - if (pRegistryKey) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( SHELLEXEC_REGKEY_NAME ) ) ); - return sal_True; - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - } - } - - return sal_False; -} - //---------------------------------------------------------------------- // component_getFactory //---------------------------------------------------------------------- diff --git a/shell/source/unix/exec/syssh.component b/shell/source/unix/exec/syssh.component new file mode 100644 index 000000000000..030240dff3bf --- /dev/null +++ b/shell/source/unix/exec/syssh.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/win32/SysShentry.cxx b/shell/source/win32/SysShentry.cxx index a542d046fc59..727cfe269f07 100644 --- a/shell/source/win32/SysShentry.cxx +++ b/shell/source/win32/SysShentry.cxx @@ -85,32 +85,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ":affine"; } -//----------------------------------------------------------------------- -// -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( - OUString::createFromAscii( SYSSHEXEC_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - bRetVal = sal_False; - } - } - - return bRetVal; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/shell/source/win32/exports.dxp b/shell/source/win32/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/shell/source/win32/exports.dxp +++ b/shell/source/win32/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/shell/source/win32/makefile.mk b/shell/source/win32/makefile.mk index 9a9564ed76ca..7a01eefed89e 100644 --- a/shell/source/win32/makefile.mk +++ b/shell/source/win32/makefile.mk @@ -67,3 +67,11 @@ DEF1EXPORTFILE= exports.dxp INCLUDE!:=$(subst,/stl, $(INCLUDE)) .EXPORT : INCLUDE + +ALLTAR : $(MISC)/syssh.component + +$(MISC)/syssh.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + syssh.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt syssh.component diff --git a/shell/source/win32/simplemail/exports.dxp b/shell/source/win32/simplemail/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/shell/source/win32/simplemail/exports.dxp +++ b/shell/source/win32/simplemail/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/shell/source/win32/simplemail/makefile.mk b/shell/source/win32/simplemail/makefile.mk index 84a209e4c072..abd35e408e2d 100644 --- a/shell/source/win32/simplemail/makefile.mk +++ b/shell/source/win32/simplemail/makefile.mk @@ -77,3 +77,11 @@ APP1DEF=$(MISC)$/$(APP1TARGET).def .INCLUDE : target.mk + +ALLTAR : $(MISC)/smplmail.component + +$(MISC)/smplmail.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + smplmail.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt smplmail.component diff --git a/shell/source/win32/simplemail/smplmail.component b/shell/source/win32/simplemail/smplmail.component new file mode 100644 index 000000000000..59246c6d1551 --- /dev/null +++ b/shell/source/win32/simplemail/smplmail.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/shell/source/win32/simplemail/smplmailentry.cxx b/shell/source/win32/simplemail/smplmailentry.cxx index e65d93a95fca..9970baa28122 100644 --- a/shell/source/win32/simplemail/smplmailentry.cxx +++ b/shell/source/win32/simplemail/smplmailentry.cxx @@ -85,32 +85,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//----------------------------------------------------------------------- -// -//----------------------------------------------------------------------- - -sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey ) -{ - sal_Bool bRetVal = sal_True; - - if ( pRegistryKey ) - { - try - { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); - pXNewKey->createKey( - OUString::createFromAscii( COMP_REGKEY_NAME ) ); - } - catch( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "InvalidRegistryException caught"); - bRetVal = sal_False; - } - } - - return bRetVal; -} - //---------------------------------------------------------------------- // component_getFactory // returns a factory to create XFilePicker-Services diff --git a/shell/source/win32/syssh.component b/shell/source/win32/syssh.component new file mode 100644 index 000000000000..1e783f5221ae --- /dev/null +++ b/shell/source/win32/syssh.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/svx/prj/d.lst b/svx/prj/d.lst index 2403c04c43a0..f8b71ea69440 100644 --- a/svx/prj/d.lst +++ b/svx/prj/d.lst @@ -552,3 +552,6 @@ mkdir: %_DEST%\inc%_EXT%\svx\sdr\table ..\inc\svx\helperhittest3d.hxx %_DEST%\inc%_EXT%\svx\helperhittest3d.hxx ..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.* +..\%__SRC%\misc\svx.component %_DEST%\xml%_EXT%\svx.component +..\%__SRC%\misc\svxcore.component %_DEST%\xml%_EXT%\svxcore.component +..\%__SRC%\misc\textconversiondlgs.component %_DEST%\xml%_EXT%\textconversiondlgs.component diff --git a/svx/source/core/coreservices.cxx b/svx/source/core/coreservices.cxx index 1f1d69781756..588623dbb39a 100644 --- a/svx/source/core/coreservices.cxx +++ b/svx/source/core/coreservices.cxx @@ -77,44 +77,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -static void writeInfo ( - XRegistryKey * pRegistryKey, - const OUString& rImplementationName, - const Sequence< OUString >& rServices) -{ - Reference< XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); - - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} - -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * , void * pRegistryKey) -{ - if( pRegistryKey ) - { - try - { - XRegistryKey *pKey = reinterpret_cast< XRegistryKey * >( pRegistryKey ); - - writeInfo( pKey, ::svx::ExtrusionDepthController_getImplementationName(),::svx::ExtrusionDepthController_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::ExtrusionDirectionControl_getImplementationName(),::svx::ExtrusionDirectionControl_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::ExtrusionLightingControl_getImplementationName(),::svx::ExtrusionLightingControl_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::ExtrusionSurfaceControl_getImplementationName(),::svx::ExtrusionSurfaceControl_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::FontWorkAlignmentControl_getImplementationName(),::svx::FontWorkAlignmentControl_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::FontWorkCharacterSpacingControl_getImplementationName(),::svx::FontWorkCharacterSpacingControl_getSupportedServiceNames() ); - } - catch (InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return sal_True; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplName, void * pServiceManager, void * ) { diff --git a/svx/source/unodialogs/textconversiondlgs/makefile.mk b/svx/source/unodialogs/textconversiondlgs/makefile.mk index b5013ca9d165..ec0cdca2620e 100644 --- a/svx/source/unodialogs/textconversiondlgs/makefile.mk +++ b/svx/source/unodialogs/textconversiondlgs/makefile.mk @@ -88,3 +88,11 @@ $(SRS)$/$(TARGET).srs: $(INCCOM)$/chinese_direction.hrc $(SLO)$/chinese_dictionarydialog.obj: $(INCCOM)$/chinese_direction.hrc $(SLO)$/chinese_translationdialog.obj: $(INCCOM)$/chinese_direction.hrc + +ALLTAR : $(MISC)/textconversiondlgs.component + +$(MISC)/textconversiondlgs.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt textconversiondlgs.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt textconversiondlgs.component diff --git a/svx/source/unodialogs/textconversiondlgs/services.cxx b/svx/source/unodialogs/textconversiondlgs/services.cxx index e397ba9e5860..02d18cef9c45 100644 --- a/svx/source/unodialogs/textconversiondlgs/services.cxx +++ b/svx/source/unodialogs/textconversiondlgs/services.cxx @@ -53,13 +53,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== -sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, g_entries_unodialogs_chinesetranslation ); -} -//================================================================================================== void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component b/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component new file mode 100644 index 000000000000..184743583645 --- /dev/null +++ b/svx/source/unodialogs/textconversiondlgs/textconversiondlgs.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index bf7a848d71c6..dbe9c735e2bd 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -261,60 +261,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment ( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -static void writeInfo ( - registry::XRegistryKey * pRegistryKey, - const OUString& rImplementationName, - const uno::Sequence< OUString >& rServices) -{ - uno::Reference< registry::XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); - - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} - -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo ( - void * , void * pRegistryKey) -{ - if( pRegistryKey ) - { - try - { - registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - - writeInfo( pKey, SvxShapeCollection::getImplementationName_Static(), SvxShapeCollection::getSupportedServiceNames_Static() ); - writeInfo( pKey, SvxUnoColorTable::getImplementationName_Static(), SvxUnoColorTable::getSupportedServiceNames_Static() ); - writeInfo( pKey, EnhancedCustomShapeEngine_getImplementationName(), EnhancedCustomShapeEngine_getSupportedServiceNames() ); - writeInfo( pKey, svx::RecoveryUI::st_getImplementationName(), svx::RecoveryUI::st_getSupportedServiceNames() ); - writeInfo( pKey, svx::GraphicExporter_getImplementationName(), svx::GraphicExporter_getSupportedServiceNames() ); - writeInfo( pKey, svx::FontHeightToolBoxControl::getImplementationName_Static(), svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() ); - - writeInfo( pKey, svx::FindTextToolbarController::getImplementationName_Static(), svx::FindTextToolbarController::getSupportedServiceNames_Static() ); - writeInfo( pKey, svx::DownSearchToolboxController::getImplementationName_Static(), svx::DownSearchToolboxController::getSupportedServiceNames_Static() ); - writeInfo( pKey, svx::UpSearchToolboxController::getImplementationName_Static(), svx::UpSearchToolboxController::getSupportedServiceNames_Static() ); - writeInfo( pKey, svx::FindbarDispatcher::getImplementationName_Static(), svx::FindbarDispatcher::getSupportedServiceNames_Static() ); - - writeInfo( pKey, ::unogallery::GalleryThemeProvider_getImplementationName(),::unogallery::GalleryThemeProvider_getSupportedServiceNames() ); - - // XPrimitiveFactory2D - writeInfo( pKey, - drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(), - drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() ); - - writeInfo( pKey, ::svx::SvXMLGraphicImportHelper_getImplementationName(),::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() ); - writeInfo( pKey, ::svx::SvXMLGraphicExportHelper_getImplementationName(),::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() ); -// writeInfo( pKey, ::svx::ExtrusionDepthController_getImplementationName(),::svx::ExtrusionDepthController_getSupportedServiceNames() ); - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return sal_True; -} - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory ( const sal_Char * pImplName, void * pServiceManager, void * ) { diff --git a/svx/util/gal.dxp b/svx/util/gal.dxp index 227006cc4e9f..e8f2e0a94819 100644 --- a/svx/util/gal.dxp +++ b/svx/util/gal.dxp @@ -17,5 +17,4 @@ Gallery_InsertSdrObj Gallery_GetThemeNameFromId Gallery_BeginLocking Gallery_EndLocking -component_writeInfo component_getFactory diff --git a/svx/util/makefile.mk b/svx/util/makefile.mk index 050decc8d4f5..18f52487e483 100644 --- a/svx/util/makefile.mk +++ b/svx/util/makefile.mk @@ -196,3 +196,17 @@ RESLIB1SRSFILES= $(SRSFILELIST) .INCLUDE : target.mk + +ALLTAR : $(MISC)/svx.component $(MISC)/svxcore.component + +$(MISC)/svx.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svx.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svx.component + +$(MISC)/svxcore.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + svxcore.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt svxcore.component diff --git a/svx/util/svx.component b/svx/util/svx.component new file mode 100644 index 000000000000..5907d69fef50 --- /dev/null +++ b/svx/util/svx.component @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/svx/util/svx.dxp b/svx/util/svx.dxp index 9630d7e06768..f0e1c69934bc 100644 --- a/svx/util/svx.dxp +++ b/svx/util/svx.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/svx/util/svxcore.component b/svx/util/svxcore.component new file mode 100644 index 000000000000..2f829cb52a77 --- /dev/null +++ b/svx/util/svxcore.component @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sysui/util/exports.dxp b/sysui/util/exports.dxp index 028ac4175990..f0e1c69934bc 100644 --- a/sysui/util/exports.dxp +++ b/sysui/util/exports.dxp @@ -1,3 +1,2 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory diff --git a/ucb/prj/d.lst b/ucb/prj/d.lst index b02c8184a6e9..65a32e21fba3 100644 --- a/ucb/prj/d.lst +++ b/ucb/prj/d.lst @@ -31,5 +31,16 @@ ..\source\ucp\gvfs\ucpgvfs.xml %_DEST%\xml%_EXT%\ucpgvfs.xml ..\source\ucp\tdoc\ucptdoc.xml %_DEST%\xml%_EXT%\ucptdoc.xml -..\%__SRC%\misc\ucpgvfs-ucd.txt %_DEST%\bin%_EXT%\ucpgvfs-ucd.txt -..\%__SRC%\misc\ucpgio-ucd.txt %_DEST%\bin%_EXT%\ucpgio-ucd.txt +..\%__SRC%\misc\ucpgvfs.component %_DEST%\xml%_EXT%\ucpgvfs.component +..\%__SRC%\misc\ucpgio.component %_DEST%\xml%_EXT%\ucpgio.component +..\%__SRC%\misc\cached1.component %_DEST%\xml%_EXT%\cached1.component +..\%__SRC%\misc\srtrs1.component %_DEST%\xml%_EXT%\srtrs1.component +..\%__SRC%\misc\ucb1.component %_DEST%\xml%_EXT%\ucb1.component +..\%__SRC%\misc\ucpdav1.component %_DEST%\xml%_EXT%\ucpdav1.component +..\%__SRC%\misc\ucpexpand1.component %_DEST%\xml%_EXT%\ucpexpand1.component +..\%__SRC%\misc\ucpext.component %_DEST%\xml%_EXT%\ucpext.component +..\%__SRC%\misc\ucpfile1.component %_DEST%\xml%_EXT%\ucpfile1.component +..\%__SRC%\misc\ucpftp1.component %_DEST%\xml%_EXT%\ucpftp1.component +..\%__SRC%\misc\ucphier1.component %_DEST%\xml%_EXT%\ucphier1.component +..\%__SRC%\misc\ucppkg1.component %_DEST%\xml%_EXT%\ucppkg1.component +..\%__SRC%\misc\ucptdoc1.component %_DEST%\xml%_EXT%\ucptdoc1.component diff --git a/ucb/source/cacher/cached1.component b/ucb/source/cacher/cached1.component new file mode 100644 index 000000000000..aa19e54b5da3 --- /dev/null +++ b/ucb/source/cacher/cached1.component @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + diff --git a/ucb/source/cacher/cacheserv.cxx b/ucb/source/cacher/cacheserv.cxx index 3aa0f1de5357..f429286cfdee 100644 --- a/ucb/source/cacher/cacheserv.cxx +++ b/ucb/source/cacher/cacheserv.cxx @@ -40,45 +40,6 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::registry; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) -{ - OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xKey; - try - { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) @@ -86,44 +47,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // CachedContentResultSetFactory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - CachedContentResultSetFactory::getImplementationName_Static(), - CachedContentResultSetFactory::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // CachedContentResultSetStubFactory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - CachedContentResultSetStubFactory::getImplementationName_Static(), - CachedContentResultSetStubFactory::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // CachedDynamicResultSetFactory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - CachedDynamicResultSetFactory::getImplementationName_Static(), - CachedDynamicResultSetFactory::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // CachedDynamicResultSetStubFactory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - CachedDynamicResultSetStubFactory::getImplementationName_Static(), - CachedDynamicResultSetStubFactory::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) diff --git a/ucb/source/cacher/makefile.mk b/ucb/source/cacher/makefile.mk index 600fefc174f7..24d245ec6ce8 100644 --- a/ucb/source/cacher/makefile.mk +++ b/ucb/source/cacher/makefile.mk @@ -66,3 +66,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/cached1.component + +$(MISC)/cached1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + cached1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt cached1.component diff --git a/ucb/source/core/exports2.dxp b/ucb/source/core/exports2.dxp index a1936474f752..8091459f4d84 100644 --- a/ucb/source/core/exports2.dxp +++ b/ucb/source/core/exports2.dxp @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory _ZTIN3com3sun4star3ucb34InteractiveBadTransferURLExceptionE diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk index 34765eb74289..6360f82320d2 100644 --- a/ucb/source/core/makefile.mk +++ b/ucb/source/core/makefile.mk @@ -74,3 +74,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucb1.component + +$(MISC)/ucb1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucb1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucb1.component diff --git a/ucb/source/core/ucb1.component b/ucb/source/core/ucb1.component new file mode 100644 index 000000000000..e9d408822cc9 --- /dev/null +++ b/ucb/source/core/ucb1.component @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/ucb/source/core/ucbserv.cxx b/ucb/source/core/ucbserv.cxx index 340fa5db0c0f..a4e5bdc1dccf 100644 --- a/ucb/source/core/ucbserv.cxx +++ b/ucb/source/core/ucbserv.cxx @@ -29,7 +29,6 @@ #include "precompiled_ucb.hxx" #include #include -#include #include "ucb.hxx" #include "ucbstore.hxx" #include "ucbprops.hxx" @@ -39,46 +38,6 @@ using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -using namespace com::sun::star::registry; - -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) -{ - OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xKey; - try - { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( @@ -87,52 +46,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // Universal Content Broker. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - UniversalContentBroker::getImplementationName_Static(), - UniversalContentBroker::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // UCB Store. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - UcbStore::getImplementationName_Static(), - UcbStore::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // UCB PropertiesManager. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - UcbPropertiesManager::getImplementationName_Static(), - UcbPropertiesManager::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // UCP Proxy Factory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - UcbContentProviderProxyFactory::getImplementationName_Static(), - UcbContentProviderProxyFactory::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // Command Environment. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(), - ucb_cmdenv::UcbCommandEnvironment::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) diff --git a/ucb/source/sorter/makefile.mk b/ucb/source/sorter/makefile.mk index 68a9959589d2..008e39b4bce3 100644 --- a/ucb/source/sorter/makefile.mk +++ b/ucb/source/sorter/makefile.mk @@ -61,3 +61,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/srtrs1.component + +$(MISC)/srtrs1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + srtrs1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt srtrs1.component diff --git a/ucb/source/sorter/sortmain.cxx b/ucb/source/sorter/sortmain.cxx index d96b4bcff796..5ad9a529e1f2 100644 --- a/ucb/source/sorter/sortmain.cxx +++ b/ucb/source/sorter/sortmain.cxx @@ -30,51 +30,10 @@ #include #include #include -#include using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -using namespace com::sun::star::registry; - -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) -{ - OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xKey; - try - { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( @@ -83,20 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // SortedDynamicResultSetFactory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - SortedDynamicResultSetFactory::getImplementationName_Static(), - SortedDynamicResultSetFactory::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) diff --git a/ucb/source/sorter/srtrs1.component b/ucb/source/sorter/srtrs1.component new file mode 100644 index 000000000000..c32705160c0f --- /dev/null +++ b/ucb/source/sorter/srtrs1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/expand/makefile.mk b/ucb/source/ucp/expand/makefile.mk index 32de160318f2..70e441171a44 100644 --- a/ucb/source/ucp/expand/makefile.mk +++ b/ucb/source/ucp/expand/makefile.mk @@ -59,3 +59,11 @@ DEF1NAME = $(SHL1TARGET) .ENDIF # L10N_framework .INCLUDE : target.mk + +ALLTAR : $(MISC)/ucpexpand1.component + +$(MISC)/ucpexpand1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpexpand1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpexpand1.component diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx index 710cf137ba06..069aa894692b 100644 --- a/ucb/source/ucp/expand/ucpexpand.cxx +++ b/ucb/source/ucp/expand/ucpexpand.cxx @@ -273,14 +273,6 @@ void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, - registry::XRegistryKey * pRegistryKey ) -{ - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, s_entries ); -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, diff --git a/ucb/source/ucp/expand/ucpexpand1.component b/ucb/source/ucp/expand/ucpexpand1.component new file mode 100644 index 000000000000..5997e9029811 --- /dev/null +++ b/ucb/source/ucp/expand/ucpexpand1.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/ucb/source/ucp/ext/makefile.mk b/ucb/source/ucp/ext/makefile.mk index 23c30b3bda5b..e106b8e1ba31 100644 --- a/ucb/source/ucp/ext/makefile.mk +++ b/ucb/source/ucp/ext/makefile.mk @@ -63,3 +63,11 @@ SHL1DEF = $(MISC)$/$(SHL1TARGET).def DEF1NAME = $(SHL1TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/ucpext.component + +$(MISC)/ucpext.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpext.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpext.component diff --git a/ucb/source/ucp/ext/ucpext.component b/ucb/source/ucp/ext/ucpext.component new file mode 100644 index 000000000000..d673777a6707 --- /dev/null +++ b/ucb/source/ucp/ext/ucpext.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/ucb/source/ucp/ext/ucpext_services.cxx b/ucb/source/ucp/ext/ucpext_services.cxx index 8daa33f5cf8c..ce525c2da665 100644 --- a/ucb/source/ucp/ext/ucpext_services.cxx +++ b/ucb/source/ucp/ext/ucpext_services.cxx @@ -79,12 +79,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - //------------------------------------------------------------------------------------------------------------------ - sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey ) - { - return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, ::ucb::ucp::ext::s_aServiceEntries ); - } - //------------------------------------------------------------------------------------------------------------------ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/ucb/source/ucp/file/exports2.dxp b/ucb/source/ucp/file/exports2.dxp index 6c42314f228b..4804c8d0ae57 100644 --- a/ucb/source/ucp/file/exports2.dxp +++ b/ucb/source/ucp/file/exports2.dxp @@ -1,5 +1,4 @@ component_getImplementationEnvironment -component_writeInfo component_getFactory _ZTIN3com3sun4star3ucb31InteractiveAugmentedIOExceptionE diff --git a/ucb/source/ucp/file/makefile.mk b/ucb/source/ucp/file/makefile.mk index 8007a2492399..3d97cb23873c 100644 --- a/ucb/source/ucp/file/makefile.mk +++ b/ucb/source/ucp/file/makefile.mk @@ -78,3 +78,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpfile1.component + +$(MISC)/ucpfile1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpfile1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpfile1.component diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index a456d2acbd32..2b9c09a7d0fa 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -31,7 +31,6 @@ #include #include #include -#include #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBBUTE_HPP_ #include #endif @@ -52,45 +51,6 @@ using namespace com::sun::star::beans; using namespace com::sun::star::ucb; using namespace com::sun::star::container; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) @@ -98,20 +58,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // File Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - fileaccess::shell::getImplementationName_static(), - fileaccess::shell::getSupportedServiceNames_static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * ) diff --git a/ucb/source/ucp/file/ucpfile1.component b/ucb/source/ucp/file/ucpfile1.component new file mode 100644 index 000000000000..28032451220a --- /dev/null +++ b/ucb/source/ucp/file/ucpfile1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/ftp/ftpservices.cxx b/ucb/source/ucp/ftp/ftpservices.cxx index fb62acd1cbc0..8e5c88ad66c1 100644 --- a/ucb/source/ucp/ftp/ftpservices.cxx +++ b/ucb/source/ucp/ftp/ftpservices.cxx @@ -35,45 +35,6 @@ using namespace com::sun::star; using namespace ftp; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -81,21 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // FTP Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - FTPContentProvider::getImplementationName_Static(), - FTPContentProvider::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) diff --git a/ucb/source/ucp/ftp/makefile.mk b/ucb/source/ucp/ftp/makefile.mk index a0f141004089..c2f1ce154a56 100644 --- a/ucb/source/ucp/ftp/makefile.mk +++ b/ucb/source/ucp/ftp/makefile.mk @@ -104,3 +104,11 @@ DEF1NAME=$(SHL1TARGET) + +ALLTAR : $(MISC)/ucpftp1.component + +$(MISC)/ucpftp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpftp1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpftp1.component diff --git a/ucb/source/ucp/ftp/ucpftp1.component b/ucb/source/ucp/ftp/ucpftp1.component new file mode 100644 index 000000000000..fa4cfe6e7557 --- /dev/null +++ b/ucb/source/ucp/ftp/ucpftp1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx index b39bc4462bbe..b8b16ba72c24 100644 --- a/ucb/source/ucp/gio/gio_provider.cxx +++ b/ucb/source/ucp/gio/gio_provider.cxx @@ -102,41 +102,6 @@ ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider ); } -static sal_Bool writeInfo( void *pRegistryKey, - const rtl::OUString &rImplementationName, uno::Sequence< rtl::OUString > const &rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * > (pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - {} - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment **) { diff --git a/ucb/source/ucp/gio/makefile.mk b/ucb/source/ucp/gio/makefile.mk index 86b32fbc0739..4cca611c7ece 100644 --- a/ucb/source/ucp/gio/makefile.mk +++ b/ucb/source/ucp/gio/makefile.mk @@ -37,8 +37,6 @@ NO_BSYMBOLIC=TRUE .INCLUDE: settings.mk .IF "$(L10N_framework)"=="" -UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt - .IF "$(ENABLE_GIO)"!="" COMPILER_WARN_ALL=TRUE PKGCONFIG_MODULES=gio-2.0 @@ -79,3 +77,11 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # L10N_framework .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpgio.component + +$(MISC)/ucpgio.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpgio.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpgio.component diff --git a/ucb/source/ucp/gio/ucpgio-ucd.txt b/ucb/source/ucp/gio/ucpgio-ucd.txt deleted file mode 100644 index ce7657fa73e3..000000000000 --- a/ucb/source/ucp/gio/ucpgio-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.GIOContentProvider -ComponentName=ucpgio1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ucb.GIOContentProvider diff --git a/ucb/source/ucp/gio/ucpgio.component b/ucb/source/ucp/gio/ucpgio.component new file mode 100644 index 000000000000..caa8fc361f7f --- /dev/null +++ b/ucb/source/ucp/gio/ucpgio.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx index 52376bf4153e..77415982c63d 100644 --- a/ucb/source/ucp/gvfs/gvfs_provider.cxx +++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx @@ -143,42 +143,6 @@ ContentProvider::queryContent( //============================ shlib entry points ============================================= - -// cut and paste verbatim from webdav (that sucks). -static sal_Bool -writeInfo( void *pRegistryKey, - const rtl::OUString &rImplementationName, - uno::Sequence< rtl::OUString > const &rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try { - xKey = static_cast< registry::XRegistryKey * > - (pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) { - try { - xKey->createKey( rServiceNames[ n ] ); - - } catch ( registry::InvalidRegistryException const & ) { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, uno_Environment **/*ppEnv*/ ) @@ -186,15 +150,6 @@ component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -extern "C" sal_Bool SAL_CALL -component_writeInfo( void */*pServiceManager*/, - void *pRegistryKey ) -{ - return pRegistryKey && - writeInfo( pRegistryKey, - ::gvfs::ContentProvider::getImplementationName_Static(), - ::gvfs::ContentProvider::getSupportedServiceNames_Static() ); -} extern "C" void * SAL_CALL component_getFactory( const sal_Char *pImplName, void *pServiceManager, diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk index a0e8a0bda3bb..87fcca87cf70 100644 --- a/ucb/source/ucp/gvfs/makefile.mk +++ b/ucb/source/ucp/gvfs/makefile.mk @@ -37,8 +37,6 @@ NO_BSYMBOLIC=TRUE .INCLUDE: settings.mk .IF "$(L10N_framework)"=="" -UNIXTEXT=$(MISC)/$(TARGET)-ucd.txt - .IF "$(ENABLE_GNOMEVFS)"!="" COMPILER_WARN_ALL=TRUE PKGCONFIG_MODULES=gnome-vfs-2.0 @@ -84,3 +82,10 @@ SHL1VERSIONMAP=$(SOLARENV)/src/component.map .INCLUDE: target.mk +ALLTAR : $(MISC)/ucpgvfs.component + +$(MISC)/ucpgvfs.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpgvfs.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpgvfs.component diff --git a/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt b/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt deleted file mode 100644 index e9ecce6effd2..000000000000 --- a/ucb/source/ucp/gvfs/ucpgvfs-ucd.txt +++ /dev/null @@ -1,6 +0,0 @@ -[ComponentDescriptor] -ImplementationName=com.sun.star.comp.GnomeVFSContentProvider -ComponentName=ucpgvfs1.uno.so -LoaderName=com.sun.star.loader.SharedLibrary -[SupportedServices] -com.sun.star.ucb.GnomeVFSContentProvider diff --git a/ucb/source/ucp/gvfs/ucpgvfs.component b/ucb/source/ucp/gvfs/ucpgvfs.component new file mode 100644 index 000000000000..cec3e4d1e2b1 --- /dev/null +++ b/ucb/source/ucp/gvfs/ucpgvfs.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/hierarchy/hierarchyservices.cxx b/ucb/source/ucp/hierarchy/hierarchyservices.cxx index e645e006032e..1830ecc35625 100644 --- a/ucb/source/ucp/hierarchy/hierarchyservices.cxx +++ b/ucb/source/ucp/hierarchy/hierarchyservices.cxx @@ -29,52 +29,12 @@ #include "precompiled_ucb.hxx" #include #include -#include #include "hierarchyprovider.hxx" #include "hierarchydatasource.hxx" using namespace com::sun::star; using namespace hierarchy_ucp; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -82,29 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // Hierarchy Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - HierarchyContentProvider::getImplementationName_Static(), - HierarchyContentProvider::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // Hierarchy Data Source. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - HierarchyDataSource::getImplementationName_Static(), - HierarchyDataSource::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) diff --git a/ucb/source/ucp/hierarchy/makefile.mk b/ucb/source/ucp/hierarchy/makefile.mk index 00b481b5e7a1..9263faa24b08 100644 --- a/ucb/source/ucp/hierarchy/makefile.mk +++ b/ucb/source/ucp/hierarchy/makefile.mk @@ -82,3 +82,11 @@ DEF1NAME=$(SHL1TARGET) .ENDIF # L10N_framework .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucphier1.component + +$(MISC)/ucphier1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucphier1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucphier1.component diff --git a/ucb/source/ucp/hierarchy/ucphier1.component b/ucb/source/ucp/hierarchy/ucphier1.component new file mode 100644 index 000000000000..5483187d8674 --- /dev/null +++ b/ucb/source/ucp/hierarchy/ucphier1.component @@ -0,0 +1,38 @@ + + + + + + + + + + + + diff --git a/ucb/source/ucp/odma/odma_services.cxx b/ucb/source/ucp/odma/odma_services.cxx index 3e4639e25806..0f5666e2bb53 100644 --- a/ucb/source/ucp/odma/odma_services.cxx +++ b/ucb/source/ucp/odma/odma_services.cxx @@ -39,45 +39,6 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::registry; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) -{ - OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xKey; - try - { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) diff --git a/ucb/source/ucp/package/makefile.mk b/ucb/source/ucp/package/makefile.mk index a8cdf7430703..b78150aed2cb 100644 --- a/ucb/source/ucp/package/makefile.mk +++ b/ucb/source/ucp/package/makefile.mk @@ -87,3 +87,11 @@ DEF1NAME=$(SHL1TARGET) .ENDIF # L10N_framework .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucppkg1.component + +$(MISC)/ucppkg1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucppkg1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucppkg1.component diff --git a/ucb/source/ucp/package/pkgservices.cxx b/ucb/source/ucp/package/pkgservices.cxx index 251ce8c78dd1..ad4af686d2d6 100644 --- a/ucb/source/ucp/package/pkgservices.cxx +++ b/ucb/source/ucp/package/pkgservices.cxx @@ -34,50 +34,6 @@ using namespace com::sun::star; -namespace { - -//========================================================================= -sal_Bool writeInfo( - void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - -} // namespace - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -85,21 +41,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // Write info into registry. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ::package_ucp::ContentProvider::getImplementationName_Static(), - ::package_ucp::ContentProvider::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) diff --git a/ucb/source/ucp/package/ucppkg1.component b/ucb/source/ucp/package/ucppkg1.component new file mode 100644 index 000000000000..a2e2418b5602 --- /dev/null +++ b/ucb/source/ucp/package/ucppkg1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/tdoc/makefile.mk b/ucb/source/ucp/tdoc/makefile.mk index 83e9599eed72..82c76b34b206 100644 --- a/ucb/source/ucp/tdoc/makefile.mk +++ b/ucb/source/ucp/tdoc/makefile.mk @@ -92,3 +92,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucptdoc1.component + +$(MISC)/ucptdoc1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucptdoc1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucptdoc1.component diff --git a/ucb/source/ucp/tdoc/tdoc_services.cxx b/ucb/source/ucp/tdoc/tdoc_services.cxx index 6f9641d5159b..fc34fd78b1a4 100644 --- a/ucb/source/ucp/tdoc/tdoc_services.cxx +++ b/ucb/source/ucp/tdoc/tdoc_services.cxx @@ -38,45 +38,6 @@ using namespace com::sun::star; using namespace tdoc_ucp; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -84,29 +45,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // Transient Documents Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ContentProvider::getImplementationName_Static(), - ContentProvider::getSupportedServiceNames_Static() ) && - - ////////////////////////////////////////////////////////////////////// - // Transient Documents Document Content Factory. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - DocumentContentFactory::getImplementationName_Static(), - DocumentContentFactory::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) diff --git a/ucb/source/ucp/tdoc/ucptdoc1.component b/ucb/source/ucp/tdoc/ucptdoc1.component new file mode 100644 index 000000000000..8ba1471bd933 --- /dev/null +++ b/ucb/source/ucp/tdoc/ucptdoc1.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk index 73ee298697e8..162d58266406 100644 --- a/ucb/source/ucp/webdav/makefile.mk +++ b/ucb/source/ucp/webdav/makefile.mk @@ -158,3 +158,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------------------------------- .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpdav1.component + +$(MISC)/ucpdav1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpdav1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpdav1.component diff --git a/ucb/source/ucp/webdav/ucpdav1.component b/ucb/source/ucp/webdav/ucpdav1.component new file mode 100644 index 000000000000..4e18b566e1a4 --- /dev/null +++ b/ucb/source/ucp/webdav/ucpdav1.component @@ -0,0 +1,34 @@ + + + + + + + + diff --git a/ucb/source/ucp/webdav/webdavservices.cxx b/ucb/source/ucp/webdav/webdavservices.cxx index 9fb6d9e82bcf..7a38636e9dc7 100644 --- a/ucb/source/ucp/webdav/webdavservices.cxx +++ b/ucb/source/ucp/webdav/webdavservices.cxx @@ -34,45 +34,6 @@ using namespace com::sun::star; -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -80,21 +41,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // WebDAV Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ::webdav_ucp::ContentProvider::getImplementationName_Static(), - ::webdav_ucp::ContentProvider::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) diff --git a/uui/prj/d.lst b/uui/prj/d.lst index 30c6f812fd5b..46b0118319fb 100644 --- a/uui/prj/d.lst +++ b/uui/prj/d.lst @@ -7,3 +7,4 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid ..\%__SRC%\lib\iuui.lib %_DEST%\lib%_EXT%\iuui.lib ..\util\uui.xml %_DEST%\xml%_EXT%\uui.xml +..\%__SRC%\misc\uui.component %_DEST%\xml%_EXT%\uui.component diff --git a/uui/source/services.cxx b/uui/source/services.cxx index 95d4d65b6faf..4ceb59c4c389 100644 --- a/uui/source/services.cxx +++ b/uui/source/services.cxx @@ -41,49 +41,6 @@ using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::registry; -namespace { - -sal_Bool writeInfo( void * pRegistryKey, - const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) -{ - OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< XRegistryKey > xKey; - try - { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - { - return sal_False; - } - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - -} // namespace - //============================================================================ // // component_getImplementationEnvironment @@ -97,43 +54,6 @@ component_getImplementationEnvironment(sal_Char const ** pEnvTypeName, *pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//============================================================================ -// -// component_writeInfo -// -//============================================================================ - -extern "C" sal_Bool SAL_CALL component_writeInfo(void *, void * pRegistryKey) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // UUI Interaction Handler. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - OUString::createFromAscii( - UUIInteractionHandler::m_aImplementationName ), - UUIInteractionHandler::getSupportedServiceNames_static() ) && - - ////////////////////////////////////////////////////////////////////// - // UUI Interaction Request String Resolver. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - OUString::createFromAscii( - UUIInteractionRequestStringResolver::m_aImplementationName ), - UUIInteractionRequestStringResolver::getSupportedServiceNames_static() ) && - - ////////////////////////////////////////////////////////////////////// - // UUI Password Container Interaction Handler. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - uui::PasswordContainerInteractionHandler::getImplementationName_Static(), - uui::PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ); -} - //============================================================================ // // component_getFactory diff --git a/uui/util/makefile.mk b/uui/util/makefile.mk index 163a7bb5502e..8a77e71b5e8d 100644 --- a/uui/util/makefile.mk +++ b/uui/util/makefile.mk @@ -62,3 +62,11 @@ RESLIB1SRSFILES = \ $(SRS)$/source.srs .INCLUDE: target.mk + +ALLTAR : $(MISC)/uui.component + +$(MISC)/uui.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + uui.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt uui.component diff --git a/uui/util/uui.component b/uui/util/uui.component new file mode 100644 index 000000000000..0a15ad6eb8e5 --- /dev/null +++ b/uui/util/uui.component @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + diff --git a/vbahelper/prj/d.lst b/vbahelper/prj/d.lst index 2d20ab1f982d..a5457b730409 100644 --- a/vbahelper/prj/d.lst +++ b/vbahelper/prj/d.lst @@ -26,4 +26,5 @@ mkdir: %_DEST%\inc%_EXT%\basic ..\inc\vbahelper\vbatextframe.hxx %_DEST%\inc%_EXT%\vbahelper\vbatextframe.hxx ..\inc\vbahelper\vbashaperange.hxx %_DEST%\inc%_EXT%\vbahelper\vbashaperange.hxx ..\inc\vbahelper\vbapagesetupbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbapagesetupbase.hxx +..\%__SRC%\misc\msforms.component %_DEST%\xml%_EXT%\msforms.component ..\inc\vbahelper\vbaeventshelperbase.hxx %_DEST%\inc%_EXT%\vbahelper\vbaeventshelperbase.hxx diff --git a/vbahelper/source/msforms/service.cxx b/vbahelper/source/msforms/service.cxx index 8e6cf29e8ec5..152517be3958 100644 --- a/vbahelper/source/msforms/service.cxx +++ b/vbahelper/source/msforms/service.cxx @@ -57,16 +57,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - OSL_TRACE("In component_writeInfo"); - - // Component registration - return component_writeInfoHelper( pServiceManager, pRegistryKey, - controlprovider::serviceDecl, userform::serviceDecl ); - } - SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/vbahelper/util/makefile.mk b/vbahelper/util/makefile.mk index dda4be0cbc81..9469df473685 100644 --- a/vbahelper/util/makefile.mk +++ b/vbahelper/util/makefile.mk @@ -102,3 +102,11 @@ SHL2LIBS=$(SLB)$/$(TARGET_MSFORMS).lib # --- Targets ----------------------------------------------------------- .INCLUDE : target.mk + +ALLTAR : $(MISC)/msforms.component + +$(MISC)/msforms.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + msforms.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt msforms.component diff --git a/vbahelper/util/msforms.component b/vbahelper/util/msforms.component new file mode 100644 index 000000000000..98ce4a8451d4 --- /dev/null +++ b/vbahelper/util/msforms.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/xmlhelp/prj/d.lst b/xmlhelp/prj/d.lst index 1cfa107f73b9..02eec754b609 100644 --- a/xmlhelp/prj/d.lst +++ b/xmlhelp/prj/d.lst @@ -5,3 +5,6 @@ ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.* ..\util\ucpchelp.xml %_DEST%\xml%_EXT%\ucpchelp.xml ..\%__SRC%\lib\ihelplinker.lib %_DEST%\lib%_EXT%\ihelplinker.lib +..\%__SRC%\misc\LuceneHelpWrapper.component %_DEST%\xml%_EXT%\LuceneHelpWrapper.component +..\%__SRC%\misc\tvhlp1.component %_DEST%\xml%_EXT%\tvhlp1.component +..\%__SRC%\misc\ucpchelp1.component %_DEST%\xml%_EXT%\ucpchelp1.component diff --git a/xmlhelp/source/com/sun/star/help/HelpComponent.java b/xmlhelp/source/com/sun/star/help/HelpComponent.java index b12eb20f9485..44b4ed091b47 100755 --- a/xmlhelp/source/com/sun/star/help/HelpComponent.java +++ b/xmlhelp/source/com/sun/star/help/HelpComponent.java @@ -68,10 +68,8 @@ import java.io.PrintStream; import java.io.File; */ -/** This class capsulates the class, that implements the minimal component, a - * factory for creating the service (__getComponentFactory) and a - * method, that writes the information into the given registry key - * (__writeRegistryServiceInfo). +/** This class capsulates the class, that implements the minimal component and a + * factory for creating the service (__getComponentFactory). */ public class HelpComponent { @@ -98,25 +96,6 @@ public class HelpComponent return xFactory; } - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

                          - * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) - { - boolean bSuccessHelpSearch = Factory.writeRegistryServiceInfo - (HelpSearch._HelpSearch.class.getName(), - HelpSearch._HelpSearch.getServiceNames(), regKey); - boolean bSuccessHelpIndexer = Factory.writeRegistryServiceInfo - (HelpIndexer.class.getName(), - HelpIndexer.getServiceNames(), regKey); - - return bSuccessHelpSearch && bSuccessHelpIndexer; - } /** This method is a member of the interface for initializing an object * directly after its creation. * @param object This array of arbitrary objects will be passed to the diff --git a/xmlhelp/source/com/sun/star/help/HelpSearch.java b/xmlhelp/source/com/sun/star/help/HelpSearch.java index 3324701f197d..dc31514afcb0 100644 --- a/xmlhelp/source/com/sun/star/help/HelpSearch.java +++ b/xmlhelp/source/com/sun/star/help/HelpSearch.java @@ -54,10 +54,8 @@ import org.apache.lucene.search.WildcardQuery; import com.sun.star.script.XInvocation; import com.sun.star.beans.XIntrospectionAccess; -/** This class capsulates the class, that implements the minimal component, a - * factory for creating the service (__getComponentFactory) and a - * method, that writes the information into the given registry key - * (__writeRegistryServiceInfo). +/** This class capsulates the class, that implements the minimal component and a + * factory for creating the service (__getComponentFactory). */ public class HelpSearch { @@ -314,19 +312,6 @@ public class HelpSearch return xFactory; } - /** - * Writes the service information into the given registry key. - * This method is called by the JavaLoader - *

                          - * @return returns true if the operation succeeded - * @param regKey the registryKey - * @see com.sun.star.comp.loader.JavaLoader - */ - public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { - return Factory.writeRegistryServiceInfo(_HelpSearch.class.getName(), - _HelpSearch.getServiceNames(), - regKey); - } /** This method is a member of the interface for initializing an object * directly after its creation. * @param object This array of arbitrary objects will be passed to the diff --git a/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component b/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component new file mode 100644 index 000000000000..04b35bcb12ec --- /dev/null +++ b/xmlhelp/source/com/sun/star/help/LuceneHelpWrapper.component @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/xmlhelp/source/com/sun/star/help/makefile.mk b/xmlhelp/source/com/sun/star/help/makefile.mk index ffa08b30cfed..a67f755a1cb2 100644 --- a/xmlhelp/source/com/sun/star/help/makefile.mk +++ b/xmlhelp/source/com/sun/star/help/makefile.mk @@ -76,6 +76,14 @@ fix_system_lucene: @echo "Fix Java Class-Path entry for Lucene libraries from system." @$(SED) -r -e "s#^(Class-Path:).*#\1 file://$(LUCENE_CORE_JAR) file://$(LUCENE_ANALYZERS_JAR)#" \ -i ../../../../../$(INPATH)/class/HelpLinker/META-INF/MANIFEST.MF + +ALLTAR : $(MISC)/LuceneHelpWrapper.component + +$(MISC)/LuceneHelpWrapper.component .ERRREMOVE : \ + $(SOLARENV)/bin/createcomponent.xslt LuceneHelpWrapper.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_JAVA)$(JARTARGET)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt LuceneHelpWrapper.component .ELSE all: @echo java disabled diff --git a/xmlhelp/source/cxxhelp/provider/services.cxx b/xmlhelp/source/cxxhelp/provider/services.cxx index b0da4e0cdec0..e6d73a4ba2eb 100644 --- a/xmlhelp/source/cxxhelp/provider/services.cxx +++ b/xmlhelp/source/cxxhelp/provider/services.cxx @@ -35,46 +35,6 @@ using namespace com::sun::star; -//========================================================================= -static sal_Bool writeInfo( - void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) @@ -82,21 +42,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // Write info into registry. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ::chelp::ContentProvider::getImplementationName_Static(), - ::chelp::ContentProvider::getSupportedServiceNames_Static() ); -} - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, diff --git a/xmlhelp/source/treeview/makefile.mk b/xmlhelp/source/treeview/makefile.mk index 0c385862d772..be0ed8e76f2f 100644 --- a/xmlhelp/source/treeview/makefile.mk +++ b/xmlhelp/source/treeview/makefile.mk @@ -67,3 +67,11 @@ DEF1DES=UCB : Treeview help .INCLUDE: target.mk + +ALLTAR : $(MISC)/tvhlp1.component + +$(MISC)/tvhlp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + tvhlp1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt tvhlp1.component diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx index 8ebfc22f082a..0a6852cdae3b 100644 --- a/xmlhelp/source/treeview/tvfactory.cxx +++ b/xmlhelp/source/treeview/tvfactory.cxx @@ -255,49 +255,6 @@ TVFactory::CreateInstance( return Reference< XInterface >::query( xP ); } - - -//========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - - - //========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) @@ -307,20 +264,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - - -//========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) -{ - (void)pServiceManager; - - return pRegistryKey && writeInfo( pRegistryKey, - TVFactory::getImplementationName_static(), - TVFactory::getSupportedServiceNames_static() ); -} - - //========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey ) diff --git a/xmlhelp/source/treeview/tvhlp1.component b/xmlhelp/source/treeview/tvhlp1.component new file mode 100644 index 000000000000..525de73e0062 --- /dev/null +++ b/xmlhelp/source/treeview/tvhlp1.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/xmlhelp/util/makefile.mk b/xmlhelp/util/makefile.mk index 10206670b5f8..5ce7bf2f10a3 100644 --- a/xmlhelp/util/makefile.mk +++ b/xmlhelp/util/makefile.mk @@ -76,3 +76,11 @@ DEF1NAME=$(SHL1TARGET) .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpchelp1.component + +$(MISC)/ucpchelp1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpchelp1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpchelp1.component diff --git a/xmlhelp/util/ucpchelp1.component b/xmlhelp/util/ucpchelp1.component new file mode 100644 index 000000000000..a8bb64124e9c --- /dev/null +++ b/xmlhelp/util/ucpchelp1.component @@ -0,0 +1,35 @@ + + + + + + + + + diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst index 7784bca0474f..9bbfe05f3ac4 100644 --- a/xmloff/prj/d.lst +++ b/xmloff/prj/d.lst @@ -116,3 +116,5 @@ mkdir: %_DEST%\inc%_EXT%\xmloff\table ..\inc\xmloff\table\XMLTableImport.hxx %_DEST%\inc%_EXT%\xmloff\table\XMLTableImport.hxx ..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +..\%__SRC%\misc\xo.component %_DEST%\xml%_EXT%\xo.component +..\%__SRC%\misc\xof.component %_DEST%\xml%_EXT%\xof.component diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx index 010318d6af49..4556e21e8152 100644 --- a/xmloff/source/core/facreg.cxx +++ b/xmloff/source/core/facreg.cxx @@ -167,117 +167,6 @@ XMLOFF_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void SAL_CALL writeInfo( registry::XRegistryKey * pRegistryKey, const OUString& rImplementationName, const uno::Sequence< OUString >& rServices ) -{ - uno::Reference< registry::XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); - - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} - -#define WRITEINFO(className)\ - writeInfo( pKey, className##_getImplementationName(), className##_getSupportedServiceNames() ) - -XMLOFF_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) -{ - if( pRegistryKey ) - { - try - { - registry::XRegistryKey *pKey = reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - - // impress oasis import - WRITEINFO( XMLImpressImportOasis ); - WRITEINFO( XMLImpressStylesImportOasis ); - WRITEINFO( XMLImpressContentImportOasis ); - WRITEINFO( XMLImpressMetaImportOasis ); - WRITEINFO( XMLImpressSettingsImportOasis ); - - // impress oasis export - WRITEINFO( XMLImpressExportOasis ); - WRITEINFO( XMLImpressStylesExportOasis ); - WRITEINFO( XMLImpressContentExportOasis ); - WRITEINFO( XMLImpressMetaExportOasis ); - WRITEINFO( XMLImpressSettingsExportOasis ); - - // animation import - WRITEINFO( AnimationsImport ); - - // impress OOo export - WRITEINFO( XMLImpressExportOOO ); - WRITEINFO( XMLImpressStylesExportOOO ); - WRITEINFO( XMLImpressContentExportOOO ); - WRITEINFO( XMLImpressMetaExportOOO ); - WRITEINFO( XMLImpressSettingsExportOOO ); - - // draw oasis import - WRITEINFO( XMLDrawImportOasis ); - WRITEINFO( XMLDrawStylesImportOasis ); - WRITEINFO( XMLDrawContentImportOasis ); - WRITEINFO( XMLDrawMetaImportOasis ); - WRITEINFO( XMLDrawSettingsImportOasis ); - - // draw oasis export - WRITEINFO( XMLDrawExportOasis ); - WRITEINFO( XMLDrawStylesExportOasis ); - WRITEINFO( XMLDrawContentExportOasis ); - WRITEINFO( XMLDrawMetaExportOasis ); - WRITEINFO( XMLDrawSettingsExportOasis ); - - // draw OOo export - WRITEINFO( XMLDrawExportOOO ); - WRITEINFO( XMLDrawStylesExportOOO ); - WRITEINFO( XMLDrawContentExportOOO ); - WRITEINFO( XMLDrawMetaExportOOO ); - WRITEINFO( XMLDrawSettingsExportOOO ); - - // drawing layer export - WRITEINFO( XMLDrawingLayerExport ); - - // impress xml clipboard export - WRITEINFO( XMLImpressClipboardExport ); - - // chart oasis import - WRITEINFO( SchXMLImport ); - WRITEINFO( SchXMLImport_Meta ); - WRITEINFO( SchXMLImport_Styles ); - WRITEINFO( SchXMLImport_Content ); - - // chart oasis export - WRITEINFO( SchXMLExport_Oasis ); - WRITEINFO( SchXMLExport_Oasis_Meta ); - WRITEINFO( SchXMLExport_Oasis_Styles ); - WRITEINFO( SchXMLExport_Oasis_Content ); - - // chart OOo export - WRITEINFO( SchXMLExport ); - WRITEINFO( SchXMLExport_Styles ); - WRITEINFO( SchXMLExport_Content ); - - // meta - WRITEINFO( XMLMetaImportComponent ); - WRITEINFO( XMLMetaExportComponent ); - - WRITEINFO( XMLVersionListPersistence ); - - // meta OOo - WRITEINFO( XMLMetaExportOOO ); - - // writer auto text events - WRITEINFO( XMLAutoTextEventExport ); - WRITEINFO( XMLAutoTextEventImport ); - WRITEINFO( XMLAutoTextEventExportOOO ); - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_True; -} - #define SINGLEFACTORY(classname)\ if( classname##_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) )\ {\ diff --git a/xmloff/source/transform/XMLFilterRegistration.cxx b/xmloff/source/transform/XMLFilterRegistration.cxx index e3bb398a6126..50e14db40e5d 100644 --- a/xmloff/source/transform/XMLFilterRegistration.cxx +++ b/xmloff/source/transform/XMLFilterRegistration.cxx @@ -146,39 +146,6 @@ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTyp *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) -{ - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xMasterKey( reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ) ); - - const ServiceDescriptor* pDescriptor = getServiceDescriptors(); - while ( pDescriptor->getImplementationName ) - { - ::rtl::OUString sNewKeyName( RTL_CONSTASCII_USTRINGPARAM("/") ); - sNewKeyName += pDescriptor->getImplementationName(); - sNewKeyName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ); - - uno::Reference< registry::XRegistryKey > xNewKey( xMasterKey->createKey( sNewKeyName ) ); - - uno::Sequence< ::rtl::OUString > aServices = pDescriptor->getSupportedServiceNames(); - const ::rtl::OUString* pServices = aServices.getConstArray(); - for( sal_Int32 i = 0; i < aServices.getLength(); ++i, ++pServices ) - xNewKey->createKey( *pServices); - - ++pDescriptor; - } - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "xof::component_writeInfo: InvalidRegistryException!" ); - } - } - return sal_True; -} - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { void * pRet = NULL; diff --git a/xmloff/source/transform/makefile.mk b/xmloff/source/transform/makefile.mk index bba8deb6db2b..031549fcb39b 100644 --- a/xmloff/source/transform/makefile.mk +++ b/xmloff/source/transform/makefile.mk @@ -93,3 +93,11 @@ DEF1NAME = $(SHL1TARGET) SLOFILES = $(SHL1OBJS) .INCLUDE: target.mk + +ALLTAR : $(MISC)/xof.component + +$(MISC)/xof.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xof.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xof.component diff --git a/xmloff/source/transform/xof.component b/xmloff/source/transform/xof.component new file mode 100644 index 000000000000..8f9c88f7fa0d --- /dev/null +++ b/xmloff/source/transform/xof.component @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmloff/util/makefile.mk b/xmloff/util/makefile.mk index b8745b6b8fff..857067985c50 100644 --- a/xmloff/util/makefile.mk +++ b/xmloff/util/makefile.mk @@ -86,3 +86,11 @@ DEF1DES =XML Office Lib # --- Targets ---------------------------------------------------------- .ENDIF .INCLUDE : target.mk + +ALLTAR : $(MISC)/xo.component + +$(MISC)/xo.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xo.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xo.component diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component new file mode 100644 index 000000000000..7fe2119636d1 --- /dev/null +++ b/xmloff/util/xo.component @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmlscript/prj/d.lst b/xmlscript/prj/d.lst index 51b2891e4926..2f1ff7e37785 100644 --- a/xmlscript/prj/d.lst +++ b/xmlscript/prj/d.lst @@ -11,3 +11,4 @@ mkdir: %_DEST%\inc%_EXT%\xmlscript ..\inc\xmlscript\xmlns.h %_DEST%\inc%_EXT%\xmlscript\xmlns.h ..\dtd\*.dtd %_DEST%\bin%_EXT%\*.dtd +..\%__SRC%\misc\xcr.component %_DEST%\xml%_EXT%\xcr.component diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx index b95665eef01e..0d4d8db169ac 100644 --- a/xmlscript/source/misc/unoservices.cxx +++ b/xmlscript/source/misc/unoservices.cxx @@ -115,15 +115,6 @@ extern "C" // ----------------------------------------------------------------------------- - sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) - { - return ::cppu::component_writeInfoHelper( - pServiceManager, pRegistryKey, ::xmlscript::s_entries ); - } - - // ----------------------------------------------------------------------------- - void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { diff --git a/xmlscript/util/makefile.mk b/xmlscript/util/makefile.mk index 3ccf63dc3b89..ba731470b2e4 100644 --- a/xmlscript/util/makefile.mk +++ b/xmlscript/util/makefile.mk @@ -74,3 +74,11 @@ $(MISC)$/$(SHL1TARGET).flt : makefile.mk xcr.flt @echo ------------------------------ @echo Making: $@ $(TYPE) xcr.flt > $@ + +ALLTAR : $(MISC)/xcr.component + +$(MISC)/xcr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + xcr.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt xcr.component diff --git a/xmlscript/util/xcr.component b/xmlscript/util/xcr.component new file mode 100644 index 000000000000..5ffe7f862fd7 --- /dev/null +++ b/xmlscript/util/xcr.component @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + -- cgit From 016ee63ec6a0998fc971aeb8095e811e13596e25 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 16:47:14 +0200 Subject: sb123: #i113189# brand-specific services.rdb --- desktop/prj/d.lst | 5 +++-- desktop/source/so_comp/makefile.mk | 7 +++++++ desktop/source/so_comp/socomp.component | 37 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 desktop/source/so_comp/socomp.component diff --git a/desktop/prj/d.lst b/desktop/prj/d.lst index e288e18c1f1c..b6e14a5ce722 100644 --- a/desktop/prj/d.lst +++ b/desktop/prj/d.lst @@ -143,10 +143,11 @@ mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar ..\%__SRC%\misc\registry\spool\org\openoffice\Office\Jobs\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Jobs -..\%__SRC%\misc\migrationoo3.component %_DEST%\xml%_EXT%\migrationoo3.component -..\%__SRC%\misc\productregistration.jar.component %_DEST%\xml%_EXT%\productregistration.jar.component ..\%__SRC%\misc\deployment.component %_DEST%\xml%_EXT%\deployment.component ..\%__SRC%\misc\deploymentgui.component %_DEST%\xml%_EXT%\deploymentgui.component ..\%__SRC%\misc\migrationoo2.component %_DEST%\xml%_EXT%\migrationoo2.component +..\%__SRC%\misc\migrationoo3.component %_DEST%\xml%_EXT%\migrationoo3.component ..\%__SRC%\misc\offacc.component %_DEST%\xml%_EXT%\offacc.component +..\%__SRC%\misc\productregistration.jar.component %_DEST%\xml%_EXT%\productregistration.jar.component +..\%__SRC%\misc\socomp.component %_DEST%\xml%_EXT%\socomp.component ..\%__SRC%\misc\spl.component %_DEST%\xml%_EXT%\spl.component diff --git a/desktop/source/so_comp/makefile.mk b/desktop/source/so_comp/makefile.mk index 590f99518c68..7f9ceb4b646a 100644 --- a/desktop/source/so_comp/makefile.mk +++ b/desktop/source/so_comp/makefile.mk @@ -75,3 +75,10 @@ SHL1STDLIBS= \ .INCLUDE : target.mk +ALLTAR : $(MISC)/socomp.component + +$(MISC)/socomp.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + socomp.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt socomp.component diff --git a/desktop/source/so_comp/socomp.component b/desktop/source/so_comp/socomp.component new file mode 100644 index 000000000000..a53035223c39 --- /dev/null +++ b/desktop/source/so_comp/socomp.component @@ -0,0 +1,37 @@ + + + + + + + + + + + -- cgit From 88d1caaeb9641347d695715f620e0178d314f5c6 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 10 Sep 2010 17:49:25 +0200 Subject: ooo330l10n3: #i113535# enable itemlist --- svx/source/items/svxitems.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/items/svxitems.src b/svx/source/items/svxitems.src index e21ea8fc6e4b..d80f871d8b3c 100644 --- a/svx/source/items/svxitems.src +++ b/svx/source/items/svxitems.src @@ -32,7 +32,7 @@ StringArray RID_ATTR_NAMES { - ItemList = + ItemList [ en-US ] = { < "Scale" ; SID_ATTR_ZOOM ; > ; < "Brush" ; SID_ATTR_BRUSH ; > ; -- cgit From 4a7e903d201016282d998960148d262aa1f31900 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 14 Sep 2010 15:14:56 +0200 Subject: sb129: #i113189# removed obviously unnecessary service registrations; allow empty --- ucb/source/ucp/expand/ucpexpand1.component | 1 - ucb/source/ucp/ext/ucpext.component | 1 - 2 files changed, 2 deletions(-) diff --git a/ucb/source/ucp/expand/ucpexpand1.component b/ucb/source/ucp/expand/ucpexpand1.component index 5997e9029811..c8a7e8e18c68 100644 --- a/ucb/source/ucp/expand/ucpexpand1.component +++ b/ucb/source/ucp/expand/ucpexpand1.component @@ -29,7 +29,6 @@ - diff --git a/ucb/source/ucp/ext/ucpext.component b/ucb/source/ucp/ext/ucpext.component index d673777a6707..2982529e539c 100644 --- a/ucb/source/ucp/ext/ucpext.component +++ b/ucb/source/ucp/ext/ucpext.component @@ -29,7 +29,6 @@ - -- cgit From b72a3cc8522b078022b5ae437807970a342fd10c Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 16 Sep 2010 11:00:47 +0200 Subject: sb129: #i113189# adjusted comments --- configmgr/source/components.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 918c80f0a2a6..64e57a5ddebe 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -656,7 +656,7 @@ void Components::parseModificationLayer() { "configmgr user registrymodifications.xcu does not (yet) exist"); // Migrate old user layer data (can be removed once migration is no // longer relevant; also see hack for xsi namespace in - // xmlreader::XmlReader constructor): + // xmlreader::XmlReader::registerNamespaceIri): parseFiles( Data::NO_LAYER, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".xcu")), &parseXcuFile, -- cgit From 9acf42572a7df150e8cdd0322fbd43e525570720 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 16 Sep 2010 14:23:50 +0200 Subject: fwk158: #i114541# generally ignore erroneous xcs/xcu files during startup (typically from extensions installed pre 3.3) --- configmgr/source/components.cxx | 45 ++++++++++++++++++++++++++++------------- configmgr/source/components.hxx | 5 +++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 33b0eca3f65f..cc5ea1e1e739 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -334,12 +334,14 @@ void Components::insertModificationXcuFile( Modifications * modifications) { OSL_ASSERT(modifications != 0); + Partial part(includedPaths, excludedPaths); try { - Partial part(includedPaths, excludedPaths); - parseXcuFile(fileUri, Data::NO_LAYER, data_, &part, modifications, 0); - } catch (css::uno::Exception & e) { //TODO: more specific exception catching + parseFileLeniently( + &parseXcuFile, fileUri, Data::NO_LAYER, data_, &part, modifications, + 0); + } catch (css::container::NoSuchElementException & e) { OSL_TRACE( - "configmgr error inserting %s: %s", + "configmgr error inserting non-existing %s: %s", rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } @@ -492,20 +494,32 @@ Components::Components( "com.sun.star.comp.deployment.configuration." "PackageRegistryBackend/configmgr.ini"))), true); + parseModificationLayer(); + RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing"); +} + +Components::~Components() {} + +void Components::parseFileLeniently( + FileParser * parseFile, rtl::OUString const & url, int layer, Data & data, + Partial const * partial, Modifications * modifications, + Additions * additions) +{ + OSL_ASSERT(parseFile != 0); try { - parseModificationLayer(); + (*parseFile)(url, layer, data, partial, modifications, additions); + } catch (css::container::NoSuchElementException &) { + throw; } catch (css::uno::Exception & e) { //TODO: more specific exception catching - // Silently ignore unreadable parts of a corrupted user modification - // layer, instead of completely preventing OOo from starting: + // Silently ignore invalid XML files, instead of completely preventing + // OOo from starting: OSL_TRACE( - "configmgr error reading user modification layer: %s", + "configmgr error reading %s: %s", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); } - RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing"); } -Components::~Components() {} - void Components::parseFiles( int layer, rtl::OUString const & extension, FileParser * parseFile, rtl::OUString const & url, bool recursive) @@ -557,7 +571,8 @@ void Components::parseFiles( file.match(extension, file.getLength() - extension.getLength())) { try { - (*parseFile)(stat.getFileURL(), layer, data_, 0, 0, 0); + parseFileLeniently( + parseFile, stat.getFileURL(), layer, data_, 0, 0, 0); } catch (css::container::NoSuchElementException & e) { throw css::uno::RuntimeException( (rtl::OUString( @@ -584,7 +599,7 @@ void Components::parseFileList( adds = data_.addExtensionXcuAdditions(url, layer); } try { - (*parseFile)(url, layer, data_, 0, 0, adds); + parseFileLeniently(parseFile, url, layer, data_, 0, 0, adds); } catch (css::container::NoSuchElementException & e) { OSL_TRACE( "configmgr file does not exist: %s", @@ -746,7 +761,9 @@ rtl::OUString Components::getModificationFileUrl() const { void Components::parseModificationLayer() { try { - parseXcuFile(getModificationFileUrl(), Data::NO_LAYER, data_, 0, 0, 0); + parseFileLeniently( + &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0, + 0, 0); } catch (css::container::NoSuchElementException &) { OSL_TRACE( "configmgr user registrymodifications.xcu does not (yet) exist"); diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 880ac95d34a8..4fc47f791821 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -123,6 +123,11 @@ private: ~Components(); + void parseFileLeniently( + FileParser * parseFile, rtl::OUString const & url, int layer, + Data & data, Partial const * partial, Modifications * modifications, + Additions * additions); + void parseFiles( int layer, rtl::OUString const & extension, FileParser * parseFile, rtl::OUString const & url, bool recursive); -- cgit From 7b97f00130fa4d5d47a2f03b95ae2173e0a053a5 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 20 Sep 2010 17:05:00 +0200 Subject: impress201: #i112587# add display properties to control shapes --- svx/source/unodraw/unoprov.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index ea875d8d9427..4be296d51219 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -644,8 +644,10 @@ SfxItemPropertyMapEntry* ImplGetSvxControlShapePropertyMap() // #i68101# { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , &::getCppuType((const ::rtl::OUString*)0), 0, 0}, { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , &::getCppuType((const ::rtl::OUString*)0), 0, 0}, + // #i112587# + { MAP_CHAR_LEN(UNO_NAME_MISC_OBJ_PRINTABLE), SDRATTR_OBJPRINTABLE , &::getBooleanCppuType(), 0, 0}, + { MAP_CHAR_LEN("Visible"), SDRATTR_OBJVISIBLE , &::getBooleanCppuType(), 0, 0}, {0,0,0,0,0,0} - }; return aControlPropertyMap_Impl; -- cgit From f0c8cd0ec5fbd30e2eea435872c4541fcfe3c9f3 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 21 Sep 2010 10:23:23 +0200 Subject: sb123: #i111449# relax expected exception type (some platforms apparently throw InteractiveNetworkConnectException instead of InteractiveNetworkResolveNameException here) --- ucb/qa/complex/ucb/UCB.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/qa/complex/ucb/UCB.java b/ucb/qa/complex/ucb/UCB.java index c027dd95bb37..445525927703 100755 --- a/ucb/qa/complex/ucb/UCB.java +++ b/ucb/qa/complex/ucb/UCB.java @@ -231,7 +231,7 @@ public class UCB { } catch (com.sun.star.lang.IllegalArgumentException ex) { //TODO error message; System.out.println("Correct exception thrown: " + ex.getClass().toString()); - } catch(com.sun.star.ucb.InteractiveNetworkResolveNameException ex) { + } catch(com.sun.star.ucb.InteractiveNetworkException ex) { System.out.println("This Exception is correctly thrown when no Proxy in StarOffice is used."); System.out.println("To reproduce the bug behaviour, use a Proxy and try again."); } catch (Exception ex) { -- cgit From b9e80bbea1647bdccde39dad5ee0c0d193db048b Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 21 Sep 2010 10:51:18 +0200 Subject: sb123: #i114642# disabled svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties for now --- svx/qa/unoapi/knownissues.xcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/svx/qa/unoapi/knownissues.xcl b/svx/qa/unoapi/knownissues.xcl index 89369160bb45..b26db6b7f99e 100644 --- a/svx/qa/unoapi/knownissues.xcl +++ b/svx/qa/unoapi/knownissues.xcl @@ -85,3 +85,6 @@ svx.AccessiblePresentationOLEShape::com::sun::star::accessibility::XAccessibleCo ### i111169 ### svx.AccessiblePageShape::com::sun::star::accessibility::XAccessibleComponent + +### i114642 ### +svx.SvxUnoTextContent::com::sun::star::style::CharacterProperties -- cgit From e2b245d76fb9daf98a955047a1ecd0895d3f0038 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 21 Sep 2010 11:45:26 +0200 Subject: sb123: #i111449# disabled framework/qa/complex/desktop again --- framework/prj/build.lst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/prj/build.lst b/framework/prj/build.lst index 153dea29af2c..cf994604699a 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -34,7 +34,9 @@ fr framework\qa\unoapi nmake - all fr_qa_unoapi NULL # BUG! opens an error box # fr framework\qa\complex\broken_document nmake - all fr_qa_complex_broken_doc NULL -fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL + +# failed: +# fr framework\qa\complex\desktop nmake - all fr_qa_complex_desktop NULL # fr framework\qa\complex\dispatches nmake - all fr_qa_complex_dispatches fr_qa_complex_dispatches_helper NULL # fr framework\qa\complex\disposing nmake - all fr_qa_complex_disposing NULL -- cgit From 95f896ad47d50f5b4792417795df3ef3dc9a10c9 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 23 Sep 2010 13:41:17 +0200 Subject: sb123: #i114211# disabled xmloff.Impress.XMLStylesImporter::com::sun::star::lang::XInitialization for now --- xmloff/qa/unoapi/knownissues.xcl | 1 + 1 file changed, 1 insertion(+) diff --git a/xmloff/qa/unoapi/knownissues.xcl b/xmloff/qa/unoapi/knownissues.xcl index a9fa072e8338..974280f032bd 100644 --- a/xmloff/qa/unoapi/knownissues.xcl +++ b/xmloff/qa/unoapi/knownissues.xcl @@ -22,3 +22,4 @@ xmloff.Impress.XMLMetaExporter::com::sun::star::document::XFilter ### i114211 ### xmloff.Draw.XMLStylesImporter::com::sun::star::lang::XInitialization +xmloff.Impress.XMLStylesImporter::com::sun::star::lang::XInitialization -- cgit From 7b1b11b49e449ba2f73b2117d8f7cc9117fcc4bb Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 24 Sep 2010 17:02:42 +0200 Subject: impress201: #114741# reducing memory footprint if mimimizing very huge documents -> no more graphics lost --- svx/source/unodraw/unoshap2.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 1f2d4fd3145b..1613f5d652e0 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1804,6 +1804,7 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const { case OWN_ATTR_VALUE_FILLBITMAP: { + sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut(); const Graphic& rGraphic = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphic(); if(rGraphic.GetType() != GRAPHIC_GDIMETAFILE) @@ -1822,6 +1823,8 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const aDestStrm.GetEndOfData()); rValue <<= aSeq; } + if ( bSwapped ) + static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut(); break; } @@ -1833,10 +1836,13 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const } else { + sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut(); const GraphicObject& rGrafObj = static_cast< SdrGrafObj*>( mpObj.get() )->GetGraphicObject(true); OUString aURL( RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_GRAPHOBJ_URLPREFIX)); aURL += OUString::createFromAscii( rGrafObj.GetUniqueID().GetBuffer() ); rValue <<= aURL; + if ( bSwapped ) + static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut(); } break; } @@ -1851,8 +1857,11 @@ bool SvxGraphicObject::getPropertyValueImpl( const ::rtl::OUString& rName, const case OWN_ATTR_VALUE_GRAPHIC: { + sal_Bool bSwapped = static_cast< SdrGrafObj* >( mpObj.get() )->IsSwappedOut(); Reference< graphic::XGraphic > xGraphic( static_cast< SdrGrafObj* >( mpObj.get() )->GetGraphic().GetXGraphic() ); rValue <<= xGraphic; + if ( bSwapped ) + static_cast< SdrGrafObj* >( mpObj.get() )->ForceSwapOut(); break; } -- cgit From e31fe5beb2debc2132cb31b9f15e2104f3b4a3ea Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 29 Sep 2010 12:24:07 +0200 Subject: sw33bf10: #i114793# missing rename crash_report.bin -> crashrep --- svx/source/dialog/sendreportunx.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/dialog/sendreportunx.cxx b/svx/source/dialog/sendreportunx.cxx index 47a75f668b2f..d59bc9bb1cba 100644 --- a/svx/source/dialog/sendreportunx.cxx +++ b/svx/source/dialog/sendreportunx.cxx @@ -243,7 +243,7 @@ namespace svx{ int ret = -1; rtl::OUString path1( RTL_CONSTASCII_USTRINGPARAM( - "$BRAND_BASE_DIR/program/crash_report.bin")); + "$BRAND_BASE_DIR/program/crashrep")); rtl::Bootstrap::expandMacros(path1); rtl::OString path2; if ((osl::FileBase::getSystemPathFromFileURL(path1, path1) == -- cgit From 4263bca190a3d67f350f6d888684e107aa4f2940 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Thu, 30 Sep 2010 17:04:23 +0200 Subject: CWS changehid: remove helpids duplicated from svtools --- sfx2/source/dialog/filedlghelper.cxx | 2 +- sfx2/source/inc/helpid.hrc | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index d5a9abe6b597..a166cf5da9b0 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -97,7 +97,7 @@ #include "filtergrouping.hxx" #include #include "filedlgimpl.hxx" - +#include #include //----------------------------------------------------------------------------- diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index c9054643fc11..e67291469f7d 100755 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -289,8 +289,6 @@ #define HID_MAILWIN_PRIO_BOX "SFX2_HID_MAILWIN_PRIO_BOX" #define HID_TABDLG_APPLY_BTN "SFX2_HID_TABDLG_APPLY_BTN" #define HID_TP_COMMONPRINTOPTIONS "SFX2_HID_TP_COMMONPRINTOPTIONS" -#define HID_FILEDLG_LINK_CB "SFX2_HID_FILEDLG_LINK_CB" -#define HID_FILEDLG_PREVIEW_CB "SFX2_HID_FILEDLG_PREVIEW_CB" #define HID_HELP_WINDOW "SFX2_HID_HELP_WINDOW" #define HID_HELP_LISTBOX "SFX2_HID_HELP_LISTBOX" #define HID_HELP_TABCONTROL "SFX2_HID_HELP_TABCONTROL" -- cgit From ebd778ca3f232102bf5fa248fcf85ce604ca7df3 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 2 Oct 2010 14:04:40 +0200 Subject: CWS changehid: make sure that toolbox buttons for child windows and the child windows themselves have different HIDs --- sfx2/source/dialog/dockwin.cxx | 4 ++-- svx/source/gallery2/gallery.src | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 499987f5ff3b..0864b0e18c2b 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -931,7 +931,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() ); if ( pSlot ) { - rtl::OString aCmd(".uno:"); + rtl::OString aCmd("SFXDOCKINGWINDOW_"); aCmd += pSlot->GetUnoName(); SetUniqueId( aCmd ); } @@ -985,7 +985,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, const SfxSlot* pSlot = pSlotPool->GetSlot( pCW->GetType() ); if ( pSlot ) { - rtl::OString aCmd(".uno:"); + rtl::OString aCmd("SFXDOCKINGWINDOW_"); aCmd += pSlot->GetUnoName(); SetUniqueId( aCmd ); } diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src index 81ab0f1ac6d9..39ee6e0e6b1b 100644 --- a/svx/source/gallery2/gallery.src +++ b/svx/source/gallery2/gallery.src @@ -35,7 +35,7 @@ DockingWindow RID_SVXDLG_GALLERYBROWSER { - HelpId = CMD_SID_GALLERY; + HelpId = "SVX_HID_GALLERY_BROWSER" ; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; -- cgit From a8a8e916ef7b626e3320a21ca5195ca66f0a704b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 2 Oct 2010 14:05:06 +0200 Subject: CWS changehid: replace hard coded numeric HID --- sfx2/source/appl/newhelp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 9289920b8e09..9235777e0d5a 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -3180,7 +3180,7 @@ void SfxHelpWindow_Impl::openDone(const ::rtl::OUString& sURL , xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("PreventHelpTips"), aBoolAny ); xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowGraphics"), aBoolAny ); xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("ShowTables"), aBoolAny ); - xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:68245") ) ); + xViewProps->setPropertyValue( DEFINE_CONST_OUSTRING("HelpURL"), makeAny( DEFINE_CONST_OUSTRING("HID:SFX2_HID_HELP_ONHELP") ) ); ::rtl::OUString sProperty( DEFINE_CONST_OUSTRING("IsExecuteHyperlinks") ); if ( xInfo->hasPropertyByName( sProperty ) ) xViewProps->setPropertyValue( sProperty, aBoolAny ); -- cgit From 09619742df11641c4f53b00f46ebe85496f1a316 Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 4 Oct 2010 13:59:08 +0200 Subject: sb133: #i114705# for performance reasons, call configmgr::writeModFile asynchronously --- configmgr/source/components.cxx | 81 +++++++++++++++++++++++++++++- configmgr/source/components.hxx | 8 +++ configmgr/source/configurationprovider.cxx | 16 +++++- 3 files changed, 103 insertions(+), 2 deletions(-) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index cc5ea1e1e739..d1ffa8629a5f 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -29,6 +29,7 @@ #include "sal/config.h" #include +#include #include #include "com/sun/star/beans/Optional.hpp" @@ -43,8 +44,11 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/uno/XInterface.hpp" +#include "osl/conditn.hxx" #include "osl/diagnose.h" #include "osl/file.hxx" +#include "osl/mutex.hxx" +#include "osl/thread.hxx" #include "rtl/bootstrap.hxx" #include "rtl/logfile.h" #include "rtl/ref.hxx" @@ -53,10 +57,12 @@ #include "rtl/ustring.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include "salhelper/simplereferenceobject.hxx" #include "additions.hxx" #include "components.hxx" #include "data.hxx" +#include "lock.hxx" #include "modifications.hxx" #include "node.hxx" #include "nodemap.hxx" @@ -148,6 +154,63 @@ static Components * singleton = 0; } +class Components::WriteThread: + public osl::Thread, public salhelper::SimpleReferenceObject +{ +public: + static void * operator new(std::size_t size) + { return Thread::operator new(size); } + + static void operator delete(void * pointer) + { Thread::operator delete(pointer); } + + WriteThread( + rtl::Reference< WriteThread > * reference, Components & components, + rtl::OUString const & url, Data const & data); + + void flush() { delay_.set(); } + +private: + virtual ~WriteThread() {} + + virtual void SAL_CALL run(); + + rtl::Reference< WriteThread > * reference_; + Components & components_; + rtl::OUString url_; + Data const & data_; + osl::Condition delay_; +}; + +Components::WriteThread::WriteThread( + rtl::Reference< WriteThread > * reference, Components & components, + rtl::OUString const & url, Data const & data): + reference_(reference), components_(components), url_(url), data_(data) +{ + OSL_ASSERT(reference != 0); +} + +void Components::WriteThread::run() { + TimeValue t = { 1, 0 }; // 1 sec + delay_.wait(&t); // must not throw; result_error is harmless and ignored + osl::MutexGuard g(lock); // must not throw + try { + try { + writeModFile(components_, url_, data_); + } catch (css::uno::RuntimeException & e) { + // Silently ignore write errors, instead of aborting: + OSL_TRACE( + "configmgr error writing modifications: %s", + rtl::OUStringToOString( + e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } + } catch (...) { + reference_->clear(); + throw; + } + reference_->clear(); +} + void Components::initSingleton( css::uno::Reference< css::uno::XComponentContext > const & context) { @@ -238,7 +301,23 @@ void Components::addModification(Path const & path) { } void Components::writeModifications() { - writeModFile(*this, getModificationFileUrl(), data_); + if (!writeThread_.is()) { + writeThread_ = new WriteThread( + &writeThread_, *this, getModificationFileUrl(), data_); + writeThread_->create(); + } +} + +void Components::flushModifications() { + rtl::Reference< WriteThread > thread; + { + osl::MutexGuard g(lock); + thread = writeThread_; + } + if (thread.is()) { + thread->flush(); + thread->join(); + } } void Components::insertExtensionXcsFile( diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx index 4fc47f791821..1c735efca6ba 100644 --- a/configmgr/source/components.hxx +++ b/configmgr/source/components.hxx @@ -94,6 +94,11 @@ public: void writeModifications(); + void flushModifications(); + // must be called with configmgr::lock unaquired; must be called before + // shutdown if writeModifications has ever been called (probably + // indirectly, via removeExtensionXcuFile) + void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri); void insertExtensionXcuFile( @@ -160,11 +165,14 @@ private: com::sun::star::beans::XPropertySet > > ExternalServices; + class WriteThread; + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > context_; Data data_; WeakRootSet roots_; ExternalServices externalServices_; + rtl::Reference< WriteThread > writeThread_; }; } diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index a89540a88158..688361a77354 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -114,6 +114,8 @@ public: private: virtual ~Service() {} + virtual void SAL_CALL disposing() { flushModifications(); } + virtual rtl::OUString SAL_CALL getImplementationName() throw (css::uno::RuntimeException) { return configuration_provider::getImplementationName(); } @@ -166,6 +168,8 @@ private: virtual css::lang::Locale SAL_CALL getLocale() throw (css::uno::RuntimeException); + void flushModifications() const; + css::uno::Reference< css::uno::XComponentContext > context_; rtl::OUString locale_; }; @@ -326,7 +330,7 @@ void Service::removeRefreshListener( } void Service::flush() throw (css::uno::RuntimeException) { - //TODO + flushModifications(); cppu::OInterfaceContainerHelper * cont = rBHelper.getContainer( cppu::UnoType< css::util::XFlushListener >::get()); if (cont != 0) { @@ -380,6 +384,16 @@ css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) { return loc; } +void Service::flushModifications() const { + Components * components; + { + osl::MutexGuard guard(lock); + Components::initSingleton(context_); + components = &Components::getSingleton(); + } + components->flushModifications(); +} + class Factory: public cppu::WeakImplHelper1< css::lang::XSingleComponentFactory >, private boost::noncopyable -- cgit From 520e99aea44c82be3d3bdb972276286f3c312124 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 4 Oct 2010 14:39:37 +0200 Subject: impress201: #i79978# do not report problems with view area --- xmloff/source/draw/sdxmlimp.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 76942cf817db..1290d545c6b3 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -915,10 +915,12 @@ void SdXMLImport::SetViewSettings(const com::sun::star::uno::SequencesetPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), uno::makeAny( aVisArea ) ); } - catch( com::sun::star::uno::Exception e ) + catch( com::sun::star::uno::Exception /*e*/ ) { +/* #i79978# since old documents may contain invalid view settings, this is nothing to worry the user about. uno::Sequence aSeq(0); SetError( XMLERROR_FLAG_WARNING | XMLERROR_API, aSeq, e.Message, NULL ); +*/ } } -- cgit From 6aebf2ff72b382fb55bf78883e9643530f9e0f4e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 4 Oct 2010 15:39:07 +0200 Subject: impress201: #i97198# do not export draw tables and table/cell styles for impress/draw if SvtSaveOptions older than ODFVER_012 --- xmloff/source/draw/sdxmlexp.cxx | 4 ++- xmloff/source/draw/shapeexport4.cxx | 50 +++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 862326495a70..2ad03f6576de 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2282,7 +2282,9 @@ void SdXMLExport::_ExportStyles(BOOL bUsed) // write draw:style-name for object graphic-styles GetShapeExport()->ExportGraphicDefaults(); - GetShapeExport()->GetShapeTableExport()->exportTableStyles(); + // do not export in ODF 1.1 or older + if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) + GetShapeExport()->GetShapeTableExport()->exportTableStyles(); // write presentation styles ImpWritePresentationStyles(); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 3f52fcd50084..238fdebefa55 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -1117,38 +1117,46 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape SvXMLElementExport aElement( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, sal_True ); - if( !bIsEmptyPresObj ) + // do not export in ODF 1.1 or older + if( mrExport.getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) { - uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY ); - if( xTemplate.is() ) + if( !bIsEmptyPresObj ) { - const OUString sTemplate( xTemplate->getName() ); - if( sTemplate.getLength() ) + uno::Reference< container::XNamed > xTemplate( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "TableTemplate" ) ) ), uno::UNO_QUERY ); + if( xTemplate.is() ) { - mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate ); - - for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ ) + const OUString sTemplate( xTemplate->getName() ); + if( sTemplate.getLength() ) { - try - { - sal_Bool bBool = sal_False; - const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); + mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_TEMPLATE_NAME, sTemplate ); - xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool; - if( bBool ) - mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE ); - } - catch( uno::Exception& ) + for( const XMLPropertyMapEntry* pEntry = &aXMLTableShapeAttributes[0]; pEntry->msApiName; pEntry++ ) { - DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!"); + try + { + sal_Bool bBool = sal_False; + const OUString sAPIPropertyName( OUString(pEntry->msApiName, pEntry->nApiNameLength, RTL_TEXTENCODING_ASCII_US ) ); + + xPropSet->getPropertyValue( sAPIPropertyName ) >>= bBool; + if( bBool ) + mrExport.AddAttribute(pEntry->mnNameSpace, pEntry->meXMLName, XML_TRUE ); + } + catch( uno::Exception& ) + { + DBG_ERROR("XMLShapeExport::ImpExportTableShape(), exception caught!"); + } } } } - } - uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue( msModel ), uno::UNO_QUERY_THROW ); - GetShapeTableExport()->exportTable( xRange ); + uno::Reference< table::XColumnRowRange > xRange( xPropSet->getPropertyValue( msModel ), uno::UNO_QUERY_THROW ); + GetShapeTableExport()->exportTable( xRange ); + } + } + + if( !bIsEmptyPresObj ) + { uno::Reference< graphic::XGraphic > xGraphic( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "ReplacementGraphic" ) ) ), uno::UNO_QUERY ); if( xGraphic.is() ) try { -- cgit From 2cdf3404665ee5e2293bf548251b07e5785141ba Mon Sep 17 00:00:00 2001 From: sb Date: Mon, 4 Oct 2010 16:02:38 +0200 Subject: sb133: #i114705# osl::Thread::onTerminated must not be called on deleted object --- configmgr/source/components.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index d1ffa8629a5f..d812e54498ac 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -175,6 +175,8 @@ private: virtual void SAL_CALL run(); + virtual void SAL_CALL onTerminated() { release(); } + rtl::Reference< WriteThread > * reference_; Components & components_; rtl::OUString url_; @@ -188,6 +190,7 @@ Components::WriteThread::WriteThread( reference_(reference), components_(components), url_(url), data_(data) { OSL_ASSERT(reference != 0); + acquire(); } void Components::WriteThread::run() { -- cgit From cac4b2315361bc5b7b95689e3c2bd1a596013cae Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 5 Oct 2010 16:38:28 +0200 Subject: CWS changehid: remove duplicated definitions of HIDs --- fpicker/source/office/iodlg.hrc | 20 +------------------- sfx2/source/inc/helpid.hrc | 21 --------------------- sfx2/util/hidother.src | 20 -------------------- 3 files changed, 1 insertion(+), 60 deletions(-) diff --git a/fpicker/source/office/iodlg.hrc b/fpicker/source/office/iodlg.hrc index 60374f226edf..b87082b56cbd 100644 --- a/fpicker/source/office/iodlg.hrc +++ b/fpicker/source/office/iodlg.hrc @@ -28,9 +28,8 @@ #ifndef _SVTOOLS_IODLGIMPL_HRC #define _SVTOOLS_IODLGIMPL_HRC -#ifndef _SVTOOLS_HRC #include "svtools/svtools.hrc" -#endif +#include "svtools/helpid.hrc" // ModalDialog DLG_SVT_EXPLORERFILE @@ -86,22 +85,5 @@ #define SID_SFX_START 5000 #define SID_OPENURL (SID_SFX_START + 596) -#define HID_FILEDLG_STANDARD "FPICKER_HID_FILEDLG_STANDARD" -#define HID_FILEDLG_MANAGER "FPICKER_HID_FILEDLG_MANAGER" -#define HID_FILEDLG_URL "FPICKER_HID_FILEDLG_URL" -#define HID_FILEDLG_USE_PASSWD "FPICKER_HID_FILEDLG_USE_PASSWD" -#define HID_FILEDLG_READ_ONLY "FPICKER_HID_FILEDLG_READ_ONLY" - -#define HID_FILEDLG_AUTOCOMPLETEBOX "FPICKER_HID_FILEDLG_AUTOCOMPLETEBOX" -#define HID_FILEDLG_SAVE_BTN "FPICKER_HID_FILEDLG_SAVE_BTN" -#define HID_FILEDLG_SAVE_FILENAME "FPICKER_HID_FILEDLG_SAVE_FILENAME" -#define HID_FILEDLG_SAVE_FILETYPE "FPICKER_HID_FILEDLG_SAVE_FILETYPE" -#define HID_FILEDLG_INSERT_BTN "FPICKER_HID_FILEDLG_INSERT_BTN" -#define HID_FILEDLG_PATH_BTN "FPICKER_HID_FILEDLG_PATH_BTN" -#define HID_FILEDLG_PATH_FILENAME "FPICKER_HID_FILEDLG_PATH_FILENAME" -#define HID_FILEDLG_FOLDER_BTN "FPICKER_HID_FILEDLG_FOLDER_BTN" -#define HID_FILEDLG_FOLDER_FILENAME "FPICKER_HID_FILEDLG_FOLDER_FILENAME" -#define HID_FILEDLG_SRCHFOLDER_BTN "FPICKER_HID_FILEDLG_SRCHFOLDER_BTN" - #endif diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc index e67291469f7d..ef5c168c36f0 100755 --- a/sfx2/source/inc/helpid.hrc +++ b/sfx2/source/inc/helpid.hrc @@ -53,12 +53,6 @@ #define HID_DOCINFORELOAD "SFX2_HID_DOCINFORELOAD" #define HID_NEWS_GROUPPAGE "SFX2_HID_NEWS_GROUPPAGE" #define HID_NEWS_SERVERPAGE "SFX2_HID_NEWS_SERVERPAGE" -#define HID_FILEDLG_STANDARD "SFX2_HID_FILEDLG_STANDARD" -#define HID_FILEDLG_MANAGER "SFX2_HID_FILEDLG_MANAGER" -#define HID_FILEDLG_URL "SFX2_HID_FILEDLG_URL" -#define HID_FILEDLG_FILE "SFX2_HID_FILEDLG_FILE" -#define HID_FILEDLG_USE_PASSWD "SFX2_HID_FILEDLG_USE_PASSWD" -#define HID_FILEDLG_READ_ONLY "SFX2_HID_FILEDLG_READ_ONLY" #define HID_EXPLORERCONTROL "SFX2_HID_EXPLORERCONTROL" #define HID_BROWSERCONTROL "SFX2_HID_BROWSERCONTROL" #define HID_CTL_ORGANIZER_LEFT "SFX2_HID_CTL_ORGANIZER_LEFT" @@ -234,26 +228,12 @@ #define HID_GROUPVIEW_SHOW_DOCS "SFX2_HID_GROUPVIEW_SHOW_DOCS" #define HID_EDIT_TEMPLATE "SFX2_HID_EDIT_TEMPLATE" #define HID_PDFOLDERS_GRAPHICS "SFX2_HID_PDFOLDERS_GRAPHICS" -#define HID_FILEDLG_AUTOCOMPLETEBOX "SFX2_HID_FILEDLG_AUTOCOMPLETEBOX" -#define HID_FILEDLG_SAVE_BTN "SFX2_HID_FILEDLG_SAVE_BTN" -#define HID_FILEDLG_SAVE_FILENAME "SFX2_HID_FILEDLG_SAVE_FILENAME" -#define HID_FILEDLG_SAVE_FILETYPE "SFX2_HID_FILEDLG_SAVE_FILETYPE" -#define HID_FILEDLG_INSERT_BTN "SFX2_HID_FILEDLG_INSERT_BTN" -#define HID_FILEDLG_PATH_BTN "SFX2_HID_FILEDLG_PATH_BTN" -#define HID_FILEDLG_PATH_FILENAME "SFX2_HID_FILEDLG_PATH_FILENAME" -#define HID_FILEDLG_FOLDER_BTN "SFX2_HID_FILEDLG_FOLDER_BTN" -#define HID_FILEDLG_FOLDER_FILENAME "SFX2_HID_FILEDLG_FOLDER_FILENAME" -#define HID_FILEDLG_SRCHFOLDER_BTN "SFX2_HID_FILEDLG_SRCHFOLDER_BTN" #define HID_PDFOLDERS_GROUPS "SFX2_HID_PDFOLDERS_GROUPS" #define HID_OPEN_CHOOSE_FILTER "SFX2_HID_OPEN_CHOOSE_FILTER" #define HID_PDFOLDERS_BOOKMARKS "SFX2_HID_PDFOLDERS_BOOKMARKS" #define HID_PDFOLDERS_FAVORITES_ADD "SFX2_HID_PDFOLDERS_FAVORITES_ADD" #define HID_PDFOLDERS_FAVORITES_REMOVE "SFX2_HID_PDFOLDERS_FAVORITES_REMOVE" #define HID_PDFOLDERS_HISTORY "SFX2_HID_PDFOLDERS_HISTORY" -#define HID_FILEDLG_EDIT_FAVORITES "SFX2_HID_FILEDLG_EDIT_FAVORITES" -#define HID_FILEDLG_NEW_FAVORITE "SFX2_HID_FILEDLG_NEW_FAVORITE" -#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX "SFX2_HID_FILEDLG_EDIT_FAVORITES_LISTBOX" -#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR "SFX2_HID_FILEDLG_EDIT_FAVORITES_HEADERBAR" #define HID_CNT_CB_FORCE_BODY_EXPORT "SFX2_HID_CNT_CB_FORCE_BODY_EXPORT" #define HID_CNT_PAGE_REPSTATE_CONTROL "SFX2_HID_CNT_PAGE_REPSTATE_CONTROL" #define HID_TASKSTATUSBAR "SFX2_HID_TASKSTATUSBAR" @@ -319,7 +299,6 @@ #define HID_HELP_TEXT_SELECTION_MODE "SFX2_HID_HELP_TEXT_SELECTION_MODE" #define HID_WARNING_SECURITY_HYPERLINK "SFX2_HID_WARNING_SECURITY_HYPERLINK" -#define HID_FILEDLG_EXPORTASPDF "SFX2_HID_FILEDLG_EXPORTASPDF" #define HID_USERDEFBMP_TOOLBOX "SFX2_HID_USERDEFBMP_TOOLBOX" #define HID_CONFIG_LOAD "SFX2_HID_CONFIG_LOAD" diff --git a/sfx2/util/hidother.src b/sfx2/util/hidother.src index ccce4820cf2f..72bd77c5c011 100644 --- a/sfx2/util/hidother.src +++ b/sfx2/util/hidother.src @@ -31,12 +31,6 @@ hidspecial HID_APP_WIN { HelpID = HID_APP_WIN; }; hidspecial HID_DESKTOP { HelpID = HID_DESKTOP; }; hidspecial HID_DOCINFO_FRAME { HelpID = HID_DOCINFO_FRAME; }; hidspecial HID_EXPLORER_FRAME { HelpID = HID_EXPLORER_FRAME; }; -hidspecial HID_FILEDLG_FILE { HelpID = HID_FILEDLG_FILE; }; -hidspecial HID_FILEDLG_MANAGER { HelpID = HID_FILEDLG_MANAGER; }; -hidspecial HID_FILEDLG_READ_ONLY { HelpID = HID_FILEDLG_READ_ONLY; }; -hidspecial HID_FILEDLG_STANDARD { HelpID = HID_FILEDLG_STANDARD; }; -hidspecial HID_FILEDLG_URL { HelpID = HID_FILEDLG_URL; }; -hidspecial HID_FILEDLG_USE_PASSWD { HelpID = HID_FILEDLG_USE_PASSWD; }; hidspecial HID_PREVIEW_FRAME { HelpID = HID_PREVIEW_FRAME; }; hidspecial HID_PRINT_OPTIONS { HelpID = HID_PRINT_OPTIONS; }; hidspecial HID_TEMPLATE_FILTER { HelpID = HID_TEMPLATE_FILTER; }; @@ -70,18 +64,6 @@ hidspecial HID_CNT_LB_DESCRIPTION { HelpID = HID_CNT_LB_DESCRIPTIO hidspecial HID_GROUPVIEW_CONTENT_BIG { HelpID = HID_GROUPVIEW_CONTENT_BIG; }; hidspecial HID_GROUPVIEW_CONTENT_SMALL { HelpID = HID_GROUPVIEW_CONTENT_SMALL; }; hidspecial HID_GROUPVIEW_CONTENT_TREE { HelpID = HID_GROUPVIEW_CONTENT_TREE; }; -hidspecial HID_FILEDLG_AUTOCOMPLETEBOX { HelpID = HID_FILEDLG_AUTOCOMPLETEBOX; }; -hidspecial HID_FILEDLG_SAVE_BTN { HelpID = HID_FILEDLG_SAVE_BTN; }; -hidspecial HID_FILEDLG_SAVE_FILENAME { HelpID = HID_FILEDLG_SAVE_FILENAME; }; -hidspecial HID_FILEDLG_SAVE_FILETYPE { HelpID = HID_FILEDLG_SAVE_FILETYPE; }; -hidspecial HID_FILEDLG_INSERT_BTN { HelpID = HID_FILEDLG_INSERT_BTN; }; -hidspecial HID_FILEDLG_PATH_BTN { HelpID = HID_FILEDLG_PATH_BTN; }; -hidspecial HID_FILEDLG_PATH_FILENAME { HelpID = HID_FILEDLG_PATH_FILENAME; }; -hidspecial HID_FILEDLG_FOLDER_BTN { HelpID = HID_FILEDLG_FOLDER_BTN; }; -hidspecial HID_FILEDLG_FOLDER_FILENAME { HelpID = HID_FILEDLG_FOLDER_FILENAME; }; -hidspecial HID_FILEDLG_SRCHFOLDER_BTN { HelpID = HID_FILEDLG_SRCHFOLDER_BTN; }; -hidspecial HID_FILEDLG_EDIT_FAVORITES_LISTBOX { HelpID = HID_FILEDLG_EDIT_FAVORITES_LISTBOX; }; -hidspecial HID_FILEDLG_EDIT_FAVORITES_HEADERBAR { HelpID = HID_FILEDLG_EDIT_FAVORITES_HEADERBAR; }; hidspecial HID_BROWSERCONTROL { HelpID = HID_BROWSERCONTROL; }; hidspecial HID_TASKSTATUSBAR { HelpID = HID_TASKSTATUSBAR; }; hidspecial HID_CNT_PAGE_HEADER_TABBAR { HelpID = HID_CNT_PAGE_HEADER_TABBAR; }; @@ -106,8 +88,6 @@ hidspecial HID_CNT_SENT_VIEW_SENT_ARTICLES { HelpID = HID_CNT_SENT_VIEW_SEN hidspecial HID_CNT_SENT_VIEW_UNSENT_ARTICLES { HelpID = HID_CNT_SENT_VIEW_UNSENT_ARTICLES; }; hidspecial HID_CNT_SENT_VIEW_MARKED_ARTICLES { HelpID = HID_CNT_SENT_VIEW_MARKED_ARTICLES; }; hidspecial HID_TABDLG_APPLY_BTN { HelpID = HID_TABDLG_APPLY_BTN; }; -hidspecial HID_FILEDLG_LINK_CB { HelpID = HID_FILEDLG_LINK_CB; }; -hidspecial HID_FILEDLG_PREVIEW_CB { HelpID = HID_FILEDLG_PREVIEW_CB; }; hidspecial HID_HELP_WINDOW { HelpID = HID_HELP_WINDOW; }; hidspecial HID_HELP_TOOLBOX { HelpID = HID_HELP_TOOLBOX; }; hidspecial HID_HELP_TOOLBOXITEM_INDEX { HelpID = HID_HELP_TOOLBOXITEM_INDEX; }; -- cgit From b7a4a131ef8efa92d1aca33c1290e6a9218a3bf8 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 6 Oct 2010 09:24:31 +0200 Subject: sb133: #i114705# flush configmgr on every soffice exit path --- desktop/inc/app.hxx | 1 + desktop/source/app/app.cxx | 32 ++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index fa7550812bbe..8eb4dd3cc25b 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -155,6 +155,7 @@ class Desktop : public Application sal_Bool InitializeInstallation( const rtl::OUString& rAppFilename ); sal_Bool InitializeConfiguration(); + void FlushConfiguration(); sal_Bool InitializeQuickstartMode( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr ); void HandleBootstrapPathErrors( ::utl::Bootstrap::Status, const ::rtl::OUString& aMsg ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index f5d6979bc4b1..e77c1dcf48ac 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -754,6 +754,7 @@ void Desktop::DeInit() // instead of removing of the configManager just let it commit all the changes RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); utl::ConfigManager::GetConfigManager()->StoreConfigItems(); + FlushConfiguration(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); // close splashscreen if it's still open @@ -784,6 +785,7 @@ BOOL Desktop::QueryExit() { RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); utl::ConfigManager::GetConfigManager()->StoreConfigItems(); + FlushConfiguration(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); } catch ( RuntimeException& ) @@ -1436,18 +1438,7 @@ USHORT Desktop::Exception(USHORT nError) if ( bAllowRecoveryAndSessionManagement ) bRestart = SaveTasks(); - // because there is no method to flush the condiguration data, we must dispose the ConfigManager - Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY ); - if (xCFGFlush.is()) - { - xCFGFlush->flush(); - } - else - { - Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY ); - if (xCFGDispose.is()) - xCFGDispose->dispose(); - } + FlushConfiguration(); switch( nError & EXC_MAJORTYPE ) { @@ -1976,6 +1967,7 @@ void Desktop::Main() // remove temp directory RemoveTemporaryDirectory(); + FlushConfiguration(); // The acceptors in the AcceptorMap must be released (in DeregisterServices) // with the solar mutex unlocked, to avoid deadlock: nAcquireCount = Application::ReleaseSolarMutex(); @@ -2073,6 +2065,22 @@ sal_Bool Desktop::InitializeConfiguration() return bOk; } +void Desktop::FlushConfiguration() +{ + Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY ); + if (xCFGFlush.is()) + { + xCFGFlush->flush(); + } + else + { + // because there is no method to flush the condiguration data, we must dispose the ConfigManager + Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager()->GetConfigurationProvider(), UNO_QUERY ); + if (xCFGDispose.is()) + xCFGDispose->dispose(); + } +} + sal_Bool Desktop::InitializeQuickstartMode( Reference< XMultiServiceFactory >& rSMgr ) { try -- cgit From 8c1f6c9b46671bc9d3a7dc16d1343cd12a9d0411 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 7 Oct 2010 17:20:55 +0200 Subject: jl161 #i114933# solve deadlock problem when adding an extension --- .../deployment/manager/dp_commandenvironments.cxx | 38 ++ .../deployment/manager/dp_commandenvironments.hxx | 23 ++ .../deployment/manager/dp_extensionmanager.cxx | 409 ++++++++++++++------- .../deployment/manager/dp_extensionmanager.hxx | 20 + 4 files changed, 358 insertions(+), 132 deletions(-) diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx index c2801ba1d965..0de1f9e96e91 100644 --- a/desktop/source/deployment/manager/dp_commandenvironments.cxx +++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx @@ -31,6 +31,8 @@ #include "com/sun/star/deployment/VersionException.hpp" #include "com/sun/star/deployment/LicenseException.hpp" #include "com/sun/star/deployment/InstallException.hpp" +#include "com/sun/star/deployment/DependencyException.hpp" +#include "com/sun/star/deployment/PlatformException.hpp" #include "com/sun/star/task/XInteractionApprove.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionHandler.hpp" @@ -250,7 +252,43 @@ void NoLicenseCommandEnv::handle( handle_(approve, abort, xRequest); } +// SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv( +// css::uno::Reference< css::task::XInteractionHandler> const & handler): +// BaseCommandEnv(handler) +// { +// } +SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv() +{ +} + +void SilentCheckPrerequisitesCommandEnv::handle( + Reference< task::XInteractionRequest> const & xRequest ) + throw (uno::RuntimeException) +{ + uno::Any request( xRequest->getRequest() ); + OSL_ASSERT( request.getValueTypeClass() == uno::TypeClass_EXCEPTION ); + deployment::LicenseException licExc; + deployment::PlatformException platformExc; + deployment::DependencyException depExc; + bool approve = false; + bool abort = false; + + if (request >>= licExc) + { + approve = true; + handle_(approve, abort, xRequest); + } + else if ((request >>= platformExc) + || (request >>= depExc)) + { + m_Exception = request; + } + else + { + m_UnknownException = request; + } +} // NoExceptionCommandEnv::NoExceptionCommandEnv( // css::uno::Reference< css::task::XInteractionHandler> const & handler, // css::uno::Type const & type): diff --git a/desktop/source/deployment/manager/dp_commandenvironments.hxx b/desktop/source/deployment/manager/dp_commandenvironments.hxx index aa21f8281c72..bea11586d462 100644 --- a/desktop/source/deployment/manager/dp_commandenvironments.hxx +++ b/desktop/source/deployment/manager/dp_commandenvironments.hxx @@ -135,6 +135,29 @@ public: }; +/* For use in XExtensionManager::addExtension in the call to + XPackage::checkPrerequisites + It prevents all user interactions. The license is always accepted. + It remembers if there was a platform or a dependency exception in + the member m_bException. if there was any other exception then m_bUnknownException + is set. + + */ +class SilentCheckPrerequisitesCommandEnv : public BaseCommandEnv +{ +public: + SilentCheckPrerequisitesCommandEnv(); + // XInteractionHandler + virtual void SAL_CALL handle( + css::uno::Reference const & xRequest ) + throw (css::uno::RuntimeException); + + // Set to true if a PlatformException or a DependencyException were handled. + css::uno::Any m_Exception; + // Set to true if an unknown exception was handled. + css::uno::Any m_UnknownException; +}; + // class NoExceptionCommandEnv : public BaseCommandEnv // { // css::uno::Type m_type; diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index c82973f1b680..23fb36ed6a43 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -139,6 +139,37 @@ void writeLastModified(OUString & url, Reference const OUSTR("Failed to update") + url, 0, exc); } } + +class ExtensionRemoveGuard +{ + css::uno::Reference m_extension; + css::uno::Reference m_xPackageManager; + +public: + ExtensionRemoveGuard( + css::uno::Reference const & extension, + css::uno::Reference const & xPackageManager): + m_extension(extension), m_xPackageManager(xPackageManager) {} + ~ExtensionRemoveGuard(); + + void reset(css::uno::Reference const & extension) { + m_extension = extension; + } +}; + +ExtensionRemoveGuard::~ExtensionRemoveGuard() +{ + try { + if (m_xPackageManager.is() && m_extension.is()) + m_xPackageManager->removePackage( + dp_misc::getIdentifier(m_extension), ::rtl::OUString(), + css::uno::Reference(), + css::uno::Reference()); + } catch (...) { + OSL_ASSERT(0); + } +} + } //end namespace namespace dp_manager { @@ -501,6 +532,103 @@ ExtensionManager::getSupportedPackageTypes() return m_userRepository->getSupportedPackageTypes(); } +bool ExtensionManager::doChecksForAddExtension( + Reference const & xPackageMgr, + uno::Sequence const & properties, + css::uno::Reference const & xTmpExtension, + Reference const & xAbortChannel, + Reference const & xCmdEnv, + Reference & out_existingExtension ) + throw (deploy::DeploymentException, + ucb::CommandFailedException, + ucb::CommandAbortedException, + lang::IllegalArgumentException, + uno::RuntimeException) +{ + try + { + Reference xOldExtension; + const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension); + const OUString sFileName = xTmpExtension->getName(); + const OUString sDisplayName = xTmpExtension->getDisplayName(); + const OUString sVersion = xTmpExtension->getVersion(); + + try + { + xOldExtension = xPackageMgr->getDeployedPackage( + sIdentifier, sFileName, xCmdEnv); + out_existingExtension = xOldExtension; + } + catch (lang::IllegalArgumentException &) + { + } + bool bCanInstall = false; + + //This part is not guarded against other threads removing, adding, disabling ... + //etc. the same extension. + //checkInstall is safe because it notifies the user if the extension is not yet + //installed in the same repository. Because addExtension has its own guard + //(m_addMutex), another thread cannot add the extension in the meantime. + //checkUpdate is called if the same extension exists in the same + //repository. The user is asked if they want to replace it. Another + //thread + //could already remove the extension. So asking the user was not + //necessary. No harm is done. The other thread may also ask the user + //if he wants to remove the extension. This depends on the + //XCommandEnvironment which it passes to removeExtension. + if (xOldExtension.is()) + { + //throws a CommandFailedException if the user cancels + //the action. + checkUpdate(sVersion, sDisplayName,xOldExtension, xCmdEnv); + } + else + { + //throws a CommandFailedException if the user cancels + //the action. + checkInstall(sDisplayName, xCmdEnv); + } + //Prevent showing the license if requested. + Reference _xCmdEnv(xCmdEnv); + ExtensionProperties props(OUString(), properties, Reference()); + + dp_misc::DescriptionInfoset info(dp_misc::getDescriptionInfoset(xTmpExtension->getURL())); + const ::boost::optional licenseAttributes = + info.getSimpleLicenseAttributes(); + + if (licenseAttributes && licenseAttributes->suppressIfRequired + && props.isSuppressedLicense()) + _xCmdEnv = Reference( + new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler())); + + bCanInstall = xTmpExtension->checkPrerequisites( + xAbortChannel, _xCmdEnv, xOldExtension.is() || props.isExtensionUpdate()) == 0 ? true : false; + + return bCanInstall; + } + catch (deploy::DeploymentException& ) { + throw; + } catch (ucb::CommandFailedException & ) { + throw; + } catch (ucb::CommandAbortedException & ) { + throw; + } catch (lang::IllegalArgumentException &) { + throw; + } catch (uno::RuntimeException &) { + throw; + } catch (uno::Exception &) { + uno::Any excOccurred = ::cppu::getCaughtException(); + deploy::DeploymentException exc( + OUSTR("Extension Manager: exception in doChecksForAddExtension"), + static_cast(this), excOccurred); + throw exc; + } catch (...) { + throw uno::RuntimeException( + OUSTR("Extension Manager: unexpected exception in doChecksForAddExtension"), + static_cast(this)); + } +} + // Only add to shared and user repository Reference ExtensionManager::addExtension( OUString const & url, uno::Sequence const & properties, @@ -524,165 +652,182 @@ Reference ExtensionManager::addExtension( throw lang::IllegalArgumentException( OUSTR("No valid repository name provided."), static_cast(this), 0); - ::osl::MutexGuard guard(getMutex()); + //We must make sure that the xTmpExtension is not create twice, because this + //would remove the first one. + ::osl::MutexGuard addGuard(m_addMutex); + Reference xTmpExtension = getTempExtension(url, xAbortChannel, xCmdEnv); + //Make sure the extension is removed from the tmp repository in case + //of an exception + ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, m_tmpRepository); const OUString sIdentifier = dp_misc::getIdentifier(xTmpExtension); const OUString sFileName = xTmpExtension->getName(); - const OUString sDisplayName = xTmpExtension->getDisplayName(); - const OUString sVersion = xTmpExtension->getVersion(); - dp_misc::DescriptionInfoset info(dp_misc::getDescriptionInfoset(xTmpExtension->getURL())); - const ::boost::optional licenseAttributes = - info.getSimpleLicenseAttributes(); Reference xOldExtension; Reference xExtensionBackup; - uno::Any excOccurred1; uno::Any excOccurred2; bool bUserDisabled = false; - try + bool bCanInstall = doChecksForAddExtension( + xPackageManager, + properties, + xTmpExtension, + xAbortChannel, + xCmdEnv, + xOldExtension ); + { - bUserDisabled = isUserDisabled(sIdentifier, sFileName); - try - { - xOldExtension = xPackageManager->getDeployedPackage( - sIdentifier, sFileName, xCmdEnv); - } - catch (lang::IllegalArgumentException &) - { - } - bool bCanInstall = false; - try + // In this garded section (getMutex) we must not use the argument xCmdEnv + // because it may bring up dialogs (XInteractionHandler::handle) this + //may potententially deadlock. See issue + //http://qa.openoffice.org/issues/show_bug.cgi?id=114933 + //By not providing xCmdEnv the underlying APIs will throw an exception if + //the XInteractionRequest cannot be handled + ::osl::MutexGuard guard(getMutex()); + + if (bCanInstall) { - if (xOldExtension.is()) + try { - //throws a CommandFailedException if the user cancels - //the action. - checkUpdate(sVersion, sDisplayName,xOldExtension, xCmdEnv); + bUserDisabled = isUserDisabled(sIdentifier, sFileName); + if (xOldExtension.is()) + { + try + { + xOldExtension->revokePackage( + xAbortChannel, Reference()); + //save the old user extension in case the user aborts + //store the extension in the tmp repository, this will overwrite + //xTmpPackage (same identifier). Do not let the user abort or + //interact + //importing the old extension in the tmp repository will remove + //the xTmpExtension + //no command environment supplied, only this class shall interact + //with the user! + xExtensionBackup = m_tmpRepository->importExtension( + xOldExtension, Reference(), + Reference()); + tmpExtensionRemoveGuard.reset(xExtensionBackup); + xTmpExtension = xExtensionBackup; + OSL_ASSERT(xTmpExtension.is()); + } + catch (lang::DisposedException &) + { + //Another thread might have removed the extension meanwhile + } + } + //check again dependencies but prevent user interaction, + //We can disregard the license, because the user must have already + //accepted it, whe we called checkPrerequisites the first time + SilentCheckPrerequisitesCommandEnv * pSilentCommandEnv = + new SilentCheckPrerequisitesCommandEnv(); + Reference silentCommandEnv(pSilentCommandEnv); + + sal_Int32 failedPrereq = xTmpExtension->checkPrerequisites( + xAbortChannel, silentCommandEnv, true); + if (failedPrereq == 0) + { + xNewExtension = xPackageManager->addPackage( + url, properties, OUString(), xAbortChannel, + Reference()); + //If we add a user extension and there is already one which was + //disabled by a user, then the newly installed one is enabled. If we + //add to another repository then the user extension remains + //disabled. + bool bUserDisabled2 = bUserDisabled; + if (repository.equals(OUSTR("user"))) + bUserDisabled2 = false; + + activateExtension( + dp_misc::getIdentifier(xNewExtension), + xNewExtension->getName(), bUserDisabled2, false, xAbortChannel, + Reference()); + } + else + { + if (pSilentCommandEnv->m_Exception.hasValue()) + ::cppu::throwException(pSilentCommandEnv->m_Exception); + else if ( pSilentCommandEnv->m_UnknownException.hasValue()) + ::cppu::throwException(pSilentCommandEnv->m_UnknownException); + else + throw deploy::DeploymentException ( + OUSTR("Extension Manager: exception during addExtension, ckeckPrerequisites failed"), + static_cast(this), uno::Any()); + } } - else - { - //throws a CommandFailedException if the user cancels - //the action. - checkInstall(sDisplayName, xCmdEnv); + catch (deploy::DeploymentException& ) { + excOccurred2 = ::cppu::getCaughtException(); + } catch (ucb::CommandFailedException & ) { + excOccurred2 = ::cppu::getCaughtException(); + } catch (ucb::CommandAbortedException & ) { + excOccurred2 = ::cppu::getCaughtException(); + } catch (lang::IllegalArgumentException &) { + excOccurred2 = ::cppu::getCaughtException(); + } catch (uno::RuntimeException &) { + excOccurred2 = ::cppu::getCaughtException(); + } catch (...) { + excOccurred2 = ::cppu::getCaughtException(); + deploy::DeploymentException exc( + OUSTR("Extension Manager: exception during addExtension, url: ") + + url, static_cast(this), excOccurred2); + excOccurred2 <<= exc; } - //Prevent showing the license if requested. - Reference _xCmdEnv(xCmdEnv); - ExtensionProperties props(OUString(), properties, Reference()); - if (licenseAttributes && licenseAttributes->suppressIfRequired - && props.isSuppressedLicense()) - _xCmdEnv = Reference( - new NoLicenseCommandEnv(xCmdEnv->getInteractionHandler())); - - bCanInstall = xTmpExtension->checkPrerequisites( - xAbortChannel, _xCmdEnv, xOldExtension.is() || props.isExtensionUpdate()) == 0 ? true : false; - } - catch (deploy::DeploymentException& ) { - excOccurred1 = ::cppu::getCaughtException(); - } catch (ucb::CommandFailedException & ) { - excOccurred1 = ::cppu::getCaughtException(); - } catch (ucb::CommandAbortedException & ) { - excOccurred1 = ::cppu::getCaughtException(); - } catch (lang::IllegalArgumentException &) { - excOccurred1 = ::cppu::getCaughtException(); - } catch (uno::RuntimeException &) { - excOccurred1 = ::cppu::getCaughtException(); - } catch (...) { - excOccurred1 = ::cppu::getCaughtException(); - deploy::DeploymentException exc( - OUSTR("Extension Manager: exception during addExtension, url: ") - + url, static_cast(this), excOccurred1); - excOccurred1 <<= exc; } - if (bCanInstall) + if (excOccurred2.hasValue()) { - if (xOldExtension.is()) + //It does not matter what exception is thrown. We try to + //recover the original status. + //If the user aborted installation then a ucb::CommandAbortedException + //is thrown. + //Use a private AbortChannel so the user cannot interrupt. + try { - xOldExtension->revokePackage(xAbortChannel, xCmdEnv); - //save the old user extension in case the user aborts - //store the extension in the tmp repository, this will overwrite - //xTmpPackage (same identifier). Do not let the user abort or - //interact Reference tmpCmdEnv( - new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler())); - //importing the old extension in the tmp repository will remove - //the xTmpExtension - xTmpExtension = 0; - xExtensionBackup = m_tmpRepository->importExtension( - xOldExtension, Reference(), - tmpCmdEnv); + new TmpRepositoryCommandEnv()); + if (xExtensionBackup.is()) + { + Reference xRestored = + xPackageManager->importExtension( + xExtensionBackup, Reference(), + tmpCmdEnv); + } + activateExtension( + sIdentifier, sFileName, bUserDisabled, false, + Reference(), tmpCmdEnv); } - xNewExtension = xPackageManager->addPackage( - url, properties, OUString(), xAbortChannel, xCmdEnv); - //If we add a user extension and there is already one which was - //disabled by a user, then the newly installed one is enabled. If we - //add to another repository then the user extension remains - //disabled. - bool bUserDisabled2 = bUserDisabled; - if (repository.equals(OUSTR("user"))) - bUserDisabled2 = false; - activateExtension( - dp_misc::getIdentifier(xNewExtension), - xNewExtension->getName(), bUserDisabled2, false, xAbortChannel, xCmdEnv); - fireModified(); + catch (...) + { + } + ::cppu::throwException(excOccurred2); } - } - catch (deploy::DeploymentException& ) { - excOccurred2 = ::cppu::getCaughtException(); + } // leaving the garded section (getMutex()) + + try + { + fireModified(); + + }catch (deploy::DeploymentException& ) { + throw; } catch (ucb::CommandFailedException & ) { - excOccurred2 = ::cppu::getCaughtException(); + throw; } catch (ucb::CommandAbortedException & ) { - excOccurred2 = ::cppu::getCaughtException(); + throw; } catch (lang::IllegalArgumentException &) { - excOccurred2 = ::cppu::getCaughtException(); + throw; } catch (uno::RuntimeException &) { - excOccurred2 = ::cppu::getCaughtException(); - } catch (...) { - excOccurred2 = ::cppu::getCaughtException(); + throw; + } catch (uno::Exception &) { + uno::Any excOccurred = ::cppu::getCaughtException(); deploy::DeploymentException exc( - OUSTR("Extension Manager: exception during addExtension, url: ") - + url, static_cast(this), excOccurred2); - excOccurred2 <<= exc; - } - - if (excOccurred2.hasValue()) - { - //It does not matter what exception is thrown. We try to - //recover the original status. - //If the user aborted installation then a ucb::CommandAbortedException - //is thrown. - //Use a private AbortChannel so the user cannot interrupt. - try - { - Reference tmpCmdEnv( - new TmpRepositoryCommandEnv(xCmdEnv->getInteractionHandler())); - if (xExtensionBackup.is()) - { - Reference xRestored = - xPackageManager->importExtension( - xExtensionBackup, Reference(), - tmpCmdEnv); - } - activateExtension( - sIdentifier, sFileName, bUserDisabled, false, - Reference(), tmpCmdEnv); - if (xTmpExtension.is() || xExtensionBackup.is()) - m_tmpRepository->removePackage( - sIdentifier, OUString(), xAbortChannel, xCmdEnv); - fireModified(); - } - catch (...) - { - } - ::cppu::throwException(excOccurred2); + OUSTR("Extension Manager: exception in doChecksForAddExtension"), + static_cast(this), excOccurred); + throw exc; + } catch (...) { + throw uno::RuntimeException( + OUSTR("Extension Manager: unexpected exception in doChecksForAddExtension"), + static_cast(this)); } - if (xTmpExtension.is() || xExtensionBackup.is()) - m_tmpRepository->removePackage( - sIdentifier,OUString(), xAbortChannel, xCmdEnv); - - if (excOccurred1.hasValue()) - ::cppu::throwException(excOccurred1); return xNewExtension; } diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index 64cada7da3ac..d0cb4bb8339f 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -235,6 +235,8 @@ private: css::uno::Reference m_bundledRepository; css::uno::Reference m_tmpRepository; + //only to be used within addExtension + ::osl::Mutex m_addMutex; /* contains the names of all repositories (except tmp) in order of there priority. That is, the first element is "user" follod by "shared" and then "bundled" @@ -296,6 +298,24 @@ private: css::uno::Reference getPackageManager(::rtl::OUString const & repository) throw (css::lang::IllegalArgumentException); + + //Do some necessary checks and user interaction. This function does not + //aquire the extension manager mutex. + //Returns true if the extension can be installed. + bool doChecksForAddExtension( + css::uno::Reference const & xPackageMgr, + css::uno::Sequence const & properties, + css::uno::Reference const & xTmpExtension, + css::uno::Reference const & xAbortChannel, + css::uno::Reference const & xCmdEnv, + css::uno::Reference & out_existingExtension ) + throw (css::deployment::DeploymentException, + css::ucb::CommandFailedException, + css::ucb::CommandAbortedException, + css::lang::IllegalArgumentException, + css::uno::RuntimeException); + + }; } -- cgit From 2f3358d7e0957236319942c6d539a99234698c57 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Fri, 8 Oct 2010 08:44:14 +0200 Subject: jl161 #i114933# solve deadlock problem when adding an extension --- desktop/source/deployment/manager/dp_extensionmanager.cxx | 15 ++++++++++----- desktop/source/deployment/manager/dp_extensionmanager.hxx | 3 --- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index 23fb36ed6a43..709cca86c631 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -531,7 +531,11 @@ ExtensionManager::getSupportedPackageTypes() { return m_userRepository->getSupportedPackageTypes(); } - +//Do some necessary checks and user interaction. This function does not +//aquire the extension manager mutex and that mutex must not be aquired +//when this function is called. doChecksForAddExtension does synchronous +//user interactions which may require aquiring the solar mutex. +//Returns true if the extension can be installed. bool ExtensionManager::doChecksForAddExtension( Reference const & xPackageMgr, uno::Sequence const & properties, @@ -708,6 +712,9 @@ Reference ExtensionManager::addExtension( xOldExtension, Reference(), Reference()); tmpExtensionRemoveGuard.reset(xExtensionBackup); + //xTmpExtension will later be used to check the dependencies + //again. However, only xExtensionBackup will be later removed + //from the tmp repository xTmpExtension = xExtensionBackup; OSL_ASSERT(xTmpExtension.is()); } @@ -783,18 +790,16 @@ Reference ExtensionManager::addExtension( //Use a private AbortChannel so the user cannot interrupt. try { - Reference tmpCmdEnv( - new TmpRepositoryCommandEnv()); if (xExtensionBackup.is()) { Reference xRestored = xPackageManager->importExtension( xExtensionBackup, Reference(), - tmpCmdEnv); + Reference()); } activateExtension( sIdentifier, sFileName, bUserDisabled, false, - Reference(), tmpCmdEnv); + Reference(), Reference()); } catch (...) { diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index d0cb4bb8339f..683f45a1bd6e 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -299,9 +299,6 @@ private: getPackageManager(::rtl::OUString const & repository) throw (css::lang::IllegalArgumentException); - //Do some necessary checks and user interaction. This function does not - //aquire the extension manager mutex. - //Returns true if the extension can be installed. bool doChecksForAddExtension( css::uno::Reference const & xPackageMgr, css::uno::Sequence const & properties, -- cgit From a8bc280fabb91e1a7282e451feadec79c66d5790 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 11 Oct 2010 17:56:12 +0200 Subject: CWS changehid: generate former auto hids into src files --- basic/source/app/basic.src | 64 ++++++++++++++++++++ desktop/source/app/desktop.src | 1 + .../deployment/gui/dp_gui_dependencydialog.src | 2 + desktop/source/deployment/gui/dp_gui_dialog.src | 3 + desktop/source/deployment/gui/dp_gui_dialog2.src | 4 ++ .../source/deployment/gui/dp_gui_updatedialog.src | 3 + .../deployment/gui/dp_gui_updateinstalldialog.src | 1 + desktop/source/migration/wizard.src | 11 ++++ formula/source/ui/dlg/formdlgs.src | 12 ++++ formula/source/ui/dlg/parawin.src | 17 ++++-- fpicker/source/office/iodlg.src | 15 +++++ framework/source/classes/resource.src | 4 ++ sfx2/source/appl/dde.src | 4 ++ sfx2/source/appl/newhelp.src | 12 ++++ sfx2/source/dialog/alienwarn.src | 1 + sfx2/source/dialog/dinfdlg.src | 41 +++++++++++++ sfx2/source/dialog/dinfedt.src | 4 ++ sfx2/source/dialog/mgetempl.src | 6 ++ sfx2/source/dialog/newstyle.src | 1 + sfx2/source/dialog/passwd.src | 3 + sfx2/source/dialog/printopt.src | 22 +++++++ sfx2/source/dialog/recfloat.src | 1 + sfx2/source/dialog/srchdlg.src | 6 ++ sfx2/source/dialog/templdlg.src | 6 ++ sfx2/source/dialog/versdlg.src | 10 ++++ sfx2/source/doc/doctdlg.src | 5 ++ sfx2/source/doc/docvor.src | 5 ++ sfx2/source/doc/new.src | 14 +++++ svx/source/dialog/bmpmask.src | 15 +++++ svx/source/dialog/contdlg.src | 2 + svx/source/dialog/docrecovery.src | 19 ++++++ svx/source/dialog/fontwork.src | 5 ++ svx/source/dialog/hdft.src | 18 ++++++ svx/source/dialog/imapdlg.src | 4 ++ svx/source/dialog/optgrid.src | 17 ++++++ svx/source/dialog/passwd.src | 3 + svx/source/dialog/rubydialog.src | 14 +++++ svx/source/dialog/srchdlg.src | 30 ++++++++++ svx/source/engine3d/float3d.src | 68 ++++++++++++++++++++++ svx/source/form/datanavi.src | 35 +++++++++++ svx/source/form/fmexpl.src | 2 + svx/source/intro/iso.src | 2 + svx/source/intro/ooo.src | 2 + svx/source/tbxctrls/extrusioncontrols.src | 5 ++ svx/source/tbxctrls/fontworkgallery.src | 5 ++ svx/source/tbxctrls/lboxctrl.src | 1 + .../chinese_dictionarydialog.src | 8 +++ .../chinese_translationdialog.src | 4 ++ uui/source/cookiedg.src | 5 ++ uui/source/fltdlg.src | 1 + uui/source/masterpasscrtdlg.src | 2 + uui/source/masterpassworddlg.src | 1 + uui/source/nameclashdlg.src | 3 + uui/source/newerverwarn.src | 1 + uui/source/passworddlg.src | 2 + uui/source/secmacrowarnings.src | 2 + uui/source/sslwarndlg.src | 2 + uui/source/unknownauthdlg.src | 4 ++ 58 files changed, 556 insertions(+), 4 deletions(-) mode change 100755 => 100644 desktop/source/deployment/gui/dp_gui_dialog.src mode change 100755 => 100644 sfx2/source/dialog/dinfdlg.src mode change 100755 => 100644 uui/source/masterpasscrtdlg.src mode change 100755 => 100644 uui/source/nameclashdlg.src mode change 100755 => 100644 uui/source/passworddlg.src diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src index 0713fd859f56..7f83ba8db2ba 100644 --- a/basic/source/app/basic.src +++ b/basic/source/app/basic.src @@ -29,6 +29,7 @@ #include "resids.hrc" ModalDialog RID_CALLDLG { + HelpID = "basic:ModalDialog:RID_CALLDLG"; PosSize = MAP_SYSFONT (18,18,142,142); SVLook = TRUE; MOVEABLE = TRUE; @@ -43,11 +44,13 @@ ModalDialog RID_CALLDLG { PosSize = MAP_SYSFONT (10,70,120,8); }; Edit RID_RETVAL { + HelpID = "basic:Edit:RID_CALLDLG:RID_RETVAL"; PosSize = MAP_SYSFONT (10,85,120,12); Border = TRUE; TabStop = TRUE; }; ListBox RID_PARAMS { + HelpID = "basic:ListBox:RID_CALLDLG:RID_PARAMS"; PosSize = MAP_SYSFONT (10,25,120,40); TabStop = TRUE; Border = TRUE; @@ -61,6 +64,7 @@ ModalDialog RID_CALLDLG { }; ModalDialog IDD_ABOUT_DIALOG { + HelpID = "basic:ModalDialog:IDD_ABOUT_DIALOG"; Pos = MAP_APPFONT( 58, 17 ); Size = MAP_APPFONT( 155, 106 ); SVLook = TRUE; @@ -107,6 +111,7 @@ ModalDialog IDD_ABOUT_DIALOG { }; ModalDialog IDD_TT_ABOUT_DIALOG { + HelpID = "basic:ModalDialog:IDD_TT_ABOUT_DIALOG"; Pos = MAP_APPFONT( 58, 17 ); Size = MAP_APPFONT( 120, 81 ); SVLook = TRUE; @@ -138,6 +143,7 @@ ModalDialog IDD_TT_ABOUT_DIALOG { }; ModalDialog IDD_FIND_DIALOG { + HelpID = "basic:ModalDialog:IDD_FIND_DIALOG"; Pos = MAP_APPFONT( 69, 30 ); Size = MAP_APPFONT( 185, 70 ); SVLook = TRUE; @@ -150,6 +156,7 @@ ModalDialog IDD_FIND_DIALOG { TEXT[ en-US ] = "~Text"; }; Edit RID_FIND { + HelpID = "basic:Edit:IDD_FIND_DIALOG:RID_FIND"; BORDER = TRUE; Pos = MAP_APPFONT( 40, 8 ); Size = MAP_APPFONT( 135, 12 ); @@ -172,6 +179,7 @@ ModalDialog IDD_FIND_DIALOG { }; ModalDialog IDD_REPLACE_DIALOG { + HelpID = "basic:ModalDialog:IDD_REPLACE_DIALOG"; Pos = MAP_APPFONT( 69, 30 ); Size = MAP_APPFONT( 185, 88 ); SVLook = TRUE; @@ -188,12 +196,14 @@ ModalDialog IDD_REPLACE_DIALOG { TEXT[ en-US ] = "~Replace by"; }; Edit RID_FIND { + HelpID = "basic:Edit:IDD_REPLACE_DIALOG:RID_FIND"; BORDER = TRUE; Pos = MAP_APPFONT( 65, 8 ); Size = MAP_APPFONT( 110, 12 ); TABSTOP = TRUE; }; Edit RID_REPLACE { + HelpID = "basic:Edit:IDD_REPLACE_DIALOG:RID_REPLACE"; BORDER = TRUE; Pos = MAP_APPFONT( 65, 28 ); Size = MAP_APPFONT( 110, 12 ); @@ -718,6 +728,7 @@ Menu RID_HELP { }; }; ModelessDialog IDD_PRINT_DIALOG { + HelpID = "basic:ModelessDialog:IDD_PRINT_DIALOG"; Pos = MAP_APPFONT( 83, 42 ); Size = MAP_APPFONT( 171, 94 ); MOVEABLE = TRUE; @@ -784,6 +795,7 @@ TabDialog IDD_OPTIONS_DLG TabPage RID_TP_GENERIC { + HelpID = "basic:TabPage:RID_TP_GENERIC"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT( 244, 100 ); @@ -793,6 +805,7 @@ TabPage RID_TP_GENERIC { Text[ en-US ] = "Area"; }; ComboBox RID_CB_AREA { + HelpID = "basic:ComboBox:RID_TP_GENERIC:RID_CB_AREA"; HScroll = TRUE; VScroll = TRUE; AutoHScroll = TRUE; @@ -803,12 +816,14 @@ TabPage RID_TP_GENERIC { DropDown = TRUE; }; PushButton RID_PB_NEW_AREA { + HelpID = "basic:PushButton:RID_TP_GENERIC:RID_PB_NEW_AREA"; Pos = MAP_APPFONT( 144, 12 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; Text[ en-US ] = "New"; }; PushButton RID_PD_DEL_AREA { + HelpID = "basic:PushButton:RID_TP_GENERIC:RID_PD_DEL_AREA"; Pos = MAP_APPFONT( 188, 12 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -820,6 +835,7 @@ TabPage RID_TP_GENERIC { Text[ en-US ] = "Setting"; }; ComboBox RID_CB_VALUE { + HelpID = "basic:ComboBox:RID_TP_GENERIC:RID_CB_VALUE"; HScroll = TRUE; VScroll = TRUE; AutoHScroll = TRUE; @@ -829,6 +845,7 @@ TabPage RID_TP_GENERIC { TabStop = TRUE; }; PushButton RID_PB_SELECT_FILE { + HelpID = "basic:PushButton:RID_TP_GENERIC:RID_PB_SELECT_FILE"; Pos = MAP_APPFONT( 188, 48 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -837,12 +854,14 @@ TabPage RID_TP_GENERIC { Hide = TRUE; }; PushButton RID_PB_NEW_VALUE { + HelpID = "basic:PushButton:RID_TP_GENERIC:RID_PB_NEW_VALUE"; Pos = MAP_APPFONT( 188, 48 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; Text[ en-US ] = "New"; }; PushButton RID_PB_DEL_VALUE { + HelpID = "basic:PushButton:RID_TP_GENERIC:RID_PB_DEL_VALUE"; Pos = MAP_APPFONT( 188, 64 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -852,6 +871,7 @@ TabPage RID_TP_GENERIC { TabPage RID_TP_PROFILE { + HelpID = "basic:TabPage:RID_TP_PROFILE"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT( 244, 100 ); @@ -861,6 +881,7 @@ TabPage RID_TP_PROFILE { Text[ en-US ] = "Profile"; }; ComboBox RID_CB_PROFILE { + HelpID = "basic:ComboBox:RID_TP_PROFILE:RID_CB_PROFILE"; HScroll = TRUE; VScroll = TRUE; AutoHScroll = TRUE; @@ -871,12 +892,14 @@ TabPage RID_TP_PROFILE { DropDown = TRUE; }; PushButton RID_PB_NEW_PROFILE { + HelpID = "basic:PushButton:RID_TP_PROFILE:RID_PB_NEW_PROFILE"; Pos = MAP_APPFONT( 144, 2 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; Text[ en-US ] = "New"; }; PushButton RID_PD_DEL_PROFILE { + HelpID = "basic:PushButton:RID_TP_PROFILE:RID_PD_DEL_PROFILE"; Pos = MAP_APPFONT( 188, 2 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -898,6 +921,7 @@ TabPage RID_TP_PROFILE { Text[ en-US ] = "Base directory"; }; CheckBox HID_CHECK { + HelpID = "basic:CheckBox:RID_TP_PROFILE:HID_CHECK"; Pos = MAP_APPFONT( 7, 58 ); Size = MAP_APPFONT( 86, 12 ); Text[ en-US ] = "Default HID directory"; @@ -905,52 +929,61 @@ TabPage RID_TP_PROFILE { Hide = FALSE; }; Edit LOG_NAME { + HelpID = "basic:Edit:RID_TP_PROFILE:LOG_NAME"; Border = TRUE; Pos = MAP_APPFONT( 97, 26 ); Size = MAP_APPFONT( 116, 12 ); TabStop = TRUE; }; Edit BASIS_NAME { + HelpID = "basic:Edit:RID_TP_PROFILE:BASIS_NAME"; Border = TRUE; Pos = MAP_APPFONT( 97, 42 ); Size = MAP_APPFONT( 116, 12 ); TabStop = TRUE; }; Edit HID_NAME { + HelpID = "basic:Edit:RID_TP_PROFILE:HID_NAME"; Border = TRUE; Pos = MAP_APPFONT( 97, 58 ); Size = MAP_APPFONT( 116, 12 ); TabStop = TRUE; }; PushButton LOG_SET { + HelpID = "basic:PushButton:RID_TP_PROFILE:LOG_SET"; Pos = MAP_APPFONT( 217, 26 ); Size = MAP_APPFONT( 12, 12 ); TabStop = TRUE; Text[ en-US ] = "..."; }; PushButton BASIS_SET { + HelpID = "basic:PushButton:RID_TP_PROFILE:BASIS_SET"; Pos = MAP_APPFONT( 217, 42 ); Size = MAP_APPFONT( 12, 12 ); TabStop = TRUE; Text[ en-US ] = "..."; }; PushButton HID_SET { + HelpID = "basic:PushButton:RID_TP_PROFILE:HID_SET"; Pos = MAP_APPFONT( 217, 58 ); Size = MAP_APPFONT( 12, 12 ); TabStop = TRUE; Text[ en-US ] = "..."; }; CheckBox CB_AUTORELOAD { + HelpID = "basic:CheckBox:RID_TP_PROFILE:CB_AUTORELOAD"; Pos = MAP_APPFONT( 7, 74 ); Size = MAP_APPFONT( 115, 12 ); Text[ en-US ] = "AutoReload"; }; CheckBox CB_AUTOSAVE { + HelpID = "basic:CheckBox:RID_TP_PROFILE:CB_AUTOSAVE"; Pos = MAP_APPFONT( 7, 87 ); Size = MAP_APPFONT( 115, 12 ); Text[ en-US ] = "Save before execute"; }; CheckBox CB_STOPONSYNTAXERRORS { + HelpID = "basic:CheckBox:RID_TP_PROFILE:CB_STOPONSYNTAXERRORS"; Pos = MAP_APPFONT( 132, 74 ); Size = MAP_APPFONT( 115, 12 ); Text[ en-US ] = "Stop on Syntax Errors"; @@ -958,6 +991,7 @@ TabPage RID_TP_PROFILE { }; TabPage RID_TP_CRASH { + HelpID = "basic:TabPage:RID_TP_CRASH"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT( 244, 100 ); @@ -967,6 +1001,7 @@ TabPage RID_TP_CRASH { Text[ en-US ] = "Crashreport"; }; CheckBox CB_USEPROXY { + HelpID = "basic:CheckBox:RID_TP_CRASH:CB_USEPROXY"; Pos = MAP_APPFONT( 8, 12 ); Size = MAP_APPFONT( 120, 12 ); Text[ en-US ] = "Use Proxy"; @@ -977,6 +1012,7 @@ TabPage RID_TP_CRASH { Text[ en-US ] = "Host"; }; Edit ED_CRHOST { + HelpID = "basic:Edit:RID_TP_CRASH:ED_CRHOST"; Border = TRUE; Pos = MAP_APPFONT( 43+12, 12+13 ); Size = MAP_APPFONT( 80, 12 ); @@ -988,6 +1024,7 @@ TabPage RID_TP_CRASH { Text[ en-US ] = "Port"; }; NumericField NF_CRPORT { + HelpID = "basic:NumericField:RID_TP_CRASH:NF_CRPORT"; Border = TRUE; Pos = MAP_APPFONT( 43+12, 12+13+16 ); Size = MAP_APPFONT( 40, 12 ); @@ -1001,6 +1038,7 @@ TabPage RID_TP_CRASH { Last = 0xffff; }; CheckBox CB_ALLOWCONTACT { + HelpID = "basic:CheckBox:RID_TP_CRASH:CB_ALLOWCONTACT"; Pos = MAP_APPFONT( 8, 12+13+16+16 ); Size = MAP_APPFONT( 120, 12 ); Text[ en-US ] = "Allow Contact"; @@ -1011,6 +1049,7 @@ TabPage RID_TP_CRASH { Text[ en-US ] = "EMail"; }; Edit ED_EMAIL { + HelpID = "basic:Edit:RID_TP_CRASH:ED_EMAIL"; Border = TRUE; Pos = MAP_APPFONT( 43+12, 12+13+16+16+13 ); Size = MAP_APPFONT( 80, 12 ); @@ -1020,6 +1059,7 @@ TabPage RID_TP_CRASH { TabPage RID_TP_MISC { + HelpID = "basic:TabPage:RID_TP_MISC"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT( 244, 100 ); @@ -1034,6 +1074,7 @@ TabPage RID_TP_MISC { Text[ en-US ] = "Host"; }; Edit ED_HOST { + HelpID = "basic:Edit:RID_TP_MISC:ED_HOST"; Border = TRUE; Pos = MAP_APPFONT( 43, 12); Size = MAP_APPFONT( 80, 12 ); @@ -1045,6 +1086,7 @@ TabPage RID_TP_MISC { Text[ en-US ] = "Testtool Port"; }; NumericField NF_TTPORT { + HelpID = "basic:NumericField:RID_TP_MISC:NF_TTPORT"; Border = TRUE; Pos = MAP_APPFONT( 191, 12); Size = MAP_APPFONT( 40, 12 ); @@ -1063,6 +1105,7 @@ TabPage RID_TP_MISC { Text[ en-US ] = "Remote UNO Port"; }; NumericField NF_UNOPORT { + HelpID = "basic:NumericField:RID_TP_MISC:NF_UNOPORT"; Border = TRUE; Pos = MAP_APPFONT( 191, 12+15); Size = MAP_APPFONT( 40, 12 ); @@ -1087,6 +1130,7 @@ TabPage RID_TP_MISC { Text[ en-US ] = "Server Timeout"; }; TimeField SERVER_TIMEOUT { + HelpID = "basic:TimeField:RID_TP_MISC:SERVER_TIMEOUT"; Border = TRUE; Pos = MAP_APPFONT( 83, 50 ); Size = MAP_APPFONT( 40, 12 ); @@ -1102,6 +1146,7 @@ TabPage RID_TP_MISC { Text[ en-US ] = "Max LRU Files"; }; NumericField TF_MAX_LRU { + HelpID = "basic:NumericField:RID_TP_MISC:TF_MAX_LRU"; Border = TRUE; Pos = MAP_APPFONT( 191, 50); Size = MAP_APPFONT( 40, 12 ); @@ -1118,12 +1163,14 @@ TabPage RID_TP_MISC { Text[ en-US ] = "OOo Program Dir"; }; Edit ED_PROGDIR { + HelpID = "basic:Edit:RID_TP_MISC:ED_PROGDIR"; Border = TRUE; Pos = MAP_APPFONT( 83, 50+15 ); Size = MAP_APPFONT( 219-83-4, 12 ); TabStop = TRUE; }; PushButton PB_PROGDIR { + HelpID = "basic:PushButton:RID_TP_MISC:PB_PROGDIR"; Pos = MAP_APPFONT( 219, 50+15 ); Size = MAP_APPFONT( 12, 12 ); TabStop = TRUE; @@ -1133,6 +1180,7 @@ TabPage RID_TP_MISC { TabPage RID_TP_FONT { + HelpID = "basic:TabPage:RID_TP_FONT"; Hide = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT( 244, 100 ); @@ -1142,6 +1190,7 @@ TabPage RID_TP_FONT { Text[ en-US ] = "Type"; }; ComboBox CB_FONTNAME { + HelpID = "basic:ComboBox:RID_TP_FONT:CB_FONTNAME"; Pos = MAP_APPFONT( 4, 12 ); Size = MAP_APPFONT( 123, 12*4 ); Sort = TRUE; @@ -1153,6 +1202,7 @@ TabPage RID_TP_FONT { Text[ en-US ] = "Typeface"; }; ComboBox CB_FONTSTYLE { + HelpID = "basic:ComboBox:RID_TP_FONT:CB_FONTSTYLE"; Pos = MAP_APPFONT( 131, 12 ); Size = MAP_APPFONT( 65, 12*4 ); AutoHScroll = TRUE; @@ -1163,6 +1213,7 @@ TabPage RID_TP_FONT { Text[ en-US ] = "Size"; }; MetricBox MB_FONTSIZE { + HelpID = "basic:MetricBox:RID_TP_FONT:MB_FONTSIZE"; Pos = MAP_APPFONT( 200, 12 ); Size = MAP_APPFONT( 29, 12*4 ); AutoHScroll = TRUE; @@ -1178,6 +1229,7 @@ TabPage RID_TP_FONT { FloatingWindow IDD_DISPLAY_HID { + HelpID = "basic:FloatingWindow:IDD_DISPLAY_HID"; OutputSize = TRUE; SVLook = TRUE; Size = MAP_APPFONT( 261, 160 ); @@ -1204,6 +1256,7 @@ FloatingWindow IDD_DISPLAY_HID { Text[ en-US ] = "Controls"; }; MultiListBox RID_MLB_CONTROLS { + HelpID = "basic:MultiListBox:IDD_DISPLAY_HID:RID_MLB_CONTROLS"; Border = TRUE; AutoHScroll = TRUE; Pos = MAP_APPFONT( 4, 28 ); @@ -1216,6 +1269,7 @@ FloatingWindow IDD_DISPLAY_HID { Text[ en-US ] = "Slots"; }; MultiListBox RID_MLB_SLOTS { + HelpID = "basic:MultiListBox:IDD_DISPLAY_HID:RID_MLB_SLOTS"; Border = TRUE; AutoHScroll = TRUE; Pos = MAP_APPFONT( 4, 132 ); @@ -1223,12 +1277,14 @@ FloatingWindow IDD_DISPLAY_HID { TabStop = TRUE; }; PushButton RID_PB_KOPIEREN { + HelpID = "basic:PushButton:IDD_DISPLAY_HID:RID_PB_KOPIEREN"; Pos = MAP_APPFONT( 216, 28 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; Text[ en-US ] = "Copy"; }; PushButton RID_PB_BENENNEN { + HelpID = "basic:PushButton:IDD_DISPLAY_HID:RID_PB_BENENNEN"; Pos = MAP_APPFONT( 216, 44 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -1236,6 +1292,7 @@ FloatingWindow IDD_DISPLAY_HID { Text[ en-US ] = "Name"; }; PushButton RID_PB_SELECTALL { + HelpID = "basic:PushButton:IDD_DISPLAY_HID:RID_PB_SELECTALL"; Pos = MAP_APPFONT( 216, 44 ); Size = MAP_APPFONT( 40, 12 ); TabStop = TRUE; @@ -1356,6 +1413,7 @@ ImageList RID_IMGLST_LAYOUT }; ModelessDialog IDD_EDIT_VAR { + HelpID = "basic:ModelessDialog:IDD_EDIT_VAR"; Pos = MAP_APPFONT( 0, 0 ); Size = MAP_APPFONT( 171, 87 ); Moveable = TRUE; @@ -1386,6 +1444,7 @@ ModelessDialog IDD_EDIT_VAR { Text[ en-US ] = "Previous contents"; }; RadioButton RID_RB_NEW_BOOL_T { + HelpID = "basic:RadioButton:IDD_EDIT_VAR:RID_RB_NEW_BOOL_T"; Hide = TRUE; Pos = MAP_APPFONT( 53, 37 ); Size = MAP_APPFONT( 40, 12 ); @@ -1393,6 +1452,7 @@ ModelessDialog IDD_EDIT_VAR { Text[ en-US ] = "True"; }; RadioButton RID_RB_NEW_BOOL_F { + HelpID = "basic:RadioButton:IDD_EDIT_VAR:RID_RB_NEW_BOOL_F"; Hide = TRUE; Pos = MAP_APPFONT( 98, 37 ); Size = MAP_APPFONT( 40, 12 ); @@ -1400,6 +1460,7 @@ ModelessDialog IDD_EDIT_VAR { Text[ en-US ] = "False"; }; NumericField RID_NF_NEW_INTEGER { + HelpID = "basic:NumericField:IDD_EDIT_VAR:RID_NF_NEW_INTEGER"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT( 53, 37 ); @@ -1414,6 +1475,7 @@ ModelessDialog IDD_EDIT_VAR { SpinSize = 10; }; NumericField RID_NF_NEW_LONG { + HelpID = "basic:NumericField:IDD_EDIT_VAR:RID_NF_NEW_LONG"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT( 53, 37 ); @@ -1428,6 +1490,7 @@ ModelessDialog IDD_EDIT_VAR { SpinSize = 10; }; Edit RID_ED_NEW_STRING { + HelpID = "basic:Edit:IDD_EDIT_VAR:RID_ED_NEW_STRING"; Hide = TRUE; Border = TRUE; Pos = MAP_APPFONT( 53, 37 ); @@ -1449,6 +1512,7 @@ ModelessDialog IDD_EDIT_VAR { }; FloatingWindow LOAD_CONF { + HelpID = "basic:FloatingWindow:LOAD_CONF"; SVLook = TRUE; Pos = MAP_APPFONT( 66, 23 ); Size = MAP_APPFONT( 156, 51 ); diff --git a/desktop/source/app/desktop.src b/desktop/source/app/desktop.src index 2f6897adf80e..98ee68685917 100644 --- a/desktop/source/app/desktop.src +++ b/desktop/source/app/desktop.src @@ -159,6 +159,7 @@ InfoBox INFOBOX_CMDLINEHELP ModalDialog DLG_CMDLINEHELP { + HelpID = "desktop:ModalDialog:DLG_CMDLINEHELP"; Text = "Help Message..."; Size = MAP_APPFONT(250, 365); Border = True; diff --git a/desktop/source/deployment/gui/dp_gui_dependencydialog.src b/desktop/source/deployment/gui/dp_gui_dependencydialog.src index fa7465678326..e7adbce9992b 100644 --- a/desktop/source/deployment/gui/dp_gui_dependencydialog.src +++ b/desktop/source/deployment/gui/dp_gui_dependencydialog.src @@ -34,6 +34,7 @@ #define LOCAL_LIST_HEIGHT (6 * RSC_BS_CHARHEIGHT) ModalDialog RID_DLG_DEPENDENCIES { + HelpID = "desktop:ModalDialog:RID_DLG_DEPENDENCIES"; Size = MAP_APPFONT( (RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH + RSC_SP_DLG_INNERBORDER_RIGHT), @@ -52,6 +53,7 @@ ModalDialog RID_DLG_DEPENDENCIES { NoLabel = TRUE; }; ListBox RID_DLG_DEPENDENCIES_LIST { + HelpID = "desktop:ListBox:RID_DLG_DEPENDENCIES:RID_DLG_DEPENDENCIES_LIST"; Pos = MAP_APPFONT( RSC_SP_DLG_INNERBORDER_LEFT, (RSC_SP_DLG_INNERBORDER_TOP + LOCAL_TEXT_HEIGHT + diff --git a/desktop/source/deployment/gui/dp_gui_dialog.src b/desktop/source/deployment/gui/dp_gui_dialog.src old mode 100755 new mode 100644 index 15823288ee20..665dbe5934d7 --- a/desktop/source/deployment/gui/dp_gui_dialog.src +++ b/desktop/source/deployment/gui/dp_gui_dialog.src @@ -169,6 +169,7 @@ String RID_STR_ERROR_MISSING_LICENSE ModalDialog RID_DLG_LICENSE { + HelpID = "desktop:ModalDialog:RID_DLG_LICENSE"; Text [ en-US ] = "Extension Software License Agreement"; Size = MAP_APPFONT(LIC_DLG_WIDTH, LIC_DLG_HEIGHT); @@ -181,6 +182,7 @@ ModalDialog RID_DLG_LICENSE MultiLineEdit ML_LICENSE { + HelpID = "desktop:MultiLineEdit:RID_DLG_LICENSE:ML_LICENSE"; Pos = MAP_APPFONT(COL1_X, ROW1_Y); Size = MAP_APPFONT(BODYWIDTH, ROW1_HEIGHT); Border = TRUE; @@ -230,6 +232,7 @@ ModalDialog RID_DLG_LICENSE }; PushButton PB_LICENSE_DOWN { + HelpID = "desktop:PushButton:RID_DLG_LICENSE:PB_LICENSE_DOWN"; TabStop = TRUE ; Pos = MAP_APPFONT(COL5_X , ROW3_Y) ; Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT) ; diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.src b/desktop/source/deployment/gui/dp_gui_dialog2.src index 7c47365999a0..996c96b1d083 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.src +++ b/desktop/source/deployment/gui/dp_gui_dialog2.src @@ -43,6 +43,7 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER PushButton RID_EM_BTN_ADD { + HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_ADD"; TabStop = TRUE; Text [ en-US ] = "~Add..."; Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -50,6 +51,7 @@ ModelessDialog RID_DLG_EXTENSION_MANAGER PushButton RID_EM_BTN_CHECK_UPDATES { + HelpID = "desktop:PushButton:RID_DLG_EXTENSION_MANAGER:RID_EM_BTN_CHECK_UPDATES"; TabStop = TRUE; Text [ en-US ] = "Check for ~Updates..."; Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -131,6 +133,7 @@ ModalDialog RID_DLG_UPDATE_REQUIRED PushButton RID_EM_BTN_CHECK_UPDATES { + HelpID = "desktop:PushButton:RID_DLG_UPDATE_REQUIRED:RID_EM_BTN_CHECK_UPDATES"; TabStop = TRUE; Text [ en-US ] = "Check for ~Updates..."; Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -138,6 +141,7 @@ ModalDialog RID_DLG_UPDATE_REQUIRED PushButton RID_EM_BTN_CLOSE { + HelpID = "desktop:PushButton:RID_DLG_UPDATE_REQUIRED:RID_EM_BTN_CLOSE"; TabStop = TRUE; DefButton = TRUE; Text [ en-US ] = "Disable all"; diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.src b/desktop/source/deployment/gui/dp_gui_updatedialog.src index 325d98c88d48..20b7d30988fd 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.src +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.src @@ -86,6 +86,7 @@ ModalDialog RID_DLG_UPDATE { TabStop = TRUE; }; CheckBox RID_DLG_UPDATE_ALL { + HelpID = "desktop:CheckBox:RID_DLG_UPDATE:RID_DLG_UPDATE_ALL"; Disable = TRUE; Pos = MAP_APPFONT( RSC_SP_DLG_INNERBORDER_LEFT, @@ -150,6 +151,7 @@ ModalDialog RID_DLG_UPDATE { Text[en-US] = "Release Notes"; }; MultiLineEdit RID_DLG_UPDATE_DESCRIPTIONS { + HelpID = "desktop:MultiLineEdit:RID_DLG_UPDATE:RID_DLG_UPDATE_DESCRIPTIONS"; Disable = TRUE; Border = TRUE; Pos = MAP_APPFONT( @@ -183,6 +185,7 @@ ModalDialog RID_DLG_UPDATE { Size = MAP_APPFONT(RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT); }; PushButton RID_DLG_UPDATE_OK { + HelpID = "desktop:PushButton:RID_DLG_UPDATE:RID_DLG_UPDATE_OK"; Disable = TRUE; Pos = MAP_APPFONT( (RSC_SP_DLG_INNERBORDER_LEFT + LOCAL_WIDTH - RSC_CD_PUSHBUTTON_WIDTH - diff --git a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src index d77dd256582c..f7cc93493b5d 100644 --- a/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src +++ b/desktop/source/deployment/gui/dp_gui_updateinstalldialog.src @@ -90,6 +90,7 @@ ModalDialog RID_DLG_UPDATEINSTALL { }; MultiLineEdit RID_DLG_UPDATE_INSTALL_INFO { + HelpID = "desktop:MultiLineEdit:RID_DLG_UPDATEINSTALL:RID_DLG_UPDATE_INSTALL_INFO"; Pos = MAP_APPFONT( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP + RSC_CD_FIXEDTEXT_HEIGHT + diff --git a/desktop/source/migration/wizard.src b/desktop/source/migration/wizard.src index 9c1ab5496d39..e690e130c74f 100644 --- a/desktop/source/migration/wizard.src +++ b/desktop/source/migration/wizard.src @@ -188,6 +188,7 @@ TabPage TP_LICENSE }; MultiLineEdit ML_LICENSE { + HelpID = "desktop:MultiLineEdit:TP_LICENSE:ML_LICENSE"; PosSize = MAP_APPFONT (MARGINLEFT+INDENT, MARGINTOP + 8*ROWHEIGHT, BODYWIDTH-INDENT , BODYHEIGHT - 8*ROWHEIGHT - 20-2*MARGINBOTTOM) ; Border = TRUE; VScroll = TRUE; @@ -195,6 +196,7 @@ TabPage TP_LICENSE }; PushButton PB_LICENSE_DOWN { + HelpID = "desktop:PushButton:TP_LICENSE:PB_LICENSE_DOWN"; TabStop = TRUE ; Pos = MAP_APPFONT ( TP_WIDTH-MARGINRIGHT-50 , TP_HEIGHT-MARGINBOTTOM-18 ) ; Size = MAP_APPFONT ( 50, 15 ) ; @@ -240,6 +242,7 @@ TabPage TP_MIGRATION CheckBox CB_MIGRATION { + HelpID = "desktop:CheckBox:TP_MIGRATION:CB_MIGRATION"; Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*10); Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*2); Check = TRUE; @@ -275,6 +278,7 @@ TabPage TP_UPDATE_CHECK CheckBox CB_UPDATE_CHECK { + HelpID = "desktop:CheckBox:TP_UPDATE_CHECK:CB_UPDATE_CHECK"; Pos = MAP_APPFONT(MARGINLEFT, MARGINTOP+ROWHEIGHT*10); Size = MAP_APPFONT(BODYWIDTH, ROWHEIGHT*2); Check = TRUE; @@ -321,6 +325,7 @@ TabPage TP_USER }; Edit ED_USER_FIRST { + HelpID = "desktop:Edit:TP_USER:ED_USER_FIRST"; Border = TRUE; Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*7); Size = MAP_APPFONT(BODYWIDTH-USERINDENT, EDHEIGHT); @@ -333,6 +338,7 @@ TabPage TP_USER }; Edit ED_USER_LAST { + HelpID = "desktop:Edit:TP_USER:ED_USER_LAST"; Border = TRUE; Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*9); Size = MAP_APPFONT(BODYWIDTH-USERINDENT, EDHEIGHT); @@ -345,6 +351,7 @@ TabPage TP_USER }; Edit ED_USER_INITIALS { + HelpID = "desktop:Edit:TP_USER:ED_USER_INITIALS"; Border = TRUE; Pos = MAP_APPFONT(MARGINLEFT+USERINDENT, MARGINTOP+ROWHEIGHT*11); Size = MAP_APPFONT(INITIALSWIDTH, EDHEIGHT); @@ -359,6 +366,7 @@ TabPage TP_USER }; Edit ED_USER_FATHER { + HelpID = "desktop:Edit:TP_USER:ED_USER_FATHER"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT(MARGINLEFT+USERINDENT*2+INITIALSWIDTH+10, MARGINTOP+ROWHEIGHT*11); @@ -391,6 +399,7 @@ TabPage TP_REGISTRATION }; RadioButton RB_REGISTRATION_NOW { + HelpID = "desktop:RadioButton:TP_REGISTRATION:RB_REGISTRATION_NOW"; Text [ en-US ] = "I want to register ~now"; Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2); Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); @@ -398,12 +407,14 @@ TabPage TP_REGISTRATION }; RadioButton RB_REGISTRATION_LATER { + HelpID = "desktop:RadioButton:TP_REGISTRATION:RB_REGISTRATION_LATER"; Text [ en-US ] = "I want to register ~later"; Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2+RB_HEIGHT); Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); }; RadioButton RB_REGISTRATION_NEVER { + HelpID = "desktop:RadioButton:TP_REGISTRATION:RB_REGISTRATION_NEVER"; Text [ en-US ] = "I do not want to ~register"; Pos = MAP_APPFONT(MARGINLEFT+INDENT2, ROWHEIGHT*12+2+RB_HEIGHT*2); Size = MAP_APPFONT(BODYWIDTH-INDENT2, RSC_CD_CHECKBOX_HEIGHT); diff --git a/formula/source/ui/dlg/formdlgs.src b/formula/source/ui/dlg/formdlgs.src index c85aa561ced8..935fed8ed2ba 100644 --- a/formula/source/ui/dlg/formdlgs.src +++ b/formula/source/ui/dlg/formdlgs.src @@ -163,6 +163,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL Moveable = TRUE ; TabControl TC_FUNCTION { + HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA_MODAL:TC_FUNCTION"; Pos = MAP_APPFONT ( 6 , 5 ) ; Size = MAP_APPFONT ( 102 , 199 ) ; PageList = @@ -249,6 +250,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; CheckBox BTN_MATRIX { + HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA_MODAL:BTN_MATRIX"; Pos = MAP_APPFONT ( 6 , 208 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -256,12 +258,14 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; Edit ED_REF { + HelpID = "formula:Edit:RID_FORMULADLG_FORMULA_MODAL:ED_REF"; Border = TRUE ; Pos = MAP_APPFONT ( 76 , 205 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; }; ImageButton RB_REF { + HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA_MODAL:RB_REF"; Pos = MAP_APPFONT ( 144 , 205 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = FALSE ; @@ -281,6 +285,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; PushButton BTN_BACKWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_BACKWARD"; Pos = MAP_APPFONT ( 171 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -288,6 +293,7 @@ ModalDialog RID_FORMULADLG_FORMULA_MODAL }; PushButton BTN_FORWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA_MODAL:BTN_FORWARD"; Pos = MAP_APPFONT ( 219 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -324,6 +330,7 @@ ModelessDialog RID_FORMULADLG_FORMULA Moveable = TRUE ; TabControl TC_FUNCTION { + HelpID = "formula:TabControl:RID_FORMULADLG_FORMULA:TC_FUNCTION"; Pos = MAP_APPFONT ( 6 , 5 ) ; Size = MAP_APPFONT ( 102 , 199 ) ; PageList = @@ -410,6 +417,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; CheckBox BTN_MATRIX { + HelpID = "formula:CheckBox:RID_FORMULADLG_FORMULA:BTN_MATRIX"; Pos = MAP_APPFONT ( 6 , 208 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; TabStop = TRUE ; @@ -417,12 +425,14 @@ ModelessDialog RID_FORMULADLG_FORMULA }; Edit ED_REF { + HelpID = "formula:Edit:RID_FORMULADLG_FORMULA:ED_REF"; Border = TRUE ; Pos = MAP_APPFONT ( 76 , 205 ) ; Size = MAP_APPFONT ( 66 , 12 ) ; }; ImageButton RB_REF { + HelpID = "formula:ImageButton:RID_FORMULADLG_FORMULA:RB_REF"; Pos = MAP_APPFONT ( 144 , 205 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = FALSE ; @@ -442,6 +452,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; PushButton BTN_BACKWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_BACKWARD"; Pos = MAP_APPFONT ( 171 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; @@ -449,6 +460,7 @@ ModelessDialog RID_FORMULADLG_FORMULA }; PushButton BTN_FORWARD { + HelpID = "formula:PushButton:RID_FORMULADLG_FORMULA:BTN_FORWARD"; Pos = MAP_APPFONT ( 219 , 208 ) ; Size = MAP_APPFONT ( 45 , 14 ) ; TabStop = TRUE ; diff --git a/formula/source/ui/dlg/parawin.src b/formula/source/ui/dlg/parawin.src index eda2bfcecda9..ea0b9b2f480b 100644 --- a/formula/source/ui/dlg/parawin.src +++ b/formula/source/ui/dlg/parawin.src @@ -68,6 +68,7 @@ TabPage RID_FORMULATAB_PARAMETER { + HelpID = "formula:TabPage:RID_FORMULATAB_PARAMETER"; Border = FALSE; Size = MAP_APPFONT( 203, 128 ); DialogControl = TRUE; @@ -119,10 +120,18 @@ TabPage RID_FORMULATAB_PARAMETER HelpId=HID_FORMULA_FAP_BTN_FX4; FXBUTTONBLOCK ( 109 ) }; - Edit ED_ARG1 { ED_ARGBLOCK ( 64 ) }; - Edit ED_ARG2 { ED_ARGBLOCK ( 79 ) }; - Edit ED_ARG3 { ED_ARGBLOCK ( 94 ) }; - Edit ED_ARG4 { ED_ARGBLOCK ( 109 ) }; + Edit ED_ARG1 { ED_ARGBLOCK ( 64 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG1"; + }; + Edit ED_ARG2 { ED_ARGBLOCK ( 79 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG2"; + }; + Edit ED_ARG3 { ED_ARGBLOCK ( 94 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG3"; + }; + Edit ED_ARG4 { ED_ARGBLOCK ( 109 ) + HelpID = "formula:Edit:RID_FORMULATAB_PARAMETER:ED_ARG4"; + }; ImageButton RB_ARG1 { diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src index 0b3c27b68071..da2d1cd926b6 100644 --- a/fpicker/source/office/iodlg.src +++ b/fpicker/source/office/iodlg.src @@ -79,12 +79,14 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ImageButton BTN_EXPLORERFILE_NEWFOLDER { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_NEWFOLDER"; TabStop = FALSE ; Pos = MAP_APPFONT ( 59 , 6 ) ; QuickHelpText [ en-US ] = "Create New Directory" ; }; ImageButton BTN_EXPLORERFILE_LISTVIEW { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_LISTVIEW"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; ButtonImage = Image @@ -99,6 +101,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ImageButton BTN_EXPLORERFILE_DETAILSVIEW { + HelpID = "fpicker:ImageButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_DETAILSVIEW"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; ButtonImage = Image @@ -113,6 +116,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; MenuButton BTN_EXPLORERFILE_UP { + HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_UP"; TabStop = FALSE ; Pos = MAP_APPFONT ( 109 , 6 ) ; QuickHelpText [ en-US ] = "Up One Level" ; @@ -120,6 +124,7 @@ ModalDialog DLG_SVT_EXPLORERFILE MenuButton BTN_EXPLORERFILE_STANDARD { + HelpID = "fpicker:MenuButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_STANDARD"; TabStop = FALSE ; Pos = MAP_APPFONT ( 59 , 6 ) ; QuickHelpText [ en-US ] = "Default Directory" ; @@ -139,6 +144,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; Edit ED_EXPLORERFILE_FILENAME { + HelpID = "fpicker:Edit:DLG_SVT_EXPLORERFILE:ED_EXPLORERFILE_FILENAME"; Pos = MAP_APPFONT ( 59 , 117 ) ; Size = MAP_APPFONT ( 159 , 12 ) ; Border = TRUE ; @@ -152,6 +158,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ListBox LB_EXPLORERFILE_SHARED_LISTBOX { + HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_SHARED_LISTBOX"; Pos = MAP_APPFONT ( 59 , 132 ) ; Size = MAP_APPFONT ( 159 , 40 ) ; DropDown = TRUE ; @@ -166,6 +173,7 @@ ModalDialog DLG_SVT_EXPLORERFILE }; ListBox LB_EXPLORERFILE_FILETYPE { + HelpID = "fpicker:ListBox:DLG_SVT_EXPLORERFILE:LB_EXPLORERFILE_FILETYPE"; Pos = MAP_APPFONT ( 59 , 147 ) ; Size = MAP_APPFONT ( 159 , 80 ) ; DropDown = TRUE ; @@ -175,26 +183,31 @@ ModalDialog DLG_SVT_EXPLORERFILE }; CheckBox CB_EXPLORERFILE_READONLY { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_EXPLORERFILE_READONLY"; Size = MAP_APPFONT ( 80 , 10 ) ; Text [ en-US ] = "~Read-only" ; }; CheckBox CB_EXPLORERFILE_PASSWORD { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_EXPLORERFILE_PASSWORD"; Size = MAP_APPFONT ( 100, 10 ) ; Text [ en-US ] = "Save with password" ; }; CheckBox CB_AUTO_EXTENSION { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_AUTO_EXTENSION"; Size = MAP_APPFONT ( 160 , 10 ) ; Text [ en-US ] = "~Automatic file name extension" ; }; CheckBox CB_OPTIONS { + HelpID = "fpicker:CheckBox:DLG_SVT_EXPLORERFILE:CB_OPTIONS"; Size = MAP_APPFONT ( 120 , 10 ) ; Text [ en-US ] = "Edit ~filter settings"; }; PushButton BTN_EXPLORERFILE_OPEN { + HelpID = "fpicker:PushButton:DLG_SVT_EXPLORERFILE:BTN_EXPLORERFILE_OPEN"; Pos = MAP_APPFONT ( 224 , 117 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; @@ -243,6 +256,7 @@ ModalDialog DLG_SVT_EXPLORERFILE // QueryFolderNameDialog ---------------------------------------------------------- ModalDialog DLG_SVT_QUERYFOLDERNAME { + HelpID = "fpicker:ModalDialog:DLG_SVT_QUERYFOLDERNAME"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -257,6 +271,7 @@ ModalDialog DLG_SVT_QUERYFOLDERNAME }; Edit ED_SVT_QUERYFOLDERNAME_DLG_NAME { + HelpID = "fpicker:Edit:DLG_SVT_QUERYFOLDERNAME:ED_SVT_QUERYFOLDERNAME_DLG_NAME"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 138 , 12 ) ; Border = TRUE ; diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src index 2f8e1bdf2f16..e14c57fb555a 100644 --- a/framework/source/classes/resource.src +++ b/framework/source/classes/resource.src @@ -175,6 +175,7 @@ ModalDialog DLG_LICENSE MultiLineEdit ML_LICENSE { + HelpID = "framework:MultiLineEdit:DLG_LICENSE:ML_LICENSE"; PosSize = MAP_APPFONT ( LICENSE_COL_1 , LICENSE_ROW_1 , LICENSE_WIDTH , LICENSE_HEIGHT ) ; Border = TRUE ; VScroll = TRUE ; @@ -221,6 +222,7 @@ ModalDialog DLG_LICENSE PushButton PB_PAGEDOWN { + HelpID = "framework:PushButton:DLG_LICENSE:PB_PAGEDOWN"; TabStop = TRUE ; Pos = MAP_APPFONT ( LICENSE_COL_4 , LICENSE_ROW_3 ) ; Size = MAP_APPFONT ( PD_WIDTH , PB_HEIGHT ) ; @@ -261,6 +263,7 @@ ModalDialog DLG_LICENSE PushButton PB_ACCEPT { + HelpID = "framework:PushButton:DLG_LICENSE:PB_ACCEPT"; TabStop = TRUE ; Pos = MAP_APPFONT ( LICENSE_COL_4 - PD_WIDTH - OFFSET_IMG , LICENSE_ROW_6 ) ; Size = MAP_APPFONT ( PD_WIDTH , PB_HEIGHT ) ; @@ -268,6 +271,7 @@ ModalDialog DLG_LICENSE PushButton PB_DECLINE { + HelpID = "framework:PushButton:DLG_LICENSE:PB_DECLINE"; TabStop = TRUE ; Pos = MAP_APPFONT ( LICENSE_COL_4 , LICENSE_ROW_6 ) ; Size = MAP_APPFONT ( PD_WIDTH , PB_HEIGHT ) ; diff --git a/sfx2/source/appl/dde.src b/sfx2/source/appl/dde.src index 22df8eff16ba..18f6517f181c 100644 --- a/sfx2/source/appl/dde.src +++ b/sfx2/source/appl/dde.src @@ -29,6 +29,7 @@ ModalDialog MD_DDE_LINKEDIT { + HelpID = "sfx2:ModalDialog:MD_DDE_LINKEDIT"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 223 , 74 ) ; @@ -42,6 +43,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_APP { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_APP"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 14 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; @@ -54,6 +56,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_TOPIC { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_TOPIC"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 32 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; @@ -66,6 +69,7 @@ ModalDialog MD_DDE_LINKEDIT }; Edit ED_DDE_ITEM { + HelpID = "sfx2:Edit:MD_DDE_LINKEDIT:ED_DDE_ITEM"; Border = TRUE ; Pos = MAP_APPFONT ( 55 , 50 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src index 8a2b4f760f7e..88dfed8ad71e 100644 --- a/sfx2/source/appl/newhelp.src +++ b/sfx2/source/appl/newhelp.src @@ -93,12 +93,14 @@ TabPage TP_HELP_INDEX }; ComboBox CB_INDEX { + HelpID = "sfx2:ComboBox:TP_HELP_INDEX:CB_INDEX"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 108 , 97 ) ; }; PushButton PB_OPEN_INDEX { + HelpID = "sfx2:PushButton:TP_HELP_INDEX:PB_OPEN_INDEX"; Pos = MAP_APPFONT ( 64 , 115 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -119,6 +121,7 @@ TabPage TP_HELP_SEARCH }; ComboBox ED_SEARCH { + HelpID = "sfx2:ComboBox:TP_HELP_SEARCH:ED_SEARCH"; Border = TRUE ; DropDown = TRUE; Pos = MAP_APPFONT ( 6 , 17 ) ; @@ -126,30 +129,35 @@ TabPage TP_HELP_SEARCH }; PushButton PB_SEARCH { + HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_SEARCH"; Pos = MAP_APPFONT ( 101 , 17 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Find"; }; CheckBox CB_FULLWORDS { + HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_FULLWORDS"; Pos = MAP_APPFONT ( 6, 34 ) ; Size = MAP_APPFONT ( 128 , 10 ) ; Text [ en-US ] = "~Complete words only"; }; CheckBox CB_SCOPE { + HelpID = "sfx2:CheckBox:TP_HELP_SEARCH:CB_SCOPE"; Pos = MAP_APPFONT ( 6, 47 ) ; Size = MAP_APPFONT ( 128 , 10 ) ; Text [ en-US ] = "Find in ~headings only"; }; ListBox LB_RESULT { + HelpID = "sfx2:ListBox:TP_HELP_SEARCH:LB_RESULT"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 60 ) ; Size = MAP_APPFONT ( 128 , 30 ) ; }; PushButton PB_OPEN_SEARCH { + HelpID = "sfx2:PushButton:TP_HELP_SEARCH:PB_OPEN_SEARCH"; Pos = MAP_APPFONT ( 84 , 182 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -170,6 +178,7 @@ TabPage TP_HELP_BOOKMARKS }; ListBox LB_BOOKMARKS { + HelpID = "sfx2:ListBox:TP_HELP_BOOKMARKS:LB_BOOKMARKS"; Border = TRUE ; Sort = TRUE; Pos = MAP_APPFONT ( 6 , 19 ) ; @@ -177,6 +186,7 @@ TabPage TP_HELP_BOOKMARKS }; PushButton PB_BOOKMARKS { + HelpID = "sfx2:PushButton:TP_HELP_BOOKMARKS:PB_BOOKMARKS"; Pos = MAP_APPFONT ( 64 , 119 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Display" ; @@ -337,6 +347,7 @@ String STR_HELP_MENU_TEXT_COPY }; ModalDialog DLG_HELP_ADDBOOKMARK { + HelpID = "sfx2:ModalDialog:DLG_HELP_ADDBOOKMARK"; Size = MAP_APPFONT ( 208 , 43 ) ; Text [ en-US ] = "Add to Bookmarks"; MOVEABLE = TRUE ; @@ -353,6 +364,7 @@ ModalDialog DLG_HELP_ADDBOOKMARK }; Edit ED_BOOKMARK_TITLE { + HelpID = "sfx2:Edit:DLG_HELP_ADDBOOKMARK:ED_BOOKMARK_TITLE"; PosSize = MAP_APPFONT ( 6 , 19 , 140 , 12 ) ; TABSTOP = TRUE ; BORDER = TRUE ; diff --git a/sfx2/source/dialog/alienwarn.src b/sfx2/source/dialog/alienwarn.src index 7aa6f3230778..ae07b28a4f4d 100644 --- a/sfx2/source/dialog/alienwarn.src +++ b/sfx2/source/dialog/alienwarn.src @@ -81,6 +81,7 @@ ModalDialog RID_DLG_ALIEN_WARNING }; CheckBox CB_WARNING_OFF { + HelpID = "sfx2:CheckBox:RID_DLG_ALIEN_WARNING:CB_WARNING_OFF"; Pos = MAP_APPFONT( AW_COL_2, AW_ROW_4 ); Size = MAP_APPFONT( DIALOG_WIDTH-AW_COL_2-RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_CHECKBOX_HEIGHT ); WordBreak = TRUE ; diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src old mode 100755 new mode 100644 index 53b0f35685cb..c78347e3dba3 --- a/sfx2/source/dialog/dinfdlg.src +++ b/sfx2/source/dialog/dinfdlg.src @@ -53,6 +53,7 @@ TabPage TP_DOCINFODESC }; Edit ED_TITLE { + HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 6 ) ; Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -68,6 +69,7 @@ TabPage TP_DOCINFODESC }; Edit ED_THEMA { + HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_THEMA"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 21 ) ; Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -83,6 +85,7 @@ TabPage TP_DOCINFODESC }; Edit ED_KEYWORDS { + HelpID = "sfx2:Edit:TP_DOCINFODESC:ED_KEYWORDS"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 36 ) ; Size = MAP_APPFONT ( 184 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -98,6 +101,7 @@ TabPage TP_DOCINFODESC }; MultiLineEdit ED_COMMENT { + HelpID = "sfx2:MultiLineEdit:TP_DOCINFODESC:ED_COMMENT"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 51 ) ; Size = MAP_APPFONT ( 184 , 128 ) ; @@ -121,6 +125,7 @@ TabPage TP_DOCINFODOC }; Edit ED_FILE_NAME { + HelpID = "sfx2:Edit:TP_DOCINFODOC:ED_FILE_NAME"; Pos = MAP_APPFONT ( 54 , 12 ) ; Size = MAP_APPFONT ( 200 , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; @@ -138,11 +143,13 @@ TabPage TP_DOCINFODOC }; Edit FT_FILE_SHOW_TYP { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_SHOW_TYP"; Pos = MAP_APPFONT ( 78 , 37 ) ; Size = MAP_APPFONT ( 106 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; CheckBox CB_FILE_READONLY { + HelpID = "sfx2:CheckBox:TP_DOCINFODOC:CB_FILE_READONLY"; Pos = MAP_APPFONT ( 163 , 37 ) ; Size = MAP_APPFONT ( 91 , RSC_CD_CHECKBOX_HEIGHT ) ; Text [ en-US ] = "~Read-only" ; @@ -155,6 +162,7 @@ TabPage TP_DOCINFODOC }; Edit FT_FILE_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_VAL"; Pos = MAP_APPFONT ( 78 , 49 ) ; Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -166,6 +174,7 @@ TabPage TP_DOCINFODOC }; Edit FT_FILE_SHOW_SIZE { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_FILE_SHOW_SIZE"; Pos = MAP_APPFONT ( 78 , 61 ) ; Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -182,6 +191,7 @@ TabPage TP_DOCINFODOC }; Edit FT_CREATE_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_CREATE_VAL"; Pos = MAP_APPFONT ( 78 , 80 ) ; Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -193,6 +203,7 @@ TabPage TP_DOCINFODOC }; Edit FT_CHANGE_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_CHANGE_VAL"; Pos = MAP_APPFONT ( 78 , 92 ) ; Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -204,11 +215,13 @@ TabPage TP_DOCINFODOC }; Edit FT_SIGNED_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_SIGNED_VAL"; Pos = MAP_APPFONT ( 78 , 104 ) ; Size = MAP_APPFONT ( 123 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; PushButton BTN_SIGNATURE { + HelpID = "sfx2:PushButton:TP_DOCINFODOC:BTN_SIGNATURE"; Pos = MAP_APPFONT ( 204 , 101 ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; Text [ en-US ] = "Digital Signature..."; @@ -225,6 +238,7 @@ TabPage TP_DOCINFODOC }; Edit FT_PRINT_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_PRINT_VAL"; Pos = MAP_APPFONT ( 78 , 116 ) ; Size = MAP_APPFONT ( 176 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -236,6 +250,7 @@ TabPage TP_DOCINFODOC }; Edit FT_TIMELOG_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_TIMELOG_VAL"; Pos = MAP_APPFONT ( 78 , 128 ) ; Size = MAP_APPFONT ( 30 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -247,11 +262,13 @@ TabPage TP_DOCINFODOC }; Edit FT_DOCNO_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_DOCNO_VAL"; Pos = MAP_APPFONT ( 78 , 140 ) ; Size = MAP_APPFONT ( 30 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; PushButton BTN_DELETE { + HelpID = "sfx2:PushButton:TP_DOCINFODOC:BTN_DELETE"; Pos = MAP_APPFONT ( 204 , 150 ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; Hide = TRUE; @@ -259,6 +276,7 @@ TabPage TP_DOCINFODOC }; CheckBox CB_USE_USERDATA { + HelpID = "sfx2:CheckBox:TP_DOCINFODOC:CB_USE_USERDATA"; Pos = MAP_APPFONT ( 6 , 152 ) ; Size = MAP_APPFONT ( 192 , RSC_CD_CHECKBOX_HEIGHT ) ; Hide = TRUE; @@ -277,6 +295,7 @@ TabPage TP_DOCINFODOC }; Edit FT_TEMPL_VAL { + HelpID = "sfx2:Edit:TP_DOCINFODOC:FT_TEMPL_VAL"; Pos = MAP_APPFONT ( 78 , 172 ) ; Size = MAP_APPFONT ( 180 , RSC_CD_FIXEDTEXT_HEIGHT ) ; }; @@ -301,6 +320,7 @@ TabPage TP_DOCINFOUSER }; Edit ED_INFO1 { + HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO1"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -314,6 +334,7 @@ TabPage TP_DOCINFOUSER }; Edit ED_INFO2 { + HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO2"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 43 ) ; Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -327,6 +348,7 @@ TabPage TP_DOCINFOUSER }; Edit ED_INFO3 { + HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO3"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 69 ) ; Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -340,6 +362,7 @@ TabPage TP_DOCINFOUSER }; Edit ED_INFO4 { + HelpID = "sfx2:Edit:TP_DOCINFOUSER:ED_INFO4"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 95 ) ; Size = MAP_APPFONT ( 248 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -347,6 +370,7 @@ TabPage TP_DOCINFOUSER }; PushButton BTN_EDITLABEL { + HelpID = "sfx2:PushButton:TP_DOCINFOUSER:BTN_EDITLABEL"; Pos = MAP_APPFONT ( 194 , 165 ) ; Size = MAP_APPFONT ( 60 , RSC_CD_PUSHBUTTON_HEIGHT ) ; Text [ en-US ] = "~Info fields..." ; @@ -362,6 +386,7 @@ TabPage TP_DOCINFORELOAD Size = MAP_APPFONT ( 260 , 185 ) ; RadioButton RB_NOAUTOUPDATE { + HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_NOAUTOUPDATE"; TabStop = TRUE ; Pos = MAP_APPFONT( COL_0 , ROW_0 ) ; Size = MAP_APPFONT( COL_7 - COL_1 , RSC_CD_RADIOBUTTON_HEIGHT ) ; @@ -370,6 +395,7 @@ TabPage TP_DOCINFORELOAD RadioButton RB_RELOADUPDATE { + HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_RELOADUPDATE"; TabStop = TRUE ; Pos = MAP_APPFONT( COL_0, ROW_1 ) ; Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ; @@ -383,6 +409,7 @@ TabPage TP_DOCINFORELOAD }; NumericField ED_RELOAD { + HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_RELOAD"; Border = TRUE ; Pos = MAP_APPFONT ( COL_2 , ROW_2 - ROWDIFF_FT_EDTFLD ) ; Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -403,6 +430,7 @@ TabPage TP_DOCINFORELOAD RadioButton RB_FORWARDUPDATE { + HelpID = "sfx2:RadioButton:TP_DOCINFORELOAD:RB_FORWARDUPDATE"; TabStop = TRUE ; Pos = MAP_APPFONT( COL_0, ROW_3 ) ; Size = MAP_APPFONT( COL_7 - COL_1, RSC_CD_RADIOBUTTON_HEIGHT ) ; @@ -416,6 +444,7 @@ TabPage TP_DOCINFORELOAD }; NumericField ED_FORWARD { + HelpID = "sfx2:NumericField:TP_DOCINFORELOAD:ED_FORWARD"; Border = TRUE ; Pos = MAP_APPFONT ( COL_2 , ROW_4 - ROWDIFF_FT_EDTFLD ) ; Size = MAP_APPFONT ( WIDTH_2 , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -441,12 +470,14 @@ TabPage TP_DOCINFORELOAD }; Edit ED_URL { + HelpID = "sfx2:Edit:TP_DOCINFORELOAD:ED_URL"; Border = TRUE ; Pos = MAP_APPFONT ( COL_2 , ROW_5 - ROWDIFF_FT_EDTFLD ) ; Size = MAP_APPFONT ( COL_5 - COL_2 , RSC_CD_TEXTBOX_HEIGHT ) ; }; PushButton PB_BROWSEURL { + HelpID = "sfx2:PushButton:TP_DOCINFORELOAD:PB_BROWSEURL"; Pos = MAP_APPFONT ( COL_6 , ROW_5 - ROWDIFF_FT_EDTFLD ) ; Size = MAP_APPFONT ( COL_7 - COL_6 , RSC_CD_PUSHBUTTON_HEIGHT ) ; Text = "..." ; @@ -459,6 +490,7 @@ TabPage TP_DOCINFORELOAD }; ComboBox CB_FRAME { + HelpID = "sfx2:ComboBox:TP_DOCINFORELOAD:CB_FRAME"; Pos = MAP_APPFONT ( COL_2 , ROW_6 - ROWDIFF_FT_EDTFLD ) ; Size = MAP_APPFONT ( COL_7 - COL_2 , RSC_CD_DROPDOWN_HEIGHT * 10 ) ; DropDown = TRUE ; @@ -524,6 +556,7 @@ TabPage TP_CUSTOMPROPERTIES }; PushButton BTN_ADD { + HelpID = "sfx2:PushButton:TP_CUSTOMPROPERTIES:BTN_ADD"; Pos = MAP_APPFONT( 204 , 165 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text [ en-US ] = "~Add"; @@ -756,6 +789,7 @@ ModalDialog RID_EDIT_DURATIONS }; CheckBox CB_NEGATIVE { + HelpID = "sfx2:CheckBox:RID_EDIT_DURATIONS:CB_NEGATIVE"; Pos = MAP_APPFONT ( 6 , 21 ) ; Size = MAP_APPFONT ( 60 , RSC_CD_FIXEDTEXT_HEIGHT ) ; Text [ en-US ] = "~Negative" ; @@ -769,6 +803,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_YEAR { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_YEAR"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 36 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -789,6 +824,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_MONTH { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MONTH"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 50 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -809,6 +845,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_DAY { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_DAY"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 64 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -829,6 +866,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_HOUR { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_HOUR"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 78 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -849,6 +887,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_MINUTE { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MINUTE"; Border = TRUE ; Pos = MAP_APPFONT ( 70, 92) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -869,6 +908,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_SECOND { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_SECOND"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 106 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; @@ -889,6 +929,7 @@ ModalDialog RID_EDIT_DURATIONS }; NumericField ED_MSECOND { + HelpID = "sfx2:NumericField:RID_EDIT_DURATIONS:ED_MSECOND"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 120 ) ; Size = MAP_APPFONT ( 40, RSC_CD_TEXTBOX_HEIGHT ) ; diff --git a/sfx2/source/dialog/dinfedt.src b/sfx2/source/dialog/dinfedt.src index 7f4875487536..110dccf11c40 100644 --- a/sfx2/source/dialog/dinfedt.src +++ b/sfx2/source/dialog/dinfedt.src @@ -45,24 +45,28 @@ ModalDialog DLG_DOCINFO_EDT }; Edit ED_INFO1 { + HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO1"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 86 , 12 ) ; }; Edit ED_INFO2 { + HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO2"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 29 ) ; Size = MAP_APPFONT ( 86 , 12 ) ; }; Edit ED_INFO3 { + HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO3"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 44 ) ; Size = MAP_APPFONT ( 86 , 12 ) ; }; Edit ED_INFO4 { + HelpID = "sfx2:Edit:DLG_DOCINFO_EDT:ED_INFO4"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 59 ) ; Size = MAP_APPFONT ( 86 , 12 ) ; diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src index f07d0873e454..bfa3948d90ac 100644 --- a/sfx2/source/dialog/mgetempl.src +++ b/sfx2/source/dialog/mgetempl.src @@ -44,12 +44,14 @@ TabPage TP_MANAGE_STYLES }; Edit ED_NAME { + HelpID = "sfx2:Edit:TP_MANAGE_STYLES:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 6 ) ; Size = MAP_APPFONT ( 184 , 12 ) ; }; CheckBox CB_AUTO { + HelpID = "sfx2:CheckBox:TP_MANAGE_STYLES:CB_AUTO"; Pos = MAP_APPFONT ( 164 , 8 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Hide = TRUE ; @@ -63,6 +65,7 @@ TabPage TP_MANAGE_STYLES }; ListBox LB_NEXT { + HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_NEXT"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 24 ) ; Size = MAP_APPFONT ( 184 , 65 ) ; @@ -79,6 +82,7 @@ TabPage TP_MANAGE_STYLES }; ListBox LB_BASE { + HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_BASE"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 42 ) ; Size = MAP_APPFONT ( 184 , 65 ) ; @@ -93,6 +97,7 @@ TabPage TP_MANAGE_STYLES }; ListBox LB_REGION { + HelpID = "sfx2:ListBox:TP_MANAGE_STYLES:LB_REGION"; Border = TRUE ; Pos = MAP_APPFONT ( 70 , 60 ) ; Size = MAP_APPFONT ( 184 , 64 ) ; @@ -107,6 +112,7 @@ TabPage TP_MANAGE_STYLES }; MultiLineEdit ED_DESC { + HelpID = "sfx2:MultiLineEdit:TP_MANAGE_STYLES:ED_DESC"; Pos = MAP_APPFONT ( 12 , 88 ) ; Size = MAP_APPFONT ( 236 , 85 ) ; ReadOnly = TRUE ; diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src index 90ed1a139cbb..b5954028779b 100644 --- a/sfx2/source/dialog/newstyle.src +++ b/sfx2/source/dialog/newstyle.src @@ -46,6 +46,7 @@ ModalDialog DLG_NEW_STYLE_BY_EXAMPLE }; ComboBox LB_COL { + HelpID = "sfx2:ComboBox:DLG_NEW_STYLE_BY_EXAMPLE:LB_COL"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 94 , 92 ) ; TabStop = TRUE ; diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src index fc58ecfda219..79cbb382ad36 100644 --- a/sfx2/source/dialog/passwd.src +++ b/sfx2/source/dialog/passwd.src @@ -47,6 +47,7 @@ ModalDialog DLG_PASSWD }; Edit ED_PASSWD_USER { + HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_USER"; Border = TRUE; Pos = MAP_APPFONT( 57, 14 ); Size = MAP_APPFONT( 75, 12 ); @@ -59,6 +60,7 @@ ModalDialog DLG_PASSWD }; Edit ED_PASSWD_PASSWORD { + HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_PASSWORD"; Border = TRUE; PassWord = TRUE; Pos = MAP_APPFONT( 57, 29 ); @@ -72,6 +74,7 @@ ModalDialog DLG_PASSWD }; Edit ED_PASSWD_CONFIRM { + HelpID = "sfx2:Edit:DLG_PASSWD:ED_PASSWD_CONFIRM"; Border = TRUE; PassWord = TRUE; Pos = MAP_APPFONT( 57, 44 ); diff --git a/sfx2/source/dialog/printopt.src b/sfx2/source/dialog/printopt.src index 4217539a3af8..01650f3e9275 100644 --- a/sfx2/source/dialog/printopt.src +++ b/sfx2/source/dialog/printopt.src @@ -60,6 +60,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_PRINTEROUTPUT { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_PRINTEROUTPUT"; TabStop = TRUE; Pos = MAP_APPFONT ( 81, 14 ) ; Size = MAP_APPFONT ( 60, 10 ) ; @@ -67,6 +68,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_PRINTFILEOUTPUT { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_PRINTFILEOUTPUT"; TabStop = TRUE; Pos = MAP_APPFONT ( 142, 14 ) ; Size = MAP_APPFONT ( 100, 10 ) ; @@ -83,6 +85,7 @@ TabPage TP_COMMONPRINTOPTIONS CheckBox CB_REDUCETRANSPARENCY { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCETRANSPARENCY"; TabStop = TRUE; Pos = MAP_APPFONT ( 18, 38 ) ; Size = MAP_APPFONT ( 115, 10 ) ; @@ -90,6 +93,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCETRANSPARENCY_AUTO { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCETRANSPARENCY_AUTO"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 51 ) ; Size = MAP_APPFONT ( 105, 10 ) ; @@ -97,6 +101,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCETRANSPARENCY_NONE { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCETRANSPARENCY_NONE"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 64 ) ; Size = MAP_APPFONT ( 105, 10 ) ; @@ -107,6 +112,7 @@ TabPage TP_COMMONPRINTOPTIONS CheckBox CB_REDUCEGRADIENTS { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEGRADIENTS"; TabStop = TRUE; Pos = MAP_APPFONT ( 136, 38 ) ; Size = MAP_APPFONT ( 121, 10 ) ; @@ -114,6 +120,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCEGRADIENTS_STRIPES { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEGRADIENTS_STRIPES"; TabStop = TRUE; Pos = MAP_APPFONT ( 146, 51 ) ; Size = MAP_APPFONT ( 77, 10 ) ; @@ -121,6 +128,7 @@ TabPage TP_COMMONPRINTOPTIONS }; NumericField NF_REDUCEGRADIENTS_STEPCOUNT { + HelpID = "sfx2:NumericField:TP_COMMONPRINTOPTIONS:NF_REDUCEGRADIENTS_STEPCOUNT"; TabStop = TRUE; Border = TRUE ; Pos = MAP_APPFONT ( 224, 49 ) ; @@ -132,6 +140,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCEGRADIENTS_COLOR { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEGRADIENTS_COLOR"; TabStop = TRUE; Pos = MAP_APPFONT ( 146, 64 ) ; Size = MAP_APPFONT ( 108, 10 ) ; @@ -142,6 +151,7 @@ TabPage TP_COMMONPRINTOPTIONS CheckBox CB_REDUCEBITMAPS { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS"; TabStop = TRUE; Pos = MAP_APPFONT ( 18, 80 ) ; Size = MAP_APPFONT ( 115, 10 ) ; @@ -149,6 +159,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCEBITMAPS_OPTIMAL { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_OPTIMAL"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 93 ) ; Size = MAP_APPFONT ( 226, 10 ) ; @@ -156,6 +167,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCEBITMAPS_NORMAL { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_NORMAL"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 106 ) ; Size = MAP_APPFONT ( 226, 10 ) ; @@ -163,6 +175,7 @@ TabPage TP_COMMONPRINTOPTIONS }; RadioButton RB_REDUCEBITMAPS_RESOLUTION { + HelpID = "sfx2:RadioButton:TP_COMMONPRINTOPTIONS:RB_REDUCEBITMAPS_RESOLUTION"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 119 ) ; Size = MAP_APPFONT ( 52, 10 ) ; @@ -170,6 +183,7 @@ TabPage TP_COMMONPRINTOPTIONS }; ListBox LB_REDUCEBITMAPS_RESOLUTION { + HelpID = "sfx2:ListBox:TP_COMMONPRINTOPTIONS:LB_REDUCEBITMAPS_RESOLUTION"; TabStop = TRUE; Border = TRUE ; Pos = MAP_APPFONT ( 81, 117 ) ; @@ -188,6 +202,7 @@ TabPage TP_COMMONPRINTOPTIONS }; CheckBox CB_REDUCEBITMAPS_TRANSPARENCY { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_REDUCEBITMAPS_TRANSPARENCY"; TabStop = TRUE; Pos = MAP_APPFONT ( 28, 132 ) ; Size = MAP_APPFONT ( 226, 10 ) ; @@ -198,6 +213,7 @@ TabPage TP_COMMONPRINTOPTIONS CheckBox CB_CONVERTTOGREYSCALES { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_CONVERTTOGREYSCALES"; TabStop = TRUE; Pos = MAP_APPFONT ( 136, 80 ) ; Size = MAP_APPFONT ( 123, 10 ) ; @@ -214,6 +230,7 @@ TabPage TP_COMMONPRINTOPTIONS }; CheckBox CB_PAPERSIZE { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERSIZE"; TabStop = TRUE; Pos = MAP_APPFONT ( 12, 159 ) ; Size = MAP_APPFONT ( 123, 10 ) ; @@ -221,6 +238,7 @@ TabPage TP_COMMONPRINTOPTIONS }; CheckBox CB_PAPERORIENTATION { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_PAPERORIENTATION"; TabStop = TRUE; Pos = MAP_APPFONT ( 12, 172 ) ; Size = MAP_APPFONT ( 123 , 10 ) ; @@ -228,6 +246,7 @@ TabPage TP_COMMONPRINTOPTIONS }; CheckBox CB_TRANSPARENCY { + HelpID = "sfx2:CheckBox:TP_COMMONPRINTOPTIONS:CB_TRANSPARENCY"; TabStop = TRUE; Pos = MAP_APPFONT ( 136, 159 ) ; Size = MAP_APPFONT ( 123, 10 ) ; @@ -241,6 +260,7 @@ TabPage TP_COMMONPRINTOPTIONS ModalDialog RID_WARN_PRINTTRANSPARENCY { + HelpID = "sfx2:ModalDialog:RID_WARN_PRINTTRANSPARENCY"; OutputSize = TRUE ; Size = MAP_APPFONT ( 195 , 85 ) ; Text [ en-US ] = "Warning" ; @@ -266,6 +286,7 @@ ModalDialog RID_WARN_PRINTTRANSPARENCY }; PushButton BTN_PRINTTRANS_NO { + HelpID = "sfx2:PushButton:RID_WARN_PRINTTRANSPARENCY:BTN_PRINTTRANS_NO"; Pos = MAP_APPFONT ( 68 , 48 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~No" ; @@ -278,6 +299,7 @@ ModalDialog RID_WARN_PRINTTRANSPARENCY }; CheckBox CBX_NOPRINTTRANSWARN { + HelpID = "sfx2:CheckBox:RID_WARN_PRINTTRANSPARENCY:CBX_NOPRINTTRANSWARN"; Pos = MAP_APPFONT ( 6 , 68 ) ; Size = MAP_APPFONT ( 183 , 10 ) ; Text [ en-US ] = "~Do not show warning again" ; diff --git a/sfx2/source/dialog/recfloat.src b/sfx2/source/dialog/recfloat.src index 5bdde1f57ab6..d71270d1e312 100644 --- a/sfx2/source/dialog/recfloat.src +++ b/sfx2/source/dialog/recfloat.src @@ -34,6 +34,7 @@ FloatingWindow SID_RECORDING_FLOATWINDOW { + HelpID = "sfx2:FloatingWindow:SID_RECORDING_FLOATWINDOW"; Moveable = TRUE ; Closeable = TRUE ; Hide = TRUE ; diff --git a/sfx2/source/dialog/srchdlg.src b/sfx2/source/dialog/srchdlg.src index 0947f3932981..d1cee69e9157 100644 --- a/sfx2/source/dialog/srchdlg.src +++ b/sfx2/source/dialog/srchdlg.src @@ -52,6 +52,7 @@ ModelessDialog RID_DLG_SEARCH }; ComboBox ED_SEARCH { + HelpID = "sfx2:ComboBox:RID_DLG_SEARCH:ED_SEARCH"; Border = TRUE; Pos = MAP_APPFONT( 6, 14 ); Size = MAP_APPFONT( 150, 50 ); @@ -60,6 +61,7 @@ ModelessDialog RID_DLG_SEARCH }; CheckBox CB_WHOLEWORDS { + HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_WHOLEWORDS"; Pos = MAP_APPFONT( 6, 29 ); Size = MAP_APPFONT( 150, 10 ); Text [ en-US ] = "~Whole words only" ; @@ -67,6 +69,7 @@ ModelessDialog RID_DLG_SEARCH }; CheckBox CB_MATCHCASE { + HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_MATCHCASE"; Pos = MAP_APPFONT( 6, 42 ); Size = MAP_APPFONT( 150, 10 ); Text[ en-US ] = "~Match case"; @@ -74,6 +77,7 @@ ModelessDialog RID_DLG_SEARCH }; CheckBox CB_WRAPAROUND { + HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_WRAPAROUND"; Pos = MAP_APPFONT( 6, 55 ); Size = MAP_APPFONT( 150, 10 ); Text [ en-US ] = "Wrap ~around" ; @@ -81,6 +85,7 @@ ModelessDialog RID_DLG_SEARCH }; CheckBox CB_BACKWARDS { + HelpID = "sfx2:CheckBox:RID_DLG_SEARCH:CB_BACKWARDS"; Pos = MAP_APPFONT( 6, 68 ); Size = MAP_APPFONT( 150, 10 ); Text [ en-US ] = "~Backwards" ; @@ -88,6 +93,7 @@ ModelessDialog RID_DLG_SEARCH }; PushButton PB_FIND { + HelpID = "sfx2:PushButton:RID_DLG_SEARCH:PB_FIND"; Pos = MAP_APPFONT( 162, 6 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "~Find" ; diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src index e5b4f1fd9cdf..60979450d9f6 100644 --- a/sfx2/source/dialog/templdlg.src +++ b/sfx2/source/dialog/templdlg.src @@ -78,6 +78,7 @@ ModalDialog RID_STYLECATALOG }; PushButton BT_ORG { + HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_ORG"; Pos = MAP_APPFONT ( 123 , 97 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Organizer..." ; @@ -85,6 +86,7 @@ ModalDialog RID_STYLECATALOG }; PushButton BT_DEL { + HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_DEL"; Pos = MAP_APPFONT ( 123 , 78 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Delete..." ; @@ -92,6 +94,7 @@ ModalDialog RID_STYLECATALOG }; PushButton BT_EDIT { + HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_EDIT"; Pos = MAP_APPFONT ( 123 , 60 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Modify..." ; @@ -99,6 +102,7 @@ ModalDialog RID_STYLECATALOG }; PushButton BT_NEW { + HelpID = "sfx2:PushButton:RID_STYLECATALOG:BT_NEW"; Pos = MAP_APPFONT ( 123 , 43 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~New..." ; @@ -112,6 +116,7 @@ ModalDialog RID_STYLECATALOG }; ListBox BT_TOOL { + HelpID = "sfx2:ListBox:RID_STYLECATALOG:BT_TOOL"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 110 , 55 ) ; @@ -128,6 +133,7 @@ ModalDialog RID_STYLECATALOG }; ListBox BT_FLIST { + HelpID = "sfx2:ListBox:RID_STYLECATALOG:BT_FLIST"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 114 ) ; Size = MAP_APPFONT ( 110 , 77 ) ; diff --git a/sfx2/source/dialog/versdlg.src b/sfx2/source/dialog/versdlg.src index 60aeb2777542..927c940e6506 100644 --- a/sfx2/source/dialog/versdlg.src +++ b/sfx2/source/dialog/versdlg.src @@ -28,6 +28,7 @@ #include "versdlg.hrc" ModalDialog DLG_VERSIONS { + HelpID = "sfx2:ModalDialog:DLG_VERSIONS"; OutputSize = TRUE ; Size = MAP_APPFONT ( 340 , 184 ) ; SvLook = TRUE ; @@ -41,6 +42,7 @@ ModalDialog DLG_VERSIONS }; PushButton PB_SAVE { + HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_SAVE"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 90 , 14 ) ; TabStop = TRUE ; @@ -48,6 +50,7 @@ ModalDialog DLG_VERSIONS }; CheckBox CB_SAVEONCLOSE { + HelpID = "sfx2:CheckBox:DLG_VERSIONS:CB_SAVEONCLOSE"; Pos = MAP_APPFONT ( 108 , 16 ) ; Size = MAP_APPFONT ( 164 , 10 ) ; TabStop = TRUE ; @@ -93,6 +96,7 @@ ModalDialog DLG_VERSIONS }; PushButton PB_OPEN { + HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_OPEN"; Pos = MAP_APPFONT ( 284 , 26 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -100,6 +104,7 @@ ModalDialog DLG_VERSIONS }; PushButton PB_VIEW { + HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_VIEW"; Pos = MAP_APPFONT ( 284 , 43 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -108,6 +113,7 @@ ModalDialog DLG_VERSIONS }; PushButton PB_DELETE { + HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_DELETE"; Pos = MAP_APPFONT ( 284 , 60 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -115,6 +121,7 @@ ModalDialog DLG_VERSIONS }; PushButton PB_COMPARE { + HelpID = "sfx2:PushButton:DLG_VERSIONS:PB_COMPARE"; Pos = MAP_APPFONT ( 284 , 77 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -130,6 +137,7 @@ ModalDialog DLG_VERSIONS }; ModalDialog DLG_COMMENTS { + HelpID = "sfx2:ModalDialog:DLG_COMMENTS"; OutputSize = TRUE ; Size = MAP_APPFONT ( 180 , 118 ) ; SvLook = TRUE ; @@ -148,6 +156,7 @@ ModalDialog DLG_COMMENTS }; MultiLineEdit ME_VERSIONS { + HelpID = "sfx2:MultiLineEdit:DLG_COMMENTS:ME_VERSIONS"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 32 ) ; Size = MAP_APPFONT ( 168 , 60 ) ; @@ -168,6 +177,7 @@ ModalDialog DLG_COMMENTS }; PushButton PB_CLOSE { + HelpID = "sfx2:PushButton:DLG_COMMENTS:PB_CLOSE"; Pos = MAP_APPFONT ( 68 , 98 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src index 3192de44c19a..1b50fd56c55e 100644 --- a/sfx2/source/doc/doctdlg.src +++ b/sfx2/source/doc/doctdlg.src @@ -46,6 +46,7 @@ ModalDialog DLG_DOC_TEMPLATE }; Edit ED_NAME { + HelpID = "sfx2:Edit:DLG_DOC_TEMPLATE:ED_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 200 , 12 ) ; @@ -64,6 +65,7 @@ ModalDialog DLG_DOC_TEMPLATE }; ListBox LB_SECTION { + HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_SECTION"; Border = TRUE ; Pos = MAP_APPFONT ( 12 , 56 ) ; Size = MAP_APPFONT ( 97 , 66 ) ; @@ -76,6 +78,7 @@ ModalDialog DLG_DOC_TEMPLATE }; ListBox LB_STYLESHEETS { + HelpID = "sfx2:ListBox:DLG_DOC_TEMPLATE:LB_STYLESHEETS"; Border = TRUE ; Pos = MAP_APPFONT ( 115 , 56 ) ; Size = MAP_APPFONT ( 97 , 66 ) ; @@ -99,12 +102,14 @@ ModalDialog DLG_DOC_TEMPLATE }; PushButton BT_EDIT { + HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_EDIT"; Pos = MAP_APPFONT ( 224 , 62 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Edit" ; }; PushButton BT_ORGANIZE { + HelpID = "sfx2:PushButton:DLG_DOC_TEMPLATE:BT_ORGANIZE"; Pos = MAP_APPFONT ( 224 , 79 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Organizer..." ; diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src index d9ef886f59bb..80ebed8b1708 100644 --- a/sfx2/source/doc/docvor.src +++ b/sfx2/source/doc/docvor.src @@ -61,6 +61,7 @@ ModalDialog DLG_ORGANIZE }; PushButton BTN_FILES { + HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_FILES"; Pos = MAP_APPFONT ( 205 , 143 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~File..." ; @@ -68,12 +69,14 @@ ModalDialog DLG_ORGANIZE }; PushButton BTN_ADDRESSTEMPLATE { + HelpID = "sfx2:PushButton:DLG_ORGANIZE:BTN_ADDRESSTEMPLATE"; Pos = MAP_APPFONT ( 205 , 124 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Address Book..." ; }; ListBox LB_LEFT_TYP { + HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_LEFT_TYP"; Border = TRUE ; Pos = MAP_APPFONT ( 3 , 144 ) ; Size = MAP_APPFONT ( 94 , 55 ) ; @@ -88,6 +91,7 @@ ModalDialog DLG_ORGANIZE }; ListBox LB_RIGHT_TYP { + HelpID = "sfx2:ListBox:DLG_ORGANIZE:LB_RIGHT_TYP"; Border = TRUE ; Pos = MAP_APPFONT ( 103 , 144 ) ; Size = MAP_APPFONT ( 94 , 55 ) ; @@ -142,6 +146,7 @@ ModalDialog DLG_ORGANIZE }; MenuButton BTN_EDIT { + HelpID = "sfx2:MenuButton:DLG_ORGANIZE:BTN_EDIT"; Pos = MAP_APPFONT ( 205 , 23 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "Commands" ; diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src index 63c9f49110dd..6737128cce43 100644 --- a/sfx2/source/doc/new.src +++ b/sfx2/source/doc/new.src @@ -59,6 +59,7 @@ ModalDialog DLG_NEW_FILE }; ListBox LB_REGION { + HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_REGION"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 18 ) ; Size = MAP_APPFONT ( 127 , 72 ) ; @@ -80,6 +81,7 @@ ModalDialog DLG_NEW_FILE }; ListBox LB_TEMPLATE { + HelpID = "sfx2:ListBox:DLG_NEW_FILE:LB_TEMPLATE"; Border = TRUE ; Pos = MAP_APPFONT ( 139 , 18 ) ; Size = MAP_APPFONT ( 127 , 72 ) ; @@ -87,6 +89,7 @@ ModalDialog DLG_NEW_FILE }; MoreButton BT_MORE { + HelpID = "sfx2:MoreButton:DLG_NEW_FILE:BT_MORE"; Pos = MAP_APPFONT ( 274 , 70 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~More" ; @@ -103,6 +106,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox BTN_PREVIEW { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:BTN_PREVIEW"; Pos = MAP_APPFONT ( 6 , 96 ) ; Size = MAP_APPFONT ( 97 , 10 ) ; Text [ en-US ] = "Pre~view" ; @@ -117,6 +121,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_TEXT_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_TEXT_STYLE"; Pos = MAP_APPFONT ( 6 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -124,6 +129,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_FRAME_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_FRAME_STYLE"; Pos = MAP_APPFONT ( 60 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -131,6 +137,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_PAGE_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_PAGE_STYLE"; Pos = MAP_APPFONT ( 114 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -138,6 +145,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_NUM_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_NUM_STYLE"; Pos = MAP_APPFONT ( 168 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -145,6 +153,7 @@ ModalDialog DLG_NEW_FILE }; CheckBox CB_MERGE_STYLE { + HelpID = "sfx2:CheckBox:DLG_NEW_FILE:CB_MERGE_STYLE"; Pos = MAP_APPFONT ( 222 , 94 ) ; Size = MAP_APPFONT ( 50 , 10 ) ; Hide = TRUE; @@ -152,6 +161,7 @@ ModalDialog DLG_NEW_FILE }; PushButton PB_LOAD_FILE { + HelpID = "sfx2:PushButton:DLG_NEW_FILE:PB_LOAD_FILE"; Pos = MAP_APPFONT ( 274 , 92 ) ; Size = MAP_APPFONT ( 56 , 14 ) ; Hide = TRUE; @@ -170,6 +180,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_TITLE { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 121 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -185,6 +196,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_THEMA { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_THEMA"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 148 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -200,6 +212,7 @@ ModalDialog DLG_NEW_FILE }; Edit ED_KEYWORDS { + HelpID = "sfx2:Edit:DLG_NEW_FILE:ED_KEYWORDS"; Border = TRUE ; Pos = MAP_APPFONT ( 145 , 175 ) ; Size = MAP_APPFONT ( 175 , 12 ) ; @@ -215,6 +228,7 @@ ModalDialog DLG_NEW_FILE }; MultiLineEdit ED_DESC { + HelpID = "sfx2:MultiLineEdit:DLG_NEW_FILE:ED_DESC"; Border = TRUE ; Pos = MAP_APPFONT ( 144 , 202 ) ; Size = MAP_APPFONT ( 175 , 32 ) ; diff --git a/svx/source/dialog/bmpmask.src b/svx/source/dialog/bmpmask.src index e65ce8c119aa..a9cd2fe60b2f 100644 --- a/svx/source/dialog/bmpmask.src +++ b/svx/source/dialog/bmpmask.src @@ -78,6 +78,7 @@ DockingWindow RID_SVXDLG_BMPMASK CheckBox CBX_1 { + HelpID = "svx:CheckBox:RID_SVXDLG_BMPMASK:CBX_1"; Pos = MAP_APPFONT ( 12 , 50 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; @@ -92,6 +93,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; MetricField SP_1 { + HelpID = "svx:MetricField:RID_SVXDLG_BMPMASK:SP_1"; Border = TRUE ; Pos = MAP_APPFONT ( 58 , 48 ) ; Size = MAP_APPFONT ( 29 , 12 ) ; @@ -106,6 +108,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; ListBox LB_1 { + HelpID = "svx:ListBox:RID_SVXDLG_BMPMASK:LB_1"; Border = TRUE ; Pos = MAP_APPFONT ( 93 , 48 ) ; Size = MAP_APPFONT ( 64 , 75 ) ; @@ -118,6 +121,7 @@ DockingWindow RID_SVXDLG_BMPMASK CheckBox CBX_2 { + HelpID = "svx:CheckBox:RID_SVXDLG_BMPMASK:CBX_2"; Pos = MAP_APPFONT ( 12 , 65 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; @@ -132,6 +136,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; MetricField SP_2 { + HelpID = "svx:MetricField:RID_SVXDLG_BMPMASK:SP_2"; Border = TRUE ; Pos = MAP_APPFONT ( 58 , 63 ) ; Size = MAP_APPFONT ( 29 , 12 ) ; @@ -146,6 +151,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; ListBox LB_2 { + HelpID = "svx:ListBox:RID_SVXDLG_BMPMASK:LB_2"; Border = TRUE ; Pos = MAP_APPFONT ( 93 , 63 ) ; Size = MAP_APPFONT ( 64 , 75 ) ; @@ -158,6 +164,7 @@ DockingWindow RID_SVXDLG_BMPMASK CheckBox CBX_3 { + HelpID = "svx:CheckBox:RID_SVXDLG_BMPMASK:CBX_3"; Pos = MAP_APPFONT ( 12 , 80 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; @@ -172,6 +179,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; MetricField SP_3 { + HelpID = "svx:MetricField:RID_SVXDLG_BMPMASK:SP_3"; Border = TRUE ; Pos = MAP_APPFONT ( 58, 78 ) ; Size = MAP_APPFONT ( 29 , 12 ) ; @@ -186,6 +194,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; ListBox LB_3 { + HelpID = "svx:ListBox:RID_SVXDLG_BMPMASK:LB_3"; Border = TRUE ; Pos = MAP_APPFONT ( 93 , 78 ) ; Size = MAP_APPFONT ( 64 , 75 ) ; @@ -198,6 +207,7 @@ DockingWindow RID_SVXDLG_BMPMASK CheckBox CBX_4 { + HelpID = "svx:CheckBox:RID_SVXDLG_BMPMASK:CBX_4"; Pos = MAP_APPFONT ( 12 , 95 ) ; Size = MAP_APPFONT ( 10 , 10 ) ; TabStop = TRUE ; @@ -212,6 +222,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; MetricField SP_4 { + HelpID = "svx:MetricField:RID_SVXDLG_BMPMASK:SP_4"; Border = TRUE ; Pos = MAP_APPFONT ( 58 , 93 ) ; Size = MAP_APPFONT ( 29 , 12 ) ; @@ -226,6 +237,7 @@ DockingWindow RID_SVXDLG_BMPMASK }; ListBox LB_4 { + HelpID = "svx:ListBox:RID_SVXDLG_BMPMASK:LB_4"; Border = TRUE ; Pos = MAP_APPFONT ( 93 , 93 ) ; Size = MAP_APPFONT ( 64 , 75 ) ; @@ -236,6 +248,7 @@ DockingWindow RID_SVXDLG_BMPMASK CheckBox CBX_TRANS { + HelpID = "svx:CheckBox:RID_SVXDLG_BMPMASK:CBX_TRANS"; Pos = MAP_APPFONT ( 12 , 110 ) ; Size = MAP_APPFONT ( 71 , 10 ) ; TabStop = TRUE ; @@ -244,6 +257,7 @@ DockingWindow RID_SVXDLG_BMPMASK PushButton BTN_EXEC { + HelpID = "svx:PushButton:RID_SVXDLG_BMPMASK:BTN_EXEC"; Pos = MAP_APPFONT ( 93 , 6 ) ; Size = MAP_APPFONT ( 64 , 14 ) ; Text [ en-US ] = "~Replace" ; @@ -251,6 +265,7 @@ DockingWindow RID_SVXDLG_BMPMASK ListBox LB_TRANS { + HelpID = "svx:ListBox:RID_SVXDLG_BMPMASK:LB_TRANS"; Border = TRUE ; Pos = MAP_APPFONT ( 93 , 108 ) ; Size = MAP_APPFONT ( 64 , 75 ) ; diff --git a/svx/source/dialog/contdlg.src b/svx/source/dialog/contdlg.src index 1b1923c66eab..bf587b3b1fda 100644 --- a/svx/source/dialog/contdlg.src +++ b/svx/source/dialog/contdlg.src @@ -33,6 +33,7 @@ // RID_SVXDLG_CONTOUR ---------------------------------------------------- FloatingWindow RID_SVXDLG_CONTOUR { + HelpID = "svx:FloatingWindow:RID_SVXDLG_CONTOUR"; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; @@ -176,6 +177,7 @@ FloatingWindow RID_SVXDLG_CONTOUR }; MetricField MTF_TOLERANCE { + HelpID = "svx:MetricField:RID_SVXDLG_CONTOUR:MTF_TOLERANCE"; Border = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( 28 , 12 ) ; diff --git a/svx/source/dialog/docrecovery.src b/svx/source/dialog/docrecovery.src index 7c1532b71b55..cf9cf6f0adcf 100644 --- a/svx/source/dialog/docrecovery.src +++ b/svx/source/dialog/docrecovery.src @@ -79,6 +79,7 @@ TabPage RID_SVXPAGE_DOCRECOVERY_SAVE }; ListBox LB_SAVE_FILELIST { + HelpID = "svx:ListBox:RID_SVXPAGE_DOCRECOVERY_SAVE:LB_SAVE_FILELIST"; Pos = MAP_APPFONT( SAVE_COL0 , SAVE_ROW4 ); Size = MAP_APPFONT( SAVE_CONTROLWIDTH, SAVE_FILELISTHEIGHT ); Border = TRUE; @@ -193,6 +194,7 @@ TabPage RID_SVXPAGE_DOCRECOVERY_RECOVER }; PushButton BTN_RECOV_NEXT { + HelpID = "svx:PushButton:RID_SVXPAGE_DOCRECOVERY_RECOVER:BTN_RECOV_NEXT"; Pos = MAP_APPFONT( RECOV_COL_C, RECOV_ROW9 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH*2, RSC_CD_PUSHBUTTON_HEIGHT ); Text[ en-US ] = "~Start Recovery >"; @@ -300,6 +302,7 @@ ModalDialog RID_SVX_MDLG_DOCRECOVERY_BROKEN }; ListBox LB_BROKEN_FILELIST { + HelpID = "svx:ListBox:RID_SVX_MDLG_DOCRECOVERY_BROKEN:LB_BROKEN_FILELIST"; Pos = MAP_APPFONT( BROKEN_COL0, BROKEN_ROW2 ); Size = MAP_APPFONT( BROKEN_CONTROLWIDTH, (BROKEN_ROW3-BROKEN_ROW2) ); Border = TRUE; @@ -313,12 +316,14 @@ ModalDialog RID_SVX_MDLG_DOCRECOVERY_BROKEN }; Edit ED_BROKEN_SAVEDIR { + HelpID = "svx:Edit:RID_SVX_MDLG_DOCRECOVERY_BROKEN:ED_BROKEN_SAVEDIR"; Pos = MAP_APPFONT( BROKEN_COL0, BROKEN_ROW5 + 1 ); // center to pushbutton Size = MAP_APPFONT( BROKEN_COL2 - BROKEN_COL0, RSC_CD_TEXTBOX_HEIGHT ); Border = TRUE; }; PushButton BTN_BROKEN_SAVEDIR { + HelpID = "svx:PushButton:RID_SVX_MDLG_DOCRECOVERY_BROKEN:BTN_BROKEN_SAVEDIR"; Pos = MAP_APPFONT( BROKEN_COL3, BROKEN_ROW5 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text [ en-US ] = "Chan~ge..."; @@ -379,6 +384,7 @@ TabPage RID_SVXPAGE_ERR_REP_WELCOME }; PushButton BTN_RECOV_PREV { + HelpID = "svx:PushButton:RID_SVXPAGE_ERR_REP_WELCOME:BTN_RECOV_PREV"; Pos = MAP_APPFONT( RECOV_COL_C, RECOV_ROW9 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text[ en-US ] = "< ~Back"; @@ -437,6 +443,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND }; Edit ED_ERRSEND_DOCTYPE { + HelpID = "svx:Edit:RID_SVXPAGE_ERR_REP_SEND:ED_ERRSEND_DOCTYPE"; Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW5 ); Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_TEXTBOX_HEIGHT ); Border = TRUE; @@ -449,6 +456,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND }; MultiLineEdit ML_ERRSEND_USING { + HelpID = "svx:MultiLineEdit:RID_SVXPAGE_ERR_REP_SEND:ML_ERRSEND_USING"; Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW8 ); Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, (ERRSEND_ROW12-ERRSEND_ROW8-RSC_SP_CTRL_Y) ); VScroll = TRUE; @@ -457,18 +465,21 @@ TabPage RID_SVXPAGE_ERR_REP_SEND }; PushButton BTN_ERRSEND_SHOWREP { + HelpID = "svx:PushButton:RID_SVXPAGE_ERR_REP_SEND:BTN_ERRSEND_SHOWREP"; Pos = MAP_APPFONT( ERRSEND_COL3, ERRSEND_ROW8 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text[ en-US ] = "Show ~Report"; }; PushButton BTN_ERRSEND_OPT { + HelpID = "svx:PushButton:RID_SVXPAGE_ERR_REP_SEND:BTN_ERRSEND_OPT"; Pos = MAP_APPFONT( ERRSEND_COL3, ERRSEND_ROW10 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text[ en-US ] = "~Options..."; }; CheckBox CB_ERRSEND_CONTACT { + HelpID = "svx:CheckBox:RID_SVXPAGE_ERR_REP_SEND:CB_ERRSEND_CONTACT"; Pos = MAP_APPFONT( ERRSEND_COL0, ERRSEND_ROW12 ); Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH2, RSC_CD_CHECKBOX_HEIGHT ); Check = FALSE; @@ -482,6 +493,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND }; Edit ED_ERRSEND_EMAILADDR { + HelpID = "svx:Edit:RID_SVXPAGE_ERR_REP_SEND:ED_ERRSEND_EMAILADDR"; Pos = MAP_APPFONT( ERRSEND_COL1, ERRSEND_ROW14 ); Size = MAP_APPFONT( ERRSEND_CONTROLWIDTH3, RSC_CD_TEXTBOX_HEIGHT ); Border = TRUE; @@ -493,6 +505,7 @@ TabPage RID_SVXPAGE_ERR_REP_SEND }; PushButton BTN_RECOV_PREV { + HelpID = "svx:PushButton:RID_SVXPAGE_ERR_REP_SEND:BTN_RECOV_PREV"; Pos = MAP_APPFONT( ERRSEND_COL5, ERRSEND_ROW16 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text[ en-US ] = "< ~Back"; @@ -530,6 +543,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_OPTIONS RadioButton BTN_ERROPT_SYSTEM { + HelpID = "svx:RadioButton:RID_SVX_MDLG_ERR_REP_OPTIONS:BTN_ERROPT_SYSTEM"; Pos = MAP_APPFONT( ERROPT_COLB, ERROPT_ROW1 ); Size = MAP_APPFONT( ERROPT_COLF - ERROPT_COLB, RSC_CD_RADIOBUTTON_HEIGHT ); Text[ en-US ] = "Use ~system settings"; @@ -537,6 +551,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_OPTIONS RadioButton BTN_ERROPT_DIRECT { + HelpID = "svx:RadioButton:RID_SVX_MDLG_ERR_REP_OPTIONS:BTN_ERROPT_DIRECT"; Pos = MAP_APPFONT( ERROPT_COLB, ERROPT_ROW2 ); Size = MAP_APPFONT( ERROPT_COLF - ERROPT_COLB, RSC_CD_RADIOBUTTON_HEIGHT ); Text[ en-US ] = "Use ~direct connection to the Internet"; @@ -544,6 +559,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_OPTIONS RadioButton BTN_ERROPT_MANUAL { + HelpID = "svx:RadioButton:RID_SVX_MDLG_ERR_REP_OPTIONS:BTN_ERROPT_MANUAL"; Pos = MAP_APPFONT( ERROPT_COLB, ERROPT_ROW3 ); Size = MAP_APPFONT( ERROPT_COLF - ERROPT_COLB, RSC_CD_RADIOBUTTON_HEIGHT ); Text[ en-US ] = "Use ~manual settings"; @@ -558,6 +574,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_OPTIONS Edit ED_ERROPT_PROXYSERVER { + HelpID = "svx:Edit:RID_SVX_MDLG_ERR_REP_OPTIONS:ED_ERROPT_PROXYSERVER"; Pos = MAP_APPFONT( ERROPT_COLC, ERROPT_ROW5 ); Size = MAP_APPFONT( ERROPT_SERVER_WIDTH, RSC_CD_TEXTBOX_HEIGHT ); Border = TRUE; @@ -572,6 +589,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_OPTIONS Edit ED_ERROPT_PROXYPORT { + HelpID = "svx:Edit:RID_SVX_MDLG_ERR_REP_OPTIONS:ED_ERROPT_PROXYPORT"; Pos = MAP_APPFONT( ERROPT_COLC + ERROPT_SERVER_WIDTH + RSC_SP_CTRL_GROUP_X, ERROPT_ROW5 ); Size = MAP_APPFONT( ERROPT_PORT_WIDTH, RSC_CD_TEXTBOX_HEIGHT ); Border = TRUE; @@ -618,6 +636,7 @@ ModalDialog RID_SVX_MDLG_ERR_REP_PREVIEW MultiLineEdit ML_ERRPREVIEW_CONTENT { + HelpID = "svx:MultiLineEdit:RID_SVX_MDLG_ERR_REP_PREVIEW:ML_ERRPREVIEW_CONTENT"; Pos = MAP_APPFONT( ERRPREVIEW_COLA, ERRPREVIEW_ROW0 ); Size = MAP_APPFONT( ERRPREVIEW_COLC - ERRPREVIEW_COLA, ERRPREVIEW_ROW1 - ERRPREVIEW_ROW0 ); VScroll = TRUE; diff --git a/svx/source/dialog/fontwork.src b/svx/source/dialog/fontwork.src index c6239dc5ef09..92d1be8abc97 100644 --- a/svx/source/dialog/fontwork.src +++ b/svx/source/dialog/fontwork.src @@ -164,6 +164,7 @@ DockingWindow RID_SVXDLG_FONTWORK }; MetricField MTR_FLD_DISTANCE { + HelpID = "svx:MetricField:RID_SVXDLG_FONTWORK:MTR_FLD_DISTANCE"; Border = TRUE ; Pos = MAP_APPFONT ( 29 , 85 ) ; Size = MAP_APPFONT ( 48 , 12 ) ; @@ -188,6 +189,7 @@ DockingWindow RID_SVXDLG_FONTWORK }; MetricField MTR_FLD_TEXTSTART { + HelpID = "svx:MetricField:RID_SVXDLG_FONTWORK:MTR_FLD_TEXTSTART"; Border = TRUE ; Pos = MAP_APPFONT ( 29 , 100 ) ; Size = MAP_APPFONT ( 48 , 12 ) ; @@ -261,6 +263,7 @@ DockingWindow RID_SVXDLG_FONTWORK }; MetricField MTR_FLD_SHADOW_X { + HelpID = "svx:MetricField:RID_SVXDLG_FONTWORK:MTR_FLD_SHADOW_X"; Border = TRUE ; Pos = MAP_APPFONT ( 29 , 144 ) ; Size = MAP_APPFONT ( 48 , 12 ) ; @@ -285,6 +288,7 @@ DockingWindow RID_SVXDLG_FONTWORK }; MetricField MTR_FLD_SHADOW_Y { + HelpID = "svx:MetricField:RID_SVXDLG_FONTWORK:MTR_FLD_SHADOW_Y"; Border = TRUE ; Pos = MAP_APPFONT ( 29 , 159 ) ; Size = MAP_APPFONT ( 48 , 12 ) ; @@ -302,6 +306,7 @@ DockingWindow RID_SVXDLG_FONTWORK }; ListBox CLB_SHADOW_COLOR { + HelpID = "svx:ListBox:RID_SVXDLG_FONTWORK:CLB_SHADOW_COLOR"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 174 ) ; Size = MAP_APPFONT ( 71 , 60 ) ; diff --git a/svx/source/dialog/hdft.src b/svx/source/dialog/hdft.src index e93d18ff351f..1cd402611dc8 100644 --- a/svx/source/dialog/hdft.src +++ b/svx/source/dialog/hdft.src @@ -46,12 +46,14 @@ TabPage RID_SVXPAGE_HEADER Size = MAP_APPFONT ( 260 , 185 ) ; CheckBox CB_TURNON { + HelpID = "svx:CheckBox:RID_SVXPAGE_HEADER:CB_TURNON"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "Hea~der on" ; }; CheckBox CB_SHARED { + HelpID = "svx:CheckBox:RID_SVXPAGE_HEADER:CB_SHARED"; Pos = MAP_APPFONT ( 12 , 30 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "Same ~content left/right" ; @@ -65,6 +67,7 @@ TabPage RID_SVXPAGE_HEADER }; MetricField ED_LMARGIN { + HelpID = "svx:MetricField:RID_SVXPAGE_HEADER:ED_LMARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 46 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -87,6 +90,7 @@ TabPage RID_SVXPAGE_HEADER }; MetricField ED_RMARGIN { + HelpID = "svx:MetricField:RID_SVXPAGE_HEADER:ED_RMARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 62 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -109,6 +113,7 @@ TabPage RID_SVXPAGE_HEADER }; MetricField ED_DIST { + HelpID = "svx:MetricField:RID_SVXPAGE_HEADER:ED_DIST"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 80 ) ; @@ -124,6 +129,7 @@ TabPage RID_SVXPAGE_HEADER }; CheckBox CB_DYNSPACING { + HelpID = "svx:CheckBox:RID_SVXPAGE_HEADER:CB_DYNSPACING"; Pos = MAP_APPFONT ( 12 , 96 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Hide = TRUE; @@ -137,6 +143,7 @@ TabPage RID_SVXPAGE_HEADER }; MetricField ED_HEIGHT { + HelpID = "svx:MetricField:RID_SVXPAGE_HEADER:ED_HEIGHT"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 96 ) ; @@ -154,6 +161,7 @@ TabPage RID_SVXPAGE_HEADER }; CheckBox CB_HEIGHT_DYN { + HelpID = "svx:CheckBox:RID_SVXPAGE_HEADER:CB_HEIGHT_DYN"; Pos = MAP_APPFONT ( 12 , 112 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "~AutoFit height" ; @@ -171,6 +179,7 @@ TabPage RID_SVXPAGE_HEADER }; PushButton BTN_EXTRAS { + HelpID = "svx:PushButton:RID_SVXPAGE_HEADER:BTN_EXTRAS"; Pos = MAP_APPFONT ( 12 , 130 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~More..." ; @@ -185,12 +194,14 @@ TabPage RID_SVXPAGE_FOOTER Size = MAP_APPFONT ( 260 , 185 ) ; CheckBox CB_TURNON { + HelpID = "svx:CheckBox:RID_SVXPAGE_FOOTER:CB_TURNON"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "~Footer on" ; }; CheckBox CB_SHARED { + HelpID = "svx:CheckBox:RID_SVXPAGE_FOOTER:CB_SHARED"; Pos = MAP_APPFONT ( 12 , 30 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "Same ~content left/right" ; @@ -204,6 +215,7 @@ TabPage RID_SVXPAGE_FOOTER }; MetricField ED_LMARGIN { + HelpID = "svx:MetricField:RID_SVXPAGE_FOOTER:ED_LMARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 46 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -226,6 +238,7 @@ TabPage RID_SVXPAGE_FOOTER }; MetricField ED_RMARGIN { + HelpID = "svx:MetricField:RID_SVXPAGE_FOOTER:ED_RMARGIN"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 62 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -247,6 +260,7 @@ TabPage RID_SVXPAGE_FOOTER }; MetricField ED_DIST { + HelpID = "svx:MetricField:RID_SVXPAGE_FOOTER:ED_DIST"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 80 ) ; @@ -262,6 +276,7 @@ TabPage RID_SVXPAGE_FOOTER }; CheckBox CB_DYNSPACING { + HelpID = "svx:CheckBox:RID_SVXPAGE_FOOTER:CB_DYNSPACING"; Pos = MAP_APPFONT ( 12 , 96 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Hide = TRUE; @@ -276,6 +291,7 @@ TabPage RID_SVXPAGE_FOOTER }; MetricField ED_HEIGHT { + HelpID = "svx:MetricField:RID_SVXPAGE_FOOTER:ED_HEIGHT"; Disable = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 96 ) ; @@ -293,6 +309,7 @@ TabPage RID_SVXPAGE_FOOTER }; CheckBox CB_HEIGHT_DYN { + HelpID = "svx:CheckBox:RID_SVXPAGE_FOOTER:CB_HEIGHT_DYN"; Pos = MAP_APPFONT ( 12 , 112 ) ; Size = MAP_APPFONT ( 152 , 10 ) ; Text [ en-US ] = "~AutoFit height" ; @@ -311,6 +328,7 @@ TabPage RID_SVXPAGE_FOOTER }; PushButton BTN_EXTRAS { + HelpID = "svx:PushButton:RID_SVXPAGE_FOOTER:BTN_EXTRAS"; Pos = MAP_APPFONT ( 12 , 130 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~More..." ; diff --git a/svx/source/dialog/imapdlg.src b/svx/source/dialog/imapdlg.src index a61a9e34fa5e..d691f5443b5a 100644 --- a/svx/source/dialog/imapdlg.src +++ b/svx/source/dialog/imapdlg.src @@ -32,6 +32,7 @@ // RID_SVXDLG_IMAP ---------------------------------------------------- ModelessDialog RID_SVXDLG_IMAP { + HelpID = "svx:ModelessDialog:RID_SVXDLG_IMAP"; OutputSize = TRUE ; Hide = TRUE ; SVLook = TRUE ; @@ -193,6 +194,7 @@ ModelessDialog RID_SVXDLG_IMAP }; ComboBox CBB_URL { + HelpID = "svx:ComboBox:RID_SVXDLG_IMAP:CBB_URL"; Pos = MAP_APPFONT ( 39 , 23 ) ; Size = MAP_APPFONT ( 225 , 69 ) ; TabStop = TRUE ; @@ -208,6 +210,7 @@ ModelessDialog RID_SVXDLG_IMAP }; Edit EDT_TEXT { + HelpID = "svx:Edit:RID_SVXDLG_IMAP:EDT_TEXT"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 39 , 41 ) ; @@ -226,6 +229,7 @@ ModelessDialog RID_SVXDLG_IMAP // nur temporaer ComboBox RID_SVXCTL_CBB_TARGET { + HelpID = "svx:ComboBox:RID_SVXDLG_IMAP:RID_SVXCTL_CBB_TARGET"; Border = TRUE ; Sort = TRUE ; Pos = MAP_APPFONT ( 213 , 41 ) ; diff --git a/svx/source/dialog/optgrid.src b/svx/source/dialog/optgrid.src index 8db8d0b54643..2bc7b430f807 100644 --- a/svx/source/dialog/optgrid.src +++ b/svx/source/dialog/optgrid.src @@ -45,6 +45,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_USE_GRIDSNAP { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_USE_GRIDSNAP"; Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 204 , 10 ) ; TabStop = TRUE ; @@ -52,6 +53,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_GRID_VISIBLE { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_GRID_VISIBLE"; Pos = MAP_APPFONT ( 12 , 27 ) ; Size = MAP_APPFONT ( 204 , 10 ) ; TabStop = TRUE ; @@ -77,6 +79,7 @@ TabPage RID_SVXPAGE_GRID }; MetricField MTR_FLD_DRAW_X { + HelpID = "svx:MetricField:RID_SVXPAGE_GRID:MTR_FLD_DRAW_X"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 54 ) ; Size = MAP_APPFONT ( 45 , 12 ) ; @@ -94,6 +97,7 @@ TabPage RID_SVXPAGE_GRID }; MetricField MTR_FLD_DRAW_Y { + HelpID = "svx:MetricField:RID_SVXPAGE_GRID:MTR_FLD_DRAW_Y"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 69 ) ; Size = MAP_APPFONT ( 45 , 12 ) ; @@ -129,6 +133,7 @@ TabPage RID_SVXPAGE_GRID }; NumericField NUM_FLD_DIVISION_X { + HelpID = "svx:NumericField:RID_SVXPAGE_GRID:NUM_FLD_DIVISION_X"; Border = TRUE ; Pos = MAP_APPFONT ( 195 , 54 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; @@ -148,6 +153,7 @@ TabPage RID_SVXPAGE_GRID }; NumericField NUM_FLD_DIVISION_Y { + HelpID = "svx:NumericField:RID_SVXPAGE_GRID:NUM_FLD_DIVISION_Y"; Border = TRUE ; Pos = MAP_APPFONT ( 195 , 69 ) ; Size = MAP_APPFONT ( 25 , 12 ) ; @@ -167,6 +173,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_SYNCHRONIZE { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_SYNCHRONIZE"; Pos = MAP_APPFONT ( 12 , 84 ) ; Size = MAP_APPFONT ( 127 , 10 ) ; TabStop = TRUE ; @@ -182,6 +189,7 @@ TabPage RID_SVXPAGE_GRID CheckBox CBX_SNAP_HELPLINES { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_SNAP_HELPLINES"; Pos = MAP_APPFONT ( 12 , 111 ) ; Size = MAP_APPFONT ( 106 , 10 ) ; Hide = TRUE; @@ -190,6 +198,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_SNAP_BORDER { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_SNAP_BORDER"; Hide = TRUE; TabStop = TRUE ; Pos = MAP_APPFONT ( 12 , 125 ) ; @@ -198,6 +207,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_SNAP_FRAME { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_SNAP_FRAME"; Pos = MAP_APPFONT ( 12 , 139 ) ; Size = MAP_APPFONT ( 106 , 10 ) ; Hide = TRUE; @@ -206,6 +216,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_SNAP_POINTS { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_SNAP_POINTS"; Pos = MAP_APPFONT ( 12 , 153 ) ; Size = MAP_APPFONT ( 106 , 10 ) ; Hide = TRUE; @@ -221,6 +232,7 @@ TabPage RID_SVXPAGE_GRID }; MetricField MTR_FLD_SNAP_AREA { + HelpID = "svx:MetricField:RID_SVXPAGE_GRID:MTR_FLD_SNAP_AREA"; Border = TRUE ; Pos = MAP_APPFONT ( 83 , 167 ) ; Size = MAP_APPFONT ( 35 , 12 ) ; @@ -252,6 +264,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_ORTHO { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_ORTHO"; Pos = MAP_APPFONT ( 136 , 111 ) ; Size = MAP_APPFONT ( 112 , 10 ) ; Hide = TRUE; @@ -260,6 +273,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_BIGORTHO { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_BIGORTHO"; Pos = MAP_APPFONT ( 136 , 125 ) ; Size = MAP_APPFONT ( 112 , 10 ) ; Hide = TRUE; @@ -268,6 +282,7 @@ TabPage RID_SVXPAGE_GRID }; CheckBox CBX_ROTATE { + HelpID = "svx:CheckBox:RID_SVXPAGE_GRID:CBX_ROTATE"; Pos = MAP_APPFONT ( 136 , 139 ) ; // 136, 111 Size = MAP_APPFONT ( 55 , 10 ) ; @@ -277,6 +292,7 @@ TabPage RID_SVXPAGE_GRID }; MetricField MTR_FLD_ANGLE { + HelpID = "svx:MetricField:RID_SVXPAGE_GRID:MTR_FLD_ANGLE"; Border = TRUE ; Pos = MAP_APPFONT ( 194 , 137 ) ; // 190, 111 @@ -302,6 +318,7 @@ TabPage RID_SVXPAGE_GRID }; MetricField MTR_FLD_BEZ_ANGLE { + HelpID = "svx:MetricField:RID_SVXPAGE_GRID:MTR_FLD_BEZ_ANGLE"; Border = TRUE ; Pos = MAP_APPFONT ( 194 , 154 ) ; Size = MAP_APPFONT ( 54 , 12 ) ; diff --git a/svx/source/dialog/passwd.src b/svx/source/dialog/passwd.src index 256628a2caca..821ede7c9357 100644 --- a/svx/source/dialog/passwd.src +++ b/svx/source/dialog/passwd.src @@ -46,6 +46,7 @@ ModalDialog RID_SVXDLG_PASSWORD }; Edit ED_OLD_PASSWD { + HelpID = "svx:Edit:RID_SVXDLG_PASSWORD:ED_OLD_PASSWD"; Border = TRUE ; Pos = MAP_APPFONT ( 71 , 14 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; @@ -65,6 +66,7 @@ ModalDialog RID_SVXDLG_PASSWORD }; Edit ED_NEW_PASSWD { + HelpID = "svx:Edit:RID_SVXDLG_PASSWORD:ED_NEW_PASSWD"; Border = TRUE ; Pos = MAP_APPFONT ( 71 , 43 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; @@ -78,6 +80,7 @@ ModalDialog RID_SVXDLG_PASSWORD }; Edit ED_REPEAT_PASSWD { + HelpID = "svx:Edit:RID_SVXDLG_PASSWORD:ED_REPEAT_PASSWD"; Border = TRUE ; Pos = MAP_APPFONT ( 71 , 59 ) ; Size = MAP_APPFONT ( 71 , 12 ) ; diff --git a/svx/source/dialog/rubydialog.src b/svx/source/dialog/rubydialog.src index 6b83f01fc2ee..e10d4d0e57e2 100644 --- a/svx/source/dialog/rubydialog.src +++ b/svx/source/dialog/rubydialog.src @@ -42,6 +42,7 @@ ModelessDialog RID_SVXDLG_RUBY Closeable = TRUE ; CheckBox CB_AUTO_DETECT { + HelpID = "svx:CheckBox:RID_SVXDLG_RUBY:CB_AUTO_DETECT"; Pos = MAP_APPFONT ( 6, 6 ) ; Size = MAP_APPFONT ( 186 , 12 ) ; Text [ en-US ] = "Automatic detection"; @@ -60,6 +61,7 @@ ModelessDialog RID_SVXDLG_RUBY }; Edit ED_LEFT_1 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_LEFT_1"; Pos = MAP_APPFONT ( 6 , 30 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Hide = False; @@ -67,42 +69,49 @@ ModelessDialog RID_SVXDLG_RUBY }; Edit ED_RIGHT_1 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_RIGHT_1"; Pos = MAP_APPFONT ( 109 , 30 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_LEFT_2 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_LEFT_2"; Pos = MAP_APPFONT ( 6 , 42) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_RIGHT_2 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_RIGHT_2"; Pos = MAP_APPFONT ( 109 , 42 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_LEFT_3 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_LEFT_3"; Pos = MAP_APPFONT ( 6 , 54 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_RIGHT_3 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_RIGHT_3"; Pos = MAP_APPFONT ( 109 , 54 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_LEFT_4 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_LEFT_4"; Pos = MAP_APPFONT ( 6 , 66 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; }; Edit ED_RIGHT_4 { + HelpID = "svx:Edit:RID_SVXDLG_RUBY:ED_RIGHT_4"; Pos = MAP_APPFONT ( 109 , 66 ) ; Size = MAP_APPFONT ( 102 , 12 ) ; Border = TRUE; @@ -122,6 +131,7 @@ ModelessDialog RID_SVXDLG_RUBY }; ListBox LB_ADJUST { + HelpID = "svx:ListBox:RID_SVXDLG_RUBY:LB_ADJUST"; Pos = MAP_APPFONT ( 6 , 93) ; Size = MAP_APPFONT ( 35 , 60 ) ; DropDown = TRUE; @@ -143,6 +153,7 @@ ModelessDialog RID_SVXDLG_RUBY }; ListBox LB_POSITION { + HelpID = "svx:ListBox:RID_SVXDLG_RUBY:LB_POSITION"; Pos = MAP_APPFONT ( 43 , 93) ; Size = MAP_APPFONT ( 35 , 60 ) ; DropDown = TRUE; @@ -161,6 +172,7 @@ ModelessDialog RID_SVXDLG_RUBY }; ListBox LB_CHAR_STYLE { + HelpID = "svx:ListBox:RID_SVXDLG_RUBY:LB_CHAR_STYLE"; Pos = MAP_APPFONT ( 80 , 93) ; Size = MAP_APPFONT ( 89 , 60 ) ; DropDown = TRUE; @@ -169,6 +181,7 @@ ModelessDialog RID_SVXDLG_RUBY }; PushButton PB_STYLIST { + HelpID = "svx:PushButton:RID_SVXDLG_RUBY:PB_STYLIST"; Pos = MAP_APPFONT ( 171 , 92 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Styles"; @@ -194,6 +207,7 @@ ModelessDialog RID_SVXDLG_RUBY }; PushButton PB_CLOSE { + HelpID = "svx:PushButton:RID_SVXDLG_RUBY:PB_CLOSE"; Pos = MAP_APPFONT ( 118, 175 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Close"; diff --git a/svx/source/dialog/srchdlg.src b/svx/source/dialog/srchdlg.src index a724edbe28bb..f82d4f06cb88 100644 --- a/svx/source/dialog/srchdlg.src +++ b/svx/source/dialog/srchdlg.src @@ -67,6 +67,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; ComboBox ED_SEARCH { + HelpID = "svx:ComboBox:RID_SVXDLG_SEARCH:ED_SEARCH"; Pos = MAP_APPFONT ( 6 , 18 ) ; Size = MAP_APPFONT ( 132 , 98 ) ; TabStop = TRUE ; @@ -74,6 +75,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; ListBox LB_SEARCH { + HelpID = "svx:ListBox:RID_SVXDLG_SEARCH:LB_SEARCH"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 18 ) ; Size = MAP_APPFONT ( 132 , 98 ) ; @@ -104,6 +106,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; ComboBox ED_REPLACE { + HelpID = "svx:ComboBox:RID_SVXDLG_SEARCH:ED_REPLACE"; Pos = MAP_APPFONT ( 6 , 65 ) ; Size = MAP_APPFONT ( 132 , 98 ) ; TabStop = TRUE ; @@ -111,6 +114,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; ListBox LB_REPLACE { + HelpID = "svx:ListBox:RID_SVXDLG_SEARCH:LB_REPLACE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 65 ) ; Size = MAP_APPFONT ( 132 , 98 ) ; @@ -135,6 +139,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_SEARCH { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_SEARCH"; Pos = MAP_APPFONT ( 144 , 9 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Find" ; @@ -143,6 +148,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_SEARCH_ALL { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_SEARCH_ALL"; Pos = MAP_APPFONT ( 144 , 26 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Find ~All" ; @@ -155,6 +161,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_REPLACE { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_REPLACE"; Pos = MAP_APPFONT ( 144 , 56 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Replace" ; @@ -162,6 +169,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_REPLACE_ALL { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_REPLACE_ALL"; Pos = MAP_APPFONT ( 144 , 73 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Replace A~ll" ; @@ -175,6 +183,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_COMPONENT_1 { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_COMPONENT_1"; Pos = MAP_APPFONT ( 144 , 103 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -182,6 +191,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_COMPONENT_2 { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_COMPONENT_2"; Pos = MAP_APPFONT ( 144 , 120 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -189,6 +199,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_MATCH_CASE { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_MATCH_CASE"; Pos = MAP_APPFONT ( 12 , 101 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; TabStop = TRUE ; @@ -196,6 +207,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_WHOLE_WORDS { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_WHOLE_WORDS"; Pos = MAP_APPFONT ( 12 , 114 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "Whole wor~ds only" ; @@ -208,6 +220,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; MoreButton BTN_MORE { + HelpID = "svx:MoreButton:RID_SVXDLG_SEARCH:BTN_MORE"; Pos = MAP_APPFONT ( 6 , 135 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -236,6 +249,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_SELECTIONS { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_SELECTIONS"; Pos = MAP_APPFONT ( 12 , 163 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "C~urrent selection only" ; @@ -244,6 +258,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_BACKWARDS { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_BACKWARDS"; Pos = MAP_APPFONT ( 12 , 176 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "Bac~kwards" ; @@ -252,6 +267,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_REGEXP { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_REGEXP"; Pos = MAP_APPFONT ( 12 , 189 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "Regular e~xpressions" ; @@ -260,6 +276,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_SIMILARITY { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_SIMILARITY"; Pos = MAP_APPFONT ( 12 , 204 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; Text [ en-US ] = "S~imilarity search" ; @@ -268,6 +285,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton PB_SIMILARITY { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:PB_SIMILARITY"; Pos = MAP_APPFONT ( 124 , 202 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Text = "~..." ; @@ -276,6 +294,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_LAYOUTS { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_LAYOUTS"; Pos = MAP_APPFONT ( 12 , 219 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "Search for St~yles" ; @@ -284,6 +303,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_NOTES { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_NOTES"; Pos = MAP_APPFONT ( 12 , 232 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; TabStop = TRUE ; @@ -291,6 +311,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_JAP_MATCH_FULL_HALF_WIDTH { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_JAP_MATCH_FULL_HALF_WIDTH"; Pos = MAP_APPFONT ( 12 , 247 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; TabStop = TRUE ; @@ -299,6 +320,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_JAP_SOUNDS_LIKE { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_JAP_SOUNDS_LIKE"; Pos = MAP_APPFONT ( 12 , 260 ) ; Size = MAP_APPFONT ( 109 , 10 ) ; TabStop = TRUE ; @@ -307,6 +329,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton PB_JAP_OPTIONS { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:PB_JAP_OPTIONS"; Pos = MAP_APPFONT ( 124 , 258 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; Text = "..." ; @@ -315,6 +338,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_ATTRIBUTE { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_ATTRIBUTE"; Pos = MAP_APPFONT ( 144 , 163 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "Attri~butes..." ; @@ -323,6 +347,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_FORMAT { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_FORMAT"; Pos = MAP_APPFONT ( 144 , 180 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "For~mat..." ; @@ -331,6 +356,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; PushButton BTN_NOFORMAT { + HelpID = "svx:PushButton:RID_SVXDLG_SEARCH:BTN_NOFORMAT"; Pos = MAP_APPFONT ( 144 , 197 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~No Format" ; @@ -352,6 +378,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; ListBox LB_CALC_SEARCHIN { + HelpID = "svx:ListBox:RID_SVXDLG_SEARCH:LB_CALC_SEARCHIN"; Border = TRUE ; Pos = MAP_APPFONT ( 75 , 283 ) ; Size = MAP_APPFONT ( 63 , 48 ) ; @@ -374,6 +401,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; RadioButton RB_CALC_ROWS { + HelpID = "svx:RadioButton:RID_SVXDLG_SEARCH:RB_CALC_ROWS"; Pos = MAP_APPFONT ( 75 , 300 ) ; Size = MAP_APPFONT ( 63 , 10 ) ; Text [ en-US ] = "Ro~ws" ; @@ -381,6 +409,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; RadioButton RB_CALC_COLUMNS { + HelpID = "svx:RadioButton:RID_SVXDLG_SEARCH:RB_CALC_COLUMNS"; Pos = MAP_APPFONT ( 75 , 313 ) ; Size = MAP_APPFONT ( 63 , 10 ) ; Text [ en-US ] = "Colu~mns" ; @@ -388,6 +417,7 @@ ModelessDialog RID_SVXDLG_SEARCH }; CheckBox CB_ALL_SHEETS { + HelpID = "svx:CheckBox:RID_SVXDLG_SEARCH:CB_ALL_SHEETS"; Pos = MAP_APPFONT ( 12 , 326 ) ; Size = MAP_APPFONT ( 126 , 10 ) ; Text [ en-US ] = "Search in all sheets" ; diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src index 3e80dc9fe485..1947fead5556 100644 --- a/svx/source/engine3d/float3d.src +++ b/svx/source/engine3d/float3d.src @@ -83,6 +83,7 @@ DockingWindow RID_SVXFLOAT_3D ImageButton BTN_GEO { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_GEO"; Pos = MAP_APPFONT ( 4 , BORDER ) ; Size = MAP_APPFONT ( VT_BUTTON_WIDTH , IMG_BUTTON_HEIGHT ) ; TabStop = TRUE ; @@ -95,6 +96,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_REPRESENTATION { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_REPRESENTATION"; Pos = MAP_APPFONT ( 22 , BORDER ) ; Size = MAP_APPFONT ( VT_BUTTON_WIDTH , IMG_BUTTON_HEIGHT ) ; TabStop = TRUE ; @@ -107,6 +109,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT"; Pos = MAP_APPFONT ( 40 , BORDER ) ; Size = MAP_APPFONT ( VT_BUTTON_WIDTH , IMG_BUTTON_HEIGHT ) ; TabStop = TRUE ; @@ -119,6 +122,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEXTURE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEXTURE"; Pos = MAP_APPFONT ( 58 , BORDER ) ; Size = MAP_APPFONT ( VT_BUTTON_WIDTH , IMG_BUTTON_HEIGHT ) ; ButtonImage = Image @@ -131,6 +135,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_MATERIAL { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_MATERIAL"; Pos = MAP_APPFONT ( 76 , BORDER ) ; Size = MAP_APPFONT ( VT_BUTTON_WIDTH , IMG_BUTTON_HEIGHT ) ; TabStop = TRUE ; @@ -144,6 +149,7 @@ DockingWindow RID_SVXFLOAT_3D ImageButton BTN_UPDATE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_UPDATE"; Pos = MAP_APPFONT ( WIDTH - BORDER - BUTTON_WIDTH * 2 , BORDER ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -156,6 +162,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_ASSIGN { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_ASSIGN"; Pos = MAP_APPFONT ( WIDTH - BORDER - BUTTON_WIDTH , BORDER ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -169,6 +176,7 @@ DockingWindow RID_SVXFLOAT_3D // Unterer Teil ImageButton BTN_CHANGE_TO_3D { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_CHANGE_TO_3D"; Pos = MAP_APPFONT ( 9 , 200 - BUTTON_HEIGHT ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -182,6 +190,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LATHE_OBJ { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LATHE_OBJ"; Pos = MAP_APPFONT ( 9 + BUTTON_WIDTH + 1 , 200 - BUTTON_HEIGHT ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -195,6 +204,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_PERSPECTIVE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_PERSPECTIVE"; Pos = MAP_APPFONT ( 9 + ( BUTTON_WIDTH + 1 ) * 2 , 200 - BUTTON_HEIGHT ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -234,6 +244,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_PERCENT_DIAGONAL { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_PERCENT_DIAGONAL"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1 , FIRST_FT_START_Y - 2 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; @@ -254,6 +265,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_BACKSCALE { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_BACKSCALE"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1, FIRST_FT_START_Y + FT_OFFSET_NEXT - 2 ) ; @@ -275,6 +287,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_END_ANGLE { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_END_ANGLE"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1, FIRST_FT_START_Y + 2*FT_OFFSET_NEXT - 2 ) ; @@ -297,6 +310,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_DEPTH { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_DEPTH"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1, FIRST_FT_START_Y + 3*FT_OFFSET_NEXT - 2 ) ; @@ -328,6 +342,7 @@ DockingWindow RID_SVXFLOAT_3D }; NumericField NUM_HORIZONTAL { + HelpID = "svx:NumericField:RID_SVXFLOAT_3D:NUM_HORIZONTAL"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + 42, SEGMENTS_START_Y+13-2 ) ; Size = MAP_APPFONT ( 22 , 12 ) ; @@ -347,6 +362,7 @@ DockingWindow RID_SVXFLOAT_3D }; NumericField NUM_VERTICAL { + HelpID = "svx:NumericField:RID_SVXFLOAT_3D:NUM_VERTICAL"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + 114+2 , SEGMENTS_START_Y+13-2 ) ; Size = MAP_APPFONT ( 22 , 12 ) ; @@ -367,6 +383,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_NORMALS_OBJ { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_NORMALS_OBJ"; Pos = MAP_APPFONT ( FT_INDENT , NORMALS_BT_START_Y ) ; Size = IMG_BUTTON_SIZE; ButtonImage = Image @@ -379,6 +396,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_NORMALS_FLAT { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_NORMALS_FLAT"; Pos = MAP_APPFONT ( FT_INDENT + (1+BUTTON_WIDTH) , NORMALS_BT_START_Y ) ; Size = IMG_BUTTON_SIZE; ButtonImage = Image @@ -391,6 +409,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_NORMALS_SPHERE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_NORMALS_SPHERE"; Pos = MAP_APPFONT ( FT_INDENT + (1+BUTTON_WIDTH) * 2 , NORMALS_BT_START_Y ) ; Size = IMG_BUTTON_SIZE; ButtonImage = Image @@ -403,6 +422,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_NORMALS_INVERT { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_NORMALS_INVERT"; Pos = MAP_APPFONT ( FT_INDENT , NORMALS_BT_START_Y + IMG_BUTTON_NEXT ) ; Size = IMG_BUTTON_SIZE; ButtonImage = Image @@ -415,6 +435,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TWO_SIDED_LIGHTING { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TWO_SIDED_LIGHTING"; Pos = MAP_APPFONT ( FT_INDENT + (1+BUTTON_WIDTH) * 2 , NORMALS_BT_START_Y + IMG_BUTTON_NEXT ) ; Size = IMG_BUTTON_SIZE; @@ -428,6 +449,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_DOUBLE_SIDED { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_DOUBLE_SIDED"; Pos = MAP_APPFONT ( FT_INDENT , NORMALS_BT_START_Y + 2*IMG_BUTTON_NEXT ) ; Size = IMG_BUTTON_SIZE; ButtonImage = Image @@ -448,6 +470,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_SHADEMODE { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_SHADEMODE"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , 30 ) ; Size = MAP_APPFONT ( 83 , 100 ) ; @@ -468,6 +491,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_SHADOW_3D { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_SHADOW_3D"; Pos = MAP_APPFONT ( FT_INDENT , SHADOW_START_Y + 11 ) ; Size = IMG_BUTTON_SIZE; TabStop = TRUE ; @@ -488,6 +512,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_SLANT { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_SLANT"; Border = TRUE ; Pos = MAP_APPFONT ( 99 , SHADOW_START_Y + 11 ) ; Size = MAP_APPFONT ( 50 , 12 ) ; @@ -515,6 +540,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_DISTANCE { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_DISTANCE"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1 , CAMERA_START_Y + 11 - 2 ) ; @@ -539,6 +565,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_FOCAL_LENGTH { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_FOCAL_LENGTH"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_LONG + 1 , CAMERA_START_Y + 11 + FT_OFFSET_NEXT - 2 ) ; @@ -570,6 +597,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_1 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_1"; Pos = MAP_APPFONT ( FT_INDENT , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -582,6 +610,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_2 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_2"; Pos = MAP_APPFONT ( FT_INDENT + 13 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -594,6 +623,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_3 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_3"; Pos = MAP_APPFONT ( FT_INDENT + 2*13 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -606,6 +636,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_4 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_4"; Pos = MAP_APPFONT ( FT_INDENT + 3*13 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -618,6 +649,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_5 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_5"; Pos = MAP_APPFONT ( FT_INDENT , FIRST_FT_START_Y + 26 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -630,6 +662,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_6 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_6"; Pos = MAP_APPFONT ( FT_INDENT + 13, FIRST_FT_START_Y + 26 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -642,6 +675,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_7 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_7"; Pos = MAP_APPFONT ( FT_INDENT + 2*13, FIRST_FT_START_Y + 26 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -654,6 +688,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_8 { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_8"; Pos = MAP_APPFONT ( FT_INDENT +3*13 , FIRST_FT_START_Y + 26 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -666,6 +701,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_1 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_1"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -674,6 +710,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_2 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_2"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -682,6 +719,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_3 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_3"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -690,6 +728,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_4 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_4"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -698,6 +737,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_5 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_5"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -706,6 +746,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_6 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_6"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -714,6 +755,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_7 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_7"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -722,6 +764,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_LIGHT_8 { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_LIGHT_8"; Border = TRUE ; Pos = MAP_APPFONT ( 66 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -730,6 +773,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_LIGHT_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_LIGHT_COLOR"; Pos = MAP_APPFONT ( 137 , FIRST_FT_START_Y + 11 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -748,6 +792,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_AMBIENTLIGHT { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_AMBIENTLIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 , FIRST_FT_START_Y + 53 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -756,6 +801,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_AMBIENT_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_AMBIENT_COLOR"; Pos = MAP_APPFONT ( 137 , FIRST_FT_START_Y + 53 ) ; Size = MAP_APPFONT ( 12 , 14 ) ; ButtonImage = Image @@ -782,6 +828,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_LUMINANCE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_LUMINANCE"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -795,6 +842,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_COLOR"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + BUTTON_WIDTH, FIRST_FT_START_Y - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -814,6 +862,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_REPLACE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_REPLACE"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y + IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -827,6 +876,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_MODULATE { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_MODULATE"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + BUTTON_WIDTH, FIRST_FT_START_Y + IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -840,6 +890,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_BLEND { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_BLEND"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + 2*BUTTON_WIDTH, FIRST_FT_START_Y + IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -859,6 +910,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_OBJECT_X { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_OBJECT_X"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y + 2*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -872,6 +924,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_PARALLEL_X { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_PARALLEL_X"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + BUTTON_WIDTH, FIRST_FT_START_Y + 2*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -885,6 +938,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_CIRCLE_X { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_CIRCLE_X"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + 2*BUTTON_WIDTH, FIRST_FT_START_Y + 2*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -904,6 +958,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_OBJECT_Y { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_OBJECT_Y"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y + 3*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -917,6 +972,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_PARALLEL_Y { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_PARALLEL_Y"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + BUTTON_WIDTH, FIRST_FT_START_Y + 3*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -930,6 +986,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_CIRCLE_Y { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_CIRCLE_Y"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 + 2*BUTTON_WIDTH, FIRST_FT_START_Y + 3*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -949,6 +1006,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_TEX_FILTER { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_TEX_FILTER"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y + 4*IMG_BUTTON_NEXT - 2 ) ; Size = IMG_BUTTON_SIZE; @@ -986,6 +1044,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_MAT_FAVORITES { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_MAT_FAVORITES"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, FIRST_FT_START_Y - 2 ) ; @@ -1010,6 +1069,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_MAT_COLOR { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_MAT_COLOR"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 , FIRST_FT_START_Y + FT_OFFSET_NEXT - 2 ) ; @@ -1019,6 +1079,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_MAT_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_MAT_COLOR"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 72 , FIRST_FT_START_Y + FT_OFFSET_NEXT - 2 ) ; Size = MAP_APPFONT ( 12, 14 ) ; @@ -1038,6 +1099,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_MAT_EMISSION { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_MAT_EMISSION"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 , FIRST_FT_START_Y + 2*FT_OFFSET_NEXT - 2 ) ; @@ -1047,6 +1109,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_EMISSION_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_EMISSION_COLOR"; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 72 , FIRST_FT_START_Y + 2*FT_OFFSET_NEXT - 2 ) ; Size = MAP_APPFONT ( 12, 14 ) ; @@ -1073,6 +1136,7 @@ DockingWindow RID_SVXFLOAT_3D }; ListBox LB_MAT_SPECULAR { + HelpID = "svx:ListBox:RID_SVXFLOAT_3D:LB_MAT_SPECULAR"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1, SPECULAR_START_Y + 13 - 2 ) ; Size = MAP_APPFONT ( 68 , 100 ) ; @@ -1081,6 +1145,7 @@ DockingWindow RID_SVXFLOAT_3D }; ImageButton BTN_SPECULAR_COLOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_SPECULAR_COLOR"; Pos = MAP_APPFONT ( 137 , SPECULAR_START_Y + 13 - 2 ) ; Size = MAP_APPFONT ( 12, 14 ) ; ButtonImage = Image @@ -1099,6 +1164,7 @@ DockingWindow RID_SVXFLOAT_3D }; MetricField MTR_MAT_SPECULAR_INTENSITY { + HelpID = "svx:MetricField:RID_SVXFLOAT_3D:MTR_MAT_SPECULAR_INTENSITY"; Border = TRUE ; Pos = MAP_APPFONT ( FT_INDENT + FT_WIDTH_SHORT + 1 , SPECULAR_START_Y + 13 + FT_OFFSET_NEXT ) ; @@ -1116,6 +1182,7 @@ DockingWindow RID_SVXFLOAT_3D }; /* ImageButton BTN_MAT_FAVORITES { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_MAT_FAVORITES"; Pos = MAP_APPFONT( BORDER, GROUP_PREV_Y+1 ); Size = IMG_BUTTON_SIZE; QuickHelpText = "Material Favoriten" ; @@ -1127,6 +1194,7 @@ DockingWindow RID_SVXFLOAT_3D TabStop = TRUE; }; ImageButton BTN_MAT_EDITOR { + HelpID = "svx:ImageButton:RID_SVXFLOAT_3D:BTN_MAT_EDITOR"; Pos = MAP_APPFONT( BORDER + BUTTON_WIDTH, GROUP_PREV_Y+1 ); Size = IMG_BUTTON_SIZE; QuickHelpText = "Material Editor" ; diff --git a/svx/source/form/datanavi.src b/svx/source/form/datanavi.src index 1b300c279312..5d81bf13ac26 100644 --- a/svx/source/form/datanavi.src +++ b/svx/source/form/datanavi.src @@ -34,6 +34,7 @@ TabPage RID_SVX_XFORMS_TABPAGES { + HelpID = "svx:TabPage:RID_SVX_XFORMS_TABPAGES"; Hide = TRUE ; DialogControl = TRUE; Size = MAP_APPFONT ( 63 , 100 ) ; @@ -348,6 +349,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; Edit ED_NAME { + HelpID = "svx:Edit:RID_SVXDLG_ADD_DATAITEM:ED_NAME"; Pos = MAP_APPFONT ( 78 , 14 ) ; Size = MAP_APPFONT ( 96 , 12 ) ; Border = TRUE ; @@ -361,12 +363,14 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; Edit ED_DEFAULT { + HelpID = "svx:Edit:RID_SVXDLG_ADD_DATAITEM:ED_DEFAULT"; Pos = MAP_APPFONT ( 78 , 29 ) ; Size = MAP_APPFONT ( 96 , 12 ) ; Border = TRUE ; }; PushButton PB_DEFAULT { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_DEFAULT"; Pos = MAP_APPFONT ( 160 , 29 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -388,6 +392,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; ListBox LB_DATATYPE { + HelpID = "svx:ListBox:RID_SVXDLG_ADD_DATAITEM:LB_DATATYPE"; Pos = MAP_APPFONT ( 78 , 55 ) ; Size = MAP_APPFONT ( 96 , 45 ) ; Border = TRUE ; @@ -395,6 +400,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; CheckBox CB_REQUIRED { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_DATAITEM:CB_REQUIRED"; Pos = MAP_APPFONT ( 6 , 72 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -402,6 +408,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; PushButton PB_REQUIRED { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_REQUIRED"; Pos = MAP_APPFONT ( 78 , 70 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -409,6 +416,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; CheckBox CB_RELEVANT { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_DATAITEM:CB_RELEVANT"; Pos = MAP_APPFONT ( 6 , 89 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -416,6 +424,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; PushButton PB_RELEVANT { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_RELEVANT"; Pos = MAP_APPFONT ( 78 , 87 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -423,6 +432,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; CheckBox CB_CONSTRAINT { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_DATAITEM:CB_CONSTRAINT"; Pos = MAP_APPFONT ( 6 , 106 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -430,6 +440,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; PushButton PB_CONSTRAINT { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_CONSTRAINT"; Pos = MAP_APPFONT ( 78 , 104 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -437,6 +448,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; CheckBox CB_READONLY { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_DATAITEM:CB_READONLY"; Pos = MAP_APPFONT ( 6 , 123 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -444,6 +456,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; PushButton PB_READONLY { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_READONLY"; Pos = MAP_APPFONT ( 78 , 121 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -451,6 +464,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; CheckBox CB_CALCULATE { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_DATAITEM:CB_CALCULATE"; Pos = MAP_APPFONT ( 6 , 140 ) ; Size = MAP_APPFONT ( 69 , 10 ) ; TabStop = TRUE ; @@ -458,6 +472,7 @@ ModalDialog RID_SVXDLG_ADD_DATAITEM }; PushButton PB_CALCULATE { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_DATAITEM:PB_CALCULATE"; Pos = MAP_APPFONT ( 78 , 138 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -574,6 +589,7 @@ ModalDialog RID_SVXDLG_ADD_CONDITION }; MultiLineEdit ED_CONDITION { + HelpID = "svx:MultiLineEdit:RID_SVXDLG_ADD_CONDITION:ED_CONDITION"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 198 , 34 ) ; @@ -599,6 +615,7 @@ ModalDialog RID_SVXDLG_ADD_CONDITION }; PushButton PB_EDIT_NAMESPACES { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_CONDITION:PB_EDIT_NAMESPACES"; Pos = MAP_APPFONT ( 132 , 102 ) ; Size = MAP_APPFONT ( 72 , 14 ) ; TabStop = TRUE ; @@ -655,6 +672,7 @@ ModalDialog RID_SVXDLG_NAMESPACE_ITEM }; PushButton PB_ADD_NAMESPACE { + HelpID = "svx:PushButton:RID_SVXDLG_NAMESPACE_ITEM:PB_ADD_NAMESPACE"; Pos = MAP_APPFONT ( 184 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -662,6 +680,7 @@ ModalDialog RID_SVXDLG_NAMESPACE_ITEM }; PushButton PB_EDIT_NAMESPACE { + HelpID = "svx:PushButton:RID_SVXDLG_NAMESPACE_ITEM:PB_EDIT_NAMESPACE"; Pos = MAP_APPFONT ( 184 , 31 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -669,6 +688,7 @@ ModalDialog RID_SVXDLG_NAMESPACE_ITEM }; PushButton PB_DELETE_NAMESPACE { + HelpID = "svx:PushButton:RID_SVXDLG_NAMESPACE_ITEM:PB_DELETE_NAMESPACE"; Pos = MAP_APPFONT ( 184 , 48 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -725,6 +745,7 @@ ModalDialog RID_SVXDLG_MANAGE_NAMESPACE }; Edit ED_PREFIX { + HelpID = "svx:Edit:RID_SVXDLG_MANAGE_NAMESPACE:ED_PREFIX"; Pos = MAP_APPFONT ( 6 , 14 ) ; Size = MAP_APPFONT ( 45 , 12 ) ; Border = TRUE; @@ -738,6 +759,7 @@ ModalDialog RID_SVXDLG_MANAGE_NAMESPACE }; Edit ED_URL { + HelpID = "svx:Edit:RID_SVXDLG_MANAGE_NAMESPACE:ED_URL"; Pos = MAP_APPFONT ( 54 , 14 ) ; Size = MAP_APPFONT ( 150 , 12 ) ; Border = TRUE; @@ -795,6 +817,7 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; Edit ED_SUBMIT_NAME { + HelpID = "svx:Edit:RID_SVXDLG_ADD_SUBMISSION:ED_SUBMIT_NAME"; Pos = MAP_APPFONT ( 78 , 14 ) ; Size = MAP_APPFONT ( 96 , 12 ) ; Border = TRUE ; @@ -808,6 +831,7 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; Edit ED_SUBMIT_ACTION { + HelpID = "svx:Edit:RID_SVXDLG_ADD_SUBMISSION:ED_SUBMIT_ACTION"; Pos = MAP_APPFONT ( 78 , 29 ) ; Size = MAP_APPFONT ( 96 , 12 ) ; Border = TRUE ; @@ -821,6 +845,7 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; ListBox LB_SUBMIT_METHOD { + HelpID = "svx:ListBox:RID_SVXDLG_ADD_SUBMISSION:LB_SUBMIT_METHOD"; Pos = MAP_APPFONT ( 78 , 44 ) ; Size = MAP_APPFONT ( 96 , 51 ) ; Border = TRUE ; @@ -835,12 +860,14 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; Edit ED_SUBMIT_REF { + HelpID = "svx:Edit:RID_SVXDLG_ADD_SUBMISSION:ED_SUBMIT_REF"; Pos = MAP_APPFONT ( 78 , 60 ) ; Size = MAP_APPFONT ( 79, 12 ) ; Border = TRUE ; }; PushButton PB_SUBMIT_REF { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_SUBMISSION:PB_SUBMIT_REF"; Pos = MAP_APPFONT ( 159 , 59 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -855,6 +882,7 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; ListBox LB_SUBMIT_BIND { + HelpID = "svx:ListBox:RID_SVXDLG_ADD_SUBMISSION:LB_SUBMIT_BIND"; Pos = MAP_APPFONT ( 78 , 75 ) ; Size = MAP_APPFONT ( 96 , 51 ) ; Border = TRUE ; @@ -869,6 +897,7 @@ ModalDialog RID_SVXDLG_ADD_SUBMISSION }; ListBox LB_SUBMIT_REPLACE { + HelpID = "svx:ListBox:RID_SVXDLG_ADD_SUBMISSION:LB_SUBMIT_REPLACE"; Pos = MAP_APPFONT ( 78 , 90 ) ; Size = MAP_APPFONT ( 96 , 51 ) ; Border = TRUE ; @@ -949,12 +978,14 @@ ModalDialog RID_SVXDLG_ADD_MODEL }; Edit ED_INST_NAME { + HelpID = "svx:Edit:RID_SVXDLG_ADD_MODEL:ED_INST_NAME"; Pos = MAP_APPFONT ( 60 , 14 ) ; Size = MAP_APPFONT ( 114 , 12 ) ; Border = TRUE ; }; CheckBox CB_MODIFIES_DOCUMENT { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_MODEL:CB_MODIFIES_DOCUMENT"; Pos = MAP_APPFONT( 6, 32 ); Size = MAP_APPFONT( 168, 16 ); Top = TRUE; @@ -1015,6 +1046,7 @@ ModalDialog RID_SVXDLG_ADD_INSTANCE }; Edit ED_INST_NAME { + HelpID = "svx:Edit:RID_SVXDLG_ADD_INSTANCE:ED_INST_NAME"; Pos = MAP_APPFONT ( 60 , 14 ) ; Size = MAP_APPFONT ( 144 , 12 ) ; Border = TRUE ; @@ -1028,6 +1060,7 @@ ModalDialog RID_SVXDLG_ADD_INSTANCE }; ComboBox ED_INST_URL { + HelpID = "svx:ComboBox:RID_SVXDLG_ADD_INSTANCE:ED_INST_URL"; Pos = MAP_APPFONT ( 60 , 29 ) ; Size = MAP_APPFONT ( 127 , 48 ) ; DropDown = TRUE ; @@ -1035,6 +1068,7 @@ ModalDialog RID_SVXDLG_ADD_INSTANCE }; PushButton PB_FILEPICKER { + HelpID = "svx:PushButton:RID_SVXDLG_ADD_INSTANCE:PB_FILEPICKER"; Pos = MAP_APPFONT ( 190 , 28 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -1042,6 +1076,7 @@ ModalDialog RID_SVXDLG_ADD_INSTANCE }; CheckBox CB_INST_LINKINST { + HelpID = "svx:CheckBox:RID_SVXDLG_ADD_INSTANCE:CB_INST_LINKINST"; Pos = MAP_APPFONT ( 6 , 44 ) ; Size = MAP_APPFONT ( 198 , 10 ) ; TabStop = TRUE ; diff --git a/svx/source/form/fmexpl.src b/svx/source/form/fmexpl.src index 8aca6d9ad86d..b5bdd50239e7 100644 --- a/svx/source/form/fmexpl.src +++ b/svx/source/form/fmexpl.src @@ -307,6 +307,7 @@ ImageList RID_SVXIMGLIST_FMEXPL_HC ModalDialog RID_SVXDLG_SETFORM { + HelpID = "svx:ModalDialog:RID_SVXDLG_SETFORM"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 200 , 200 ) ; @@ -345,6 +346,7 @@ ModalDialog RID_SVXDLG_SETFORM }; DockingWindow RID_SVX_FMEXPLORER { + HelpID = "svx:DockingWindow:RID_SVX_FMEXPLORER"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 200 , 200 ) ; diff --git a/svx/source/intro/iso.src b/svx/source/intro/iso.src index ecadfd9d4c6a..7b9067662c7a 100644 --- a/svx/source/intro/iso.src +++ b/svx/source/intro/iso.src @@ -58,6 +58,7 @@ String RID_BUILDVERSION ModalDialog RID_DEFAULTABOUT { + HelpID = "svx:ModalDialog:RID_DEFAULTABOUT"; OutputSize = TRUE ; Size = MAP_APPFONT ( 245 , 260 ) ; Moveable = TRUE ; @@ -78,6 +79,7 @@ ModalDialog RID_DEFAULTABOUT }; MultiLineEdit ABOUT_FTXT_COPYRIGHT { + HelpID = "svx:MultiLineEdit:RID_DEFAULTABOUT:ABOUT_FTXT_COPYRIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; diff --git a/svx/source/intro/ooo.src b/svx/source/intro/ooo.src index 49f6f68fd7e4..7f6f0ed6ff47 100644 --- a/svx/source/intro/ooo.src +++ b/svx/source/intro/ooo.src @@ -64,6 +64,7 @@ String RID_BUILDVERSION ModalDialog RID_DEFAULTABOUT { + HelpID = "svx:ModalDialog:RID_DEFAULTABOUT"; OutputSize = TRUE ; Size = MAP_APPFONT ( 245 , 260 ) ; Moveable = TRUE ; @@ -84,6 +85,7 @@ ModalDialog RID_DEFAULTABOUT }; MultiLineEdit ABOUT_FTXT_COPYRIGHT { + HelpID = "svx:MultiLineEdit:RID_DEFAULTABOUT:ABOUT_FTXT_COPYRIGHT"; Border = TRUE ; Pos = MAP_APPFONT ( 54 , 25 ) ; Size = MAP_APPFONT ( 168 , 51 ) ; diff --git a/svx/source/tbxctrls/extrusioncontrols.src b/svx/source/tbxctrls/extrusioncontrols.src index 084606439cc3..c7655b9576af 100644 --- a/svx/source/tbxctrls/extrusioncontrols.src +++ b/svx/source/tbxctrls/extrusioncontrols.src @@ -32,6 +32,7 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_EXTRUSION_DIRECTION"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -202,6 +203,7 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_DIRECTION DockingWindow RID_SVXFLOAT_EXTRUSION_DEPTH { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_EXTRUSION_DEPTH"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -292,6 +294,7 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_DEPTH DockingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_EXTRUSION_LIGHTING"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -608,6 +611,7 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_LIGHTING DockingWindow RID_SVXFLOAT_EXTRUSION_SURFACE { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_EXTRUSION_SURFACE"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -686,6 +690,7 @@ DockingWindow RID_SVXFLOAT_EXTRUSION_SURFACE ModalDialog RID_SVX_MDLG_EXTRUSION_DEPTH { + HelpID = "svx:ModalDialog:RID_SVX_MDLG_EXTRUSION_DEPTH"; OutputSize = TRUE; SVLook = TRUE ; Moveable = TRUE; diff --git a/svx/source/tbxctrls/fontworkgallery.src b/svx/source/tbxctrls/fontworkgallery.src index e5f52158b4b6..98fd8c6cb5df 100644 --- a/svx/source/tbxctrls/fontworkgallery.src +++ b/svx/source/tbxctrls/fontworkgallery.src @@ -37,6 +37,7 @@ ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY { + HelpID = "svx:ModalDialog:RID_SVX_MDLG_FONTWORK_GALLERY"; OutputSize = TRUE; SVLook = TRUE ; Moveable = TRUE; @@ -94,6 +95,7 @@ ModalDialog RID_SVX_MDLG_FONTWORK_GALLERY DockingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_FONTWORK_ALIGNMENT"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -229,6 +231,7 @@ DockingWindow RID_SVXFLOAT_FONTWORK_ALIGNMENT DockingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING { + HelpID = "svx:DockingWindow:RID_SVXFLOAT_FONTWORK_CHARSPACING"; Border = FALSE ; Hide = TRUE ; SVLook = TRUE ; @@ -271,6 +274,7 @@ DockingWindow RID_SVXFLOAT_FONTWORK_CHARSPACING ModalDialog RID_SVX_MDLG_FONTWORK_CHARSPACING { + HelpID = "svx:ModalDialog:RID_SVX_MDLG_FONTWORK_CHARSPACING"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 139 , 64 ) ; @@ -306,6 +310,7 @@ ModalDialog RID_SVX_MDLG_FONTWORK_CHARSPACING }; MetricField MF_VALUE { + HelpID = "svx:MetricField:RID_SVX_MDLG_FONTWORK_CHARSPACING:MF_VALUE"; Border = FALSE ; Pos = MAP_APPFONT ( 6 , 17 ) ; Size = MAP_APPFONT ( 32 , 12 ) ; diff --git a/svx/source/tbxctrls/lboxctrl.src b/svx/source/tbxctrls/lboxctrl.src index 18e345675532..4150e07ba249 100644 --- a/svx/source/tbxctrls/lboxctrl.src +++ b/svx/source/tbxctrls/lboxctrl.src @@ -42,6 +42,7 @@ FloatingWindow RID_SVXTBX_UNDO_REDO_CTRL ListBox LB_SVXTBX_UNDO_REDO_CTRL { + HelpID = "svx:ListBox:RID_SVXTBX_UNDO_REDO_CTRL:LB_SVXTBX_UNDO_REDO_CTRL"; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( 150 , 60 ) ; Border = TRUE ; diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.src index 76ec3f39eb43..46c6a7b341d1 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.src +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.src @@ -66,6 +66,7 @@ ModalDialog DLG_CHINESEDICTIONARY { + HelpID = "svx:ModalDialog:DLG_CHINESEDICTIONARY"; //HelpId = ; Size = MAP_APPFONT( FULL_WIDTH, FULL_HEIGHT ); OutputSize = TRUE; @@ -79,6 +80,7 @@ ModalDialog DLG_CHINESEDICTIONARY CheckBox CB_REVERSE { + HelpID = "svx:CheckBox:DLG_CHINESEDICTIONARY:CB_REVERSE"; Pos = MAP_APPFONT ( COL_1, ROW_3 ) ; Size = MAP_APPFONT ( FULL_WIDTH - COL_1 - RSC_SP_DLG_INNERBORDER_RIGHT , RSC_CD_CHECKBOX_HEIGHT ) ; @@ -93,6 +95,7 @@ ModalDialog DLG_CHINESEDICTIONARY }; Edit ED_TERM { + HelpID = "svx:Edit:DLG_CHINESEDICTIONARY:ED_TERM"; Border = TRUE ; Pos = MAP_APPFONT ( COL_1 , ROW_5 ) ; Size = MAP_APPFONT ( COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -107,6 +110,7 @@ ModalDialog DLG_CHINESEDICTIONARY }; Edit ED_MAPPING { + HelpID = "svx:Edit:DLG_CHINESEDICTIONARY:ED_MAPPING"; Border = TRUE ; Pos = MAP_APPFONT ( COL_2 , ROW_5 ) ; Size = MAP_APPFONT ( COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -120,6 +124,7 @@ ModalDialog DLG_CHINESEDICTIONARY }; ListBox LB_PROPERTY { + HelpID = "svx:ListBox:DLG_CHINESEDICTIONARY:LB_PROPERTY"; Border = TRUE ; Pos = MAP_APPFONT ( COL_3 , ROW_5 ) ; Size = MAP_APPFONT ( REST_COL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; @@ -154,6 +159,7 @@ ModalDialog DLG_CHINESEDICTIONARY PushButton PB_ADD { + HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_ADD"; Pos = MAP_APPFONT( COL_4, ROW_5 ); Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ); @@ -161,6 +167,7 @@ ModalDialog DLG_CHINESEDICTIONARY }; PushButton PB_MODIFY { + HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_MODIFY"; Pos = MAP_APPFONT( COL_4, ROW_5a ); Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ); @@ -168,6 +175,7 @@ ModalDialog DLG_CHINESEDICTIONARY }; PushButton PB_DELETE { + HelpID = "svx:PushButton:DLG_CHINESEDICTIONARY:PB_DELETE"; Pos = MAP_APPFONT( COL_4, ROW_5b ); Size = MAP_APPFONT( BUTTONCOL_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src index 397466a7dc68..b99d3e7c745a 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src +++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.src @@ -58,6 +58,7 @@ ModalDialog DLG_CHINESETRANSLATION { + HelpID = "svx:ModalDialog:DLG_CHINESETRANSLATION"; //HelpId = ; Size = MAP_APPFONT( FULL_WIDTH, FULL_HEIGHT ); OutputSize = TRUE; @@ -78,6 +79,7 @@ ModalDialog DLG_CHINESETRANSLATION CheckBox CB_USE_VARIANTS { + HelpID = "svx:CheckBox:DLG_CHINESETRANSLATION:CB_USE_VARIANTS"; Pos = MAP_APPFONT( COL_3, ROW_4 ); Size = MAP_APPFONT ( FULL_WIDTH - COL_3 - RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_CHECKBOX_HEIGHT ) ; @@ -93,6 +95,7 @@ ModalDialog DLG_CHINESETRANSLATION CheckBox CB_TRANSLATE_COMMONTERMS { + HelpID = "svx:CheckBox:DLG_CHINESETRANSLATION:CB_TRANSLATE_COMMONTERMS"; Pos = MAP_APPFONT( COL_2, ROW_6 ); Size = MAP_APPFONT ( COL_4 - COL_2, RSC_CD_CHECKBOX_HEIGHT ) ; @@ -101,6 +104,7 @@ ModalDialog DLG_CHINESETRANSLATION PushButton PB_EDITTERMS { + HelpID = "svx:PushButton:DLG_CHINESETRANSLATION:PB_EDITTERMS"; Pos = MAP_APPFONT( COL_4, ROW_6-(RSC_CD_PUSHBUTTON_HEIGHT-RSC_CD_CHECKBOX_HEIGHT)/2 ); Size = MAP_APPFONT( EDITBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); diff --git a/uui/source/cookiedg.src b/uui/source/cookiedg.src index 9df0d481d6ae..156da50c160c 100644 --- a/uui/source/cookiedg.src +++ b/uui/source/cookiedg.src @@ -64,18 +64,21 @@ ModalDialog DLG_COOKIES }; RadioButton RB_INFUTURE_SEND { + HelpID = "uui:RadioButton:DLG_COOKIES:RB_INFUTURE_SEND"; Pos = MAP_APPFONT ( 12 , 171 ) ; Size = MAP_APPFONT ( 52 , 10 ) ; Text [ en-US ] = "~Send" ; }; RadioButton RB_INFUTURE_IGNORE { + HelpID = "uui:RadioButton:DLG_COOKIES:RB_INFUTURE_IGNORE"; Pos = MAP_APPFONT ( 67 , 171 ) ; Size = MAP_APPFONT ( 52 , 10 ) ; Text [ en-US ] = "I~gnore" ; }; RadioButton RB_INFUTURE_INTERACTIVE { + HelpID = "uui:RadioButton:DLG_COOKIES:RB_INFUTURE_INTERACTIVE"; Pos = MAP_APPFONT ( 122 , 171 ) ; Size = MAP_APPFONT ( 52 , 10 ) ; Text [ en-US ] = "I~nteractive" ; @@ -90,12 +93,14 @@ ModalDialog DLG_COOKIES }; PushButton BTN_COOKIES_CANCEL { + HelpID = "uui:PushButton:DLG_COOKIES:BTN_COOKIES_CANCEL"; Pos = MAP_APPFONT ( 186 , 173 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Ignore" ; }; PushButton BTN_COOKIES_OK { + HelpID = "uui:PushButton:DLG_COOKIES:BTN_COOKIES_OK"; Pos = MAP_APPFONT ( 239 , 173 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; DefButton = TRUE ; diff --git a/uui/source/fltdlg.src b/uui/source/fltdlg.src index 84e27cd1be1f..6e25266e95ed 100644 --- a/uui/source/fltdlg.src +++ b/uui/source/fltdlg.src @@ -53,6 +53,7 @@ ModalDialog DLG_FILTER_SELECT ListBox LB_FILTERS { + HelpID = "uui:ListBox:DLG_FILTER_SELECT:LB_FILTERS"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 19 ) ; Size = MAP_APPFONT ( 182 , 175 ) ; diff --git a/uui/source/masterpasscrtdlg.src b/uui/source/masterpasscrtdlg.src old mode 100755 new mode 100644 index 439026d3f6e1..1ed1e9507b96 --- a/uui/source/masterpasscrtdlg.src +++ b/uui/source/masterpasscrtdlg.src @@ -63,6 +63,7 @@ ModalDialog DLG_UUI_MASTERPASSWORD_CRT }; Edit ED_MASTERPASSWORD_CRT { + HelpID = "uui:Edit:DLG_UUI_MASTERPASSWORD_CRT:ED_MASTERPASSWORD_CRT"; Pos = MAP_APPFONT ( COL_0 , ROW_3 ) ; Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; @@ -76,6 +77,7 @@ ModalDialog DLG_UUI_MASTERPASSWORD_CRT }; Edit ED_MASTERPASSWORD_REPEAT { + HelpID = "uui:Edit:DLG_UUI_MASTERPASSWORD_CRT:ED_MASTERPASSWORD_REPEAT"; Pos = MAP_APPFONT ( COL_0 , ROW_5 ) ; Size = MAP_APPFONT ( CTRL_WIDTH , RSC_CD_TEXTBOX_HEIGHT ) ; Border = TRUE ; diff --git a/uui/source/masterpassworddlg.src b/uui/source/masterpassworddlg.src index c7bc835d92ee..2919a85ab488 100644 --- a/uui/source/masterpassworddlg.src +++ b/uui/source/masterpassworddlg.src @@ -50,6 +50,7 @@ ModalDialog DLG_UUI_MASTERPASSWORD }; Edit ED_MASTERPASSWORD { + HelpID = "uui:Edit:DLG_UUI_MASTERPASSWORD:ED_MASTERPASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 3 , 17 ) ; Size = MAP_APPFONT ( 169 , 13 ) ; diff --git a/uui/source/nameclashdlg.src b/uui/source/nameclashdlg.src old mode 100755 new mode 100644 index de8cdb8e716d..b0e5ab5d15bf --- a/uui/source/nameclashdlg.src +++ b/uui/source/nameclashdlg.src @@ -60,6 +60,7 @@ ModalDialog DLG_SIMPLE_NAME_CLASH Edit EDIT_NEW_NAME { + HelpID = "uui:Edit:DLG_SIMPLE_NAME_CLASH:EDIT_NEW_NAME"; Border = TRUE ; Pos = MAP_APPFONT ( BORDER_OFFSET, DLG_HEIGTH - EDIT_HEIGTH - BTN_HEIGTH - 2*BORDER_OFFSET ) ; Size = MAP_APPFONT ( DLG_WIDTH - 2*BORDER_OFFSET , EDIT_HEIGTH ) ; @@ -67,6 +68,7 @@ ModalDialog DLG_SIMPLE_NAME_CLASH PushButton BTN_OVERWRITE { + HelpID = "uui:PushButton:DLG_SIMPLE_NAME_CLASH:BTN_OVERWRITE"; Pos = MAP_APPFONT ( DLG_WIDTH - 3*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; TabStop = TRUE ; @@ -75,6 +77,7 @@ ModalDialog DLG_SIMPLE_NAME_CLASH PushButton BTN_RENAME { + HelpID = "uui:PushButton:DLG_SIMPLE_NAME_CLASH:BTN_RENAME"; Pos = MAP_APPFONT ( DLG_WIDTH - 2*(BTN_WIDTH + BORDER_OFFSET) , DLG_HEIGTH - BTN_HEIGTH - BORDER_OFFSET ) ; Size = MAP_APPFONT ( BTN_WIDTH, BTN_HEIGTH ) ; TabStop = TRUE ; diff --git a/uui/source/newerverwarn.src b/uui/source/newerverwarn.src index 3de289d69baa..94ee6be7db12 100644 --- a/uui/source/newerverwarn.src +++ b/uui/source/newerverwarn.src @@ -66,6 +66,7 @@ ModalDialog RID_DLG_NEWER_VERSION_WARNING }; PushButton PB_UPDATE { + HelpID = "uui:PushButton:RID_DLG_NEWER_VERSION_WARNING:PB_UPDATE"; Pos = MAP_APPFONT ( COL_3 , ROW_3 ) ; Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; TabStop = TRUE ; diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src old mode 100755 new mode 100644 index 52f8fbfac134..41c90dfabcab --- a/uui/source/passworddlg.src +++ b/uui/source/passworddlg.src @@ -52,6 +52,7 @@ ModalDialog DLG_UUI_PASSWORD Edit ED_PASSWORD { + HelpID = "uui:Edit:DLG_UUI_PASSWORD:ED_PASSWORD"; Pos = MAP_APPFONT( 3, 17 ); Size = MAP_APPFONT( 159, 12 ); Border = TRUE ; @@ -67,6 +68,7 @@ ModalDialog DLG_UUI_PASSWORD Edit ED_CONFIRM_PASSWORD { + HelpID = "uui:Edit:DLG_UUI_PASSWORD:ED_CONFIRM_PASSWORD"; Pos = MAP_APPFONT( 3, 45 ); Size = MAP_APPFONT( 159, 12 ); Border = TRUE ; diff --git a/uui/source/secmacrowarnings.src b/uui/source/secmacrowarnings.src index 6d0039da7746..f19694054281 100644 --- a/uui/source/secmacrowarnings.src +++ b/uui/source/secmacrowarnings.src @@ -74,6 +74,7 @@ ModalDialog RID_XMLSECDLG_MACROWARN }; PushButton PB_VIEWSIGNS { + HelpID = "uui:PushButton:RID_XMLSECDLG_MACROWARN:PB_VIEWSIGNS"; Pos = MAP_APPFONT( MW_COL_3, MW_ROW_2 ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); Text [ en-US ] = "View Signatures..."; @@ -87,6 +88,7 @@ ModalDialog RID_XMLSECDLG_MACROWARN }; CheckBox CB_ALWAYSTRUST { + HelpID = "uui:CheckBox:RID_XMLSECDLG_MACROWARN:CB_ALWAYSTRUST"; Pos = MAP_APPFONT( MW_COL_1, MW_ROW_4 ); Size = MAP_APPFONT( MW_COL_4-MW_COL_1, RSC_CD_CHECKBOX_HEIGHT ); Text [ en-US ] = "Always trust macros from this source"; diff --git a/uui/source/sslwarndlg.src b/uui/source/sslwarndlg.src index acae9453a971..b1fe7f54c020 100644 --- a/uui/source/sslwarndlg.src +++ b/uui/source/sslwarndlg.src @@ -59,6 +59,7 @@ ModalDialog DLG_UUI_SSLWARN PushButton PB_VIEW__CERTIFICATE { + HelpID = "uui:PushButton:DLG_UUI_SSLWARN:PB_VIEW__CERTIFICATE"; Pos = MAP_APPFONT( DLG_CTLBTN_CERT_START_X, DLG_CTLBTN_START_Y ); Size = MAP_APPFONT( DLG_CTLBTN_CERT_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -77,6 +78,7 @@ ModalDialog DLG_UUI_SSLWARN PushButton PB_OK { + HelpID = "uui:PushButton:DLG_UUI_SSLWARN:PB_OK"; Pos = MAP_APPFONT( DLG_CTLBTN_OK_START_X, DLG_CTLBTN_START_Y ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); diff --git a/uui/source/unknownauthdlg.src b/uui/source/unknownauthdlg.src index d20a28a00704..37613939565e 100644 --- a/uui/source/unknownauthdlg.src +++ b/uui/source/unknownauthdlg.src @@ -62,6 +62,7 @@ ModalDialog DLG_UUI_UNKNOWNAUTH PushButton PB_VIEW__CERTIFICATE { + HelpID = "uui:PushButton:DLG_UUI_UNKNOWNAUTH:PB_VIEW__CERTIFICATE"; Pos = MAP_APPFONT( DLG_TEXT_START_X, RSC_SP_DLG_INNERBORDER_TOP + DLG_TEXT_1_HEIGHT + RSC_SP_CTRL_GROUP_Y ); Size = MAP_APPFONT( 70, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -80,6 +81,7 @@ ModalDialog DLG_UUI_UNKNOWNAUTH PushButton PB_OK { + HelpID = "uui:PushButton:DLG_UUI_UNKNOWNAUTH:PB_OK"; Pos = MAP_APPFONT( DLG_CTLBTN_OK_START_X, DLG_CTLBTN_START_Y ); Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ); @@ -96,6 +98,7 @@ ModalDialog DLG_UUI_UNKNOWNAUTH RadioButton RB_ACCEPT_1 { + HelpID = "uui:RadioButton:DLG_UUI_UNKNOWNAUTH:RB_ACCEPT_1"; Pos = MAP_APPFONT( DLG_TEXT_START_X, DLG_RADIOBTN_START_Y ); Size = MAP_APPFONT( 182, RSC_CD_RADIOBUTTON_HEIGHT ); @@ -106,6 +109,7 @@ ModalDialog DLG_UUI_UNKNOWNAUTH RadioButton RB_DONTACCEPT_2 { + HelpID = "uui:RadioButton:DLG_UUI_UNKNOWNAUTH:RB_DONTACCEPT_2"; Pos = MAP_APPFONT( DLG_TEXT_START_X, DLG_RADIOBTN_START_Y + RSC_CD_RADIOBUTTON_HEIGHT ); Size = MAP_APPFONT( 182, RSC_CD_RADIOBUTTON_HEIGHT ); -- cgit From 9bb2e324941a1b4eb0dc22d585a945db4e2a8562 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 13 Oct 2010 10:26:03 +0200 Subject: CWS changehid: wrong UNO cmd name for SID_THESAURUS --- svx/inc/svx/svxcommands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/inc/svx/svxcommands.h b/svx/inc/svx/svxcommands.h index 54376da62e7b..01ff0bcd95b2 100644 --- a/svx/inc/svx/svxcommands.h +++ b/svx/inc/svx/svxcommands.h @@ -433,7 +433,7 @@ #define CMD_SID_TEXTDIRECTION_LEFT_TO_RIGHT ".uno:TextdirectionLeftToRight" #define CMD_SID_TEXTDIRECTION_TOP_TO_BOTTOM ".uno:TextdirectionTopToBottom" #define CMD_SID_ATTR_TEXT_FITTOSIZE ".uno:TextFitToSize" -#define CMD_SID_THESAURUS ".uno:Thesaurus" +#define CMD_SID_THESAURUS ".uno:ThesaurusDialog" #define CMD_SID_INSERT_TIMEFIELD ".uno:InsertTimeField" #define CMD_SID_FM_TIMEFIELD ".uno:TimeField" #define CMD_SID_BEZIER_EDIT ".uno:ToggleObjectBezierMode" -- cgit From 8d22455d3e7c7e8e25bcb8724754fc764f0e713c Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 18 Oct 2010 14:46:06 +0200 Subject: #i114970# --- ucb/source/ucp/gio/gio_provider.cxx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ucb/source/ucp/gio/gio_provider.cxx b/ucb/source/ucp/gio/gio_provider.cxx index b8b16ba72c24..750f7408e7ec 100644 --- a/ucb/source/ucp/gio/gio_provider.cxx +++ b/ucb/source/ucp/gio/gio_provider.cxx @@ -108,14 +108,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void *pRegistryKey ) -{ - return pRegistryKey && - writeInfo( pRegistryKey, - ::gio::ContentProvider::getImplementationName_Static(), - ::gio::ContentProvider::getSupportedServiceNames_Static() ); -} - extern "C" void * SAL_CALL component_getFactory( const sal_Char *pImplName, void *pServiceManager, void * ) { -- cgit From 30316be0535df018c5b333979153b0339ab82de9 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 20 Oct 2010 15:22:02 +0200 Subject: CWS changehid: #i115137#: cope with string HIDs --- sfx2/source/appl/sfxhelp.cxx | 208 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 199 insertions(+), 9 deletions(-) diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index db3015824134..a12ced237f55 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -329,7 +329,7 @@ public: ~SfxHelp_Impl(); SfxHelpOptions_Impl* GetOptions(); - String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); + static String GetHelpText( const rtl::OUString& aCommandURL, const String& rModule ); sal_Bool HasModule( const ::rtl::OUString& rModule ); // module installed sal_Bool IsHelpInstalled(); // module list not empty }; @@ -405,6 +405,199 @@ sal_Bool SfxHelp_Impl::IsHelpInstalled() } // class SfxHelp --------------------------------------------------------- +/* some test code for HID conversion - please don't remove + +#include +void TestHids() +{ + static const char* aModules[] = + { + "swriter", + "scalc", + "simpress", + "sdraw", + "sdatabase", + "smath", + "schart", + "sbasic" + }; + + SvFileStream* pOut[] = + { + 0,0,0,0,0,0,0,0,0 + }; + + String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst"); + String aOut = String::CreateFromAscii("/data/OOo/replacer/"); + SvFileStream aInStrm( aIn, STREAM_READ ); + ByteString aBuffer; + while ( aInStrm.ReadLine( aBuffer ) ) + { + ByteString aHid = aBuffer.GetToken(0, ' '); + ByteString aNr = aBuffer.GetToken(1, ' '); + bool bFound=false; + for (sal_Int32 n= 0; n<8; n++) + { + bFound = false; + String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); + if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + { + if (!pOut[n]) + { + String aTmp( aOut ); + aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 ); + aTmp += String::CreateFromAscii(".lst"); + pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); + } + pOut[n]->WriteLine( aHid ); + bFound = true; + break; + } + } + + if (!bFound) + { + if (!pOut[8]) + { + String aTmp( aOut ); + aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 ); + aTmp += String::CreateFromAscii(".lst"); + pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); + } + pOut[8]->WriteLine( aHid ); + } + } + + for (sal_Int32 n= 0; n<9; n++) + DELETEZ( pOut[n] ); +} + +void TestHids2() +{ + static const char* aModules[] = + { + "swriter", + "scalc", + "simpress", + "smath", + "sbasic" + }; + + String aOut = String::CreateFromAscii("/data/OOo/replacer/"); + aOut += String::CreateFromAscii("lost.lst"); + SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC ); + for (sal_Int32 n= 0; n<5; n++) + { + String aIn = String::CreateFromAscii("/data/OOo/replacer/help/"); + aIn += String::CreateFromAscii( aModules[n] ); + aIn += String::CreateFromAscii(".lst"); + SvFileStream aInStrm( aIn, STREAM_READ ); + ByteString aBuffer; + while ( aInStrm.ReadLine( aBuffer ) ) + { + String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); + if ( SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) + aOutStrm.WriteLine( aBuffer ); + } + } +} + +#include +void TestHids3() +{ + static const char* aModules[] = + { + "swriter", + "scalc", + "simpress", + "sdraw", + "sdatabase", + "smath", + "schart", + "sbasic" + }; + + SvFileStream* pOut[] = + { + 0,0,0,0,0,0,0,0,0 + }; + + String aIn = String::CreateFromAscii("/data/OOo/replacer/hidsin.lst"); + String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); + SvFileStream aInStrm( aIn, STREAM_READ ); + ByteString aBuffer; + while ( aInStrm.ReadLine( aBuffer ) ) + { + ByteString aHid = aBuffer.GetToken(0, ' '); + ByteString aNr = aBuffer.GetToken(1, ' '); + bool bFound=false; + for (sal_Int32 n= 0; n<8; n++) + { + bFound = false; + String aHelpURL = SfxHelp::CreateHelpURL( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); + if ( SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() ) +// if ( SfxHelp_Impl::GetHelpText( String( aNr, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ).Len() ) + { + if (!pOut[n]) + { + String aTmp( aOut ); + aTmp += String( aModules[n], RTL_TEXTENCODING_UTF8 ); + aTmp += String::CreateFromAscii(".lst"); + pOut[n] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); + } + pOut[n]->WriteLine( aHid ); + bFound = true; + break; + } + } + + if (!bFound) + { + if (!pOut[8]) + { + String aTmp( aOut ); + aTmp += String( "notfound", RTL_TEXTENCODING_UTF8 ); + aTmp += String::CreateFromAscii(".lst"); + pOut[8] = new SvFileStream( aTmp, STREAM_WRITE | STREAM_TRUNC ); + } + pOut[8]->WriteLine( aHid ); + } + } + + for (sal_Int32 n= 0; n<9; n++) + DELETEZ( pOut[n] ); +} + +void TestHids4() +{ + static const char* aModules[] = + { + "swriter", + "scalc", + "simpress", + "smath", + "sbasic" + }; + + String aOut = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); + aOut += String::CreateFromAscii("lost.lst"); + SvFileStream aOutStrm( aOut, STREAM_WRITE | STREAM_TRUNC ); + for (sal_Int32 n= 0; n<5; n++) + { + String aIn = String::CreateFromAscii("/data/OOo/replacer/quickhelp/"); + aIn += String::CreateFromAscii( aModules[n] ); + aIn += String::CreateFromAscii(".lst"); + SvFileStream aInStrm( aIn, STREAM_READ ); + ByteString aBuffer; + while ( aInStrm.ReadLine( aBuffer ) ) + { + String aHelpURL = SfxHelp::CreateHelpURL( String( aBuffer, RTL_TEXTENCODING_UTF8 ), String( aModules[n], RTL_TEXTENCODING_UTF8 ) ); + if ( !SfxContentHelper::GetActiveHelpString( aHelpURL ).Len() ) + aOutStrm.WriteLine( aBuffer ); + } + } +} +*/ SfxHelp::SfxHelp() : @@ -746,7 +939,11 @@ BOOL SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const Strin String aHelpModuleName( GetHelpModuleName_Impl() ); switch ( nProtocol ) { - case INET_PROT_NOT_VALID : + case INET_PROT_VND_SUN_STAR_HELP: + // already a vnd.sun.star.help URL -> nothing to do + aHelpURL = rURL; + break; + default: { // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); @@ -771,13 +968,6 @@ BOOL SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const Strin } break; } - case INET_PROT_VND_SUN_STAR_HELP: - // already a vnd.sun.star.help URL -> nothing to do - aHelpURL = rURL; - break; - default: - aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); - break; } Reference < XFrame > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( -- cgit