A question about HTML export

Miklos Vajna vmiklos at collabora.co.uk
Fri Mar 25 13:20:10 UTC 2016


Hi,

On Fri, Mar 25, 2016 at 01:59:35PM +0200, Gülşah Köse <gulsah.1004 at gmail.com> wrote:
> My question is which class(es) sets svg:width and svg:height atrributes. If
> you think that is very particular question, I can change my question as how
> generates LibreOffice Writer the content.xml files.

It depends on how the image is anchored. So a specific case: if the
image is a Writer image (so the image is part of a Text Frame), and it's
anchored as-paragraph (that's what you get when you just insert -> image
in a new document), then it's

xmloff/source/text/txtparae.cxx:2667

You can do something like:

----
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 5310185..57922ee 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -975,6 +975,8 @@ void SvXMLExport::AddAttribute( sal_uInt16 nPrefixKey,
                                 enum XMLTokenEnum eName,
                                 const OUString& rValue )
 {
+    if (nPrefixKey == XML_NAMESPACE_SVG && eName == XML_WIDTH)
+        SAL_DEBUG("foo");
     mpAttrList->AddAttribute(
         _GetNamespaceMap().GetQNameByKey( nPrefixKey, GetXMLToken(eName) ),
         rValue );
----

and then put a breakpoint on "foo" in a debugger, and see who is the
caller.

Beware though, that the ODT export uses the UNO API, while the sw HTML
export uses the internal sw API directly, so you probably want to look
at the sw UNO API implementation as well.

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160325/9f47ff5c/attachment.sig>


More information about the LibreOffice mailing list