diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-03-27 18:46:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 11:05:49 +0000 |
commit | a929f282d7baa6cb73b17cae2d68d82d72008903 (patch) | |
tree | fb3a2e12d98a11982b5e31b840bc30e2b199ae47 /oox | |
parent | 16f1459e78bf286d029f0672ef2977d89ae3ef71 (diff) |
write (no)wrap of text only for custom shapes to .pptx (fdo#71961)
Apparently checking the TextWordWrap property in DrawingML::WriteText()
gives false by default for objects that do not have it set, which happens
to be everything except for custom shapes, which seem to be the only ones
to actually obey it. So all normal text would be exported as nowrap to .pptx
and read back as custom shape that has non-wrapping text.
I tried to make the property return true (which is what it should be in practice),
but that appears to be an exercise in futility, or I'm not mad enough to follow
the complicated property sets and whatnot. So just write it out only for custom
shapes. UNO purists, if any, are welcome to change the dynamic_cast to something
UNO-better if they manage without an ambiguous base class error.
Conflicts:
sd/qa/unit/import-tests.cxx
Change-Id: I3ed906285fde88d902ac9c801986a82a7515638b
Reviewed-on: https://gerrit.libreoffice.org/8774
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a8c57418adba..dd6605b5e133 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -69,6 +69,7 @@ #include <editeng/svxenum.hxx> #include <svx/unoapi.hxx> #include <svx/svdoashp.hxx> +#include <svx/unoshape.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -1320,7 +1321,8 @@ void DrawingML::WriteText( Reference< XInterface > rXIface ) sal_Bool bHasWrap = sal_False; sal_Bool bWrap = sal_False; - if( GETA( TextWordWrap ) ) { + // Only custom shapes obey the TextWordWrap option, normal text always wraps. + if( dynamic_cast<SvxCustomShape*>(rXIface.get()) && GETA( TextWordWrap ) ) { mAny >>= bWrap; bHasWrap = sal_True; } |