You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2013/08/08 17:01:58 UTC
svn commit: r1511822 [4/5] - in /openoffice/branches/alg/aw080/main:
basegfx/source/point/ basegfx/source/vector/
chart2/source/controller/dialogs/ chart2/source/controller/drawinglayer/
chart2/source/controller/inc/ chart2/source/controller/main/ char...
Modified: openoffice/branches/alg/aw080/main/svx/source/unodraw/unomod.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/unodraw/unomod.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/svx/source/unodraw/unomod.cxx (original)
+++ openoffice/branches/alg/aw080/main/svx/source/unodraw/unomod.cxx Thu Aug 8 15:01:55 2013
@@ -711,8 +711,7 @@ void SAL_CALL SvxUnoDrawPagesAccess::rem
throw(uno::RuntimeException)
{
OGuard aGuard( Application::GetSolarMutex() );
-
- sal_uInt16 nPageCount = mrModel.mpDoc->GetPageCount();
+ const sal_uInt32 nPageCount = mrModel.mpDoc->GetPageCount();
if( nPageCount > 1 )
{
// pPage von xPage besorgen und dann die Id (nPos )ermitteln
Modified: openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx (original)
+++ openoffice/branches/alg/aw080/main/svx/source/unodraw/unoshap2.cxx Thu Aug 8 15:01:55 2013
@@ -1196,87 +1196,55 @@ bool SvxShapePolyPolygon::setPropertyVal
}
break;
}
- case OWN_ATTR_BASE_GEOMETRY:
- {
- if( rValue.getValue() )
- {
- if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0))
- {
- if( mpObj.is() )
- {
- // get polygpon data
- basegfx::B2DPolyPolygon aNewPolyPolygon(
- basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(
- *(const drawing::PointSequenceSequence*)rValue.getValue()));
-
- if(aNewPolyPolygon.count())
- {
- // migrate to pool metric
- ForceMetricToItemPoolMetric(aNewPolyPolygon);
-
- // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear
- // or rotation. Apply these current values from the object
- const basegfx::B2DHomMatrix aNoScaleTrans(
- basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
- basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0),
- mpObj->getSdrObjectShearX(),
- mpObj->getSdrObjectRotate(),
- mpObj->getSdrObjectTranslate()));
-
- aNewPolyPolygon.transform(aNoScaleTrans);
-
- // position relative to anchor
- if(isWriterAnchorUsed())
- {
- aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
- }
- }
+ case OWN_ATTR_BASE_GEOMETRY:
+ {
+ if( rValue.getValue() && mpObj.is() )
+ {
+ basegfx::B2DPolyPolygon aNewPolyPolygon;
- // set at object
- SetPolygon(aNewPolyPolygon);
- }
- return true;
+ if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0))
+ {
+ // get polygpon data from PointSequenceSequence
+ aNewPolyPolygon = basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(
+ *(const drawing::PointSequenceSequence*)rValue.getValue());
+ }
+ else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0))
+ {
+ // get polygpon data from PolyPolygonBezierCoords
+ aNewPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+ *(const drawing::PolyPolygonBezierCoords*)rValue.getValue());
}
- else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0))
- {
- if( mpObj.is() )
- {
- // get polygpon data
- basegfx::B2DPolyPolygon aNewPolyPolygon(
- basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
- *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()));
-
- if(aNewPolyPolygon.count())
- {
- // migrate to pool metric
- ForceMetricToItemPoolMetric(aNewPolyPolygon);
-
- // BaseGeometry means the polygon is just scaled, but has no position, shear
- // or rotation. Apply these current values from the object
- const basegfx::B2DHomMatrix aNoScaleTrans(
- basegfx::tools::createShearXRotateTranslateB2DHomMatrix(
- mpObj->getSdrObjectShearX(),
- mpObj->getSdrObjectRotate(),
- mpObj->getSdrObjectTranslate()));
-
- aNewPolyPolygon.transform(aNoScaleTrans);
-
- // position relative to anchor
- if(isWriterAnchorUsed())
- {
- aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
- }
- }
- // set at object
- SetPolygon(aNewPolyPolygon);
- }
- return true;
+ if(aNewPolyPolygon.count())
+ {
+ // migrate to pool metric
+ ForceMetricToItemPoolMetric(aNewPolyPolygon);
+
+ // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear
+ // or rotation. Apply these current values from the object
+ const basegfx::B2DHomMatrix aNoScaleTrans(
+ basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+ basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0),
+ mpObj->getSdrObjectShearX(),
+ mpObj->getSdrObjectRotate(),
+ mpObj->getSdrObjectTranslate()));
+
+ aNewPolyPolygon.transform(aNoScaleTrans);
+
+ // position relative to anchor
+ if(isWriterAnchorUsed())
+ {
+ aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos()));
+ }
}
- }
- break;
- }
- case OWN_ATTR_VALUE_POLYGON:
+
+ // set at object and return
+ SetPolygon(aNewPolyPolygon);
+ return true;
+ }
+ break;
+ }
+ case OWN_ATTR_VALUE_POLYGON:
{
if( rValue.getValue() && (rValue.getValueType() == ::getCppuType(( const drawing::PointSequence*)0) ))
{
@@ -1385,17 +1353,17 @@ bool SvxShapePolyPolygon::getPropertyVal
}
break;
}
- case OWN_ATTR_BASE_GEOMETRY:
- {
- basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
+ case OWN_ATTR_BASE_GEOMETRY:
+ {
+ basegfx::B2DPolyPolygon aPolyPolygon(GetPolygon());
if(aPolyPolygon.count())
{
- // make pos relative to anchor
- if(isWriterAnchorUsed())
- {
+ // make pos relative to anchor
+ if(isWriterAnchorUsed())
+ {
aPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(-mpObj->GetAnchorPos()));
- }
+ }
// migrtate to 1/100th mm
ForceMetricTo100th_mm(aPolyPolygon);
@@ -1406,7 +1374,7 @@ bool SvxShapePolyPolygon::getPropertyVal
basegfx::B2DHomMatrix aOnlyScaleTransform(mpObj->getSdrObjectTransformation());
// extract the scale
- const basegfx::B2DVector aScale(basegfx::absolute(mpObj->getSdrObjectScale()));
+ const basegfx::B2DVector aScale(basegfx::absolute(mpObj->getSdrObjectScale()));
// get transformation to unit coordinates
aOnlyScaleTransform.invert();
@@ -1420,10 +1388,10 @@ bool SvxShapePolyPolygon::getPropertyVal
if(aPolyPolygon.areControlPointsUsed())
{
// convert Polygon to needed data representation
- drawing::PolyPolygonBezierCoords aRetval;
+ drawing::PolyPolygonBezierCoords aRetval;
basegfx::tools::B2DPolyPolygonToUnoPolyPolygonBezierCoords(aPolyPolygon, aRetval);
- rValue <<= aRetval;
+ rValue <<= aRetval;
}
else
{
@@ -1431,20 +1399,20 @@ bool SvxShapePolyPolygon::getPropertyVal
drawing::PointSequenceSequence aRetval;
basegfx::tools::B2DPolyPolygonToUnoPointSequenceSequence(aPolyPolygon, aRetval);
- rValue <<= aRetval;
+ rValue <<= aRetval;
}
}
else
{
// empty PolyPolygon
drawing::PolyPolygonBezierCoords aRetval;
-
+
rValue <<= aRetval;
}
break;
- }
- case OWN_ATTR_VALUE_POLYGON:
+ }
+ case OWN_ATTR_VALUE_POLYGON:
{
if(isBezierBased())
{
Modified: openoffice/branches/alg/aw080/main/svx/source/xoutdev/xtabgrdt.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/svx/source/xoutdev/xtabgrdt.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/svx/source/xoutdev/xtabgrdt.cxx (original)
+++ openoffice/branches/alg/aw080/main/svx/source/xoutdev/xtabgrdt.cxx Thu Aug 8 15:01:55 2013
@@ -216,7 +216,7 @@ Bitmap XGradientList::CreateBitmapForUI(
}
}
- const sal_uInt16 nSteps((rSize.Width() + rSize.Height()) / 3);
+ const sal_uInt16 nSteps(static_cast< sal_uInt16 >((rSize.Width() + rSize.Height()) / 3));
const drawinglayer::attribute::FillGradientAttribute aFillGradient(
aGradientStyle,
(double)rGradient.GetBorder() * 0.01,
Modified: openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/shapeimport.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/shapeimport.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/shapeimport.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/shapeimport.hxx Thu Aug 8 15:01:55 2013
@@ -252,17 +252,29 @@ public:
class SvXMLShapeContext : public SvXMLImportContext
{
protected:
- com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
- sal_Bool mbTemporaryShape;
- rtl::OUString msHyperlink;
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
+ rtl::OUString msHyperlink;
-public:
- SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
- const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {}
+ /// bitfield
+ bool mbTemporaryShape : 1;
- const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; }
+public:
+ SvXMLShapeContext(
+ SvXMLImport& rImp,
+ sal_uInt16 nPrfx,
+ const ::rtl::OUString& rLName,
+ bool bTemporaryShape )
+ : SvXMLImportContext( rImp, nPrfx, rLName ),
+ mbTemporaryShape(bTemporaryShape)
+ {
+ }
+
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const
+ {
+ return mxShape;
+ }
- void setHyperlink( const ::rtl::OUString& rHyperlink );
+ void setHyperlink( const ::rtl::OUString& rHyperlink );
};
//////////////////////////////////////////////////////////////////////////////
@@ -322,7 +334,7 @@ public:
SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape = sal_False);
+ bool bTemporaryShape = false);
SvXMLShapeContext* CreateFrameChildContext(
SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName,
Modified: openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmlmultiimagehelper.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmlmultiimagehelper.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmlmultiimagehelper.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmlmultiimagehelper.hxx Thu Aug 8 15:01:55 2013
@@ -40,7 +40,7 @@ protected:
public:
multiImageImportHelper();
- ~multiImageImportHelper();
+ virtual ~multiImageImportHelper();
/// solve multiple imported images. The most valuable one is choosen,
/// see imlementation for evtl. changing weights and/or adding filetypes.
Modified: openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmluconv.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmluconv.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmluconv.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/inc/xmloff/xmluconv.hxx Thu Aug 8 15:01:55 2013
@@ -253,24 +253,21 @@ public:
/** convert double number to string (using ::rtl::math) and DO
convert to export MapUnit */
- void convertDouble(::rtl::OUStringBuffer& rBuffer,
- double fNumber, sal_Bool bWriteUnits) const;
+ void convertDoubleAndUnit(::rtl::OUStringBuffer& rBuffer, double fNumber) const;
/** convert double number to string (using ::rtl::math) and
DO convert from eSrcUnit to export MapUnit */
- static void convertDouble( ::rtl::OUStringBuffer& rBuffer,
- double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit);
-
- /** convert double number to string (using ::rtl::math) without unit conversion */
- static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber);
+ static void convertDoubleAndUnit( ::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit);
/** convert string to double number (using ::rtl::math) and DO convert. */
- sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const;
+ sal_Bool convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString) const;
/** convert string to double number (using ::rtl::math) and DO convert from
SrcUnit to DstUnit. */
- static sal_Bool convertDouble(double& rValue,
- const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit);
+ static sal_Bool convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit);
+
+ /** convert double number to string (using ::rtl::math) without unit conversion */
+ static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber);
/** convert string to double number (using ::rtl::math) without unit conversion */
static sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/chart/PropertyMaps.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/chart/PropertyMaps.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/chart/PropertyMaps.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/chart/PropertyMaps.cxx Thu Aug 8 15:01:55 2013
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
Modified: openoffice/branches/alg/aw080/main/xmloff/source/core/xmluconv.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/core/xmluconv.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/core/xmluconv.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/core/xmluconv.cxx Thu Aug 8 15:01:55 2013
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/Time.hpp>
@@ -706,16 +705,13 @@ sal_Bool SvXMLUnitConverter::convertNumb
}
/** convert double number to string (using ::rtl::math) */
-void SvXMLUnitConverter::convertDouble(::rtl::OUStringBuffer& rBuffer,
- double fNumber, sal_Bool bWriteUnits) const
+void SvXMLUnitConverter::convertDoubleAndUnit(::rtl::OUStringBuffer& rBuffer, double fNumber) const
{
- SvXMLUnitConverter::convertDouble(rBuffer, fNumber,
- bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit);
+ SvXMLUnitConverter::convertDoubleAndUnit(rBuffer, fNumber, true, meCoreMeasureUnit, meXMLMeasureUnit);
}
/** convert double number to string (using ::rtl::math) */
-void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer,
- double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit)
+void SvXMLUnitConverter::convertDoubleAndUnit( ::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit)
{
if(MAP_RELATIVE == eCoreUnit)
{
@@ -743,25 +739,15 @@ void SvXMLUnitConverter::convertDouble(
}
/** convert string to double number (using ::rtl::math) */
-sal_Bool SvXMLUnitConverter::convertDouble(double& rValue,
- const ::rtl::OUString& rString, sal_Bool bLookForUnits) const
+sal_Bool SvXMLUnitConverter::convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString) const
{
- if(bLookForUnits)
- {
- MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit);
+ const MapUnit eSrcUnit(SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit));
- return SvXMLUnitConverter::convertDouble(rValue, rString,
- eSrcUnit, meCoreMeasureUnit);
- }
- else
- {
- return SvXMLUnitConverter::convertDouble(rValue, rString);
- }
+ return SvXMLUnitConverter::convertDoubleAndUnit(rValue, rString, eSrcUnit, meCoreMeasureUnit);
}
/** convert string to double number (using ::rtl::math) */
-sal_Bool SvXMLUnitConverter::convertDouble(double& rValue,
- const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit)
+sal_Bool SvXMLUnitConverter::convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit)
{
rtl_math_ConversionStatus eStatus;
rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL );
@@ -1465,11 +1451,11 @@ sal_Bool SvXMLUnitConverter::convertPosi
if ( !lcl_getPositions(rValue,aContentX,aContentY,aContentZ) )
return sal_False;
- if ( !convertDouble( rPosition.PositionX, aContentX, sal_True ) )
+ if ( !convertDoubleAndUnit( rPosition.PositionX, aContentX ) )
return sal_False;
- if ( !convertDouble( rPosition.PositionY, aContentY, sal_True ) )
+ if ( !convertDoubleAndUnit( rPosition.PositionY, aContentY ) )
return sal_False;
- return convertDouble( rPosition.PositionZ, aContentZ, sal_True );
+ return convertDoubleAndUnit( rPosition.PositionZ, aContentZ );
}
/** convert Position3D to string */
@@ -1477,11 +1463,11 @@ void SvXMLUnitConverter::convertPosition
const drawing::Position3D& rPosition )
{
rBuffer.append( sal_Unicode('(') );
- convertDouble( rBuffer, rPosition.PositionX, sal_True );
+ convertDoubleAndUnit(rBuffer, rPosition.PositionX);
rBuffer.append( sal_Unicode(' ') );
- convertDouble( rBuffer, rPosition.PositionY, sal_True );
+ convertDoubleAndUnit(rBuffer, rPosition.PositionY);
rBuffer.append( sal_Unicode(' ') );
- convertDouble( rBuffer, rPosition.PositionZ, sal_True );
+ convertDoubleAndUnit(rBuffer, rPosition.PositionZ);
rBuffer.append( sal_Unicode(')') );
}
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport2.cxx Thu Aug 8 15:01:55 2013
@@ -161,13 +161,13 @@ void XMLShapeExport::ImpExportNewTrans_F
}
// write positive svg:width
- mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, aTRScale.getX(), true);
+ mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, aTRScale.getX());
//mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getX()));
aStr = sStringBuffer.makeStringAndClear();
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr);
// write positive svg:height
- mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, aTRScale.getY(), true);
+ mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, aTRScale.getY());
//mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getY()));
aStr = sStringBuffer.makeStringAndClear();
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr);
@@ -234,7 +234,7 @@ void XMLShapeExport::ImpExportNewTrans_F
if(nFeatures & SEF_EXPORT_X)
{
// svg: x
- mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, rTRTranslate.getX(), true);
+ mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, rTRTranslate.getX());
//mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.getX()));
aStr = sStringBuffer.makeStringAndClear();
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr);
@@ -243,7 +243,7 @@ void XMLShapeExport::ImpExportNewTrans_F
if(nFeatures & SEF_EXPORT_Y)
{
// svg: y
- mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, rTRTranslate.getY(), true);
+ mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, rTRTranslate.getY());
//mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.getY()));
aStr = sStringBuffer.makeStringAndClear();
mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeexport4.cxx Thu Aug 8 15:01:55 2013
@@ -549,7 +549,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionBrightness = 0;
if ( rProp.Value >>= fExtrusionBrightness )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionBrightness, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionBrightness, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_BRIGHTNESS, aStr );
@@ -564,7 +564,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fDepth = 0;
if ( aDepthParaPair.First.Value >>= fDepth )
{
- rExport.GetMM100UnitConverter().convertDouble( aStrBuffer, fDepth, sal_True );
+ rExport.GetMM100UnitConverter().convertDoubleAndUnit(aStrBuffer, fDepth);
ExportParameter( aStrBuffer, aDepthParaPair.Second );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_DEPTH, aStr );
@@ -577,7 +577,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionDiffusion = 0;
if ( rProp.Value >>= fExtrusionDiffusion )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionDiffusion, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionDiffusion, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_DIFFUSION, aStr );
@@ -620,7 +620,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionFirstLightLevel = 0;
if ( rProp.Value >>= fExtrusionFirstLightLevel )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionFirstLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionFirstLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_FIRST_LIGHT_LEVEL, aStr );
@@ -632,7 +632,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionSecondLightLevel = 0;
if ( rProp.Value >>= fExtrusionSecondLightLevel )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionSecondLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionSecondLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SECOND_LIGHT_LEVEL, aStr );
@@ -726,7 +726,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionShininess = 0;
if ( rProp.Value >>= fExtrusionShininess )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionShininess, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionShininess, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SHININESS, aStr );
@@ -750,7 +750,7 @@ void ImpExportEnhancedGeometry( SvXMLExp
double fExtrusionSpecularity = 0;
if ( rProp.Value >>= fExtrusionSpecularity )
{
- rUnitConverter.convertDouble( aStrBuffer, fExtrusionSpecularity, sal_False, MAP_RELATIVE, MAP_RELATIVE );
+ rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionSpecularity, sal_False, MAP_RELATIVE, MAP_RELATIVE );
aStrBuffer.append( (sal_Unicode)'%' );
aStr = aStrBuffer.makeStringAndClear();
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SPECULARITY, aStr );
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeimport.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeimport.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeimport.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/shapeimport.cxx Thu Aug 8 15:01:55 2013
@@ -19,23 +19,15 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
#include <tools/debug.hxx>
-
#include <com/sun/star/text/PositionLayoutDir.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
-
#include "unointerfacetouniqueidentifiermapper.hxx"
-
#include <list>
-
-#ifndef _XMLOFF_SHAPEIMPORT_HXX
#include <xmloff/shapeimport.hxx>
-#endif
#include <xmloff/xmltkmap.hxx>
#include "xmloff/xmlnmspe.hxx"
#include <xmloff/xmltoken.hxx>
@@ -47,7 +39,6 @@
#include "ximp3dobject.hxx"
#include "ximpgrp.hxx"
#include "ximplink.hxx"
-
#include <map>
#include <vector>
@@ -789,7 +780,7 @@ SvXMLShapeContext* XMLShapeImportHelper:
const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
{
SdXMLShapeContext *pContext = 0L;
@@ -889,7 +880,7 @@ SvXMLShapeContext* XMLShapeImportHelper:
case XML_TOK_GROUP_CUSTOM_SHAPE:
{
// draw:customshape
- pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, sal_False );
+ pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, false );
break;
}
case XML_TOK_GROUP_A:
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/xexptran.cxx Thu Aug 8 15:01:55 2013
@@ -19,10 +19,9 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
+
#include "xexptran.hxx"
#include <tools/debug.hxx>
#include <rtl/ustrbuf.hxx>
@@ -237,7 +236,7 @@ double Imp_GetDoubleChar(const OUString&
if(sNumberString.getLength())
{
if(bLookForUnits)
- rConv.convertDouble(fRetval, sNumberString.makeStringAndClear(), true);
+ rConv.convertDoubleAndUnit(fRetval, sNumberString.makeStringAndClear());
else
rConv.convertDouble(fRetval, sNumberString.makeStringAndClear());
}
@@ -251,7 +250,7 @@ void Imp_PutDoubleChar(OUString& rStr, c
OUStringBuffer sStringBuffer;
if(bConvertUnits)
- rConv.convertDouble(sStringBuffer, fValue, true);
+ rConv.convertDoubleAndUnit(sStringBuffer, fValue);
else
rConv.convertDouble(sStringBuffer, fValue);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.cxx Thu Aug 8 15:01:55 2013
@@ -54,7 +54,7 @@ SdXML3DObjectContext::SdXML3DObjectConte
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mbSetTransform( sal_False )
{
@@ -188,7 +188,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCu
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
maMinEdge(-2500.0, -2500.0, -2500.0),
maMaxEdge(2500.0, 2500.0, 2500.0),
@@ -297,7 +297,7 @@ SdXML3DSphereObjectShapeContext::SdXML3D
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
maCenter(0.0, 0.0, 0.0),
maSize(5000.0, 5000.0, 5000.0),
@@ -403,7 +403,7 @@ SdXML3DPolygonBasedShapeContext::SdXML3D
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -552,7 +552,7 @@ SdXML3DLatheObjectShapeContext::SdXML3DL
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
@@ -594,7 +594,7 @@ SdXML3DExtrudeObjectShapeContext::SdXML3
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dobject.hxx Thu Aug 8 15:01:55 2013
@@ -54,7 +54,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DObjectContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
@@ -76,7 +76,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DCubeObjectShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
@@ -98,7 +98,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DSphereObjectShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
@@ -118,7 +118,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DPolygonBasedShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
@@ -135,7 +135,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DLatheObjectShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
@@ -152,7 +152,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DExtrudeObjectShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.cxx Thu Aug 8 15:01:55 2013
@@ -101,8 +101,9 @@ SdXML3DSceneShapeContext::SdXML3DSceneSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShapes)
-: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShapes ), SdXML3DSceneAttributesHelper( rImport )
+ bool bTemporaryShapes)
+: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShapes ),
+ SdXML3DSceneAttributesHelper( rImport )
{
}
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximp3dscene.hxx Thu Aug 8 15:01:55 2013
@@ -54,7 +54,7 @@ public:
const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXML3DSceneShapeContext();
virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList);
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpcustomshape.cxx Thu Aug 8 15:01:55 2013
@@ -125,7 +125,7 @@ void GetDistance( std::vector< com::sun:
{
double fAttrDouble;
MapUnit eSrcUnit( SvXMLExportHelper::GetUnitFromString( rValue, MAP_100TH_MM ) );
- if ( SvXMLUnitConverter::convertDouble( fAttrDouble, rValue, eSrcUnit, MAP_100TH_MM ) )
+ if ( SvXMLUnitConverter::convertDoubleAndUnit( fAttrDouble, rValue, eSrcUnit, MAP_100TH_MM ) )
{
beans::PropertyValue aProp;
aProp.Name = EASGet( eDestProp );
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.cxx Thu Aug 8 15:01:55 2013
@@ -43,7 +43,7 @@ SdXMLGroupShapeContext::SdXMLGroupShapeC
sal_uInt16 nPrfx, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.hxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.hxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpgrp.hxx Thu Aug 8 15:01:55 2013
@@ -46,7 +46,7 @@ public:
SdXMLGroupShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape);
+ bool bTemporaryShape);
virtual ~SdXMLGroupShapeContext();
virtual SvXMLImportContext *CreateChildContext(
Modified: openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx?rev=1511822&r1=1511821&r2=1511822&view=diff
==============================================================================
--- openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx (original)
+++ openoffice/branches/alg/aw080/main/xmloff/source/draw/ximpshap.cxx Thu Aug 8 15:01:55 2013
@@ -144,26 +144,41 @@ static bool ImpIsEmptyURL( const ::rtl::
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SdXMLShapeContext::SdXMLShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
-: SvXMLShapeContext( rImport, nPrfx, rLocalName, bTemporaryShape )
-, mxShapes( rShapes )
-, mxAttrList(xAttrList)
-, mbListContextPushed( false )
-, mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID)
-, mbIsPlaceholder(sal_False)
-, mbClearDefaultAttributes( true )
-, mbIsUserTransformed(sal_False)
-, mnZOrder(-1)
-, maSize(1, 1)
-, maPosition(0, 0)
-, maUsedTransformation()
-, mbVisible(true)
-, mbPrintable(true)
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ uno::Reference< drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
+: SvXMLShapeContext( rImport, nPrfx, rLocalName, bTemporaryShape ),
+ mxShapes( rShapes ),
+ mxCursor(),
+ mxOldCursor(),
+ mxAttrList(xAttrList),
+ mxGluePoints(),
+ mxLockable(),
+ maDrawStyleName(),
+ maTextStyleName(),
+ maPresentationClass(),
+ maShapeName(),
+ maThumbnailURL(),
+ mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID),
+ mnClass(0),
+ mnZOrder(-1),
+ maShapeId(),
+ maLayerName(),
+ maShapeTitle(),
+ maShapeDescription(),
+ mnTransform(),
+ maObjectSize(1.0, 1.0),
+ maObjectPosition(0.0, 0.0),
+ maUsedTransformation(),
+ mbVisible(true),
+ mbPrintable(true),
+ mbListContextPushed(false),
+ mbIsPlaceholder(false),
+ mbClearDefaultAttributes(true),
+ mbIsUserTransformed(false)
{
}
@@ -534,55 +549,53 @@ void SdXMLShapeContext::AddShape(const c
void SdXMLShapeContext::SetTransformation()
{
- if(mxShape.is())
- {
- uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(xPropSet.is())
- {
- maUsedTransformation.identity();
+ if(mxShape.is())
+ {
+ uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY);
- if(maSize.Width != 1 || maSize.Height != 1)
- {
- // take care there are no zeros used by error
- if(0 == maSize.Width)
- maSize.Width = 1;
- if(0 == maSize.Height)
- maSize.Height = 1;
+ if(xPropSet.is())
+ {
+ maUsedTransformation.identity();
- // set global size. This should always be used.
- maUsedTransformation.scale(maSize.Width, maSize.Height);
- }
+ if(!basegfx::fTools::equal(maObjectSize.getX(), 1.0) || !basegfx::fTools::equal(maObjectSize.getY(), 1.0))
+ {
+ // take care there are no zeros used by error
+ // set global size. This should always be used.
+ maUsedTransformation.scale(
+ basegfx::fTools::equalZero(maObjectSize.getX()) ? 1.0 : maObjectSize.getX(),
+ basegfx::fTools::equalZero(maObjectSize.getY()) ? 1.0 : maObjectSize.getY());
+ }
- if(maPosition.X != 0 || maPosition.Y != 0)
- {
- // if global position is used, add it to transformation
- maUsedTransformation.translate(maPosition.X, maPosition.Y);
- }
+ if(!basegfx::fTools::equalZero(maObjectPosition.getX()) || !basegfx::fTools::equalZero(maObjectPosition.getY()))
+ {
+ // if global position is used, add it to transformation
+ maUsedTransformation.translate(maObjectPosition.getX(), maObjectPosition.getY());
+ }
- if(mnTransform.NeedsAction())
- {
- // transformation is used, apply to object.
- // NOTICE: The transformation is applied AFTER evtl. used
- // global positioning and scaling is used, so any shear or
- // rotate used herein is applied around the (0,0) position
- // of the PAGE object !!!
- ::basegfx::B2DHomMatrix aMat;
- mnTransform.GetFullTransform(aMat);
+ if(mnTransform.NeedsAction())
+ {
+ // transformation is used, apply to object.
+ // NOTICE: The transformation is applied AFTER evtl. used
+ // global positioning and scaling is used, so any shear or
+ // rotate used herein is applied around the (0,0) position
+ // of the PAGE object !!!
+ ::basegfx::B2DHomMatrix aMat;
- // now add to transformation
- maUsedTransformation *= aMat;
- }
+ mnTransform.GetFullTransform(aMat);
- // now set transformation for this object
- uno::Any aAny;
- drawing::HomogenMatrix3 aMatrix;
- basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(maUsedTransformation, aMatrix);
- aAny <<= aMatrix;
+ // now add to transformation
+ maUsedTransformation = aMat * maUsedTransformation;
+ }
- xPropSet->setPropertyValue(
- OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny);
+ // now set transformation for this object
+ drawing::HomogenMatrix3 aMatrix;
+ basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(maUsedTransformation, aMatrix);
+ uno::Any aAny;
+ aAny <<= aMatrix;
+
+ xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny);
}
- }
+ }
}
//////////////////////////////////////////////////////////////////////////////
@@ -847,19 +860,31 @@ void SdXMLShapeContext::processAttribute
{
if( IsXMLToken( rLocalName, XML_X ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(maPosition.X, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(maPosition.X, rValue);
+ double fValue(0.0);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue);
+ maObjectPosition.setX(fValue);
}
else if( IsXMLToken( rLocalName, XML_Y ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(maPosition.Y, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(maPosition.Y, rValue);
+ double fValue(0.0);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue);
+ maObjectPosition.setY(fValue);
}
else if( IsXMLToken( rLocalName, XML_WIDTH ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue);
+ double fValue(0.0);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue);
+ maObjectSize.setX(fValue);
}
else if( IsXMLToken( rLocalName, XML_HEIGHT ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue);
+ double fValue(0.0);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue);
+ maObjectSize.setY(fValue);
}
else if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
{
@@ -916,7 +941,7 @@ SdXMLRectShapeContext::SdXMLRectShapeCon
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mnRadius( 0L )
{
@@ -983,17 +1008,17 @@ void SdXMLRectShapeContext::StartElement
////////////////////////////////////////3////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SdXMLLineShapeContext::SdXMLLineShapeContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx,
- const OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ SvXMLImport& rImport,
+ sal_uInt16 nPrfx,
+ const OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ uno::Reference< drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
- mnX1( 0L ),
- mnY1( 0L ),
- mnX2( 1L ),
- mnY2( 1L )
+ mfX1( 0.0 ),
+ mfY1( 0.0 ),
+ mfX2( 1.0 ),
+ mfY2( 1.0 )
{
}
@@ -1012,22 +1037,26 @@ void SdXMLLineShapeContext::processAttri
{
if( IsXMLToken( rLocalName, XML_X1 ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnX1, rValue);
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnX1, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfX1, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_Y1 ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnY1, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(mnY1, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfY1, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_X2 ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnX2, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(mnX2, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfX2, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_Y2 ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnY2, rValue);
+ //GetImport().GetMM100UnitConverter().convertMeasure(mnY2, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfY2, rValue);
return;
}
}
@@ -1065,9 +1094,9 @@ void SdXMLLineShapeContext::StartElement
awt::Point* pInnerSequence = pOuterSequence->getArray();
uno::Any aAny;
- *pInnerSequence = awt::Point(mnX1, mnY1);
+ *pInnerSequence = awt::Point(basegfx::fround(mfX1), basegfx::fround(mfY1));
pInnerSequence++;
- *pInnerSequence = awt::Point(mnX2, mnY2);
+ *pInnerSequence = awt::Point(basegfx::fround(mfX2), basegfx::fround(mfY2));
aAny <<= aPolyPoly;
xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny);
@@ -1105,12 +1134,12 @@ SdXMLEllipseShapeContext::SdXMLEllipseSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
- mnCX( 0L ),
- mnCY( 0L ),
- mnRX( 1L ),
- mnRY( 1L ),
+ mfCX( 0.0 ),
+ mfCY( 0.0 ),
+ mfRX( 1.0 ),
+ mfRY( 1.0 ),
meKind( drawing::CircleKind_FULL ),
mnStartAngle( 0 ),
mnEndAngle( 0 )
@@ -1132,29 +1161,34 @@ void SdXMLEllipseShapeContext::processAt
{
if( IsXMLToken( rLocalName, XML_RX ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRX, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_RY ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnRY, rValue);
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnRY, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRY, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_CX ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnCX, rValue);
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnCX, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfCX, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_CY ) )
{
- GetImport().GetMM100UnitConverter().convertMeasure(mnCY, rValue);
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnCY, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfCY, rValue);
return;
}
if( IsXMLToken( rLocalName, XML_R ) )
{
// single radius, it's a circle and both radii are the same
- GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
- mnRY = mnRX;
+ // GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue);
+ GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRX, rValue);
+ mfRY = mfRX;
return;
}
}
@@ -1200,13 +1234,16 @@ void SdXMLEllipseShapeContext::StartElem
SetStyle();
SetLayer();
- if(mnCX != 0 || mnCY != 0 || mnRX != 1 || mnRY != 1)
+ if(!basegfx::fTools::equalZero(mfCX)
+ || !basegfx::fTools::equalZero(mfCY)
+ || !basegfx::fTools::equalZero(mfRX)
+ || !basegfx::fTools::equalZero(mfRY))
{
// #121972# center/radius is used, put to pos and size
- maSize.Width = 2 * mnRX;
- maSize.Height = 2 * mnRY;
- maPosition.X = mnCX - mnRX;
- maPosition.Y = mnCY - mnRY;
+ maObjectSize.setX(2.0 * mfRX);
+ maObjectSize.setY(2.0 * mfRY);
+ maObjectPosition.setX(mfCX - mfRX);
+ maObjectPosition.setY(mfCY - mfRY);
}
// set pos, size, shear and rotate
@@ -1241,7 +1278,9 @@ SdXMLPolygonShapeContext::SdXMLPolygonSh
sal_uInt16 nPrfx,
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- uno::Reference< drawing::XShapes >& rShapes, sal_Bool bClosed, sal_Bool bTemporaryShape)
+ uno::Reference< drawing::XShapes >& rShapes,
+ bool bClosed,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mbClosed( bClosed )
{
@@ -1305,10 +1344,9 @@ void SdXMLPolygonShapeContext::StartElem
// TTTT: Is this correct? It overrides ViewBox stuff; OTOH it makes no
// sense to have the geometry content size different from object size
- if(maSize.Width != 0 && maSize.Height !=0)
+ if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY()))
{
- aSize.setX(maSize.Width);
- aSize.setY(maSize.Height);
+ aSize = maObjectSize;
}
basegfx::B2DPolygon aPolygon;
@@ -1368,7 +1406,7 @@ SdXMLPathShapeContext::SdXMLPathShapeCon
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mbClosed( sal_True )
{
@@ -1414,10 +1452,9 @@ void SdXMLPathShapeContext::StartElement
// TTTT: Is this correct? It overrides ViewBox stuff; OTOH it makes no
// sense to have the geometry content size different from object size
- if(maSize.Width != 0 && maSize.Height !=0)
+ if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY()))
{
- aSize.setX(maSize.Width);
- aSize.setY(maSize.Height);
+ aSize = maObjectSize;
}
basegfx::B2DPolyPolygon aPolyPolygon;
@@ -1610,7 +1647,7 @@ SdXMLTextBoxShapeContext::SdXMLTextBoxSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mnRadius(0)
{
@@ -1782,7 +1819,7 @@ SdXMLControlShapeContext::SdXMLControlSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
@@ -1854,7 +1891,7 @@ SdXMLConnectorShapeContext::SdXMLConnect
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
maStart(0,0),
maEnd(1,1),
@@ -2145,7 +2182,7 @@ SdXMLMeasureShapeContext::SdXMLMeasureSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
maStart(0,0),
maEnd(1,1)
@@ -2258,7 +2295,7 @@ SdXMLPageShapeContext::SdXMLPageShapeCon
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mnPageNumber(0)
{
mbClearDefaultAttributes = false;
@@ -2353,7 +2390,7 @@ SdXMLCaptionShapeContext::SdXMLCaptionSh
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
// #86616# for correct edge rounding import mnRadius needs to be initialized
mnRadius( 0L )
@@ -2456,7 +2493,7 @@ SdXMLGraphicObjectShapeContext::SdXMLGra
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
maURL(),
mbLateAddToIdentifierMapper(false)
@@ -2633,7 +2670,7 @@ SdXMLChartShapeContext::SdXMLChartShapeC
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mpChartContext( NULL )
{
@@ -2738,10 +2775,10 @@ SvXMLImportContext * SdXMLChartShapeCont
//////////////////////////////////////////////////////////////////////////////
SdXMLObjectShapeContext::SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const rtl::OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
@@ -2955,10 +2992,10 @@ SvXMLImportContext* SdXMLObjectShapeCont
//////////////////////////////////////////////////////////////////////////////
SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const rtl::OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mbIsScript( sal_False )
{
@@ -3024,14 +3061,14 @@ void SdXMLAppletShapeContext::EndElement
{
uno::Any aAny;
- if ( maSize.Width && maSize.Height )
- {
- // the visual area for applet must be set on loading
- awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- aAny <<= aRect;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
- }
-
+ if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY()))
+ {
+ // the visual area for applet must be set on loading
+ awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY()));
+ aAny <<= aRect;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
+ }
+
if( maParams.getLength() )
{
aAny <<= maParams;
@@ -3118,10 +3155,10 @@ SvXMLImportContext * SdXMLAppletShapeCon
//////////////////////////////////////////////////////////////////////////////
SdXMLPluginShapeContext::SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const rtl::OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape) :
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ bool bTemporaryShape) :
SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
mbMedia( false )
{
@@ -3230,18 +3267,18 @@ void SdXMLPluginShapeContext::EndElement
{
uno::Any aAny;
- if ( maSize.Width && maSize.Height )
- {
- const rtl::OUString sVisibleArea( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) );
- uno::Reference< beans::XPropertySetInfo > aXPropSetInfo( xProps->getPropertySetInfo() );
+ if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY()))
+ {
+ const rtl::OUString sVisibleArea( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) );
+ uno::Reference< beans::XPropertySetInfo > aXPropSetInfo( xProps->getPropertySetInfo() );
if ( !aXPropSetInfo.is() || aXPropSetInfo->hasPropertyByName( sVisibleArea ) )
- {
- // the visual area for a plugin must be set on loading
- awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- aAny <<= aRect;
- xProps->setPropertyValue( sVisibleArea, aAny );
- }
- }
+ {
+ // the visual area for a plugin must be set on loading
+ awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY()));
+ aAny <<= aRect;
+ xProps->setPropertyValue( sVisibleArea, aAny );
+ }
+ }
if( !mbMedia )
{
@@ -3388,10 +3425,10 @@ SvXMLImportContext * SdXMLPluginShapeCon
//////////////////////////////////////////////////////////////////////////////
SdXMLFloatingFrameShapeContext::SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const rtl::OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
@@ -3466,15 +3503,15 @@ void SdXMLFloatingFrameShapeContext::End
if( xProps.is() )
{
- if ( maSize.Width && maSize.Height )
- {
- // the visual area for a floating frame must be set on loading
- awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height );
- uno::Any aAny;
- aAny <<= aRect;
- xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
- }
- }
+ if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY()))
+ {
+ // the visual area for a floating frame must be set on loading
+ awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY()));
+ uno::Any aAny;
+ aAny <<= aRect;
+ xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny );
+ }
+ }
SetThumbnail();
SdXMLShapeContext::EndElement();
@@ -3483,10 +3520,10 @@ void SdXMLFloatingFrameShapeContext::End
//////////////////////////////////////////////////////////////////////////////
SdXMLFrameShapeContext::SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const rtl::OUString& rLocalName,
- const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes,
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ),
multiImageImportHelper(),
mbSupportsReplacement( sal_False ),
@@ -3755,7 +3792,7 @@ SdXMLCustomShapeContext::SdXMLCustomShap
const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
- sal_Bool bTemporaryShape)
+ bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}