[Libreoffice-commits] .: oox/source

Noel Power noelp at kemper.freedesktop.org
Tue Feb 22 07:38:24 PST 2011


 oox/source/vml/vmlshapecontext.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0d3f222ad7c0604e3aa811c0dfcfb657aaadfa76
Author: Noel Power <noel.power at novell.com>
Date:   Tue Feb 22 15:37:17 2011 +0000

    use r:id or o:relid ( whichever exists ) for vml shape import

diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 3cabdfd..e533214 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -241,7 +241,10 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A
             mrTypeModel.maFillModel.moRotate = lclDecodeBool( rAttribs, XML_rotate );
         break;
         case VML_TOKEN( imagedata ):
-            mrTypeModel.moGraphicPath = decodeFragmentPath( rAttribs, R_TOKEN( id ) );
+            // shapes in docx use r:id for the relationship id
+            // in xlsx it they use o:relid
+            bool bHasORelId = rAttribs.hasAttribute( O_TOKEN( relid ) );
+            mrTypeModel.moGraphicPath = decodeFragmentPath( rAttribs, bHasORelId ? O_TOKEN( relid ) : R_TOKEN( id ) );
             mrTypeModel.moGraphicTitle = rAttribs.getString( O_TOKEN( title ) );
         break;
     }


More information about the Libreoffice-commits mailing list