Kaydet (Commit) 9c9bf9a3 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

SVG: remove unused code in svgreader.cxx

üst 5977a8d4
...@@ -1496,7 +1496,7 @@ struct ShapeWritingVisitor ...@@ -1496,7 +1496,7 @@ struct ShapeWritingVisitor
// collect attributes // collect attributes
const sal_Int32 nNumAttrs( xAttributes->getLength() ); const sal_Int32 nNumAttrs( xAttributes->getLength() );
rtl::OUString sAttributeValue; rtl::OUString sAttributeValue;
double x=0.0,y=0.0,width=0.0,height=0.0; double x=0.0,y=0.0;
for( sal_Int32 i=0; i<nNumAttrs; ++i ) for( sal_Int32 i=0; i<nNumAttrs; ++i )
{ {
sAttributeValue = xAttributes->item(i)->getNodeValue(); sAttributeValue = xAttributes->item(i)->getNodeValue();
...@@ -1510,12 +1510,6 @@ struct ShapeWritingVisitor ...@@ -1510,12 +1510,6 @@ struct ShapeWritingVisitor
case XML_Y: case XML_Y:
y = convLength(sAttributeValue,maCurrState,'v'); y = convLength(sAttributeValue,maCurrState,'v');
break; break;
case XML_WIDTH:
width = convLength(sAttributeValue,maCurrState,'h');
break;
case XML_HEIGHT:
height = convLength(sAttributeValue,maCurrState,'v');
break;
default: default:
// skip // skip
break; break;
...@@ -1532,31 +1526,14 @@ struct ShapeWritingVisitor ...@@ -1532,31 +1526,14 @@ struct ShapeWritingVisitor
// extract basic transformations out of CTM // extract basic transformations out of CTM
basegfx::B2DTuple aScale, aTranslate; basegfx::B2DTuple aScale, aTranslate;
double fRotate, fShearX; double fRotate, fShearX;
::rtl::OUString sTransformValue;
if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX)) if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX))
{ {
rtl::OUString sTransform;
x += aTranslate.getX(); x += aTranslate.getX();
y += aTranslate.getY(); y += aTranslate.getY();
sTransform +=
USTR("scale(") +
rtl::OUString::valueOf(aScale.getX()) +
USTR(", ") +
rtl::OUString::valueOf(aScale.getX()) +
USTR(")");
if( fRotate )
sTransform += USTR(" rotate(") + rtl::OUString::valueOf(fRotate*180.0/M_PI) + USTR(")");
if( fShearX )
sTransform += USTR(" skewX(") + rtl::OUString::valueOf(fShearX*180.0/M_PI) + USTR(")");
} }
xAttrs->AddAttribute( USTR( "svg:x" ), rtl::OUString::valueOf(pt2mm(x))+USTR("mm")); xAttrs->AddAttribute( USTR( "svg:x" ), rtl::OUString::valueOf(pt2mm(x))+USTR("mm"));
xAttrs->AddAttribute( USTR( "svg:y" ), rtl::OUString::valueOf(pt2mm(y))+USTR("mm")); xAttrs->AddAttribute( USTR( "svg:y" ), rtl::OUString::valueOf(pt2mm(y))+USTR("mm"));
(void)width;
(void)height;
xAttrs->AddAttribute( USTR( "draw:style-name" ), USTR("svggraphicstyle")+sStyleId ); xAttrs->AddAttribute( USTR( "draw:style-name" ), USTR("svggraphicstyle")+sStyleId );
mxDocumentHandler->startElement(USTR("draw:frame"),xUnoAttrs); mxDocumentHandler->startElement(USTR("draw:frame"),xUnoAttrs);
......
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