Kaydet (Commit) 78fb2c52 authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

INTEGRATION: CWS warnings01 (1.9.34); FILE MERGED

2005/11/16 21:34:07 pl 1.9.34.2: #i55991# removed warnings
2005/11/02 14:57:48 cl 1.9.34.1: warning free code changes
üst b506af8d
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: XMLImageMapExport.cxx,v $ * $RCSfile: XMLImageMapExport.cxx,v $
* *
* $Revision: 1.9 $ * $Revision: 1.10 $
* *
* last change: $Author: rt $ $Date: 2005-09-09 13:40:39 $ * last change: $Author: hr $ $Date: 2006-06-19 18:07:57 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -136,18 +136,18 @@ const sal_Char sAPI_ImageMapCircleObject[] = "com.sun.star.image.ImageMapCircleO ...@@ -136,18 +136,18 @@ const sal_Char sAPI_ImageMapCircleObject[] = "com.sun.star.image.ImageMapCircleO
const sal_Char sAPI_ImageMapPolygonObject[] = "com.sun.star.image.ImageMapPolygonObject"; const sal_Char sAPI_ImageMapPolygonObject[] = "com.sun.star.image.ImageMapPolygonObject";
XMLImageMapExport::XMLImageMapExport(SvXMLExport& rExp) : XMLImageMapExport::XMLImageMapExport(SvXMLExport& rExp) :
rExport(rExp), msBoundary(RTL_CONSTASCII_USTRINGPARAM("Boundary")),
bWhiteSpace(sal_True), msCenter(RTL_CONSTASCII_USTRINGPARAM("Center")),
sBoundary(RTL_CONSTASCII_USTRINGPARAM("Boundary")), msDescription(RTL_CONSTASCII_USTRINGPARAM("Description")),
sCenter(RTL_CONSTASCII_USTRINGPARAM("Center")), msImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap")),
sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")), msIsActive(RTL_CONSTASCII_USTRINGPARAM("IsActive")),
sImageMap(RTL_CONSTASCII_USTRINGPARAM("ImageMap")), msName(RTL_CONSTASCII_USTRINGPARAM("Name")),
sIsActive(RTL_CONSTASCII_USTRINGPARAM("IsActive")), msPolygon(RTL_CONSTASCII_USTRINGPARAM("Polygon")),
sName(RTL_CONSTASCII_USTRINGPARAM("Name")), msRadius(RTL_CONSTASCII_USTRINGPARAM("Radius")),
sPolygon(RTL_CONSTASCII_USTRINGPARAM("Polygon")), msTarget(RTL_CONSTASCII_USTRINGPARAM("Target")),
sRadius(RTL_CONSTASCII_USTRINGPARAM("Radius")), msURL(RTL_CONSTASCII_USTRINGPARAM("URL")),
sTarget(RTL_CONSTASCII_USTRINGPARAM("Target")), mrExport(rExp),
sURL(RTL_CONSTASCII_USTRINGPARAM("URL")) mbWhiteSpace(sal_True)
{ {
} }
...@@ -159,9 +159,9 @@ XMLImageMapExport::~XMLImageMapExport() ...@@ -159,9 +159,9 @@ XMLImageMapExport::~XMLImageMapExport()
void XMLImageMapExport::Export( void XMLImageMapExport::Export(
const Reference<XPropertySet> & rPropertySet) const Reference<XPropertySet> & rPropertySet)
{ {
if (rPropertySet->getPropertySetInfo()->hasPropertyByName(sImageMap)) if (rPropertySet->getPropertySetInfo()->hasPropertyByName(msImageMap))
{ {
Any aAny = rPropertySet->getPropertyValue(sImageMap); Any aAny = rPropertySet->getPropertyValue(msImageMap);
Reference<XIndexContainer> aContainer; Reference<XIndexContainer> aContainer;
aAny >>= aContainer; aAny >>= aContainer;
...@@ -179,8 +179,8 @@ void XMLImageMapExport::Export( ...@@ -179,8 +179,8 @@ void XMLImageMapExport::Export(
{ {
// image map container element // image map container element
SvXMLElementExport aImageMapElement( SvXMLElementExport aImageMapElement(
rExport, XML_NAMESPACE_DRAW, XML_IMAGE_MAP, mrExport, XML_NAMESPACE_DRAW, XML_IMAGE_MAP,
bWhiteSpace, bWhiteSpace); mbWhiteSpace, mbWhiteSpace);
// iterate over image map elements and call ExportMapEntry(...) // iterate over image map elements and call ExportMapEntry(...)
// for each // for each
...@@ -216,7 +216,6 @@ void XMLImageMapExport::ExportMapEntry( ...@@ -216,7 +216,6 @@ void XMLImageMapExport::ExportMapEntry(
Sequence<OUString> sServiceNames = Sequence<OUString> sServiceNames =
xServiceInfo->getSupportedServiceNames(); xServiceInfo->getSupportedServiceNames();
sal_Int32 nLength = sServiceNames.getLength(); sal_Int32 nLength = sServiceNames.getLength();
sal_Bool bFound = sal_False;
for( sal_Int32 i=0; i<nLength; i++ ) for( sal_Int32 i=0; i<nLength; i++ )
{ {
OUString& rName = sServiceNames[i]; OUString& rName = sServiceNames[i];
...@@ -250,44 +249,44 @@ void XMLImageMapExport::ExportMapEntry( ...@@ -250,44 +249,44 @@ void XMLImageMapExport::ExportMapEntry(
// now: handle ImageMapObject properties (those for all types) // now: handle ImageMapObject properties (those for all types)
// XLINK (URL property) // XLINK (URL property)
Any aAny = rPropertySet->getPropertyValue(sURL); Any aAny = rPropertySet->getPropertyValue(msURL);
OUString sHref; OUString sHref;
aAny >>= sHref; aAny >>= sHref;
if (sHref.getLength() > 0) if (sHref.getLength() > 0)
{ {
rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, rExport.GetRelativeReference(sHref)); mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, mrExport.GetRelativeReference(sHref));
} }
rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
// Target property (and xlink:show) // Target property (and xlink:show)
aAny = rPropertySet->getPropertyValue(sTarget); aAny = rPropertySet->getPropertyValue(msTarget);
OUString sTargt; OUString sTargt;
aAny >>= sTargt; aAny >>= sTargt;
if (sTargt.getLength() > 0) if (sTargt.getLength() > 0)
{ {
rExport.AddAttribute( mrExport.AddAttribute(
XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargt); XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, sTargt);
rExport.AddAttribute( mrExport.AddAttribute(
XML_NAMESPACE_XLINK, XML_SHOW, XML_NAMESPACE_XLINK, XML_SHOW,
sTargt.equalsAsciiL( "_blank", sizeof("_blank")-1 ) sTargt.equalsAsciiL( "_blank", sizeof("_blank")-1 )
? XML_NEW : XML_REPLACE ); ? XML_NEW : XML_REPLACE );
} }
// name // name
aAny = rPropertySet->getPropertyValue(sName); aAny = rPropertySet->getPropertyValue(msName);
OUString sItemName; OUString sItemName;
aAny >>= sItemName; aAny >>= sItemName;
if (sItemName.getLength() > 0) if (sItemName.getLength() > 0)
{ {
rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, sItemName); mrExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, sItemName);
} }
// is-active // is-active
aAny = rPropertySet->getPropertyValue(sIsActive); aAny = rPropertySet->getPropertyValue(msIsActive);
if (! *(sal_Bool*)aAny.getValue()) if (! *(sal_Bool*)aAny.getValue())
{ {
rExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NOHREF, XML_NOHREF); mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_NOHREF, XML_NOHREF);
} }
// call specific rectangle/circle/... method // call specific rectangle/circle/... method
...@@ -303,28 +302,30 @@ void XMLImageMapExport::ExportMapEntry( ...@@ -303,28 +302,30 @@ void XMLImageMapExport::ExportMapEntry(
case XML_AREA_POLYGON: case XML_AREA_POLYGON:
ExportPolygon(rPropertySet); ExportPolygon(rPropertySet);
break; break;
default:
break;
} }
// write element // write element
DBG_ASSERT(XML_TOKEN_INVALID != eType, DBG_ASSERT(XML_TOKEN_INVALID != eType,
"No name?! How did this happen?"); "No name?! How did this happen?");
SvXMLElementExport aAreaElement(rExport, XML_NAMESPACE_DRAW, eType, SvXMLElementExport aAreaElement(mrExport, XML_NAMESPACE_DRAW, eType,
bWhiteSpace, bWhiteSpace); mbWhiteSpace, mbWhiteSpace);
// description property (as <svg:desc> element) // description property (as <svg:desc> element)
aAny = rPropertySet->getPropertyValue(sDescription); aAny = rPropertySet->getPropertyValue(msDescription);
OUString sDescription; OUString sDescription;
aAny >>= sDescription; aAny >>= sDescription;
if (sDescription.getLength() > 0) if (sDescription.getLength() > 0)
{ {
SvXMLElementExport aDesc(rExport, XML_NAMESPACE_SVG, XML_DESC, SvXMLElementExport aDesc(mrExport, XML_NAMESPACE_SVG, XML_DESC,
bWhiteSpace, sal_False); mbWhiteSpace, sal_False);
rExport.GetDocHandler()->characters(sDescription); mrExport.GetDocHandler()->characters(sDescription);
} }
// export events attached to this // export events attached to this
Reference<XEventsSupplier> xSupplier(rPropertySet, UNO_QUERY); Reference<XEventsSupplier> xSupplier(rPropertySet, UNO_QUERY);
rExport.GetEventExport().Export(xSupplier, bWhiteSpace); mrExport.GetEventExport().Export(xSupplier, mbWhiteSpace);
} }
// else: no service info -> can't determine type -> ignore entry // else: no service info -> can't determine type -> ignore entry
} }
...@@ -333,23 +334,23 @@ void XMLImageMapExport::ExportRectangle( ...@@ -333,23 +334,23 @@ void XMLImageMapExport::ExportRectangle(
const Reference<XPropertySet> & rPropertySet) const Reference<XPropertySet> & rPropertySet)
{ {
// get boundary rectangle // get boundary rectangle
Any aAny = rPropertySet->getPropertyValue(sBoundary); Any aAny = rPropertySet->getPropertyValue(msBoundary);
awt::Rectangle aRectangle; awt::Rectangle aRectangle;
aAny >>= aRectangle; aAny >>= aRectangle;
// parameters svg:x, svg:y, svg:width, svg:height // parameters svg:x, svg:y, svg:width, svg:height
OUStringBuffer aBuffer; OUStringBuffer aBuffer;
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.X); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.X);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_X, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_X,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Y); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Y);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Width); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Width);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Height); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aRectangle.Height);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
} }
...@@ -357,25 +358,25 @@ void XMLImageMapExport::ExportCircle( ...@@ -357,25 +358,25 @@ void XMLImageMapExport::ExportCircle(
const Reference<XPropertySet> & rPropertySet) const Reference<XPropertySet> & rPropertySet)
{ {
// get boundary rectangle // get boundary rectangle
Any aAny = rPropertySet->getPropertyValue(sCenter); Any aAny = rPropertySet->getPropertyValue(msCenter);
awt::Point aCenter; awt::Point aCenter;
aAny >>= aCenter; aAny >>= aCenter;
// parameters svg:cx, svg:cy // parameters svg:cx, svg:cy
OUStringBuffer aBuffer; OUStringBuffer aBuffer;
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.X); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.X);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_CX, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_CX,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.Y); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, aCenter.Y);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_CY, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_CY,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
// radius // radius
aAny = rPropertySet->getPropertyValue(sRadius); aAny = rPropertySet->getPropertyValue(msRadius);
sal_Int32 nRadius; sal_Int32 nRadius;
aAny >>= nRadius; aAny >>= nRadius;
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nRadius); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, nRadius);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_R, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_R,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
} }
...@@ -386,7 +387,7 @@ void XMLImageMapExport::ExportPolygon( ...@@ -386,7 +387,7 @@ void XMLImageMapExport::ExportPolygon(
// pair sequence. The bounding box is always the entire image. // pair sequence. The bounding box is always the entire image.
// get polygon point sequence // get polygon point sequence
Any aAny = rPropertySet->getPropertyValue(sPolygon); Any aAny = rPropertySet->getPropertyValue(msPolygon);
PointSequence aPoly; PointSequence aPoly;
aAny >>= aPoly; aAny >>= aPoly;
...@@ -412,29 +413,29 @@ void XMLImageMapExport::ExportPolygon( ...@@ -412,29 +413,29 @@ void XMLImageMapExport::ExportPolygon(
// parameters svg:x, svg:y, svg:width, svg:height // parameters svg:x, svg:y, svg:width, svg:height
OUStringBuffer aBuffer; OUStringBuffer aBuffer;
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, 0); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, 0);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_X, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_X,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, 0); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, 0);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nWidth); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, nWidth);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_WIDTH,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
rExport.GetMM100UnitConverter().convertMeasure(aBuffer, nHeight); mrExport.GetMM100UnitConverter().convertMeasure(aBuffer, nHeight);
rExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT,
aBuffer.makeStringAndClear() ); aBuffer.makeStringAndClear() );
// svg:viewbox // svg:viewbox
SdXMLImExViewBox aViewBox(0, 0, nWidth, nHeight); SdXMLImExViewBox aViewBox(0, 0, nWidth, nHeight);
rExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX,
aViewBox.GetExportString(rExport.GetMM100UnitConverter())); aViewBox.GetExportString(mrExport.GetMM100UnitConverter()));
// export point sequence // export point sequence
awt::Point aPoint(0, 0); awt::Point aPoint(0, 0);
awt::Size aSize(nWidth, nHeight); awt::Size aSize(nWidth, nHeight);
SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize, SdXMLImExPointsElement aPoints( &aPoly, aViewBox, aPoint, aSize,
rExport.GetMM100UnitConverter() ); mrExport.GetMM100UnitConverter() );
rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS, mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_POINTS,
aPoints.GetExportString()); aPoints.GetExportString());
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment